Marc Paquette

CodeWarrior 8- & 16-bit tools: printf() IN HC08

Discussion created by Marc Paquette Employee on Jan 27, 2006
To help you find solutions to problems that have already been solved, we have posted this message. It contains an entire topic ported from a separate forum. The original message and all replies are in this single message.
Posted: Jul 19, 2004 - 10:22 PM   
Hi there,
I'm using CodeWarrior 3.0 to compile my project for use on a MC68HC908JK1. When trying to debug my program, which does compile, I am inserting the printf() function and now my project won't compile.
Link Error: L1822: Symbol TERMIO_PutChar in file ...\ansii.lib is undefined
Could someone help me out by telling me how to get the printf to work.
Posted: Jul 20, 2004 - 04:44 PM   
Just add the file termio.c from installation directory lib\HC12c\src to the project.
Ron Liechty
Ombudsman for Metrowerks
Posted: Jul 20, 2004 - 08:54 PM   
Hi Ron,
Thanks for tip but it opened up more problems,
now I am out of allocation space in segment ROM
I have stripped down all of my code trying to get this printf() function to work but there is still not enough room.
The ROM locations and size are:
$F600–$FBFF; user memory, 1536 bytes on MC68H(R)C08JK1.
Posted: Jul 20, 2004 - 10:02 PM   
As a follow-up to my last reply I am using a MC68HC08JL3 chip now for the sake of debugging. I plan to revert back to the JK1 once this is said and done.
So now there is enough ROM to compile but the True-time Simulator and Real-time Debugger is telling me I am using "invalid or unitialized memory" when I start my simulation
So now I've got two questions:
how to get printf() to compile onto a JK1?
how do I get printf() to print to console (my screen)?
Posted: Jul 22, 2004 - 04:57 PM   
ANSI printf() take a lot ROM space. If your mcu is ROM limited
or use free SE CW HC08. Then you may code your won SCI utility like SendChar() / GetChar() / SendString()..
Check Compiler manual on how to generate compact code and
Manual_Engine_HC08.PDF -- P&E target interface for how to use full-chip-simulation properly.