ST7565 LCD notes

From HeepyWiki
Jump to: navigation, search

this is pretty good, if you can spare the memory. the display runs on 3.3vdc and draws very little power. This display plus a 328p in powerdown draw 177 uA. Unfortunately unless you want to get clever you need a large (1k) buffer to hold the display bitmap. it's organized as 8 rows, each of which is 128 columns, like this:

||||||||||||||||||||||||||| ...
||||||||||||||||||||||||||| ... 

so for instance a 0xFF in location 0 shows a vertical bar in the top left corner of the screen.

This works out ok for a 5x7 text font but i'll still need to implement scrolling, etc. The display seems to have some builtin assistance for this but i need to figure it out.

Backlight is white LED @25mA. Display contrast is decent but not spectacular.

  • It should be possible to do plain 21x8 text without using

a bitmap buffer. This would only be 168 bytes to hold the whole screen of text.

you can write a line of text without any buffer at all, because you send data to the display as 128 vertical 1 pixel wide columns all the way across the screen, so you just send the character bitmaps as you go. you'd only need to buffer data to scroll the screen upward to make room for a new line at the bottom. To do that you don't need to remember the top line, since it's getting thrown out anyway, so that's only 147 chars to buffer.

maybe write a function for writing a line of text to a line of display bitmap, define an array to hold the text, and some functions like stlcd_putchar(c) for updating the array.

it would be nice to be able to write one character at a time to the display since you don't want to have to write full lines (or the whole screen) at a time, though the update time may be fast enough that it doesn't matter. maybe write chars to the display immediately when putchar is called, and simultaneously update the backing array so we can update if we have to scroll.

also make sure everything that touches the display asserts and deasserts CS so other things can live on the SPI bus. .

  • should try driving the backlight directly off a GPIO. they can source 20mA which is about what it draws, so it might work. Also, if you put it on one of the OCR outputs you can PWM it at high freq to make it as dim or bright as you want.
  • an additional bigger font would be really nice.