From: Richard H. <hug...@gm...> - 2012-05-25 14:19:21
|
Hi all, I'm the main developer for ColorHug, an open source colorimeter device. I'm looking to port away from the Microchip tools, and compile natively using Linux. I'm using a PIC18F46J50 in the hardware, and need to set certain config fuses to do things like turning on the watch dog timer and setting the clock PLL mode. I noticed that the file device/non-free/include/pic16/pic18f46j50.h is missing all the fuse #defines, unlike other files like device/non-free/include/pic16/pic18f2455.h which do have the constants, e.g. pic18f2455.h: /* Configuration register locations */ #define __CONFIG1L 0x300000 #define __CONFIG1H 0x300001 ... /* Full-Speed USB Clock Source Selection 1L options */ #define _USBPLL_CLOCK_SRC_FROM_96MHZ_PLL_2_1L 0xFF /* Clock src from 96MHz PLL/2 */ #define _USBPLL_CLOCK_SRC_FROM_OSC1_OSC2_1L 0xDF /* Clock src from OSC1/OSC2 */ pic18f46j50.h: #define __CONFIG1L 0xFFF8 #define __CONFIG1H 0xFFF9 ... Now, i see both files were created by inc2h-pic16.pl which must use the gputils/header/p18f2455.inc and gputils/lkr/18f46j50.lkr files as inputs. Looking at these files, it looks like the former has the _PLLDIV_1_1L type #defines created manually, and the other does not. To correct the pic18f46j50.h shipped with sdcc, I'm guessing I have to "fix" the 18f46j50.lkr file in gputils, and then re-run inc2h-pic16.pl -- does that sound about correct? Richard |