Re: SPI send problems
Posted: Tue Mar 31, 2015 1:23 pm
The fig.13 of the L6474 datasheet shows it clocks out the data on the rising edge.
Try and see.
Try and see.
diurpaneus wrote:Hi,
You are right, I interpreted wrongly the figure 224 in my reference manual.
Thanks.
But I have another related question. Can I configure the SPI driver so that I can transmit data on the rising edge, but receive data on the falling edge?
At CPOL=0 the base value of the clock is zero:
For CPHA=0, data are captured on the clock's rising edge (low→high transition) and data is propagated on a falling edge (high→low clock transition).
For CPHA=1, data are captured on the clock's falling edge and data is propagated on a rising edge.
At CPOL=1 the base value of the clock is one (inversion of CPOL=0):
For CPHA=0, data are captured on clock's falling edge and data is propagated on a rising edge.
For CPHA=1, data are captured on clock's rising edge and data is propagated on a falling edge.
That is, CPHA=0 means sample on the leading (first) clock edge, while CPHA=1 means sample on the trailing (second) clock edge, regardless of whether that clock edge is rising or falling. Note that with CPHA=0, the data must be stable for a half cycle before the first clock cycle.