Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

How to add support for new PIC

2006-12-17
2013-03-12
  • Hi,

    I would like to use unsupported PIC with SDCC.

    I looked at the source kode and the devices are referenced at the following place:
    -pics.all
    -pic18fxxxx.h
    -pic18fxxxx.c
    -pic18fregs.h
    -devices.inc

    I guess that I would have to:
    - add the PIC number in pics.all and pic18fregs.h
    - create pic18fxxxx.h and pic18fxxxx.c
    - add description in devices.c

    The following is written in devices.c

    /* Device descriptions are now generated by scripts.
    * For simplicities sake we just include them here.
    * Manual overrides may be inserted on top of devices.inc
    * or right here BEFORE inclusion of devices.inc. */

    I found the script inc2h.pl that generate pic18fxxxx.h but have not found scripts for pic18fxxxx.c and devices.inc.

    Does anyone have information that may help me?

     
    • Raphael Neider
      Raphael Neider
      2007-03-09

      In recent SDCC snapshots (since r4603, 2007-01-28), support/scripts/inc2h-pic16.pl provides a script to create .h and .c files. The script also contains directions as to which files to edit in what ways to get you going. Alternatively you could simply post requested devices and I will add them to the official sources timely, assuming that gputils already support them...

      Here is a (despite the asterisks valid) link to the script, in case you do not want to/cannot upgrade:

      http://svn.sourceforge.net/viewvc/\*checkout*/sdcc/trunk/sdcc/support/scripts/inc2h-pic16.pl?revision=4603

      Regards,
      Raphael

       
      • Baltazar
        Baltazar
        2007-05-03

        Hello,

        I had exactly the same question : how to add unsupported PICs into SDCC. However, I think that it is also necessary to create the .lib file for the concerned device. Can anybody explain how to do this (on linux) ?

        Thanks

         
        • Raphael Neider
          Raphael Neider
          2007-06-12

          The procedure to add new devices is now documented in the script file (support/scripts/inc2h{,-pic16}.pl) and the manual. The .lib file will be created from the picXXXXX.c file, which needs to be copied into device/lib/pic{,16}/libdev, during regular build of the whole library (using make in device/lib/pic{,16}).

          Manually:
          1. Compile the generated picXXXX.c into picXXXX.o
          2. gplib -c picXXXX.lib picXXXX.o
          That's it.

          Regards,
          Raphael

           
    • jpremor
      jpremor
      2007-11-26

      well,

      i added new 18F67J60 pic just compiling for 18F6680 device (very similar to my pic) and the .h and .c is automatically generated by line command. It uses the mplab .inc file to create (with pearl) the .h and .c
      very interesting. The instruction can be found at the manual, "Create new device" item.

      best regards
      Jose