Keywords: sdccman

## 4.6.2 Adding New Devices to the Port

Adding support for a new 14 bit PIC MCU requires the following steps:

1. Create a new device description.
   Each device is described in two files: pic16f*.h and pic16f*.c. These files primarily define SFRs, structs to access their bits, and symbolic configuration options. Both files can be generated from gputils' .inc files using the perl script support/scripts/inc2h.pl. This file also contains further instructions on how to proceed.
2. Copy the .h file into SDCC's include path and either add the .c file to your project or copy it to device/lib/pic/libdev. Afterwards, rebuild and install the libraries.
3. Edit pic14devices.txt in SDCC's include path (device/include/pic/ in the source tree or /usr/local/share/sdcc/include/pic after installation).
   You need to add a device specification here to make the memory layout (code banks, RAM, aliased memory regions, ...) known to the compiler. Probably you can copy and modify an existing entry. The file format is documented at the top of the file.