Main Site Documentation

Project - Parallel to SPI GLCD conversion


#1

Parallel to SPI GLCD conversion

An old project taken from the old wiki.

A parallel display can’t be controlled directly at a reasonable speed because the software layer simply can’t flip the IO pins fast enough. Even the low level hardware methods with direct register access to fast IO port control can’t help. The display needs fast control of 8 data lines, 2 chip select, data/instruction then the final clock/enable.

The SPI bus is a very fast shift register and can transfer a large buffer at low level hardware speeds. The only weakness is that it still has to flip the chip select pin for the start and end of transfer. The original type 1 schematic worked but wasn’t fast because it had to latch every 2 byte transfer with e CS pin. There had to be a way to eliminate the CS pin and still have the 74595 chips latch data every 2 bytes.

The solution is to have the shift registers automatically latch every 16 bits. By adding a counter(s) it’s possible to auto clock and latch everything so the entire 2k worth of SPI instructions can be sent at once. The counter(s) will count to 16 then reset and trigger the shift register latch and LCD clock at the same time.

For the type 2 schematic, the OR gates are used with the 4017 so the CS pin can sync and reset if needed. It can’t be connected directly because it would be connecting the 4017 outputs to the CS which is also an output. A high on the CS pin will override and reset both counters along with disabling the output of the shift registers.

Parts used
•(2) 74HC595 shift registers.
•(1) 4049 invert buffer.
•(1) 2.2K Ω resistor for backlight gate control.
•(1) 100 Ω resistor for backlight current limit.(50 Ω can also be used for brighter backlight but also twice the power needed. The backlight LEDs seem to be connected in series so there isn’t a need for much current control)
•(1) 10K Ω potentiometer for LCD contrast.
•(1) PNP transistor of any kind, 200mA minimum.(P-channel MOSFET would also work)
•(1) 4071 OR gate.(schematic type 2 only)
•(2) 4017 decade counters.(schematic type 2 only)
•(1) 4516 HEX counter.(schematic type 3 only)


#2

@ John - I experienced a similar issue using a 8-bit parallel TFT from Adafruit. I had the exact same idea you did, but never got it fully working. If you have the time, please visit my thread and see what you make of the diagrams I posted.

The problem screen has a “write strobe” pin, so I used non-latching registers.
When the registers are chip-selected, data is fed from the FEZ.
When the screen is chip-selected, the pre-loaded data scrolls within the registers.
Using a counter, every 8th clock was supposed to strobe the write pin.
I tried the counter using _ASYNCRESET, counting from 0 to 7. (7 tied to reset and the write strobe pin)
I also tried the counter using _LOAD, counting from 9 to “17”. Since bit 4 is always high until overflow, I tied it to (synchronous) _LOAD; the next clock loaded 9. RCARRY was tied to the write strobe pin on the screen.

Both/all of the methods I tried [em]nearly[/em] worked, but not quite. When it worked, it was instant but, occasionally, something would goof and it would start clearing half the screen in the wrong color, or go blank (assuming it wrote to a register improperly).

I couldn’t get a good picture with my 1-channel scope, so I never did sort it out… (Got the T43 later)

TIA if you can help,
Jon


#3

@ John - http://www.ghielectronics.com/community/forum/topic?id=11378


#4

Regretfully this is not actually a project I wrote, it was something taken from the old TinyCLR wiki that we felt should be saved so we posted it here on Codeshare.