Yahoo Groups archive

AVR-Chat

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

Message

Re: Atmega16 Real time clock

2005-06-03 by Graham Davies

--- In AVR-Chat@yahoogroups.com, "wbounce" <wbounce@s...> wrote:

> So you write all your own print
> to uart routines ...

Absolutely, but using buffered I/O. Personally, I use my own operating 
system which includes stream I/O. My printf(), actually OsPrintfLite(), 
puts the output characters in a buffer and an interrupt transfers them 
to the actual UART, or wherever else the stream identifier sends them. 
This makes printf() *much* less intrusive and *much* safer in embedded 
applications.

> ... including things
> like handling double? 

Floating point is often not necessary in embedded systems and should be 
avoided due to long and unpredictable execution times. So, just don't 
implement it in your printf(). That's why mine's called OsPrintfLite(). 
If you absolutely have to printf() floating point, use the library to 
print it to a string and throw the string to your printf(). But, now 
you've got to inspect the floating point library and sprintf() for 
suitability to embedded systems.

Graham.

Attachments

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.