Friday, August 21, 2015

A 128x64 GLCD for Teensy 3.x

The aim of this project is to use a high-speed port to transfer eight bits at a time on a graphical display 128x64. To do this I have studied a suitable configuration of Teensy I/O and  also have modified the KS0108 library, as described in my post "Teensy rev.3.1 and KS0108 Graphic LCD library".
This system can be used in several applications, such as portable low frequency oscilloscopes, FFT analyzers, data loggers etc.
The complete diagram of my project is visible in the figure below.

Warning: As can be seen from the circuit diagram, I connected directly the LCD display to the Teensy pins. This is because the Teensy 3.1 and 3.2 cards are 5 volts tolerant. Do not use a Teensy 3.0 or LC or other boards with processors that don’t tolerate 5 volts TTL signals. In this case a bi-directional voltage level adapter must be used for the display 8 bits data bus.

I also add an SD board module, a J3 connector for the serial interface, a J4 connector with the rest of the bits of I/O available and a battery for Teensy RTC.
For the power supply I used a power bank, as I wrote in the post "A very simple way to power Arduino".
As illustrated in the scheme, I used a special display with RGB backlight (Winstar WG12864A Rev.J), which has 22 pins instead of 20. You can use a more common  display based on NT7108 controller or equivalent.
In the tables below you can see the pin layout of the display used in this project and the connections with the Teensy board.
The figure below shows the breadboard with the components used, the LCD display, Teensy and the SD module are not yet mounted.
The lithium battery is used for the Real Time Clock Teensy, on which I welded the small quartz with a frequency of 32768 Hz.
In Google Drive (  I created the folder ‘Teensy’ where I put the file with the library modified and, in the examples, I added my small test program TeensyGLCD.ino. I recognize that my changes are not very elegant as programming style but work well and reach the goal. Suggestions and modifications by users are well accepted.
With few changes I also ran on my Teensy GLCD, the program arduino-oscillo.pde of Noriaki Mitsunaga (3), an interesting oscilloscope which uses the same library and display.
1) “Tutorial on digital I/O, ATMega PIN/PORT/DDR D/B registers vs. ARM GPIO_PDIR / _PDOR” - immortalSpirit - Jan 2013.
2) “K20 Sub-Family Reference Manual”- Freescale - Document Number: K20P64M72SF1RM, Rev. 1.1, Dec 2012.
3) “Arduino Oscilloscope”, Noriaki Mitsunaga,

No comments:

Post a Comment