Content originally posted in LPCWare by coryrc on Thu May 12 15:29:55 MST 2011
Wow, Zero, thank you so much!
Quote: Zero
Can't confirm that:
1. Changing CPHA changes capturing as decribed in manual and as expected.
2. Your code is working, if you don't transmit Data too fast. Don't know why you've deleted the SSPSR_BSY check, but ignoring busy state doesn't make your code more reliable.
I took out the busy check because I intended to send data asynchronously without interrupts in the future, and I wanted to be able to queue up several bytes before running some other operations (16us*#bytes*send_rate adds up to a lot of time!)
But your confirmation that the setup code is correct is so helpful! Adding the busy check back in didn't help. I am going to make another project to test just the SPI functionality.