Error writing CONFIG2L and CONFIG2H register of PIC18F2680:
//CONFIG2H
#define WDTPS (0b0000<<1) //Watchdog Timer Postscale Select bits: 0000
// 1:1
#define WDTEN (0b0) //Watchdog Timer Enable : 0 no Enable
#define CONFIG2H_ WDTPS|WDTEN
//CONFIG2L
#define VBOR (0b11<<3) //Brown-out Reset Voltage: 11 set to 2.1V
#define BOREN (0b00<<1) //Brown-out Enable bits: 00 Brown-out
//disabled in hardware and software
#define PWRTEN (0b0) // Power-up Timer Enable: 0 = PWRT enabled
#define CONFIG2L_ VBOR|BOREN|PWRTEN
__code __at __CONFIG2L char conf2L = CONFIG2L_;
__code __at __CONFIG2H char conf2H = CONFIG2H_;
error: File "obj\Release\Heizung.o", section
".config_300002_OBJ\RELEASE\HEIZUNG.O" (0x300002) is absolute but occurs
in more than one file.
I have also tested two alternatives:
__code __at __CONFIG2L unsigned short conf2H_conf2L=(((unsigned
short)CONFIG2H_)<<8)|CONFIG2L_;
__code __at __CONFIG2L char conf2L[] = {CONFIG2L_,CONFIG2H_};
In both cases, only register CONFIG2L was described.And CONFIG2H always remains 0b00011111 (default) ..
Diff: