This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

printf does not work on microcontroller

I have a very simple but annoying problem. I use printf () in my code and either on Keil or Proteus simulations it works. However, when I load this code to my microcontroller, which is DS89C450, it does not work.I also add the putchar.c and getkey.c to my source code. Characters, observed on Terminal Emulator are dots and squares and sometimes endless loops. The baud rate is correct. I test it by sending characters via SBUF0. The code is right here.

#include <DS89C4xx.H>
#include <stdio.h>

void main (void)
{
  SCON0=0x50;
  TMOD=0x20;
  TH1=0xFC; //9600 bps with 14.7456 MHz crystal
  TR1=1;
  TI_0=1;
   while (1)
  {     printf ("test\n");
}