on first turn-on, the RFM12 outputs a 1Mhz osc for the pic, which I am putting in on OSC1.
After I write the command ... dout = $C0F7 : gosub Writecmd ... this changes that osc freq from 1MHz to 10MHz... so my pic will run at 10MHz. I have figured out the problem to just be that my crystal setting was on XT, not HS.
I am onto the next part of converting C to Basic if anyone dare to assist....
So far I have...Code:void WriteFSKbyte( uchar DATA ) { uchar RGIT=0; uint temp=0xB800; temp|=DATA; Loop: SCK = 0; nSEL=0; SDI=0; SCK=1; if(SDO) //polling SDO { RGIT=1; } else { RGIT=0; WriteCMD(temp); } }
The part I am struggling with right now is...Code:WriteFSKbyte: temp = $B800 Loop: SCK = 0 nSEL = 0 SDI = 0 SCk = 1 if SDO = 1 then rgit = 1 else rgit = 0 endif SCK = 0 SDI = 1 nSEL = 1 if rgit = 0 then goto loop endif rgit = 0 dout = temp gosub writecmd return
Does this take bit 0 of DATA and stick it to temp somehow??Code:uchar RGIT=0; uint temp=0xB800; temp|=DATA;
Someone with some C knowledge please help me!
Thanks!






Bookmarks