Tuesday, November 20, 2012

Interfacing a Toshiba T6963C Equipped GLCD with a PIC Microcontroller

So you happen to have a GLCD with the Toshiba T6963C display controller and you want to interface it with a PIC and write a driver for it. You've scoured the internet, but the only tutorial you've found that shows how to do it is useless. Well, here I will demonstrate just exactly how to go about doing it.

For this tutorial, our example setup is the Microchip 44-pin Demo board, which features the PIC 16F887, driving a Solomon LM6271FWL 240 x 64 GLCD display. This display has 8K VRAM available as well as both a character generator ROM with built in character map as well as an external CG RAM for user defined characters. This display as you've probably figured out also uses the Toshiba T6963C controller chip.

The Hardware Interface

The physical hardware interface is rather simple. On our GLCD, we have an 8 bit bi-directional data port (lines D0-D7) which you can drive with one of the I/O ports on the PIC. Or if you want a serial interface, you can drive it with a 74HC595 serial in/parallel out latch, but the catch to this is that you cannot read from the display if that's all you use. You could just as well use a 74HC165 parallel in/serial out chip in conjunction with the 74HC595 latch if you need to read from the display. In my example, I am using PORTD on the PIC to direct drive the GLCD's data port.

On the control side of the GLCD, you will have the following lines -

C/D - Command/Data mode select (Command High/Data Low)
CE - Chip Enable (active when low)
READ Mode Select (active when low)
WRITE Mode Select (active when Low)
RESET - Resets the GLCD's controller (reset active when low)
Font Select - Allows you to select either a 6x8 or 8x8 font size (6x8 High/8x8 Low)

On my example display, I'm using the lower 3 bits of PORTA and PORTC to drive these lines as follows -

RA0 - CD
RA1 - RESET
RA2 - Font Select
RC0 - WRITE
RC1 - READ
RC2 - CE

Before we get into how to initialize the display we first need to talk about the power up sequence. On your GLCD, you will find that you have connections for two power supplies. The first supply is the 5V logic supply. This supply powers the GLCD's controller, VRAM chips and all of the logic stuff that makes the GLCD work. The second supply is an adjustable 0-12V negative supply that powers the LCD screen itself. The reason it is adjustable is to provide a means of adjusting the display contrast. This supply should not be on until the logic supply has come up to voltage and the display controller has been run through the initialization sequence. Once the display initialization sequence is complete, you can then apply power to the GLCD from the second supply. This prevents latch up of the CMOS LSI (the T6963C and the LCD driver LSI).

Now let's talk about PIC speed. The setup and hold time for all of the control signals as well as data input/output on the T6963C is between 10 and 150nS. So as long as your PIC instruction clock does not run faster than 200nS per instruction (20MHz Fosc, which results in a 5MHz instruction clock), we don't have to worry about needing "nop" instructions or running delay loops in between control line switching/data throughput. On my example PIC, I'm running a 16MHz crystal, which results in an instruction clock frequency of 4MHz, and instructions are executed at a rate of 250nS per instruction (1/4MHz = 250nS). You can run slower than this if you want. It's not a requirement to run the PIC that fast.

Now that the power up sequence and PIC speed is understood, we can get into what needs to happen for the initialization sequence of the T6963C.

Read more at http://www.hqew.net/circuit-diagram/Interfacing-a-Toshiba-T6963C-Equipped-GLCD-with-a-PIC-Microcontroller_11332.html

No comments:

Post a Comment