nRF2401A Sparkfun Code Query

After going through the given code with the supplied board uMirf from sparkfun I had a query on the config setup for transmit and receive.

When going to setup the Transmit and Receive you have to set TX_CE=0,TX_CS=1 and then load the config bits in. Then when setting up the receiver you set RX_CE=0,RX_CS=1 and then load the config bits in.

As these pins are the same for the TX and RX on the supplied sparkfun board does this mean that the Transceiver must be configured each time before transmit or receive as it appears to me that the inital config bits setup is cleared each time the transmit or receive is configured??? There is only one bit change between them so can I change that particular bit without having to go through each configure function???

I’am using a PIC18F4620 running at 40MHz and communicating with a PIC18F2520 running at 20Mhz.

Any ideas would be greatly appreciated.

Hi There,

First, you only need to reconfig when switching between TX and RX.

Second, I seem to remember Nate trying to do the last-bit config change some time ago. If I remember right, I don’t think he had any luck doing it, but you could always try it and tell us what you find.

Hope that helps,

pete

Thanks Pete-O

I guess when trying to change that last bit it may try to clear all of the config bits, although on second thoughts it is only one bit of the config array, so if I make the config array global I can affect the last bit of the array from both receive and transmit functions.

Thanks again.

I am trying to manipulate the provided RF-24G code in Microchips C18 compiler and keep running into issues with the uns8 and uns24 data types.

I’ve tried to get around this by using arrays for manipulating the bit but as yet have had no luck, does anyone have an idea of which way I can go?

I need to use this compiler as I have another program runnning on top of this subfunction.

i have had success and failure with the last bit problem

going from rx to tx is fine

going from tx to rx sometimes does not work well

in my experiance, i think it is good to load all config every time you want to recieve a packet. this has improved my packet rate at large diatances but i dont know why. on the other hand, switching to tx is by moving in one bit is not a problem

Any idea on the data types though.

I don’t seem to be able to access individual bits like this

TX_DATA=config_setup.7

But seem to be only able to use arrays ie

for(i=23;i>=0;i–)

{

TX_DATA=config_setup*;*
TX_CLK=1;
TX_CLK=0;
}
The same goes for the data array and rf address.