简体中文 | 日本語
14 Replies Latest reply: Apr 27, 2010 7:22 AM by CraigG RSS

SM2602 CODEC Driver for the ADSP-BF518 EZkit

yairraz Contributor
Currently Being Moderated

Hello,

 

As my application needs that CODEC (that is why I bought this board), I browsed through the source code of the drivers in the VisualDSP installation, and found that there is a driver for this CODEC (a good step).

However, I did not find any documentation (PDF) for that driver, nor any example on how to use it with the board.

 

Can someone provide me with some documentation on that driver + and example program that ilustrates its usage?

 

Thanks in advance,

 

Yair

  • 1. Re: SM2602 CODEC Driver for the ADSP-BF518 EZkit
    mmurali Analog Employee
    Currently Being Moderated

    Hello Yair,

     

           Yes you are right there is no example or document provided for the SSM2602 driver. Please find the attached example code and driver document which may be helpful for you. We will be releasing the example and driver document in the upcoming releases.

     

           Please untar the SSM2602_example.tar in <VDSP Install dir>\Blackfin\Examples\ADSP-BF518F EZ-Board and follow the instructions in the Readme_Audio_Loopback.txt file to run the example.

     

    Regards,

    Murali     

  • 2. Re: SM2602 CODEC Driver for the ADSP-BF518 EZkit
    yairraz Contributor
    Currently Being Moderated

    Thanks Murali,

     

    Any special consideration for using this driver with VDK?

     

    Regards,

    Yair

  • 3. Re: SM2602 CODEC Driver for the ADSP-BF518 EZkit
    mmurali Analog Employee
    Currently Being Moderated

    Hello Yair,

          The driver itself does not use any OS resources so I don't see any special considerations for VDK.

     

    Regards,

    Murali

  • 4. Re: SM2602 CODEC Driver for the ADSP-BF518 EZkit
    yairraz Contributor
    Currently Being Moderated

    Hello Murali,

     

    With VDK, should I use Deferred Callbacks with this driver, or can I used live callbacks?

     

    Thanks,

    Yair

  • 5. Re: SM2602 CODEC Driver for the ADSP-BF518 EZkit
    mmurali Analog Employee
    Currently Being Moderated

    Hello Yair,

     

        You can use either of them. If you use live callback the latency between actual event occurance and when it is reported to the application via callback will be less and if you use deferred callbacks it takes more time. As the deferred callbacks are handled at the task level.

     

    Regards,

    Murali

  • 6. Re: SM2602 CODEC Driver for the ADSP-BF518 EZkit - Error while executingibhe
    yairraz Contributor
    Currently Being Moderated

    Hi Murali,

     

    I build the example successfully, and tried to run it on the board. I have board Rev 0.2

     

    I got the following message on the console:

     

    Loading: "C:\Users\EarsForMe\BF-Examples\Drivers\AudioCodec\Audio_Loopback\Debug\Audio_Loopback.dxe"...

    Load complete.

    ADI SSM2602 as Master device in USB Mode

    Audio Loopback example with Line-In as record source

    Set SW2:  1(ON),  2(ON)

    Set SW5:  1(OFF), 2(OFF), 3(ON),  4(OFF), 5(ON),  6(ON)

    Set SW15: 1(ON),  2(ON),  3(ON),  4(ON),  5(ON),  6(ON), 7(ON)

    Set SW22: 1(OFF), 2(OFF), 3(OFF), 4(OFF), 5(OFF), 6(OFF)

    Set SW23: 1(OFF), 2(OFF), 3(OFF), 4(OFF), 5(OFF), 6(OFF)

    Failed to configure SSM2602 register fields, Error Code: 0x40000017

    Program terminated abnormally with error code: 0x40000017

     

    Looking at the code, I was that it uses the TWI interface. However, the board is configured by default to SPI interface.

    Here are couple of discrepancies and issues I found with the switch settings:

     

    SW5: You specify 6 switches; my board has only 4 switches.

     

    According to the manual, SW16 controls the SPI/TWI connection to to the codec. By default, it specifies SPI connection.

    I set it to TWI (according to the manual: OFF, OFF, OFF, ON, OFF, ON)

     

    SW6, Positions 3, 4: Also, the default specifies SPI as the control interface; I set it to TWI (OFF, ON).

     

    Regardless of these setup changes, I got the same error (0x40000017). From adi_dev.h: 0x0017 - TWI locked in other operation

     

    Any ideas how can I make this sample code run correctly on the board?

     

    Regards,

    Yair

  • 7. Re: SM2602 CODEC Driver for the ADSP-BF518 EZkit - Solved problem
    yairraz Contributor
    Currently Being Moderated

    Looks like the code was indeed using TWI.

    I changed the board settings to use SPI again, and modified the code to use SPI instead of TWI (by reading the examples in the driver manual).

     

    Now the program runs correctly. I connected audio source to line in, and powered speakers to headphone out, and was able to hear the music.

     

    I could only hear one channel though, but this might be a bad cable (or J5 connector), as when the cable was all the way in to J5, no audio was heard; when I wiggled the connector and took it out a bit, I heard the audio on both speakers, but the source was one side only.

     

    Tomorrow I'll buy a new cable and try again.

     

    Yair

  • 8. Re: SM2602 CODEC Driver for the ADSP-BF518 EZkit - Only one channel is playing
    yairraz Contributor
    Currently Being Moderated

    Hi,

     

    I just bought a new cable, but the result is the same.

    When I insert the cable all the way in to J5 Line In, I hear no audio at the headphone output.

    However, when I just insert part of the cable I hear the audio left channel on both outputs of the headphone.

     

    I tested that there is connectivity between J5 Line input connector signals to FER2 and FER5 chokes at the input of the CODEC, and signal path is OK.

     

    Any explanation to this phenomena? Is that software problem or a problem with my board?

     

    Regards,

     

    Yair

     

    PS: I'm attaching my modified files (to enable using SPI instead of TWI). See previous messages.

  • 9. Re: SM2602 CODEC Driver for the ADSP-BF518 EZkit - maybe the whole code does not work?
    yairraz Contributor
    Currently Being Moderated

    Sorry for all the posts, but as I was wrapping up the session and pressed PB2, the program stopped running (as it should), but I was still listening to the music (left channel, as before).

     

    So, probably, all the time I was able to hear something, it was via the loopback connections?

     

    If that the case, than this program does not run as it should.

     

    Any ideas how to fix that?

    Again, I have Rev 0.2 of the ADSP-BF518 EZkit board.

     

    Your help will be appreciated.

     

    Regards,

    Yair

  • 10. Re: SM2602 CODEC Driver for the ADSP-BF518 EZkit - Now it is working!
    yairraz Contributor
    Currently Being Moderated

    Hi,

     

    After close examination and looking at the schematics of the board, I made the following changes in the header file (for SPI mode):

     

    /* SPI device connected to SSM2602 (SPI using PORTG MUX2 - so use the virtual SPI device number (device 0))*/

    #define     SPI_DEVICE_NUMBER         0

     

    /* SPI Chipselect connected to SSM2602 (SPISEL3) */

    #define     SSM2602_SPI_CS             3

     

    I changed the device number from 1 to 0, and CS to 3. Now it works like charm.

    I assume the reason it does not work with TWI mode is wrong setup too.

     

    Does the example program intended to run on the BF518 EZboard or another board?

     

    Also: Can I use SPI CS3 and the Thumbwheel?

     

    Thanks,

    Yair

  • 11. Re: SM2602 CODEC Driver for the ADSP-BF518 EZkit - Now it is working!
    mmurali Analog Employee
    Currently Being Moderated

    Hello Yair,

     

         Good to know that you are able to get the loopback example working on your board. The example that I provided you was intended to work on BF518 Ezkit Revision 1.0 board.

     

         Regarding the simultaneous use of CS3 and thumbwheel, the answer is no. The SPI0 CS3 (Pin PH4) line is shared with CUD signal of thumb wheel. So when SPI0 CS3 is used thumb wheel cannot be used. The other option is to use TWI for Audio codec control path.

     

    Regards,

    Murali

  • 12. Re: SM2602 CODEC Driver for the ADSP-BF518 EZkit - Now it is working!
    yairraz Contributor
    Currently Being Moderated

    Hello Murali,

     

    Thanks for your answer.

    I was able to make the example work with TWI, so SPI0_CS3/CUD signal is now available for the thumbwheel.

     

    Regards,

    Yair

  • 13. Re: SM2602 CODEC Driver for the ADSP-BF518 EZkit - Now it is working!
    JonaS Member
    Currently Being Moderated

    Hi!

    I experience the same problem with my BF526 EZ-KIT:

     

    Failed to configure SSM2603 register fields, Error Code: 0x40000017
    Program terminated abnormally with error code: 0x40000017

     

    Please tell more about your solution, of how to make the TWI mode start working.

    Thanks

  • 14. Re: SM2602 CODEC Driver for the ADSP-BF518 EZkit - Now it is working!
    CraigG Analog Employee
    Currently Being Moderated

    Hi Jonas

     

    Can I ask you to contact us via our private support channel at the following URL, and give us details on the problems you're having:

    www.analog.com/processors/support

     

    The following document gives guidelines on the type of information we need in order to reproduce and investigate issues: http://ez.analog.com/docs/DOC-1060

     

    Please include a link to this thread, and details of the Board, BOM and Silicon revision of your EZ-KIT Lite. The Board Revision is silk-screened on the PCB, and the BOM revision is available on a sticker on the underside of the board. The Silicon revision is printed directly on the BF526 itself.

     

    regards,

    Craig.

More Like This

  • Retrieving data ...

Legend

  • Correct Answers - 4 points
  • Helpful Answers - 2 points