PDA

View Full Version : compilation error



Protech
- 7th January 2012, 22:55
Hallo everyone,

I just copied this code from Rentron electronics and tried to compile it to get a hex code to programme the pic16f628, but unfortunately I get an error and I can't seem to get the hex code.

I use Nigel Goodwin's WinPicProg, and whenever I try to set the fuses there I also get a verification error. Even when I disable the auto verify I can't get the hex code.

Here is the first part of the code causing the error:
@ DEVICE MCLR_OFF, INTRC_OSC, WDT_OFF, LVP_OFF, BOD_OFF, PWRT_ON, PROTECT_OFF

Illegal Opcode (MCLR_OFF)

the complete code is here:

http://www.rentron.com/PicBasic/IR_Chips.htm

I appreciate your help!

Many thanks in advance.

mackrackit
- 7th January 2012, 23:14
Why are you using that?
Use MicroCode Studio that comes with PicBasicPro to edit the code and to invoke PicBasic to compile it.

Protech
- 7th January 2012, 23:24
Why are you using that?
Use MicroCode Studio that comes with PicBasicPro to edit the code and to invoke PicBasic to compile it.

Thanks for the instant reply,

But this is how I had learned to do the job for some time in the past before I started some C ...etc.

please see attachment

mackrackit
- 7th January 2012, 23:31
For the 628A...
@ DEVICE MCLRE_OFF, INTRC_OSC, WDT_OFF, LVP_OFF, BOD_OFF, PWRT_ON, PROTECT_OFF
And the config type you are using is for PM. Is that set correctly in MCS?

Demon
- 8th January 2012, 01:47
Check the code here:
http://www.picbasic.co.uk/forum/showthread.php?t=15960

You are missing the PIC model after DEVICE.

Robert

Protech
- 8th January 2012, 18:18
For the 628A...
@ DEVICE MCLRE_OFF, INTRC_OSC, WDT_OFF, LVP_OFF, BOD_OFF, PWRT_ON, PROTECT_OFF
And the config type you are using is for PM. Is that set correctly in MCS?

thanks for the reply,

I tried your suggestion but I keep getting an error

Protech
- 8th January 2012, 18:23
Check the code here:
http://www.picbasic.co.uk/forum/showthread.php?t=15960

You are missing the PIC model after DEVICE.

Robert

Thanks for the reply,

And by the way interesting tutorial for me for further and later needs.

But as for now I need this job urgently done for this IR project and I can't seem to get anywhere except with illegal opcode and found label after column 1 (DEVICE).

mackrackit
- 8th January 2012, 18:35
You still do not have
MCLRE

Protech
- 8th January 2012, 18:42
You still do not have
MCLRE

I did! Here it is once again!

mackrackit
- 8th January 2012, 19:15
See if this works. I was not paying attention, you are using PBP 3 ?

#CONFIG
__config _CONFIG1, _INTRC_OSC_NOCLKOUT & _WDT_ON & _LVP_OFF & _CP_OFF & _MCLRE_OFF
#ENDCONFIG

Bruce
- 8th January 2012, 19:22
This should work;


#CONFIG
__CONFIG _MCLRE_OFF & _INTRC_OSC_NOCLKOUT & _WDT_OFF & _LVP_OFF & _BODEN_OFF & _PWRTE_ON
#ENDCONFIG

And disable case sensitivity in MPASM or make porta PORTA in the assembler part.

Protech
- 8th January 2012, 20:14
Lots of thanks to all contributions!

Now I've got it.


Special thanks to you Bruce, you just saved me a lot of effort.

I was about to call Rentron and report this as I tried another code and had the same problem.

Best regards to all.