PIC16F1828 config/assembly problem


Closed Thread
Results 1 to 3 of 3
  1. #1
    Join Date
    Jul 2012
    Posts
    7

    Default PIC16F1828 config/assembly problem

    Hello,

    I cannot get this to compile with PBP3:

    Code:
    #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:
    Code:
    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:

    Code:
    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.

  2. #2
    Join Date
    Jul 2012
    Posts
    7


    Did you find this post helpful? Yes | No

    Default Re: PIC16F1828 config/assembly problem

    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:

    Code:
    [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.

  3. #3
    Join Date
    Jul 2012
    Posts
    7


    Did you find this post helpful? Yes | No

    Default Re: PIC16F1828 config/assembly problem

    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.

Similar Threads

  1. Config problem PIC16F886
    By Bosse in forum mel PIC BASIC Pro
    Replies: 55
    Last Post: - 2nd January 2014, 06:24
  2. Context saving in assembly - 16F72 giving problem
    By financecatalyst in forum Off Topic
    Replies: 6
    Last Post: - 3rd August 2012, 20:30
  3. PIC18F4620 Oscillator Config problem
    By Andy Wood in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 28th October 2011, 03:21
  4. PIC16F887 Config problem
    By Agent36 in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 13th November 2008, 22:38
  5. 877A AtoD config problem?
    By ttease in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 1st April 2007, 16:57

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts