You were right I was using an old version (actually the one provided by my
distro, Ubuntu), so switching to a newer version solve the problem, thanks.
(sorry for not having checked).
But there is still a probleme in the new version (December 4, 2007 nigthly
build), in pic16f88.h there is :
// ----- PORTA bits --------------------
typedef union {
struct {
unsigned char RA0:1;
unsigned char RA1:1;
unsigned char RA2:1;
unsigned char RA3:1;
unsigned char RA4:1;
unsigned char RA5:1;
unsigned char :1;
unsigned char :1;
};
} __PORTA_bits_t;
extern volatile __PORTA_bits_t __at(PORTA_ADDR) PORTA_bits;
#ifndef NO_BIT_DEFINES
#define RA0 PORTA_bits.RA0
#define RA1 PORTA_bits.RA1
#define RA2 PORTA_bits.RA2
#define RA3 PORTA_bits.RA3
#define RA4 PORTA_bits.RA4
#define RA5 PORTA_bits.RA5
#endif /* NO_BIT_DEFINES */
Why are RA6 and RA7 not defined?
They can be used as regular io so defining them does no harm (and helps someone
who want's to use them).
I don't use those pins right now, so thanks for your help.
Take care
>Date: Mon, 03 Dec 2007 18:05:50 +0100
>De: Raphael Neider <[EMAIL PROTECTED]>
>A: [email protected], [EMAIL PROTECTED]
>Sujet: Re: [Sdcc-user] PORTA and PORTB bit structures missing for pic16f88
>
>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