Hi, I have a project which involves an Arduino connected to an SPI camera module. The camera generates image that are 40ish k in size.
Using the arduino, I can grab that image, 32bytes at a time from the cameras buffer. I would then like to send the 32b over to a spark core with a nRF24L01 attatched. The spark cores job is to FTP those 32b to a server.
So, I decided not to use any libraries for the nRF24L01 because I want to communicate between two dissimilar micro boards. I read up on the nRF24L01 and watched some youtube videos and now have a system working(ish)
The thing is this, I have a loop on the arduino which :
1) reads 32bytes from the camera 2) sends the 32b to the spark core via the nRF24L01.
the loop then itterates until all the bytes have been read from the camera and sent via the nRF24L01.
On the recieving side, the spark core also has a loop, this loop :
1) polls the RX_DR register bit, ie the one that says there was data recieved. 2) if there was, it grabs the 32b recieved and ftps it. It then continues to poll RX_DR
The problem is that I am in a bit of confusion as to how to control the timing of these two loops.
The Spark core has to do the ftp bit but maybe the arduino will continue to fire 32b irrespective of whether the spark is busy or not.
I thought that maybe a soluton was to utilize the shockburst feature of the nRF24L01 but that would only tell the arduino that the data was sent succesfully, not that its ok to send further data as the spark has finished processing the previouse lot.
I would like to know if I should design my own protocol to enable these two to play nice, ie, the following :
1) the tx sends data 2) the rx recieves the data 3) the rx processes the data 4) the rx sends the tx the "ok, send more data" flag 5) the tx sends more data and so on.
Does anyone have any advice on this, I am quite new to these nRF24L01 and just learning to use them via setting registers was difficult but through perserverence I have got there, debugging is a pain too as I can never be sure if a problem is on the tx side or the rx side slowing my progress somewhat.
Thanks for reading, Rick.