Difference between revisions of "Model 100 LCD Programming"
(New page: Category:Model T Developer Reference The LCD has 10 driver chips, which store graphics bits directly. The driver chip is the HD44102. I would recommend reading the datasheet for HD4...)
Latest revision as of 19:39, 23 October 2011
The LCD has 10 driver chips, which store graphics bits directly. The driver chip is the HD44102. I would recommend reading the datasheet for HD44102. Each driver chip controls a specific reqion of the LCD, as follows-
--------------------- | 0 | 1 | 2 | 3 | 4 | --------------------- | 5 | 6 | 7 | 8 | 9 | ---------------------
Drivers 0-3 and 5-8 all drive 50 x 32 of dots each, while 4 and 9 only drive 40 x 32 dots.
(the unused dots in 4 and 9 represent some 'free ram' for use by programmers).
The dot content is updated by writing data to each of these chips. To select a driver for access, you must write a 1 to a specific bit on port B9 or BA.
LSB MSB | B9 | BA | 0 1 2 3 4 5 6 7 8 9 X X X X X X
You must preserve bits 2-7 of BA at all times. You can select as many drives as you want at any one time.
Note - since the timer uses these ports, you must do your graphics updates with interrupts disabled, or your chip selects get modified. Once selected, you should update that driver within the same disabled interrupts window.
Rather than describe all the different things you can do with these driver chips, the simplest thing to do is describe the standard way to program them. They are pretty flexible parts, and the M100 does not really leverage the capabilities well. Hardware scroll is an example.
Each driver divides it's bit field into 4 banks, each bank representing one line of text on the screen. They run top 00 to bottom 11.
Port FE is the control port for the driver chip, and FF is the data port.
First, write the control byte to the driver, which specifies bank in bits 6 and 7, and then the column number in bits 0-5. Column number ranges from 0 to 49.
Control Port LSB MSB | FE | 0 1 2 3 4 5 6 7 | column | bank |
Then, write the data for the selected column to port FF. I believe that the LSB represents the dot at the bottom of the column, while MSB is the dot at the top.
Those are the basics.