From: Raphael N. <RN...@we...> - 2005-09-26 14:41:15
|
Hi folks, > Have you written an implementation of the putchar() function for your > hardware implementation? > > Due to the many varied ways in which printf() could be used, for > example: RS232 comms to displaying on a 2x40 character LCD display, you > need to define your own putchar() function which is utilised by printf() > when it needs to display a character. This will certainly work some day -- right now, the pic14 library is virtually non-existant. At the moment you will have to grab a printf-implementation of your choice (try device/lib/ or device/lib/pic16/libc/libio/ for some microcontroller versions), and insert it (a) directly in your code or (b) into a new .c file. In the latter case you will need to link the resulting .o file with your main program... Depending on your printf-version you might still need to provide a putchar which actually emits a char "somewhere". >>Hi, >>I doownloaded the sdcc-snapshot-i586-mingw32msvc-20050926 >>and when I try to compile a test source I give this error: >> >>C:\projeto\testesdcc>sdcc -mpic14 -p16f877 main.c >>Processor: 16f877 >>main.c:4: warning 85: in function putchar unreferenced function >>argument : 'c' >>message: using default linker script "C:\Program Files\gputils\lkr >>\16f877.lkr" >>error: missing definition for symbol "_printf", required by "main.o" >> >>C:\projeto\testesdcc> >> >>Is not possible to use printf with pic14? There is still some work to be done to make this more convenient, sorry. Regards, Raphael Neider |