[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [avr-gcc-list] Problem to control S1D13305 (SED1335-Epson Controller
From: |
Preston Wilson |
Subject: |
Re: [avr-gcc-list] Problem to control S1D13305 (SED1335-Epson Controller) with using ATmega32 |
Date: |
Fri, 04 Jul 2008 07:54:11 -0400 |
User-agent: |
Microsoft-Entourage/11.4.0.080122 |
"Paulo Marques" wrote:
> Sach wrote:
>> hi,
>>
>> I am trying to control S1D13305 (SED1335-Epson Controller) based Graphic LCD
>> with using AVR ATmega32 microcontroller.
>> [...]
>>
>> void Delay(unsigned int counter)
>> {
>> while(counter)
>> {
>> counter = counter - 1;
>> }
>> }
>
> I didn't check the whole code, but at least this part is bad as the
> compiler is free to optimize this function away completely.
>
> Place a:
>
> #define F_CPU 8000000UL
>
> on the top of your code and use the delay macros in "util/delay.h".
>
> I hope this helps,
The overuse of the global variable "i" is at least part of the problem.
-Preston