Driver and Interface For Kyocera 320 and
Driver and Interface For Kyocera 320 and
Abstract: This paper is presenting the authors’ realization of an original, tested and applied driver and
interface - called D/I - made for QVGA LCD with Touch Screen, type Kyocera KCG057QV1. We proposed, to
achieve with a reduced number of components, a set of important functions: interface signal generation, display
data generation, touch screen interface, power supply command sequences generation, USB and RS232/485
interface, back light signal generation, screen memory, character generator. All of these functions are controlled
with a single LSI integrated circuit: the multiprocessor microcontroller Propeller-P8X32A, made by Parallax
Inc. This allows the development of a complex driver and interface for which, since not so long ago, there were
used industrial microcomputer modules or specialized FPGA circuits.
Even in these conditions, the generation of fast synchronization signals was possible only through rapid timing,
by calculating the effective duration of the performed machine code instructions, used in Propeller Driver
Objects written in assembly language. This paper is focused on presenting this issue.
I2C
4 x 64KB Touchscreen 4 bit
Parallax LOAD
SEG DRIVER IC
4 bit I/O P8X32A
VEE VEE
VEE
+12V VBL
INVERTER CFL BACKLIGHT
D4 G319 R2 B4 G319 R2
60nS 40nS 100nS
D3 B319 G2 R5 B319 G2
CP
D2 R320 B2 G5 R320 B2
>25nS
D1 G320 R3 B5 G320 R3
D 0-7
D0 B320 G3 R6 B320 G3
60nS
FRM
CP last 1st
40nS 500nS
400nS
LOAD LOAD
Fig. 2 LCD input timing chart Fig. 3 LCD interface timing chart
The DISP signal must be held high during normal alphanumerical characters), then solving the control
operation. It should be held low to suppress display problem with a single integrated circuit seems
artifacts during power-up and power-down. impossible. But we found an interesting solution to
If the LCD driving voltage is left applied to a LCD resolve this requirement!
cell for any length of time, the liquid crystal
molecules become permanently polarized so that they 3. THE PROPELLER CHIP
can no longer assume their light transmitting
orientation. The solution is to reverse the polarity of The propeller chip is designed to provide
the LCD drive voltage hundreds of times per second. flexibility and high-speed processing for embedded
So, the controller must provide an AC signal to systems, through its eight processors, called Cogs, that
control the internal drive voltage polarization. After can perform simultaneous tasks independently or
the technical specifications, the used LCD accepts the cooperatively, sharing resources through a central
LOAD signal as input, to produce the polarization Hub, all while maintaining a relatively simple
signal. The only problem is, that for this reason, the architecture that is easy to learn and use [5].
cycle of LOAD signal should be stable and Common resources (I/O pins and the System
continuously applied without interruption. An LCD Counter) can be accessed at any time by any number
can easily be destroyed if the liquid crystal driver of Cogs. As shown in Figure. 4, mutually-exclusive
voltage is allowed to stay too long with the same resources (RAM, ROM, Configuration, Control), can
polarity! also be accessed by any number of Cogs, but only by
In consideration of display quality, it is one cog at a time, and the access to them is controlled
recommended that frame frequency to be set in the by the Hub.
range of 70 – 120Hz. Generally, as frame and clock
frequencies become higher, current consumption will
get bigger and display quality will be degraded.
On the other hand, if the frame frequency becomes
lower, the stability of the picture is broken, and the
vibration effect will occur.
This means that severe conditions are required for
design, if we want to generate through software
signals for the LCD driver. If we start from an
acceptable value for the frame frequency, of 80Hz,
this means that FRM signal period must be 1/80 =
12,5mS. As a result of this the LOAD signal period
must be 12,5mS / 240 = 52,1uS, and CP signal period
must be 52,1uS / (320x3)/8 = 434nS, what
corresponds to a data loading frequency of 1/434nS =
2,3MHz. Fig. 4 Hub and Cog interaction
These conditions (generating pulses of 150- 200nS,
with a frequency of 2.3 MHz and transferring with the Each Cog has its own RAM, called CogRAM
same speed the picture information from memory to (2kB configured as 512x32bits), and can be started
the LCD screen, respectively to generate other and stopped at run time and can be programmed to
interface signals synchronized with the CP signal perform tasks simultaneously, either independent or
fronts) are difficult to meet even using specialized with coordination from other Cogs through HubRAM
discrete controller IC or FPGA. ( 32kB ).
If we take into consideration that besides of the The Hub controls access to mutually-exclusive
generation of interface signals and transferring the resources by giving each Cog a turn in a "round robin"
image data to the LCD controller, should be solved fashion. The Hub and its bus run at half the System
many other important tasks (touchscreen signal Clock rate, giving a cog access to resources once
processing, serial communication with PC or other every 16 clock cycles. Hub instructions (assembly
embedded systems, control the own peripherals, instructions that access mutually-exclusive resources)
control I / O the signals, generating of graphical or require 7 cycles to execute but they first need to be
synchronized to the start of the Hub Access Window. In Figure 5. is presented the structure flowchart of the
It takes up to 15 cycles (16 minus 1, if we just missed LCD driver routine and in continue in Figure 6. is
it) to synchronize to the window, plus 7 cycles to presented the structure of assembly routine that
execute the Hub instruction, so Hub instructions take generates the LCD driver signals also that generates
from 7 to 22 cycles to complete. In the worst-case the loading procedure of image data (bitmaps) in the
scenario, the Cog waits until the next Hub Access LCD screen memory.
Window 15 cycles, then the Hub instruction executes
(7 cycles).
Again, there are 9 additional cycles after the Hub RUNLCD
instruction for other instructions to execute before the
next window arrives. Since most Cog assembly
DBUF [DATPTR]
instructions take 4 clock cycles - except the
conditional branching instructions that take 8 cycles if
the condition isn't occurring (no jump) and 4 cycles if CP = 1
the condition occurring (jump), respectively except
the wait instructions - two such instructions can be PORTD DBUF
executed in between otherwise contiguous Hub
instructions. So, to minimize clock waste, it can insert DATPTR = DATPTR+1
two 4-clock instructions between any two otherwise-
contiguous Hub instructions, without any increase in CP = 0
execution time.
The System Clock is the central clock source for DBUF [DATPTR]
nearly every component of the Propeller chip. The
System Clock's signal comes from one of three CNTH = CNTH - 1
possible sources:
- the internal RC oscillator (20kHz or 12MHz)
N
- the XI input pin (crystal oscillator) CNTH = 0
- the clock PLL fed by the XI input (internally ?
In the observation area of the program listing, was FFRM = 1/ TFRM = 85,7 Hz
highlighted the instruction cycle time in number of
system clock cycles (1 cycle =12.5nS). Supplementary Frame rate of approx. 86 Hz falls into the optimum
NOP instructions complete the program in order to zone of the technical characteristics features
obtain the necessary timing for compliance with the recommended by Kyocera.
switching characteristics of the LCD driver. If we Also, we can see that if a NOP instruction is inserted
analyze the duration of the instructions in the inner between ADD DATPTR,#1 and RESET CP
loop of the routine, we get the feature in Figure 7., instructions, the TCP duty cycle becomes ½, without
which is the time evolution of the instructions changing the frame frequency.
t
[50nS]
LOAD 240 1
150 48600 nS
FRM
200 150 250 150 47050 nS 150 850 nS 150 250 150
CP 1 2 120 1 2
100 100 100 100 100
D 0-7
6. CONCLUSIONS