how to make printf work for HCS08QG8?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

how to make printf work for HCS08QG8?

4,262 Views
Fan
Contributor I
This must be a dumb question: how to make printf work? If I put a printf() in my code, I got compilation error:
------------------------------------------------------------------------------------------------------------------------
Link Error   : L1822: Symbol TERMIO_PutChar in file C:\Program Files\Freescale\CW08 V5.0\lib\hc08c\lib\ansiis.lib is undefined

Link Error   : Link failed
-------------------------------------------------------------------------------------------------------------------------
I am using a P&E USB Multilink  debugger directly on my physical board.
Any help will be greatly appreciated. This is blocking all my code development.
 
Thanks  
 
Labels (1)
0 Kudos
Reply
5 Replies

939 Views
admin
Specialist II
I never got printf() to work for me (despite using termio.c).  If you just want to shove simple data out the serial port, you might be better off just writing yourself some quickie output functions specific to your data.
 
just my $0.02
Tomahawk
0 Kudos
Reply

939 Views
Fan
Contributor I
Thanks for the reply. Do you know what program to use to display the serial port data?
 
0 Kudos
Reply

939 Views
Lundin
Senior Contributor IV
Hyperterminal comes with Windows. It is a bad program, however. Google for "serial terminal program" or something like that. Here is a free one:
http://hp.vector.co.jp/authors/VA002416/teraterm.html

To connect to the PC's COM-ports, you need RS232. SPI won't do. Use the SCI and a RS232 tranceiver.
0 Kudos
Reply

939 Views
CompilerGuru
NXP Employee
NXP Employee
Check the lib\hc08c\src\termio.c, and add an adapted copy to your project.
The point is that the code actually sending the character with the SCI is derivative specific, therefore it cannot be in the generic ansi library.
(Also which sci to use in case your derivative has more than one)

Daniel
0 Kudos
Reply

939 Views
Fan
Contributor I
Thanks a lot for the response.
I implemented termio_putchar(), and get the code the compile. I used SPI output. Is the next step to write a PC side program to display the data? Somewhere on the board people were saying to use hyperterm for display. Where can I get one? What kind of connector do I need to connect SPI output to PC?
 
0 Kudos
Reply