Menu

#1365 compiling error for pic16f688

closed-invalid
nobody
None
5
2013-05-25
2007-08-27
Anonymous
No

email: mclain.cox@navy.mil

I have issues while attempting to compile my code for a pic16f688. Here is my code:

#include <pic/pic16f688.h>
#include <stdlib.h>
#include <string.h>

typedef unsigned int configure;

configure at 0x2007 __CONFIG = _FCMEN_OFF &
_IESO_OFF &
_BOD_ON &
_CPD_OFF &
_CP_OFF &
_MCLRE_ON &
_PWRTE_OFF &
_WDT_OFF &
_HS_OSC;

void main()
{

}

to compile I use sdcc -c filename.c

I get a bunch of warnings for pic16f688.h about the absolute address for sfr 'CMCON1' probably out of range, and the same warning for the rest of the stuff like that, then I get this

?ASxxxx-Error<oq> in line 44 of filename.asm
<o> .org in REL area or directive / mnemonic error
<q> missing or improper operators, terminators or delimitors
removing filename.rel

I am running vs 2.7.3 #4903 windows version

Please help, I'm trying to get this chip configured correctly, and this won't let me configure. Thanks

McLain

Discussion

  • Raphael Neider

    Raphael Neider - 2007-08-27
    • labels: 101552 -->
    • milestone: --> non_bugs
    • status: open --> closed-invalid
     
  • Raphael Neider

    Raphael Neider - 2007-08-27

    Logged In: YES
    user_id=1115835
    Originator: NO

    You should have told SDCC which PORT (mcs51, hc08, pic, pic16, ...) to use and which DEVICE to target. SDCC defaults to the mcs51 target...

    Try
    sdcc -mpic14 -p16f688 -c filename.c

    Furthermore, I recommend using
    <code>
    // make .c file generic for all PIC14 devices
    #include <pic14regs.h>

    typedef unsigned int configure;

    // __at(ADDR) can be reDEFINEd to something else for other compilers/lint/...
    configure __at(0x2007) __CONFIG = _FCMEN_OFF & ...;

    void main(void)
    {
    }
    </code>

    BTW: The C-library for the pic14 port is non-existant; you wanted to use string.h and stdio.h---their functions are not implemented in the PIC14 libraries. Add their sources (e.g., from sdcc/device/lib/) to your project, adapt them to suit your needs, and compile them as part of your project.

    HTH,
    Raphael

     

Log in to post a comment.

MongoDB Logo MongoDB