Let's say I want to send the following byte array
0x12 0x34 0x45 0x56
What's getting sent back via SPI is:
0x12 0x34 0x34 0x56
I think I've tracked this down the SPI IRQ not being serviced in time to queue up the next byte to be sent.
In addition, from what I can tell this is happening because I'm measuring pulse width on a GPIO interrupt (long story, but can't use built in timer to measure PWM).
From review of the data sheets, I had though I could set the SPI Interrupt to be a priority so it would get called within the GPIO interrupt but it doesn't seem to be working.
ITC->ISPR3 &= 0xDF;
Which should set the VECT10SPR = 01 which would be a Level 1 priority which in turn should let the SPI IRQ interrupt the GPIO IRQ and queue up the next character, (SPI is Interrupt vector 10).
I'm fairly certain I could solve this by moving into the 32 bit world and DMA, but I'm just not ready to make that jump yet beside, I'm pretty sure this should work. I'm currently using an STM8S207K6
Any thoughts? What am I'm issing?
Kevin...