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 (and
.build).
Note: No 18f prefix here!
- Adjust /path/to/sdcc/device/lib/pic16/libio/*.ignore
Add your DEVICE if it does not compile in adc, i2c,
or usart.
- 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 it sorted).
- Edit /path/to/sdcc/src/pic16/devices.inc. Copy and modify
an existing entry and insert it at the correct place (keep the file
sorted). The file is hardly documented, look at the entries for the
18f2221...
- Recompile SDCC, including the pic16 libraries.
2008-04-18