PDA

View Full Version : New to PBP



GoldStar
- 12th May 2009, 05:03
Hello, I just found PBP at my local college and I am trying to build my first program for a 12F683 but it seems that I can't get the inline assembly right. So far I've got everything right, but I'd like to set the configuration fuses so the watchdog timer doesn't reset on me. I copy and pasted this from an other thread:
@ DEVICE PIC12F683,MCLR_OFF,INTRC_OSC_NOCLKOUT,WDT_OFF,BOD_ ON, PWRT_ON

Also from http://www.picbasic.co.uk/forum/showthread.php?p=69895
@ DEVICE pic12F683, WDT_Off
Doesn't even work.

Here's my error


Warning[207] C:\RFID\UNTITLED.ASM 95 : Found label after column 1. (DEVICE)
Error[122] C:\RFID\UNTITLED.ASM 95 : Illegal opcode (pic12F683)


The computer I'm using has MPLab8.15a and PBP 2.47 it looks like from the compile window. Commenting out the line clears the error.

Archangel
- 12th May 2009, 05:06
The Config statement you are trying to use is for the "DEFAULT" assembler and apparently the microcode Studio is set to use MPASM.
Please read this link: http://www.picbasic.co.uk/forum/showthread.php?t=543

Here is the MPASM config statement you are using when you comment the one in your code out: __config _INTRC_OSC_NOCLKOUT & _WDT_ON & _MCLRE_ON & _CP_OFF , it is located in the file named 12F683.inc, and is located in the root directory of PBP. You can change it there or better yet, put a semicolon just ahead of it and put it directly in your code every time and be master over it. Here is what you want in your code:

@ __config _INTRC_OSC_NOCLKOUT & _WDT_OFF & _MCLRE_ON & _CP_OFF
Alternatively you can switch assemblers, in MCS back to the default, by unchecking " USE MPASM".
Click view, compile and program options, assembler tab . . .

GoldStar
- 12th May 2009, 16:24
Thank you so much, the post you linked to made so much sense. I dont see how I missed that. I understand how to configure it, but I don't understand why I have to edit the include file. Are those there just for the beginners who don't need to mess with the configuration fuses just yet?