hi
i am new to graphic lcdsand have bought the CFAG160x160 Crystalfontz Graphic LCD Module
i am interfacing it to a Atmel ATMEGA 32 microcontroller
i basically just need to have it display text using the internal character generator
i have started to write code for it in C but have run into many problems. All i have on the screen is a few vertical lines.
here is a bit of my code for the mode control
void modecontrol(void)
{
PORTC = 0x00; //write 00H into instruction reg//
PORTA |= 0x08; //RS=1 instruction
lcdenable();
busyflag();
PORTC = 0x30; //display on, master, Char Mode, Built-in CG//
PORTA &= ~0x08; //RS=0 data
lcdenable();
busyflag();
}
void lcdenable(void)
{
PORTA &= ~0x02; //Enable pin low//
asm volatile ("nop");
PORTA |= 0x02; //Enable pin high//
}
any help would be great, thanks
Steve
|