Hi Durango,
Note that this discussion is not about who is right and why Microchip used descriptions disagreeing with diagrams and other vendors, but how to change description in Help to avoid misunderstandings. Your opposing opinion actually proves that present description is not adequate.
I also still believe with Dany's settings, that the external SPI device is getting the data sent to it on the clocks rising edge when the data is stable. In the diagram's case it occurs at the center of the data Then the data is changed on the clocks falling and at the same time the PIC would read in any data sent to it on the SDI pin on the same falling edge.
There's no doubt about this. It's depicted as the mode set with CKP=0 and CKE=1 (mode 0,0) in datasheet diagram and we all agree how it works.
I think Mikro libs set up the SPI correctly it just does not agree with the new CKE description.
Well, that's where we disagree
. But it should be enough to look at the diagrams to clear things up. We agree that transmitter changes data on falling edge of clock. From transmitter point of view, it's the only distinctive moment - the moment when it starts transmitting new data. Not some arbitrary time after, or before. And, for CKP=0 (clock idle state low) and CKE=1, the datasheet says: 'Transmit occurs on transition from active to Idle clock state', i.e. on transition from high to low clock state. That's in par with other descriptions of SPI interface. While different terms are used, mostly describing the moment when data is read/latched/captured, this moment is distinctly differentiated from the moment when data is changed/transmitted/propagated.
Unfortunately, one obtains the CKP=0 and CKE=1 settings with _SPI_CLK_IDLE_LOW and _SPI_LOW_2_HIGH value of 'Transmit edge' parameter in SPI1_Init_Advanced call. This value is described as 'Data transmit on low to high edge'. Well, I wouldn't interpret this as 'data should be read on low to high edge'
.
While it's probably a leftover from older Microchip datasheets and no fault of mE, I agree with Dany that something should be done. Easiest and not affecting already written code would be to change description in Help. 'Data valid clock edge' seems unambiguous.