Hello All,
A while ago I found a code posted by dhouston for Manchester encoded RF communication. http://www.picbasic.co.uk/forum/showthread.php?t=6261
I have been trying to compile the code using Microcode Studio and the PBP compiler but have come across some problems.
The first problem I came across was the PIC fuse settings, the code would not compile when the “@ __config” line was present. I did some searching and found that when using Microcode Studio with PBP, the fuse settings needed to be written differently;
It is written like this in dhouston’s examples (MPASM);
<code>@ __config _INTRC_OSC_NOCLKOUT & _WDT_OFF & _PWRTE_ON & _MCLRE_OFF & _BODEN_ON & _CP_OFF & _CPD_OFF</code>
Converted fuse settings, thanks to Melanie’s Post(PM);
<code>@ DEVICE PIC12f629, INTRC_OSC_NOCLKOUT
@ DEVICE PIC12f629, WDT_OFF
@ DEVICE PIC12f629, PWRT_ON
@ DEVICE PIC12f629, MCLR_OFF
@ DEVICE PIC12f629, BOD_ON
@ DEVICE PIC12f629, CPD_OFF</code>
I made the changes and removed “CP_OFF” from the code because I don’t think the 12F629 supports that setting. The Transmitter code then compiled successfully with no errors.
Unfortunately the Receiver code did not compile successfully, it produces the same three errors for both line 41 and 42.
Line 41: <code>If RF[0]+RF[1]<>&HFF Then init</code>
Line 42: <code>If RF[2]+RF[3]<>&HFF Then init</code>
Errors produced by Microcode Studio whilst compiling;
ERROR Line 41: Bad expression. (RX.pbp)
ERROR Line 41: Bad expression or missing THEN. (RX.pbp)
ERROR Line 41: IF without a matching ENDIF. (RX.pbp)
ERROR Line 42: Bad expression. (RX.pbp)
ERROR Line 42: Bad expression or missing THEN. (RX.pbp)
ERROR Line 42: IF without a matching ENDIF. (RX.pbp)
Can anyone see any problems with the code that could cause such an error? I have attached copies of the full code just in case.
Thank you all for your help,
Jeremy
Bookmarks