Mathieu: Another LCD backpack
From DP
Contents |
Protocol
i initialize LCD
Reset and initialize the LCD.
v version string
Hardware/software version string.
- HxxxxFxxxxBxxxx (null terminated)
c contrast
| 0 | 1 | 2 | 3 |
|---|---|---|---|
| command | VOLCTR byte 1 | VOLCTR byte 2 | SETCON byte 1 |
| c (0x63) | contrast (EPSON) | resistor ratio (EPSON?) | contrast (PHILLIPS) |
| 0x63 | 0x24 | 0x03 | 0x30 |
Requires 3 bytes. Byte one is the contrast, only setting that seems to have effect on current LCD
- VOLCTR - contrast/brightness for EPSON
- Byte 1 - VOLCTR 1 contrast setting (0x24 default)
- Byte 2 - VOLCTR 2 internal resistor ratio (no effect) (0x03 default)
- SETCON - contrast/brightness for PHILLIPS
- Byte 3 - SETCON value (no effect) (0x30 default)
b set bounding box
Defines the area of the screen to draw.
| 0 | 1 | 2 | 3 | 4 |
|---|---|---|---|---|
| command | x start | y start | x end | y end |
| b (0x62) | 0x00 | 0x00 | 0x64 | 0x64 |
p/P send page of image data
| 0 | 1 | 2 | 3 | ... | n |
|---|---|---|---|---|---|
| command | pixel byte 1 | px byte 2 | px byte 3 | ... | px byte n |
| p (0x) | rrrrgggg | bbbbrrrr | ggggbbbb | ... | ggggbbbb |
- P Fill the entire display with the pixel data sent
- p Fill the area defined by the last bounding box
Send command, then enough pixels to fill the screen or bounding box. Replies '1' at the end.
| 0 | 1 | 2 |
|---|---|---|
| pixel byte 1 | pixel byte 2 | pixel byte 3 |
| rrrrgggg | bbbbRRRR | GGGGBBBB |
- 12bit color
- two pixels packed per 3 bytes
- must use three byte/two pixel segments! end on an even boundary
t/T test pattern
- T Cycles colors on the entire display
- t In the area defined by the last bounding box
Any byte exits at the end of the next refresh.
f/F fill with color
- F Fill the entire display with the pixel data sent
- f Fill the area defined by the last bounding box
| 0 | 1 | 2 |
|---|---|---|
| command | color byte 1 | color byte 2 |
| f (0x62) | 0000rrrr | ggggbbbb |
a LCD backlight voltage reading
Returns the raw 10bit ADC reading of the pin connected to the the MC34063A feedback resistors (18K/3.9K).
- Raw reading: 0x182 (386)
- Actual voltage: (386/1024)*3.3volts=1.24volts
- Scale for resistor divider: 1.24volts*(18K/3.9K)= 5.72volts (ideal is 7volts)
Example solution.
d dim the LCD backlight
Send a 1 byte duty cycle setting, 0-255 (0-100%).
Software Utility
Description/Purpose
This utility simply sends a bmp image file to the Nokia LCD Backpack using the commands described above.
Version Information
Early development stage,
BMP image sender for Nokia LCD Backpack http://www.dangerousprototypes.com
Usage
Screen Shots
Notes
This utility works on windows only and untested on other OS. This code was compiled using Code::Base 10.05 and used the buili-in windows headers for bitmats:BITMAPFILEHEADER and BITMAPINFO. This apps checks for the validity of the bmp file, gets the image data offset from the header and send 'p' to the NOKOA LCD backpack, followed by the image data starting from the offset.
Download the Source
Download the source from the svn [here]
