MC9S08GT60 communicate with 8-bit parallel device in 6800-mode (write/read)

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

MC9S08GT60 communicate with 8-bit parallel device in 6800-mode (write/read)

3,696 Views
priyanto
Contributor II
Hi,
 
I want to use one port of MC9S08GT60 as 8-bit bidirectional port (PortB) to communicate with the device (LCD Driver) for write and read operations. In the past, I usually had one port dedicated only for input port or output port but not both for write/read operations. According to the device spec, the LCD Driver has 6800-mode for write/read operations (RD/WR and E signals). I use the other GPIO pins for handshaking signals (RD/WR, E, chip select and so on). I followed the required timing diagrams from the device spec, but so far, the device still does not respond to any write or read operations from my code. Any inputs or suggestions would be really appreciated.
 
Regards,
-priyanto.
 
 
Labels (1)
0 Kudos
Reply
4 Replies

741 Views
glork
Contributor I
Hi Priyanto.
I've done this several times. You just need to be careful of a few things, such as these:
1. When you use the same port (e.g. port B) for reading and writing the lcd you MUST be sure you don't get the port direction control wrong. The key is to make the port outputs just before writing to the lcd (also please remember to write to the data latch of the port before making it outputs) and then changing it back to inputs as soon as you've finished. It should always 'rest' as inputs to avoid contention with the lcd controller.
2. Most lcd controller manufacturers provide timing specs & waveforms for the control lines (E, R/W, etc). Make sure your control algorithm follows these specs.
3. Finally, most lcd modules that come with a controller DON'T provide a reset line. This is a shame because they typically have a very poor reset circuit, and don't suffer brown-outs politely. Make sure you provide a clean power-up for the lcd module.
Hope this helps.
ron
0 Kudos
Reply

741 Views
alex_spotw
Contributor III
Hi:

Additionally, they require long delays at power up, and delays between commands in the order of ms (depending of the display).

The contrast connection is also a source of frustration, because the display and the SW might be working properly, but the contrast is 0, and the user doesn't see anything. Please check the connections.

Depending of the display, it might require a back light to illuminate it and have visible characters. Let us know the exact reference of the display you're using.

Regards,

Alex R
0 Kudos
Reply

741 Views
priyanto
Contributor II
Hi All,
 
Thank you for all valuable inputs. Now I can write to the LCD Driver using 6800-mode protocol and it responds to any commands like Display ON/OFF, etc. The LCD is from Sitronix and requires 20KHz clock which I supply from freescale.
However, I still cannot read from the LCD Driver. Maybe I need to adjust the read timing from freescale. I also want to make the port as input port as default. Again, thanks for the support!
 
Regards,
-Priyanto.
 
 
 
0 Kudos
Reply

741 Views
peg
Senior Contributor IV

Hi Priyanto,

Actually it seems to be more common to just do delays rather than poll for ready with LCD's. This saves a few GPIO and means port is out only!

You can get the gist of how to do it from M68HC05AG/AD. I have run code based on this in HC05C8 then HC08GP and now S08GT.

Regards David

 

0 Kudos
Reply