[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 05:15:42 +0200

> 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.. :-/

void lcd_send_byte(unsigned char data, unsigned char type)

        LCD_PORT = type;        //select register or data

        //send high nibble
        //send low nibble
        lcd_send_nibble(data << 4);

        PORTD = 0xFF;   //toggle all port pins for scope to see
        _delay_us(45);  //give LCD time to execute the command...
        PORTD = 0x00;


Amazing how easily you can debug programs with just toggling a port pin,
and your trusty old scope... The _delay_us(45) indeed lasts 1,300us not
45 !!!
_delay_ms(x) works perfectly, though. I run on the on-chip 1MHz
oscillator and set my define accordingly in my lcd module :

#define F_CPU 1000000UL

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

No idea what's wrong... but sure would kill my mom to find out, as that
would make printing on the LCD literally 20 times faster !!!

Any idea anyone ??


reply via email to

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