Giter Site home page Giter Site logo

easyt6963's Introduction

easyT6963

Library for T6963 displays with a GPIO (only 4 wires)
image

Now Beta and fully working, lot of speedup, mixed (text&Graphic) environment working. Check the examples...
The new beta should be compatible with Energia IDE so many processors can be used (Stellaris, etc.)
Warning: Energia support just as it's basic stage and not tested. It compiles but doesn't mean that will works! So please wait I test it (and prolly fix) before use it with Energia MCU's!

ToDo:

  • Graphic Font rendering can be faster. Next release will not render blank pixels but a routine will fast erase the string placeholder and render routine will fill just needed pixels, this will fast a lot rendering.
  • Some graphic low level routine can be a bit faster.
  • Can use SPI Transactions in the very next beta!

Introduction:
T6963 it's a graphic controller from Toshiba mounted usually on few large graphic displays. Unfortunatly it needs a lot of wires, from 14 to 16, and it's not well supported for MCU like Arduino, Teensy, DUE, etc.
I google it and find some library but mainly only 2 was (almost) works:
U8glib https://code.google.com/p/u8glib/
T6963_Lib http://code.google.com/p/arduino-t6963c/
The first one it's really basic and have no DUE or Teensy3 support, second one was pretty interesting but it's quite old and uses hardware mapped pins, plus have some bug.
Since I have some of those displays (mainly 240x128) I decided to wrote a library with these goals:

  • Uses just 4 wires.
  • Should works w all my MCU's without changes.
  • Must able to use the features of this chip.

Since I need to uses only 4 wires, I'm enforced to use a GPIO chip. I choosed my preferred one, MCP23s17 from Microchip and since I wroted already a library for it (here in my GITHUB,https://github.com/sumotoy/gpio_expander) a part of the job it's done, yo!
T6963 it's quite strange chip, not particular fast and Toshiba's datasheet it's a confused messy of informations in bad english, pure Japanese attempt to give as less infos as possible, so was not easy but thanks a guy called Radosław Kwiecień that spent a lot of time writing his T6963_Lib I was able to grab part of his cede for this one so thanks a lot Radosław, nice you shared!
One good thing of this chip is the ability to uses graphic and text separately in different memory pages an some un-usual command give the ability to switch by adding reverse or blink, it has some other features that give some speed in visualization and only Radosław was able to findout (U8glib it's really raw) but unfortunatly he never finish the library and left some unworking parts of code, so I need to write many part from scratch and replace completely the text routines.
Another problem is the negative voltage needed from almost all those displays (take a look in the display datasheet first!) that need to be from -9v to -15v, this is not easy when you only have 5V for your MCU!
I fixed the negative voltage problem with a microchip IC MC34063 that uses a couple of Jaf but you can use any step-up negative supply since the current needed it's really tiny!
My displays was using High Voltage for backlight so I need to build up another stepUp supply for that! Take a look in LCD datasheet and check
The Pro and Cons of this chip are so far:

PRO:

  • Ability to drive large displays thanks byte addressing and internal shadow ram.
  • Ability to works with mixed Graphics and Text, it's a mix of Char LCD and Graphics one.
  • Hardware drived paged display with some effects.
  • Ability to perform animations thanks to fast hardware drived paging (kinda)
  • Very fast when byte transfer is used (just this case...)

CONS:

  • Not particular fast. Single pixel addressing it's not particular fast.
  • It need to read chip state before each command/data transmit, accordly datasheet....
  • Commands are clumsy and documentation crappy.
  • Initialization it's slow, the reset pin not works as expected.
  • Clear graphic screen slow, in contrast clear text screen it's fast.

Here's the pin connection with GPIO:

LCD PinMCP23S17 PIN
D0I/O:0
D1I/O:1
D2I/O:2
D3I/O:3
D4I/O:4
D5I/O:5
D6I/O:6
D7I/O:7
CEI/O:8
CDI/O:9
WRI/O:10
RDI/O:11
FSI/O:12 (see note 1)
RVI/O:13 (see note 2)
RSTI/O:14
BacklightI/O:15 (see note 3)
  • Note 1: FS pin is not present in all LCD's. If not, ignore it.
  • Note 2: RV pin is not present in all LCD's. If not, ignore it.
  • Note 3: Backlight pin should be used carefully since large displays use a lot of current and MCP23s17 cannot handle more that a couple of leds. I will include a simple schematic for an universal background driver that use a reed relay, this allow you to use almost every LCD background (even mine that uses High Voltage), for the experiment ignore this pin and connect your Background as your datasheet suggest without use the GPIO pin, you can use it later.

Note About Reset pin:

For some reason the reset pin it's not working as expected! Every display I used in the past (that have a reset pin) poerform an hardware reset of the controller but this one it's really curious... It seems to slowly clear internal ram after a reset, as result the timings I have to respect after a reset are not so clear so It happens that it starts up with screnn mi-unlined and so on (maybe once every 10-15 times). I discovered that it's better tie the pin at 5V or trough a 10K resistor to Vdd but can be an issue of my LCD, the library can control the reset directly so if you want to experiment there's an hardware reset routine commented out in library, just comment out and find your way but I suggest to leave always on, if works...

The other pins of MCP23s17:

The remaining MCP23s17 pins are of course GND, VDD, the MOSI,MISO,SCK and CS pins and 3 address pin (A0,A1,A2) and a RESET pin (should be connected to VDD). Only 2 pins labeled INT-a and INT-b should be leaved unconnected since they are not needed. Just remember to put some decoupling capacitor for MCP23s17 and LCD!
The address pins are really important since you can use the HAEN feature of this chip that let you share 8 of these GPIOs by sharing the same SPI lines, included CS! So, if you like to add some other GPIO to control some relay and maybe some switch and led you can use some other MCP23s17 with different A0,A1,A2 address on same wires, in this way you will lose only 1 pin of your micro since you can still share main SPI with other stuff!
For a quick test, tie all address to GND, that means address 0x20

A note about memory impact on your MCU:

Take care using large displays on small memory MCU like UNO, I tried to use the internal ram as much I could but if you plan to use external fonts or bitmaps you can reach the limits of those small cpu's!

Expanding Library:

Library it's modular, this mean that low hardware routines have been splitted to simply use any GPIO you like or even direct connections, just add a separate file with your own method or propose here that I will include it.

Processor compatibility:

Since it uses a GPIO chip in SPI it's potentially compatible with most MCU's! To work with DUE and TEENSY3.x I used a 74HCT541, at 96Mhz and SPI_CLOCK_DIV2 the performance it's amazing (http://youtu.be/Am8p5E8Cb_4 bad quality video but ok to see the speedup).
I've tested with UNO,Mega2560,Teensy3,Teensy3.1 and worked perfectly.
Some of the examples give an error on Teensy3, just disable the bitmaps array and bitmap test, it's not an error of the library but tests originating from old code from Radosław and have no time to fixup, I'm using his examples as reference to see the improvements.

Final Note:

This is an experiment, it works (i made a video that proof it http://youtu.be/LYF7QgHgnZg) but it's not finished, I did quite optimizations to get as fast I can but it can be inproved for sure.

I got my LCD for around 14 euro, expedition included, I build up a small board (you can see in photo) that contains GPIO chip, High Voltage supply for backlight, a stepUp negative supply for contrast, a level converter for use it with 3V micro and a relay for turn on/off backlight plus some supply filter to clean up the noises introduced by the 2 supplies. image

easyt6963's People

Contributors

sumotoy avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.