Hi guys, I'm always here to asking some tips about spi.
I have to setup a comunication sequence between flex (the master) and DCB500( yamar production, the slave).
I have only to send data from Master to Slave; the Master starts the transmission process by lowering pin SS and sending the command byte 41h. The following bytes are data bytes to be transmitted. After the last data byte is sent to
the slave, the Master raises and lowers the SS pin and than sends the command byte A1h. Than the master raises the SS pin.
I rising and lowering SS pin after my data sequence but, on oscilloscope I see SS1 rise and lower much earlier than i expect.
I think the problem is the time requied to send data from SPI1BUF to shift register and from shift register to SDO.
In effect before sends another data byte I check if the previous data byte is moved from SPI1TXB to SR, but it's not send yet on SDO pin.
It looks like that the command on SS pin is always 2 byte in advance.
Actually I haven't connect the slave, I try to create the sequence on oscilloscope with the right start & end times.
Image & code attach:
http://orfeo.unipv.it/daniele/image-code.zipMany Thanks
Crazy Daniele