LCDInfo.com

http://www.lcdinfo.com
It is currently Mon Nov 25, 2024 2:54

All times are UTC + 2 hours




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Crystalfontz LCD help
PostPosted: Fri Sep 23, 2005 20:27 
Offline

Joined: Fri Sep 23, 2005 20:26
Posts: 1
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


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 16, 2006 22:23 
Offline

Joined: Thu Mar 16, 2006 22:01
Posts: 13
steveszol,

Your lcdenable() routine is not corect.

when sending data to the LCD you need to put the data on the bus and then bring E high then low. you have it the other way arround.

P.S. i dont know what xtal your running the Mega32 at but i would give quite a bit more delay so that you leave the E line high longer than 1 nop time length. start out with 1ms i know its a long time but that will rule out one possible problem anyway. you can allways shorten your delays later after you get it working properly.


Good luck!
Jim


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC + 2 hours


Who is online

Users browsing this forum: Bing [Bot] and 43 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group