Can't print on the monitor

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

Can't print on the monitor

3,677 Views
SanderDijkstra
Contributor II
Hi all,
 
For days i've been trying to print something on my monitor, but without succes.
 
I use the MC9S12DP512 (CardHCS12) which has the Twinpeeks monitor on it. Thereby I use the OC-console and CodeWarrior.
 
The following example works in the Simulator and I can load it into the HCS12 with OC-console (after using sreccvt and updating the .prm-file to prevent "invalid bank load address errors" ).
When I run the prog, the HCS12 responds (I assume, because the default led stops) but doesn't show anyting on the OC-console.
 
--example from CW Help System: "Library: printf support"---
 
#include "Cpu.h"
#include "PE_Types.h"
#include "PE_Error.h"
#include "PE_Const.h"
#include "IO_Map.h"
#include <stdio.h>
#include <termio.h>
void main(void)
{
 /*** Processor Expert internal initialization. DON'T REMOVE THIS CODE!!! ***/
 PE_low_level_init();
 /*** End of Processor Expert internal initialization.                    ***/
 
 TERMIO_Init();
 for (;:smileywink: {
   (void)printf("Hello %s\n", "World");
 }

 /*** Processor Expert end of main routine. DON'T MODIFY THIS CODE!!! ***/
 for(;:smileywink:{}
 
(I also tried the Guess the Number-tutorial without succes)
 
Can somebody give me a hint how to get printf working?? 
 
Thank a lot,
Sander Dijkstra
 
Labels (1)
0 Kudos
4 Replies

519 Views
CrasyCat
Specialist III
Hello
 
How are you communicating with the board?
Are you using a P&E Multilink cable, a Softec InDart Cable, ....?
 
Where do you expect to see the output for printf?
 
CrasyCat
0 Kudos

519 Views
SanderDijkstra
Contributor II
Hi!
 
I'm using the OC-console terminal and the the board is connected with SCI 0 to my COM-port (serial cable).
 
I want to see the output on the terminal; so I can use printf to check a program when it is running.
 
greetz
Sander
 
 
0 Kudos

519 Views
CrasyCat
Specialist III
Hello
 
Normally printf is using the low level function TERMIO_PutChar to send characters to stdout.
Also It is good practice to call first TERMIO_Init to initialize the SCI port.
 
Can you check if you call the function TERMIO_Init prior to the first printf?
Can you also check if the low level functions TERMIO_PutChar and TERMIO_Init you are linking with your application are appropriate for setting up and writing to SCI0?
 
CrasyCat
0 Kudos

519 Views
Alban
Senior Contributor II
Hello,

To get info on how to use PRINTF, look for printf in the search engine.
Subject has already been treated a couple of times...

Alban.
0 Kudos