Hi there !
Can anyone tell me please how send many bytes on spi bus (using the API for SPIM) without get SS high before sent all the bytes ?
Thank you very much.
This depends on the SPI frequency. When it is too high, even using an interrupt to refill the FIFO is not fast enough. In this case SS will go high even though it should not.
Thank you very much Bob and hli for your valuable help.
Thanks both of you , with your suggestion and experience , finaly I could establish comunication with nRFL24L01+.
The point was that that chip has a SPI and requires hold its CSN ( chip select) low over the entire transaccion for send a write or read comand to set Registers or Verify Register.
I 'm using SPIM API and when I need to send two bytes and receive two ( status register and other one), there is no issue with the API.
The issue come up when I am trying to send a read or write comand byte with 5 or more byte long. At that time API does not work.
I suppose it happend because ss ( ss( SPIM API) ------->CSN ( nRF24L01+) ), goes high - low- high, with every SPIM_WriteTxData or SPIM_ReadTxData.
I have tried to use void SPIM_PutArray(const uint8/uint16 buffer, uint8 byteCount) .
Taking a look to this fuction, it has a loop with SPIM_WriteTxData, and that implies that ss is getting" low and high too."
So, based on both of you suggestion I have controlled CSN independently of API. I have used a control register for that.
And !!!!!! every think work ok so far.
So Thank you so much.
As said above, when you configure tha SPI buffers to more than 4 bytes (which I assume you did), an internal ISR is used. And it might just not be fast enough to supply the data fast enough before the SPI runs out of data to send. (And if not, a similar thing happens when you send more than 4 bytes with a 4 byte buffer, but then its the API method doing this magic)
Gee, folks, I really should have read your posts before I spent a few days figuring this out by myself. I have exactly the same problem. SS goes high before I could put another byte through WriteTxData(). While the slave sees SS going high, it reset itself and call it a day! I am going to use a control register like you guys suggested!