RF12 module need to convert some C to Basic
Hi,
I have a few RFM12 modules that I have posted on here about before. I have started to delve into the coding side of things, but am somewhat lost. The datasheets for these modules have examples coded in C. But I currently have absolutely no knowledge of C. Can someone who knows picbasic, and C please point me in the right direction?
The module is 'programmable' for a LOT of options. I am interested in getting just one to work, then I should be able to find my way from there. It has an osc output that can be used to supply the pic. I currently have that working, but at the default 1Mhz. This is the setting I have been attempting to change, as it should be easy to spot.
The register is in the datasheet at: http://www.hoperf.com/pdf/RF12.pdf Page 22, item 14.
according to what I can see, changing that register to 1100000011110111 should change the osc output to 10Mhz, and the low voltage detector to 4.5V
The C example of how to do this, from what I can see uses a command called write.
Code example is at: http://www.hoperf.com/pdf/RF12_code.pdf Page 20.
The piece I'm particularly interested in is when it calls a subroutine called "WriteCMD()" and has the following:
Code:
void WriteCMD( uint CMD )
{
uchar n=16;
SCK=0;
nSEL=0;
while(n--)
{
if(CMD&0x8000)
Write1();
else
Write0();
CMD=CMD<<1;
}
SCK=0;
nSEL=1;
}
Can this be done in picbasic via shiftout, or serout?
I am using a 16f877a
Thanks in advance as always....
Re: RF12 module need to convert some C to Basic
Thank for the link.
The program is written in German... but it is a great help.
regards,
Ambrogio