| The Build Process | ||
| Links Mentioned N/A |
![]() The APP-II support files include a sample makefile, so if you have a make program (for example, the one that Cygwin includes) you can use it. If you are using gputils, copy makefile-gp to makefile. If you want to use the Microchip tools, copy makefile-mchip instead. Simply change the target name (and any directories necessary) in the file. Don't use an extension in the target name, so if your program name is myprog.c, just set target to myprog. If you don't want to use make, just issue the following command from a command prompt or a shell: sdcc -mpic14 -p16f873 -Wl -sapp2.lkr myprog.c Here, myprog.c is your program source, and app2.lkr is the file from the APP-II support files. You also need app2.h and app2lib.h from the support files, of course. This generates a hex file and you can program it into the APP-II in the usual way. If you want to use the Microchip tools, your build process will be a bit more complex. Be sure to get the latest programs from Microchip since some older versions of MPLINK won't correctly handle SDCC's output. Here's a typical build script: sdcc -S -mpic14 -p16f873 myprog.c mpasmwin /o /q myprog.asm mplink /o myprog.hex myprog.o app2.lkr In the end, you have a working hex file either way. Here is some information about PIC programming from the SDCC manual:
void Intr(void) interrupt 0 { T0IF = 0; /* Clear timer interrupt */ }
So there you have it. C programming on the APP-II!
|