I'm pretty new to C and PIC programming and this may sound a bit silly but i dont know how to link several .c files for organizing the code page and RAM banks. The manual for SDCC explains briefly but i dont really know how to do it. I tried searching for linking in the web but the results refers to linking object files, lkr, etc.
Can someone help me or link me an example please?
here is an example, how I do it to generate file2.hex:
$ sdcc -mpic14 -p16f628 --opt-code-size -c file1.c
$ sdcc -mpic14 -p16f628 --opt-code-size -c file2.c
$ sdcc -L /usr/local/share/sdcc/lib/pic -mpic14 -p16f628 file2.c file1.o
header of file2.c:
/* Define processor and include header file. */
#define clock_speed 16000000
/* Setup chip configuration */
typedef unsigned int config;
config at 0x2007 __CONFIG = _CP_OFF &
header of file1.c:
Thanks for the code sample. I really appreciate your help.
I will try it out and hopefully, be able to solve any problems that i face :)
Sign up for the SourceForge newsletter:
You seem to have CSS turned off.
Please don't fill out this field.