i'm trying to create SPI slave API for my application using lpcxpresso51u68 board and i'm using SDK_2.5.0_LPC51U68.
i'm using master and slave from same board.my sample code for testing slave api is very simple, that is"transfer of 2 packets(3 bytes each) between master and slave".
i gone thorugh spi interrupt slave example in sdk and created my api.
what i'm doing in api is:
1. configuring the pins
2. calling SPI_SlaveInit() with application defind configuration
3. calling SPI_SlaveTransferCreateHandle() to handle the irq and user callback to refill the next packet
so,when i'm sending one packet and receiving one packet it seems to work perfectly.but when it is more than one packet slave loads duplicate byte into tx shift register after first packet (i thought i'm facing similar problem after i read this thread K22 DSPI in Slave Mode Sometimes Has Duplicate TX Bytes )
actually my sample application code is:
1.sending 0x03,0x05,0x07 from master to slave <-> responding with 0x02,0x04,0x06 from slave to master(first packet working perfectly)
2.sending 0x09,0x0b,0x0d from master to slave <-> responding with 0x08,0x0a,0x0c from slave to master(but here slave is sending 0x08,0x08,0x0a)
extra thing i did: in second packet i read 4 bytes on master side and it gave me 0x08,0x08,0x0a,0x0c
so,does this mean slave adds one duplicate byte to tx shift register at the end of first packet?
if that is the case then how can i clear that.it's not mentioned anywhere in lpc51u68 manual about spi slave constraints.
if i'm facing same problem as K22 DSPI in Slave Mode Sometimes Has Duplicate TX Bytes this one,then the solution mentioned in that thread will cost me some things in my application side.
i'm struck at this one for a week.someone help me to solve this
also i attached output from my application