From: Aaron C. <mar...@ho...> - 2004-08-15 05:51:55
|
I'm having problems getting the following .c code to link. I'm using SDCC from CVS and gputils-0.12.3 in MINGW. -- [snip] --- #include "pic18fregs.h" // set configuration bits data char at __CONFIG1H conf1H = (_IESO_OFF_1H & _FCMEN_OFF_1H & _OSC_INT_Port_on_RA6_Port_on_RA7_1H); data char at __CONFIG2L conf2L = (_BODENV_2_0V_2L & _BODEN_OFF_2L & _PUT_ON_2L); data char at __CONFIG2H conf2H = (_WDT_DISABLED_CONTROLLED_2H & _WDTPS_1_32768_2H); data char at __CONFIG3H conf3H = _MCLRE_MCLR_enabled_RA5_input_dis_3H; data char at __CONFIG4L conf4L = (_BACKBUG_OFF_4L & _LVP_OFF_4L & _STVR_ON_4L); data char at __CONFIG5L conf5L = (_CP_0_OFF_5L & _CP_1_OFF_5L); data char at __CONFIG5H conf5H = (_CPB_OFF_5H & _CPD_OFF_5H); data char at __CONFIG6L conf6L = (_WRT_0_OFF_6L & _WRT_1_OFF_6L); data char at __CONFIG6H conf6H = (_WRTC_ON_6H & _WRTB_OFF_6H & _WRTD_OFF_6H); data char at __CONFIG7L conf7L = (_EBTR_0_OFF_7L & _EBTR_1_OFF_7L); data char at __CONFIG7H conf7H = _EBTRB_OFF_7H; void main() { OSCCON = 0x73; // Set oscillator to 8 MHz ADCON1 = 0xff; // Set all RA lines to digital } -- [snip] --- When I try to compile this using the command-line, sdcc -mpic16 -ppic18f1220 test.c I get and error that says "error: multiple sections using address 0x180002" If I comment out the __CONFIG2L or __CONFIG2H like the error goes away. I need to configure both registers though so only specifying one or the other really isn't and option. Does anyone have an ideas what is going wrong? Is this the proper way to setup the configuration registers? Any help would be greatly appreciated. Thanks in advance. Aaron _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfee® Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 |