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.

TMS320F28375D: McBSP communication during two C2000 communication

Part Number: TMS320F28375D
Other Parts Discussed in Thread: C2000WARE

Hi Champs,

We used to discuss following thread for two C2000 MCU communication.

We choose to use McBSP for these comunication.

So, I have two questions.

*If we use McBSP as same as SPI comunication, is this transfer rate same as SPI ?

i.e.) if SPICLK=50MHz, McBSP is able to operate 50MHZ ?

*Could you provide us sample code that is McBSP communication as same as SPI spec ?

We would like to realize 2ch SPI comunication.  one McBSP for mcu to mcu comunication as same as SPI.Another nomal SPI is for some another comunication.

Regards,

Kz777

  • Hi Kz777,

    The McBSP SPI mode is not the same as the SPI module. There are specific timings for McBSP SPI mode in your device's datasheet which will need to be followed. They are not the same as the SPI module.

    We do have McBSP in SPI mode sample code available in C2000Ware, but again, these timings are not the same as the SPI spec.

    Regards,
    Kris
  • Hi Kris,

    Thanks for your input.
    We will use McBSP.
    So, we would like to confirm few things.

    McBSB is working as
    *CLKG=CLKSRG/(1+CLKGDV)
    *CLKSRG=LSPCLK
    *When McBSP is working as SPI, CLKGDV=1.

    So, if we set CLKSRG=LSPCLK=200MHz,
    Maximum McBSP transfer rate is CLKG =200M/(1+1) =100Mbps.

    Does this my understanding a correct ?

    Regards,
    Kz777
  • Hi Kz777,

    The McBSP is not capable of 100Mbps. Please review Section "5.11.3.1 McBSP Electrical Data and Timing" of the datasheet. You will need to find the appropriate table for your use of the module.

    www.ti.com/.../tms320f28377d.pdf

    Regards,
    Kris

  • Hi Chris,

    Regarding McBSP moude as SPI mode 

    Yes, according to datasheet, McBSP module is capability is "CLKG =25MHz". but, they would like to use it as MCBSP as SPI mode.

    In that case, is this equation possible  or it still maximam 25MHz ?? . Then, it is 25Mbps ?

    Sorry, I would like to add SPI module maximum speed.

    Regarding SPI module ,

    I would like to just know these maximam transfer rate:

    Maximum spi transfer  rate

    SPI = 200/4 = 50Mbps ? (For High speed mode , TRM discribe as maximum 50MHz. I would like to know this "bps" number . )

    P2141 discribe low speed mode, this show maximam transfer value(bps). but, for High speed mode (p2141 , it discribe only maximum speed as "MHZ". 

    How much value this for bps order for High speed mode ?

     http://www.ti.com/lit/ug/spruhm8g/spruhm8g.pdf

    Regards,

    kz777

  • Sorry, I had lots of confusion. I understand SPI (theoritical speed) clock is 50MHz. Theoritical maximum value is 50Mbps. ( I know this actual value is half of value)

    But, Could you tell us McBSP as SPI mode speed.

    Please see this page 148: Table 5-71. McBSP as SPI Master or Slave Timing Requirements (CLKSTP = 11b, CLKXP = 0)(1)

    www.ti.com/.../tms320f28377d.pdf

    I think this "M42" tc(CKX) Cycle time, CLKX minimum value is "2P".
    2P = 1/CLKG

    " CLKG " also define at page 144 as bellow:
    "2P = 1/CLKG in ns. CLKG is the output of sample rate generator mux. CLKG = CLKSRG / (1 + CLKGDV). CLKSRG can be LSPCLK,
    CLKX, CLKR as source. CLKSRG ≤ (SYSCLK/2)."

    If we calcurate SYSCLK =200MHz, CLKSRG< 100MHz, CLKG = 100/1+(CLKGDV =1) =100/2 = 50Mhz .
    2P= 20ns. (CLKGDV have to set "1" for McBsp as spi.
    However, page 144 define McBSP module clock (CLKG, CLKX, CLKR) range maximum 25 MHz.
    cycle =40ns.

    Which cycle or frequency speed is correct 20ns or 40ns at CPU 200MHz?


    Regards,
    Kz777
  • Hi , Champs,

    I input this excel for above Mcbsp max speed.

    Mcbsp_spi.xlsx

    So, McBSP module cycle time is 40ns. However, CLKX cycle MIN value "2P" is  20nsec that based on above calculation. Which value is correct for McBSP as SPI clock speed ?

  • Hi Kz777,

    The McBSP cannot be clocked faster than 25 MHz.

    2P = 1/CLKG where CLKG <= 25 MHz.

    Regards,

    Kris

  • Thanks, Kris. Appriciate it.
  • Sorry, I have one more query.

    >2P = 1/CLKG where CLKG <= 25 MHz.

    We would like to know how to set this maximum frequency.

    McBSP as SPI is able to set bellow:
    (1) CLKG frequency = input clock frequency / (CLKGDV + 1)
      (2) the input clock ?
      (3) SPI master:CLKGDV=1~255
     
    Usually, If we calcurate SYSCLK =200MHz, CLKSRG< SYSCLK/2 = 100MHz, CLKG = 100/1+(CLKGDV =1) =100/2 = 50Mhz .
    2P= 20ns. (CLKGDV have to set "1" for McBsp as spi.
    but, it is due to module performance. even we set above condition module frequency automatically set 25MHz at module HW ?
    Or should we have toset CLKGDV > 2 at McBSP ?