AM2432: SPI is not generating the accurate clock | AM2432

Part Number: AM2432
Other Parts Discussed in Thread: SYSCONFIG

Hello TI Team,

In sitara AM2432, as we tested SPI communication, we have observed that the controller is not generating the actual clock which is configured by the sysConfig in firmware. 

When SPI is configured at 20Mhz, it generates arround 16.5MHz. Although, we are getting the accurate clock when it is configured at 25Mhz. As i review the library for SPI in SDK (v10), it has been observed that the library function which is used to calculate the divider for clock is rounding the clock divider values and increament which result in not getting the actual clock.

SPI Clock:

SPI Library code:

image.png

Is it an acceptable behaviour of SPI in controller or it can be corrected. Let us know your views and provide the resolutions.

Best regards,

Nilesh V Parmar

  • Hi Nilesh,

    Allow me sometime to provide a response.

    Regards,

    Vaibhav

  • Hi Vaibhav,

    Yes. But please share the resolution ASAP.

  • Hi Nilesh,

    I am assuming you have the MCSPI configured in Controller mode.

    So since its master driver protocol, there should be no issues communicating with lower frequencies than whats being set.

    For example, setting 20 MHz in sysconfig delivers 16.67 MHz based on the calculation, this is intentional as the divider does not support a value which can give exact 20 MHz, hence it bumps its value by 1, thereby 50 MHz/3 delivers close to 16.67 MHz. All you would need to make sure is that the external Peripheral operates within its minimum and maximum clock frequency, rest the master is going to take care of the rest of the things.

    For example, upon setting 25 MHz in SysConfig, results in the effective clock being 25 MHz, as the divider allows the same.

    Similarly, if we set, lets suppose 30 MHz, then the effective becomes 25 MHz based on calculation.

    Regards,

    Vaibhav

  • Hi Vaibhav,

    Thanks for your response.

    Based on your response, I can consider that the AM2432 SPI does not generate the 20Mhz configured clock. This is the limitation from the controller side.

    Based on that consideration, It has been conclude that we have to accept the frequency which we are getting.

    Kindly confirm. 

  • Hi Nilesh,

    Based on your response, I can consider that the AM2432 SPI does not generate the 20Mhz configured clock. This is the limitation from the controller side.

    Based on that consideration, It has been conclude that we have to accept the frequency which we are getting.

    Your understanding is correct.

    I am also going to raise a bug as this is not supposed to be the correct behaviour. I am suspecting this may be a bug, if not I can update this ticket later on as per the feedback from the development team. Marking this closed as of now.

    Regards,

    Vaibhav