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.

[FAQ] AM2634: How to set SPI baudrate in EB Tresos

Part Number: AM2634

Hi, Experts.

As title description, this setting should be appear in "SPIExternalDevice" tab, but I do not find this setting.

I found MCAL driver documents writes as below.

My question is :

How to set fSPI frequency in EB Tresos?

How to set CLKD frequency in EB Tresos?

Many Thanks

Gibbs

  • Hi,
    Please find the details below.

    SPI Baud Rate Calculation:

    Baud rate = fSPI / CLKD
    Where fSPI – SPI Functional clock frequency. fSPI can be set from MCU clocksetting configuration, where user can configure clock source(as per TRM) and clock division value for required fSPI (fSPI=clk/clkdiv+1).

    Refer the figure below:

    CLKD – Prescalar clock divider (SpiExtDeviceClockDivider value as per EBtresos Configuration).SpiExtDeviceClockDivider can be set from EBtresos as in below figure:

    CLKD value should be set such a way to get the expected baudrate as per calculation below:

    For example, if fSPI of MCSPI is 50 MHz:

    #. For Baudrate = 50Mbps , CLKD should be given as 0 , calculation will be as following

    Baudrate = 50/(0+1) = 50Mbps

    #. For Baudrate =25Mbps ,CLKD should be given as 1 , calculation will be as following

    Baudrate = 50/(1+1) = 25Mbps