Without your source code and version numbers this is kinda hard to
debug; lets try anyways...

(1) Probably you are simply using an ancient version of SDCC, 2.6.0?
    Use sdcc -v to tell.
(2) Do you #include "pic14regs.h" or at least #include "pic16f88.h"?
    If you did, recent SDCC versions should have complained about
    redefining PORTA_bits...
(3) How do you compile and link? You must link against libsdcc.lib and
    pic16f88.lib, preferably by mimicking the way SDCC calls the linker
    (see output of 'sdcc -mpic14 -p16f88 main.c -V' for some
    self-contained source file that includes the main() routine.

> missing definition for symbol "_PORTA_bits", required by "led.o"

This indicates that you are not linking with pic16f88.lib (or that your
library is outdated).

> So I edited my main c file (main.c) and added :
> volatile __PORTA_bits_t __at(PORTA_ADDR) PORTA_bits;
> 
> Now I get this error :
> multiple sections using address 0x5

Address 0x05 is defined in the library to be PORTA (I guess). This
indicates that you are linking with pic16f88.lib but are using an
outdated SDCC version. Grab and install a snapshot of the 2.7.4 release
and try again.

> I really don't know how to do this #define so I can simply test and set a pin.

You cannot, unless you take a different approach:
#define SET(reg,bit)    (reg) |= (1<<(bit))
#define CLR(reg,bit)    (reg) &= ~(1<<(bit))

#define LED1    PORTA,0
#define LED2    PORTA,2

void myfunc (void) {
  SET(LED1); CLR(LED2);
}

> I looked and the pic16f88.h and pic16f88.c in the share/sdcc/ folder
> and changed thing but still no improvement. I also found a pic16f88.lib
> which I think should be modify (re-compiled) to add the PORTA_bits
> structure, but I don't know how to do it.

Conceptually the right approach, but needless, as this is already done
in up-to-date versions.

Regards,
Raphael

-------------------------------------------------------------------------
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
_______________________________________________
Sdcc-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sdcc-user

Reply via email to