PDA

View Full Version : PIC16F1828 config/assembly problem



jgjgjg
- 3rd July 2013, 21:47
Hello,

I cannot get this to compile with PBP3:


#config
__CONFIG _CONFIG1, _FOSC_INTOSC & _WDTE_OFF & _PWRTE_ON & _MCLRE_ON & _CP_OFF & _CPD_OFF & _BOREN_OFF & _CLKOUTEN_OFF & _IESO_OFF & _FCMEN_OFF
__CONFIG _CONFIG2, _WRT_OFF & _PLLEN_OFF & _STVREN_OFF & _BORV_19 & _LVP_OFF
#endconfig

define OSC 16
OSCCON = %01111010 ' 0xxx xxxx SPLLEN (4xPLL disabled)
' x111 1xxx IRCF<3:0> (16 MHz HF)
' xxxx x0xx unimplemented
' xxxx xx10 SCS (internal oscillator)
ADCON0 = 0 ' ADC disabled

led var PORTC.5
output led

main:
toggle led
pause 200
goto main

I have "Use MPASMX Assembler" ticked. MPASMX has been working in other projects, but not with the 16F1828. This is the error message I'm getting when the #config section is not commented out:


PICBASIC PRO(TM) Compiler 3.0.6.4, (c) 1998, 2012 microEngineering Labs, Inc.
All Rights Reserved.
[ASM ERROR] PIC16F1828 BLINK.ASM (29) : Illegal character (,)
[ASM ERROR] PIC16F1828 BLINK.ASM (29) : Symbol not previously defined (_CONFIG1)
[ASM ERROR] PIC16F1828 BLINK.ASM (30) : Overwriting previous address contents (2007)
[ASM ERROR] PIC16F1828 BLINK.ASM (30) : Illegal character (,)
[ASM ERROR] PIC16F1828 BLINK.ASM (30) : Symbol not previously defined (_CONFIG2)

I cannot get MPASM (not the X version) to work with any projects at all with PBP3 (it worked with PBP 2.46). I always get this error message:



Error in parameter "/s".


Even when I copy and paste the example config code from the PIC16F1828.INFO file I still get the above error message with MPASMX. I can't think what the problem is.

I have just upgraded to PBP3 so I'm not sure if it's a problem with my code or my PBP3/MPASMX installation.

Many thanks.

Jonathan.

jgjgjg
- 3rd July 2013, 22:25
When I installed PBP3, I did not installed MPLAB since it was already installed. It just occurred to me that perhaps MPASMWIN was not working because it might be an old version. So I uninstalled MPLAB and MPLABX and then reinstalled PBP3 using the installer that includes MPLAB 8.9.

Well now MPASMWIN is working with other projects, but I still get this error message with the PIC16F1828 code in my previous post:



[ASM ERROR] PIC16F1828 BLINK.ASM (29) : Illegal character (,)
[ASM ERROR] PIC16F1828 BLINK.ASM (29) : Symbol not previously defined (_CONFIG1)
[ASM ERROR] PIC16F1828 BLINK.ASM (30) : Overwriting previous address contents (2007)
[ASM ERROR] PIC16F1828 BLINK.ASM (30) : Illegal character (,)
[ASM ERROR] PIC16F1828 BLINK.ASM (30) : Symbol not previously defined (_CONFIG2)


So I still get the error message after a fresh install. All I can think is that the formatting of the config directive must be wrong. But the same format works with 16F88 which has two config words (albeit with different values). I do not know why it does not compile without errors.

Any ideas?

Thanks.

Jonathan.

jgjgjg
- 3rd July 2013, 22:44
Problem solved.

Well, well. That was a lot of effort for one small error: I had the wrong PIC selected in MicroCode Studio. I remember selecting it before but maybe it got unselected somehow. The whole new-to-PBP3 thing was just a decoy. I have obviously spent too many hours staring at a computer screen today..... Bed time.

Jonathan.