tags:

views:

116

answers:

3

LCDs have 4 data lines. But the data to be displayed in the LCD is given in the ASCII form which is 7 bits. How is that possible?

+2  A: 

I answered a question from another user a while ago (here) that referenced the following doc: www.cloverlcd.com/pdf/S6A0069.pdf. You can get an idea as to how it may work from that link (at least for that example).

Many of these embedded devices typically have a two-cycle approach to delivering data to the chips. I've seen one example where you output two f-nybbles in a row to synchronize (since ff is invalid 7-bit) then you start the process of outputting the nybbles. As long as there's no way to generate two consecutive f-nybbles except for synchronization, it's easy to achieve.

There's also typically other lines attached to the device from the bus that allow the device to detect a new write of data. This means it will detect two identical writes as different values. In other words, it uses other signals to control the receipt of the data. Most of the simpler devices also have strict timing requirements (e.g., you must delay at least N microseconds after each write).

In addition, what you tend to send are commands, not just the ASCII codes. The nybble output for display Hello at offset 3 on an LCD may be:

f f           ; sync
0             ; clear display (cmd = 0).
1 0 3         ; set cursor (cmd = 1) to offset 3.
2 H e l l o 0 ; output text (cmd = 2) teminated by NULL.

Since only data lines d3 through d0 are attached to the device, ther upper nybble is irrelevant.

paxdiablo
A: 

It might be some sort of serial bus.

Steve Kuo
It **might** be some sort of flying monkey :-) I didn't downvote you by the way....
paxdiablo
Yeah I'm not too worried about my score :-)
Steve Kuo
+1  A: 

Typically the device powers up in 8-bit mode, but the commands required to put it in 4-bit mode ignore the 4 LSBs.

In 4-bit mode two xfers are required per character.

See this description

Doug Currie