In p18f45j50.inc from gputils and from mpasm is written:

;   IMPORTANT: For the PIC18 devices, the __CONFIG directive has been
;              superseded by the CONFIG directive.  The following settings
;              are available for this device.

This is why there are no __config definitions in the gputils *.inc and 
consequently in sdcc pic16 device *.h files.

Have you tried to use #pragma config as described in sdccman? Be 
careful: #pragma config was introduced 2012-03-16, which means that it 
exists only in the sdcc snapshot builds.

Borut

On 25. 05. 2012 16:19, Richard Hughes wrote:
> 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
>

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Sdcc-user mailing list
Sdcc-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sdcc-user

Reply via email to