[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-gcc-list] Initilizing complex const arrays : syntax ?

From: Vincent Trouilliez
Subject: Re: [avr-gcc-list] Initilizing complex const arrays : syntax ?
Date: Tue, 20 Sep 2005 06:38:22 +0200

On Tue, 2005-09-20 at 05:15 +0200, Vincent Trouilliez wrote:
> > Wow, superb. But, I must first find the bug in lcd_putc() :-/
> > when I use _delay_ms(xxx) it is accurate, but in lcd_putc() I use
> > _delay_us() of course, let's see what it's doing exactly.. :-/

Still don't know what's wrong with _delay_us(45), so replaced it with a
for(i=15;i;i--);  which does give exactly 45us and generates only 2
instructions, versus about 30 for _delay_us().... so I guess I will
stick with that, just need to remember to revisit the routine when I put
a 16MHz quartz instead of the on-chip 1MHz oscillator...

Boy I thought my LCD was slow, but it's now lightening quick, I am truly
delighted, it's no longer a bottle neck in my main loop, even at only
1MHz, my AVR is now plenty fast enough for my project I think, no need
to use a power hungry 16MHz clock, board will be simpler, smaller,
cheaper, and might as well consider a handheld unit on top of the
original/current plan of a permanently wired solution... 

So, the correct numbers are now the following, these do NOT include the
time it takes to print to the LCD, so that we can really compare the
numbers in a meaningful way...

printf("%d.%02d", x / 100, x % 100);
--> 5.0ms

--> 1.1ms

--> 1.1ms

The numbers speak for themselves... your two functions are equally fast,
and are pretty much literally 80% shorter than printf ! I am sold :-)


reply via email to

[Prev in Thread] Current Thread [Next in Thread]