Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

Using pic16 C libraries for pic12fxxx

Help
2008-06-27
2013-03-12
  • Hi,
    I am simultaneously working on pic18f2550 as well as pic12f675 and while I am eagerly awaiting for help on my previous post, I would appreciate that somebody out there would help me out in using c libraries (the headers of which are stored in ~sdcc/include/pic16 folder) with pic12fxxx controllers.

    Compiler: SDCC 2.7.0
    IDE: Piklab
    Device: 12f675

    The code doesn't make any sense but this to delineate the error that was reported when I tried to compile a code which uses the c libraries found in ~sdcc/include/pic16 folder.

    Note: The compiler's include path has been pointed to the ~sdcc/include/pic16 folder, the Assembler and linker paths are also suitably added.

    #include <pic12f675.h>
    #include <delay.h>

    void main()
    {
    }

    The error message is:

    sdcc -mpic14 -p12f675 -V --debug -I/home/ashwin/Desktop/16f675/ -I/usr/share/sdcc/include/pic16/ -c 12f.c
    + "/usr/bin/sdcpp" -nostdinc -Wall -std=c99 -I"/home/ashwin/Desktop/16f675/" -I"/usr/share/sdcc/include/pic16/" -obj-ext=.o -DSDCC_MODEL_SMALL -DSDCC=270 -DSDCC_pic14 -D__pic14 -DSDCC_PROCESSOR="12f675" -I"/usr/bin/../share/sdcc/include/pic14" -I"/usr/share/sdcc/include/pic14" -I"/usr/bin/../share/sdcc/include" -I"/usr/share/sdcc/include" -I"/usr/bin/../share/sdcc/include/pic" -I"/usr/share/sdcc/include/pic"  "12f.c"
    delay.h:30: warning 115: unknown or unsupported #pragma directive 'library c'

    delay.h:43: syntax error: token -> '__wparam' ; column 39
    delay.h:43: error 159: in function delay10tcy: name omitted for parameter 1
    delay.h:43: warning 85: in function delay10tcy unreferenced function argument : '_delay10tcy_PARM_1'

    delay.h:44: syntax error: token -> '__wparam' ; column 40
    delay.h:44: error 159: in function delay100tcy: name omitted for parameter 1
    delay.h:44: warning 85: in function delay100tcy unreferenced function argument : '_delay100tcy_PARM_1'

    delay.h:45: syntax error: token -> '__wparam' ; column 39
    delay.h:45: error 159: in function delay1ktcy: name omitted for parameter 1
    delay.h:45: warning 85: in function
    delay.h:45: warning 85: in function delay1ktcy unreferenced function argument : '_delay1ktcy_PARM_1'

    delay.h:46: syntax error: token -> '__wparam' ; column 40
    delay.h:46: error 159: in function delay10ktcy: name omitted for parameter 1
    delay.h:46: warning 85: in function delay10ktcy unreferenced function argument : '_delay10ktcy_PARM_1'

    delay.h:47: syntax error: token -> '__wparam' ; column 41
    delay.h:47: error 159: in function delay100ktcy: name omitted for parameter 1
    delay.h:47: warning 85: in function delay100ktcy unreferenced function argument : '_delay100ktcy_PARM_1'

    delay.h:48: syntax error: token -> '__wparam' ; column 39
    delay.h:48: error 159: in function delay1mtcy: name omitted for parameter 1
    delay.h:48: warning 85: in function delay1mtcy unreferenced function argu
    delay.h:48: warning 85: in function delay1mtcy unreferenced function argument : '_delay1mtcy_PARM_1'

    *** Exited with status: 1 ***

    Help is appreciated. Thank you very much.

     
    • Raphael Neider
      Raphael Neider
      2008-06-27

      You need write your own libc for the pic14 or port the pic16/any libc to the pic14 target of sdcc; at least you cannot use the pic16 libs:
      __wparam is a keyword for the pic16 target, but unknown in the pic14 target (you might succeed to include the header using

      #define __wparam /* nothing */
      #include <delay.h>

      but the implementation is PIC16 assembly, which is probably not directly portable...

      Hope that helps,
      Raphael