- Mon Apr 23, 2007 8:37 pm
#28915
After a few weeks of development, I have rewritten a large chunk of my include library for the nRF24L01 chip. All of the old SPI functions are gone now, and there is only one SPI function you must write. It simply takes one byte as an argument and sends it over the SPI bus to the 24L01. It then waits for the response from the 24L01 and returns that value. It doesn't get much simpler than that. You still have to implement the microsecond delay function that takes the number of microseconds as the argument. You also have to set up the registers and pin masks in the .h file. (All of this is extremely well-documented in the .h file.)
Another thing that I changed in this code version was the elimination of the 130 uS delay. The one time this is necessary is when a receiver goes from standby mode (CE = 0) to RX mode (CE = 1). The function should not be added to the receiving device, but to the transmitter such that it waits the necessary 130 uS for the receiver to get into RX mode. Without using this delay, you may miss packets at the receiver until it gets fully into RX mode.
I have two tutorials that are totally written right now code-wise, and I have to make write-ups for explaining them. I also have a sort of "everything you need to know" document almost ready describing just about everything about the 24L01 and the MiRF-v2 breakout. Watch for these to be posted in the coming few weeks.
As for the links to the code, they are the same as they always are: nrf24l01.h and nrf24l01.c.
Another thing that I changed in this code version was the elimination of the 130 uS delay. The one time this is necessary is when a receiver goes from standby mode (CE = 0) to RX mode (CE = 1). The function should not be added to the receiving device, but to the transmitter such that it waits the necessary 130 uS for the receiver to get into RX mode. Without using this delay, you may miss packets at the receiver until it gets fully into RX mode.
I have two tutorials that are totally written right now code-wise, and I have to make write-ups for explaining them. I also have a sort of "everything you need to know" document almost ready describing just about everything about the 24L01 and the MiRF-v2 breakout. Watch for these to be posted in the coming few weeks.
As for the links to the code, they are the same as they always are: nrf24l01.h and nrf24l01.c.