Yahoo Groups archive

AVR-Chat

Index last updated: 2026-04-28 22:41 UTC

Thread

Re: [AVR-Chat] Serial communication problem in atmega32

Re: [AVR-Chat] Serial communication problem in atmega32

2008-03-14 by eko setiawan

what kind of program which U use to write uC?
try this:
I use CV AVR. that program have provide the fitur for serial comm easily.
U can use code wizard fitur in there.
U only adjust the baud rate.
the command for display is "printf", like command in c language.
Show quoted textHide quoted text
----- Original Message ----
From: rakesh modi <get_rak20ec@yahoo.com>
To: AVR-Chat@yahoogroups.com
Sent: Friday, March 14, 2008 3:33:57 PM
Subject: [AVR-Chat] Serial communication problem in atmega32

                Hello,
I want to do serial communication using atmega32. Is there any setting of timer i have to do? If yes can anyone tell me whats that setting?

Reply me plz
 
R.P.Modi




	
 		   
					
<!--

Re: [AVR-Chat] Serial communication problem in atmega32

2008-03-14 by David Kelly

On Mar 14, 2008, at 4:22 AM, eko setiawan wrote:

> what kind of program which U use to write uC?
> try this:
> I use CV AVR. that program have provide the fitur for serial comm  
> easily.
> U can use code wizard fitur in there.
> U only adjust the baud rate.
> the command for display is "printf", like command in c language.


"printf" is not a C command, it is a routine like any other,  
contained in a library, described in header file(s).

printf() is usually a very large consumer of CPU resources as it must  
include a runtime interpreter to read the format string, then it must  
include binary to ASCII converters for all supported output formats  
whether you use them or not.

In general only very large projects, students or other novices, can  
afford the cost of printf() in an embedded environment.

What most of us do is write routines that do just what we want and  
nothing else. Maybe a putchar() to write individual bytes out the  
serial port. Then puts() to repeatedly call putchar() writing each  
character of a string. Then i8puts() to convert an 8 bit integer and  
write to the serial port in ASCII, and/or u8puts(), or u16puts(), and/ 
or i16puts(), ... And often I add crlf() for line endings.

void crlf(void)
{
	putchar(0x0d);
	putchar(0x0a);
}

and use something like this:

	puts("The answer is ");
	i16puts(sum);
	crlf();

rather than

	printf("The answer is %i\n", sum);


--
David Kelly N4HHE, dkelly@HiWAAY.net
========================================================================
Whom computers would destroy, they must first drive mad.

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.