Hi,
On SFE website, http://www.sparkfun.com/commerce/produc … cts_id=152, there is a sampel code which is provided by SFE.
What progrmmer did they use? Does anyone know?
Hi,
On SFE website, http://www.sparkfun.com/commerce/produc … cts_id=152, there is a sampel code which is provided by SFE.
What progrmmer did they use? Does anyone know?
Looks like it was written for the CC5X compiler.
In CCS5x compiler, is shifting bits to the left represented as
move <<= 1; // move all bits to the left by 1.
Also, in a sample code for nRF2401 on SFE website, in a code,
few things are represented as the following.
config = 0b.0010.0011.0110.1110.0000.0101;
for(i=0; i<24; i++)
{
RX = config.23;
}
What does RX=config.23 mean??
I am confused.
In a sample code, under void boot_up(void), it defines
TRISB.2 as an input for RX. Is this an error? Or is this necessary for
nRF2401 to function properly?
I only see that command in void boot_up(void) and I am not sure where to connect
this TRISB.2 pinout to where.
myjcha:
In CCS5x compiler, is shifting bits to the left represented asmove <<= 1; // move all bits to the left by 1.
Yes, this is a standard left-shift in C.
myjcha:
Also, in a sample code for nRF2401 on SFE website, in a code,few things are represented as the following.
config = 0b.0010.0011.0110.1110.0000.0101;
for(i=0; i<24; i++)
{
RX = config.23;
}
What does <B>**RX=config.23**</B> mean??
I’m very new to PIC programming, but I read that as setting the RX variable to the 23rd offset bit of config. Is this really from the sample code? It doesn’t make sense the way you have posted it here (it does the same “RX = config.23” instruction 24 times; I’d assume there was a shift you are missing in this sample code.
-Josh
The actual code in their example is
config_setup = 0b.0010.0011.0110.1110.0000.0101; //Look at pages 13-15 for more bit info
for(i = 0 ; i < 24 ; i++)
{
RX_DATA = config_setup.23;
RX_CLK1 = 1;
RX_CLK1 = 0;
config_setup <<= 1;
}
This sets RX_DATA to the leftmost bit of config_setup, pulses RX_CLK1,
and then shifts RX_DATE left by one bit. Repeating this 24 times will clock out all of the bits of RX_DATA.
/mike