From: MiGaNuTs <mig...@fr...> - 2008-11-20 16:40:45
|
Hello, try to write "TRISB6 = 0;" in place of " TRISB_bits.TRISB6 = 0;" it should works better. if not, write "TRISB=0x08;" it do the same jo, and the asm code is shorter and faster. Sorry for my bad english. have fun. MiGaNuTs Le 20 nov. 08 à 13:11, Vaclav Peroutka a écrit : > Hello, I use following short code: > > #include <pic16f690.h> > > void main(void) > { > // config the application > OSCCON = 0x70; //8MHz internal clock, sysclock defined in CONFIG > ANSEL = 0x00; > ANSELH = 0x00; > > // config SPI > TRISB_bits.TRISB6 = 0; // SCK > TRISB_bits.TRISB4 = 1; // SDI > TRISC_bits.TRISC7 = 0; // SDO > > SSPSTAT = 0x80; // SMP=1, CKP=0 > SSPCON = 0x31; // CKE=1, enable, SPI master, Fosc/16 > > while(1) ; > > } > > During comiplation I get erors: >> sdcc -V -mpic14 -ppic16f690 main.c > + d:\v\sw\sdcc\bin\sdcpp.exe -nostdinc -Wall -obj-ext=.o - > DSDCC_MODEL_SMALL -DSDCC=284 -DSDCC_REVISION=5264 -DSDCC_pic14 - > D__pic14 -DSDCC_PROCESSOR="pic16f690" -isystem "d:\v\sw\sdcc\include > \pic14" -isystem "d:\V\sw\sdcc\bin\..\include\pic14" -isystem "d:\v > \sw\sdcc\include" -isystem "d:\V\sw\sdcc\bin\..\include" -isystem > "d:\v\sw\sdcc\include\pic" -isystem "d:\V\sw\sdcc\bin\..\include > \pic" "main.c" > main.c:23: error 26: '_TRISB_bits' not a structure/union member > main.c:23: error 25: Structure/Union expected left of '.->' > main.c:24: error 26: '_TRISB_bits' not a structure/union member > main.c:24: error 25: Structure/Union expected left of '.->' > main.c:25: error 26: '_TRISC_bits' not a structure/union member > main.c:25: error 25: Structure/Union expected left of '.->' > > In .H file there is correct definition of "TRISB_bits". But it > seems to me that SDCC wrongly interprets underscores. Is there some > hack, how to enable unions ? My SDCC is of version 2.8.4 #5264 (Nov > 11 2008) (MINGW32) > > Thank you in advance, > Vaclav > > ---------------------------------------------------------------------- > --- > This SF.Net email is sponsored by the Moblin Your Move Developer's > challenge > Build the coolest Linux based applications with Moblin SDK & win > great prizes > Grand prize is a trip for two to an Open Source event anywhere in > the world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > _______________________________________________ > Sdcc-user mailing list > Sdc...@li... > https://lists.sourceforge.net/lists/listinfo/sdcc-user > |