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.

CCS/TMS570LC4357: MIBSPI Confusing SPI modes

Part Number: TMS570LC4357
Other Parts Discussed in Thread: HALCOGEN

Tool/software: Code Composer Studio

Why is the data sheet not clear on SPI modes?

SPI Normally has two bits to set parameters, CPOL and CPHA.

Normally, they are defined like this:

Mode CPOL CPHA Inactive Clock MOSI MISO
0 0 0 Low Changed on Falling Edge Changed on Falling Edge
1 0 1 Low Changed on Rising Edge Changed on Rising Edge
2 1 0 High Changed on Falling Edge Changed on Falling Edge
3 1 1 High Changed on Rising Edge

Changed on Rising Edge

It appears to me, what is called CPHA on this chip is actually nCPHA.

Is the data sheet correct in that you have to program CPOL=0, CPHA=1 to get SPI Mode 0?

The HALCoGen program should in this case avoid setting CPOL, CPHA as separate bits.

Instead you should have a setting for *SPI Mode* with a drop down list allowing you to set Mode 0,1,2,3..

You should probably update the data sheet so you explain how to program the MIBSPI/SPI into the four different SPI modes.