This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

McBSP as SPI on DM6437

Dear All

I am trying to use the McBSP-as-SPI of the DM6437 however I have run into a few problems. Before I begin, I will detail my setup:

I am using the

  • DM6437 EVM (Spectrum Digital
  • DSP/BIOS 5.31.08
  • DVSDK 1.11.0.0
  • PSP 1.10.0

Looking around at various documents, I have understood that there is no PSP Driver for this ability, meaning that I would have to write it myself. I found that this could be done in a similar manner to a PSP driver or at a lower level using the CSL. It is the later was that I have chosen.

I have written the code using information in SPRU943C Multichannel Buffered Serial Port Interface User's Guide.

I am additionally using a logic analyser to see if I am generating what I think I am generating. This is good in theory however I am not getting anything on logic analyser. Just information purposes, I am triggering the logic analyser on the falling edge of the FSX0 signal.

Secondly, how is the transfer actually triggered on the device. The method I am using is wrong, based on what I have read after writing the code.

I was setting the FRST bit of the SPCR, however, because I have set FSGM of SRGR to 1, the DXR-to-XSR triggers the transmit frame sync. However is the DXR to XSR invoked?

Any help or advice would be appreciated.

What the best way to post the code - I cannot upload a '.c'?

Thank you

Regards

Chithambaram

  • Are you trying to be a SPI master or slave?  Did you follow the init procedure in Section 2.9.5?  Did you set GRST=1 and XRST=1?  You initiate a transfer by writing data to the DXR register.  It will then automatically get moved into XSR and sent out.

  • Hi

    To answer your question, I am using trying to be an SPI Master.

    I have just checked my code, I am already setting GRST=1 and XRST=1.

    In terms of following the init procedure in 2.9.5, I am. The only bit I am unsure of is point 5 & 7 - waiting two sample rate generator delays. What is the best way to implement such a delay when using CSL? At present I am using asm("nop"), but I am sure that this is not the best way of implementing it.

    Thank you

    Regards

    Chithambaram

     

  • Chithambaram Veerappan said:

    In terms of following the init procedure in 2.9.5, I am. The only bit I am unsure of is point 5 & 7 - waiting two sample rate generator delays. What is the best way to implement such a delay when using CSL? At present I am using asm("nop"), but I am sure that this is not the best way of implementing it.

    I usually just do something like:

    volatile int i;

    for (i=0; i<500; i++) {}

    Keep in mind the CPU frequency will be much higher than the sample rate generator frequency, so you don't just want 2 NOPs.

    Brad

  • Thank you for your help and sorry for the delay.

    I checked my code in minute detail yesterday. I noticed that I made a mistake with the Sample Rate Generator Input Clock Mode (SCLKME) in PCR. Once corrected, it started to work.

    Thank you

    Chithambaram

  • Dear Chithambaram,

    I have been following your posts regarding the problem of configuring McBSP as SPI on DM6437 EVM board. I am also working on a similar project where I have to read/write to an SPI EEPROM in the SPI socket on DM6437 EVM board. It is nice to know that you succeeded in configuring your hardware for SPI. I also referred to SPRU943, but could not get a clue to my problem. Can you please share your code with me, since I have to get my project working quickly and due to time consraint not able to study all documents ? Thanks in advance for your help. If possible please email your code to my email id: Mandayam.P@wpgsystem.com

    Best Regards,

    Parthasarathy

     


     

  • Hi,

    The McBSP in SPI mode feature is implemented in the PSP driver.

    This is available in version 1.10.03 and can be downloaded from here:

    https://www-a.ti.com/downloads/sds_support/targetcontent/psp/bios_psp/index.html

     

    Regards,

    Sriram

  • Hi All

    Sorry for the late reply, I was not in the office on Friday.

    With regard to Sriram's response. I thought that the PSP only contained an SPI Driver for the DM648 only and not the DM6437 which is what request was for. This is what I found when I was developing a few months ago (using PSP 1.10.00).

    Looking at the download page this also appears to the case for 1.10.03 - a SPI datasheet is only available for the DM648.

    Regards

    Chithambaram

  • Hi All,

    Chithambaram Veerappan said:

    I thought that the PSP only contained an SPI Driver for the DM648 only and not the DM6437 which is what request was for.

    The SPI operation on DM6437 is acheivable only via McBSP in SPI mode.

    Please refer to the latest release - 01.10.03 McBSP driver for this implementation.

    Regards,

    Sriram

  • Hi,

    I tried downloading the PSP package version 1.10.03 from the above link, but unable to download it. Is this link alive any more? or Where can i get the PSP package version 1.10.03 if not from the  above link?

    Regards,

    Tamij

     

  • Hi Tamij,

    The link you have used is correct. However, there is a problem with the link path which will be corrected and notified very soon.

    Apologies for the inconvenience.

    Regards,

    Sriram

  • The link should be fixed now as I posted in another thread.