LCD DEVICE FOR HCS08 QG8

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

LCD DEVICE FOR HCS08 QG8

5,605 Views
SAPAN
Contributor I
    I AM WORKING WITH HCS08 QG8 FAMILY. I AM STUDENT. I WANT TO KNOW WEHTER I NEED LATCH OT BUFFER TO DRIVE LCD. I AM GETTING RIGHT CONTOLWORD  ON PORT BUT IT IS NOT DISPLAYED ON LCD.
Labels (1)
0 Kudos
7 Replies

569 Views
peg
Senior Contributor IV
Hi SAPAN,
 
First, I presume you want to interface to a LCD character module such as 2 line x 20 char (or 16x2 or 40x2 etc). The vast majority of these are based on the old Hitachi LSI controller HD44780.
 
Second, as these are setup for a TTL interface then they work perfectly well, within spec, when connected to a 3/3.3v i/o. Just run the MPU on 3/3.3v, the LCD on 5v and connect directly. Connecting the bias pot to 3.3v gives a better range as you never need a high voltage. The easiest way is to simply tie R/W to GND and use time delays where required.
 
As for how to control it you can refer to the documentation for the controller on your module or there are some good refences on this site:
 
An old HC05 manual that shows you how to do it all in assembler:
 
and some more modern application notes:
 
AN1774
AN2940 and its software AN2940sw.zip
and others.
 
Just plug these into the keyword search at the top right.
Also try LCD in the search box to reveal much more.
 
Good Luck!
 
 


Message Edited by peg on 2007-10-21 11:06 AM
0 Kudos

569 Views
Limestone
Contributor III

Hello!

 

I don´t know if there is a point in reopening a very old thread, but here goes.

I was just thrown in a project using a MC9S08QE64. One of the tasks for the unit was to drive a display.

 

I have searched the forum and the rest of the freescale site and a fail compleatly in finding the file AN2940sw.zip

 

Can anyone supply me with a direct link please.

 

Thanks

Martin

0 Kudos

569 Views
tonyp
Senior Contributor II

Search for "AN2940sw.zip" in Freescale.

 

It should show the PDF.  On the left side, you will see Documentation(1).  Click on that.  It will show the PDF and a ZIP icon underneath.  Click on the ZIP icon and you get the file.

0 Kudos

569 Views
fredycolombia
Contributor I
hi sapan

I'm going to attach a schematic, about lcd conecction, with this you can test with the variable resistance if your lcd work.
also I worked with lcd module in gp 32, and I have a pdf about the configuration lcd, but It is spanish, if you are interested in this I can send you.
this are routines to send a Instruction and caracter that I used:


void LCDINSTRUCCION (uchar instruccion){

 PTB = instruccion;
 PTC_PTC0 = 0;
 PTC_PTC2 = 1;
 RETARDO(50);
 PTC_PTC2 = 0;

}



void LCDCARACTER (uchar caracteres){

PTB = caracteres;
PTC_PTC0 = 1;
PTC_PTC2 = 1;
asm nop
PTC_PTC2 = 0;
RETARDO(3000);

}



and this is to initialize lcd module,  if you want 8 o 4 bits and displacement way

void LCDSET (void){

LCDINSTRUCCION(0x01);
RETARDO(1168);
LCDINSTRUCCION(0x3F);
RETARDO(1168);
LCDINSTRUCCION(0x0C);
RETARDO(1168);
LCDINSTRUCCION(0x06);

}


regars
fredy





0 Kudos

569 Views
IanfromUK
Contributor I
This might sound obvious but a 'standard' (ie 5v) LCD probably won't work directly with the HCS08. You need a 3v device. They are available but not as common.
0 Kudos

569 Views
PeterHouse
Contributor I
That was obvious and I did not think of it having started with 5v logic in 1975!  Think: Dinosaur.

Most (?) of the 3.3v devices are 5v tolerant and this could probably be fixed using 10K pullups to 5v for simple level translation.
0 Kudos

568 Views
PeterHouse
Contributor I
Sapan,

I am guessing you are trying to use an LCD module and not a raw LCD.

LCD modules can be tricky to get up and running.  There is usually a start up sequence to initialize the module consisting of several control words written in sequence.  Most LCD modules have a busy flag (BF) which may not be active until after this sequence and this sequence must be timed with delays. 

When I start with a new LCD module I figure out this sequence by sending the bytes at 100ms intervals to get it working and test the BF and then tighten up the timing once I have a stable and consistent response from the module.

If you can get the datasheet for the controller IC used in the module it will usually spell out this sequence correctly.

VERY IMPORTANT:  Some module require a bias voltage to control the contrast and if this is wrong you will not see anything on the display not matter what you do in software.  If it a dot matrix display - you should adjust this bias so you can barely see the dots in the matrix to get started.

Good Luck,

Peter House
0 Kudos