Show us your code. I'm guessing you are defining something that is already defined without realizing it.
Robert
Edit: it's always possible you are the first to use that chip and found a bug.
Show us your code. I'm guessing you are defining something that is already defined without realizing it.
Robert
Edit: it's always possible you are the first to use that chip and found a bug.
My blinky led code...
And I doubled checked by un-commenting the line in the .PBPINC file and trying to compile (with the same error result).#CONFIG
__config _CONFIG1, _FOSC_INTOSC & _WDTE_OFF & _MCLRE_ON & _CP_OFF & _CLKOUTEN_OFF & _PWRTE_OFF & _BOREN_OFF
__config _CONFIG2, _LVP_OFF & _LPBOR_OFF
#ENDCONFIG
#define OSC 4
OSCCON=%01101000 ' 4MHz internal
TRISC=0
PORTC=0
LED0 var PORTC.0
Start:
LED0=1
Pause 500
LED0=0
Pause 500
Goto Start
#define OSC 4 is the error
should it be
DEFINE OSC 4?
Steve Earl www.datageo.co.uk
Actually thats not what I have in my project so I must have copied and pasted the wrong code, though the rest of the lines are the same. I tried changing my code to what I posted and it compiles and runs OK (if I have the line commented out as noted in my original post) and I've just checked in the PBP3 manual and that syntax is allowed, like the #config
Just trying to help. No need to get upset.
Steve Earl www.datageo.co.uk
Hi,
I tried to compile the code, specifically:And it compiles and assembles for the 16F1509 without any error messages or warnings using PBPX 3.0.7.4 and MPASM 5.45.Code:#CONFIG __config _CONFIG1, _FOSC_INTOSC & _WDTE_OFF & _MCLRE_ON & _CP_OFF & _CLKOUTEN_OFF & _PWRTE_OFF & _BOREN_OFF __config _CONFIG2, _LVP_OFF & _LPBOR_OFF #ENDCONFIG #define OSC 4 OSCCON=%01101000 ' 4MHz internal TRISC=0 PORTC=0 LED0 var PORTC.0 Start: LED0=1 Pause 500 LED0=0 Pause 500 Goto Start
What version of MPASM are you using?
As for the DEFINE vs #DEFINE.... Yes both are valid but different and in this case you DO want DEFINE OSC 4 - without the # - but it's not related to the error message you get.
See section 2.3.3 (DEFINEs defined) as well as section 4.10 (#DEFINE) in the manual.
/Henrik.
I have MPSAM 5.56 in the Microchip install folder, but I also have 5.37 installed in another folder completely outside the Microchip install folder. I'm running MPLAB X 2.10 and I also have a copy of MPLAB 8.92 installed. I have removed MPSAM 5.37 from the tool list in MPLAB X but still same error. My PBP3 is version 3.07 (I downloaded the trial) Would you mind looking at your PIC16F1509.PBPINC file, line 41 and advise if it reads asIf it does, then I guess I have some version conflict which I need to sort out (perhaps it is time to reinstall fresh). Thanks, Chris#define SPBRG SPBRGL
I wasn't upset and I appreciate the fact you replied with a suggestion. The error was mine, in that I posted code from the wrong window, but from your response, we have both discovered something new about PBP3 - so I guess we are both winners![]()
The only reason I come here is to learn, as most people do. Whether what I learn will be of any use or not is debatable. For me it just needs to be interesting.
Steve Earl www.datageo.co.uk
Bookmarks