A discussion group for the PICMicro microcontroller. Also called the Microchip PIC, this list is dedicated to the use and abuse of this fine, simple, microcontroller. Close to topic posts are welcome, ie. general electronics.
|
The following code excerpt shows the declaration of an 80 byte array which causes a compiler error: Can't find 0x58 words for psect rbss_0 in segment BANK0 (error) Any array larger than 72 causes the error(it compiles fine with small arrays). This is a pretty simple thing that I'm trying to do - what the heck is up? Do I need to be doing something to handle the PIC memory banks? I thought that was all handled by the compiler. #include <pic.h> #include <conio.h> #include <stdio.h> void writebuf(char*); void outc(char); char outputBuffer[80]; main() { unsigned int i; unsigned char state; outputBuffer[0] = 'a'; outputBuffer[1] = 'b'; outputBuffer[2] = '\0'; ******************************** Building PUBLINK.HEX... Compiling PUBLINK.C: Command line: "C:\HT-PIC\BIN\PICC.EXE -W0 -G -O -Zg -D24 -E -ASMLIST - FAKELOCAL -16F876 -C C:\PUBLINK\PICPROJ\PUBLINK.C" Enter PICC -HELP for help Linking: Command line: "C:\HT-PIC\BIN\PICC.EXE -INTEL -ICD -16F876 - oPUBLINK.HEX -fakelocal PUBLINK.OBJ " Enter PICC -HELP for help ::Can't find 0x58 words for psect rbss_0 in segment BANK0 (error) Exit status = 1 MPLAB is unable to find output file "PUBLINK.HEX". Build failed. |
|
|
|
--- In piclist@e..., "Stewart Teaze" <stewart.teaze@g...> wrote: > The following code excerpt shows the declaration of an 80 byte array > which causes a compiler error: > > Can't find 0x58 words for psect rbss_0 in segment BANK0 (error) > > Any array larger than 72 causes the error(it compiles fine with small > arrays). This is a pretty simple thing that I'm trying to do - what > the heck is up? Do I need to be doing something to handle the PIC > memory banks? I thought that was all handled by the compiler. Unless you state otherwise, Hi-Tech C uses Bank 0 The processor has 128 bytes in Bank 0 and quite a few are reserved for SFR use, so about 90 bytes or so are available. I think you will have to move something into other banks using the Bank qualifier. cheers, |