cprintfatmelteraterm

Tera Term with Atmel Board in C


Trying to debug an issue using Atmel Mega 328p Board.

#include <stdio.h>
#include <avr/io.h>

void main() 
{
   while(1)
   {
      printf("hello world,");
   }
   return;
} 

Viewing this port in Tera Term returns nothing at all.

Warning : Implicit declaration of printf();

What could be the problem in our code?


Solution

  • You must initialize UART of the uC and write custom function for redirecting output on it, if you want to view output on tera-term. printf does not output on UART unless it is written in that way. However in this case, the output of the program can be viewed in the output console of the IDE which you are using.