[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: |
Blake Leverett |
Subject: |
Re: [avr-gcc-list] Problem to control S1D13305 (SED1335-Epson Controller) with using ATmega32 |
Date: |
Fri, 4 Jul 2008 06:05:17 -0600 |
User-agent: |
KMail/1.9.9 |
Hello Sach,
I don't know much about the SED1335, but I can give some advice. See my
comments below.
Blake
On Friday 04 July 2008, Sach wrote:
> hi,
>
> I am trying to control S1D13305 (SED1335-Epson Controller) based Graphic
> LCD with using AVR ATmega32 microcontroller.
>
> I have written the demo code in c language for it in AVRStudio4. The
> problem is i am not getting any output on LCD. I have read the datasheet of
> SED1335 many times but i can not understand in details how to initialize
> LCD, about delay of LCD, contrast port values etc.
>
> Please help me with this.
>
> Regards,
> Sachin Rathod,
> India.
>
<snip>
> void LcdInit(void)
> {
> CtrlPort |= (RD|WR);
> CtrlPort &= (~CS)|(~RST)|(~FS1);
This won't work. It should be
CtrlPort &= ~(CS|RST|FS1);
> Delay(i);
> CtrlPort |= RST;
> }
<snip>
This Delay() funtion will be entirely optimized out, and won't even get
called. You can fix it by using a volatile counter as shown below, or use
the avr-libc's delay() function, which is better.
> void Delay(unsigned int counter)
> {
volatile cnt = counter;
// change counter to cnt below:
> while(counter)
> {
> counter = counter - 1;
> }
> }