ralpok
Joined: 21 Dec 2005 Posts: 25
|
Queue up SPI TX in Slave Mode |
Posted: Thu Sep 06, 2012 2:00 pm |
|
|
I am working on implementing the SPI Slave using a PIC24FV32KA304 on PCWHD 4.134.
What I need to be able to do is queue up two bytes to transmit once the master starts to clock it in.
Code: |
#use SPI (FORCE_HW, SPI1, STREAM=HOST, BITS=8, SLAVE, SAMPLE_RISE,IDLE=1)
...
whichChannel = spi_xfer(HOST,0x11,8);
whichChannel = spi_xfer(HOST,0x08,8);
|
For the above code when I queue both of these up and then the master clocks in 16 clocks, instead of getting a 0x11 and 0x08 I get two copies of the 0x08 byte. How do I queue up these bytes correctly so that I get both once the master starts clocking in the data.
Thanks! |
|