Next: 4.6.10 Memory Models
Up: 4.6 The PIC16 port
Previous: 4.6.8 Libraries
Contents
Index
Adding support for a new 16bit PIC MCU requires the following steps:
- Create picDEVICE.c and picDEVICE.h from pDEVICE.inc using
perl /path/to/sdcc/support/scripts/inc2h-pic16.pl /path/to/gputils/header/pDEVICE.inc
- mv picDEVICE.h /path/to/sdcc/device/include/pic16
- mv picDEVICE.c /path/to/sdcc/device/lib/pic16/libdev
- Add DEVICE to /path/to/sdcc/device/lib/pic16/pics.all
Note: No 18f prefix here!
- Edit /path/to/sdcc/device/include/pic16/adc.h
Add the new devices to the correct ADC style class (depending on
the number of ADC channels).
Do not touch adc.h if the device does not offer any ADC
at all.
- Edit /path/to/sdcc/device/include/pic16/pic18fregs.h
The file format is self-explanatory, just add
#elif defined(picDEVICE)
# include <picDEVICE.h>
at the right place (keep the file sorted, please).
- Edit /path/to/sdcc/device/include/pic16devices.txt
Copy and modify an existing entry or create a new one and insert
it at the correct place (keep the file sorted, please).
- Add the device to /path/to/sdcc/device/lib/pic16/libdev/Makefile.am
Copy an existing entry and adjust the device name.
- Add the device to /path/to/sdcc/device/lib/pic16/libio/Makefile.am
Copy the record from the 18f2220 and adjust the device name.
If the new device does not offer ADC, I
C, and/or
(E)USART functionality as assumed by the library, remove the lines
with references to adc/*.c, usart/*.c, or usart/*.c,
respectively.
- Update libdev/Makefile.in and libio/Makefile.in
using
./bootstrap.sh
in /path/to/sdcc/device/lib/pic16.
- Recompile the pic16 libraries as described in 4.6.8.
Next: 4.6.10 Memory Models
Up: 4.6 The PIC16 port
Previous: 4.6.8 Libraries
Contents
Index
2010-12-26