Application Note. LCD Driver Based on the HT1621 Controller

Similar documents
Use the Status Register when the firmware needs to query the state of internal digital signals.

This optional pin is present if the Mode parameter is set to SyncMode or PulseMode. Otherwise, the clock input does not show.

Use the Status Register when the firmware needs to query the state of internal digital signals.

Filter_ADC_VDAC_poll Example Project Features. General Description. Development Kit Configuration

HT1621. RAM Mapping 32 4 LCD Controller for I/O µc. Features. General Description. Selection Table

CY7C603xx CYWUSB

UNISONIC TECHNOLOGIES CO., LTD 6621 Preliminary LINEAR INTEGRATED CIRCUIT

This optional pin is present if the Mode parameter is set to SyncMode or PulseMode. Otherwise, the clock input does not show.

Cypress HX2VL Configuration Utility Blaster User Guide

Reviving Bit-slice Technology in a Programmable Fashion

CE PSoC 4: Time-Stamped ADC Data Transfer Using DMA

PSoC 1 I 2 C Bootloader

Programmable Threshold Comparator Data Sheet

EZ I 2 C Slave. Features. General Description. When to use a EZ I 2 C Slave 1.50

CYClockMaker Programming Kit Guide CY3675. Doc. # Rev. **

CYClockMaker Programming Kit Guide CY3675. Doc. # Rev. *C

FTG Programming Kit CY3670. Spec. # Rev. *C

The color of the Clock component waveform symbol will change based on the clock's domain (as shown in the DWR Clock Editor), as follows:

Writing to Internal Flash in PSoC 3 and PSoC 5

CY3660-enCoRe V and encore V LV DVK Kit Guide

Voltage Reference (Vref) Features. General Description. Input/Output Connections. When to Use a Vref Voltage references and supplies

Comparator (Comp) Features. General Description. When to use a Comparator 1.60

This Application Note demonstrates an SPI-LIN slave bridge using a PSoC device. Demonstration projects are included.

PSoC 4 Low Power Comparator (LPComp) Features. General Description. When to Use a LPComp 2.0. Low input offset. User controlled offset calibration

4 to 1 Analog Multiplexer Data Sheet

The following table lists user modules used in this code example and the hardware resources occupied by each user module.

Next-Generation Hot-Swap Controllers

For one or more fully configured, functional example projects that use this user module go to

16-Bit Hardware Density Modulated PWM Data Sheet

8 to 1 Analog Multiplexer Datasheet AMux8 V 1.1. Features and Overview

CE56273 Associated Part Families: CY8C38xx/CY8C55xx Software: PSoC Creator Related Hardware: CY8CKIT-001 Author: Anu M D

Preliminary. Gas Sensor Analog Front End Datasheet GasSensorAFE V Features and Overview. This datasheet contains Preliminary information.

Programmable Gain Amplifier Datasheet PGA V 3.2. Features and Overview

Incremental ADC Data Sheet

HT1628 RAM Mapping LCD Driver

THIS SPEC IS OBSOLETE

HX2VL Development Kit Guide. Doc. # Rev. **

HX2VL Development Kit Guide. Doc. # Rev. *A

Clock Programming Kit

AN EZ-USB FX3 I 2 C Boot Option. Application Note Abstract. Introduction. FX3 Boot Options

Use the IDAC8 when a fixed or programmable current source is required in an application.

PSoC Creator Component Datasheet

AN SIO Tips and Tricks in PSoC 3 / PSoC 5. Application Note Abstract. Introduction

THIS SPEC IS OBSOLETE

PTG Programming Kit CY3672. Features. Functional Description. CY3672-PRG Kit Contents. Set Up

THIS SPEC IS OBSOLETE

24-Bit Pseudo Random Sequence Generator Data Sheet

Supported Devices: CY8C28x13, CY8C28x33, CY8C28x43, CY8C28x45, CY8C28x52, CY8C21x45, CY8C22x45, CY8C24x93. CY8C24x

LPF (Optional) CY8C24x93. Without LPF and ISR to 3* With LPF only** to 3* With ISR only to 3*

2-Mbit (128K x 16) Static RAM

Programmer User Guide

Cypress HX2VL Configuration Utility Blaster User Guide

DMX512 Receiver Datasheet DMX512Rx V 1.0. Features and Overview

Shadow Registers Datasheet ShadowRegs V 1.1. Features and Overview

GPIF II Designer - Quick Start Guide

CE58957 demonstrates how to implement the fade and toggle feature to the backlight LEDs of CapSense buttons.

Libraries Guide. Arithmetic Libraries User Guide. Document #: Rev. *A

PSoC Designer Release Notes

144-Mbit QDR -II SRAM 2-Word Burst Architecture

Pentium Processor Compatible Clock Synthesizer/Driver for ALI Aladdin Chipset

Multifunction Serial Interface (PDL_MFS) Features. General Description. When to Use a PDL_MFS Component. Quick Start 1.0

Interfacing Z8 Encore! XP MCUs with an I 2 C-Based Character LCD

1-Mbit (64K x 16) Static RAM

Bootloader project - project with Bootloader and Communication components

CapSense I 2 C/SPI Timer Flash RAM

EZ-USB FX3 Development Kit Guide

Supported devices: CY8C29x66, CY8C27x43, CY8C28xxx, CY8C24x23, CY8C24x33, CY8C21x23, CY8C21x34, CY8C21x45, CY8C22x45, CY8C24x94

Supports one or two address decoding with independent memory buffers. Memory buffers provide configurable Read/Write and Read Only regions

PSoC Blocks. CY8C20xx6/6A/6AS/6H/6L, CY8C20xx7/7S, CY7C643xx, CY7C604xx, CYONS2xxx, CYONSxNxxxx, CYRF89x35, CY8C20065, CY8C24x93, CY7C69xxx

Base Timer Channel (BT) Features. General Description. When to Use a PDL_BT Component 1.0

PSoC 4 Voltage Comparator (Comp) Features. General Description. When to Use Comparator Low input offset. User controlled offset calibration

CY8CKIT-029 PSoC LCD Segment Drive Expansion Board Kit Guide

4K x 8 Dual-Port Static RAM and 4K x 8 Dual-Port SRAM with Semaphores

The AMuxSeq is capable of having between 2 and 32 analog inputs. The paired inputs are present when the MuxType parameter is set to "Differential.

PSoC Programmer 3.12 Release Notes

PSoC Creator Component Data Sheet

Capable of adjusting detection timings for start bit and data bit

4-Mbit (512K x 8) Static RAM

AN PSoC 3 and PSoC 5 SFF-8485 Serial GPIO (SGPIO) Initiator Interface. Application Note Abstract. Introduction

Using the Sensory NLP-5x LCD Module and LCD Sample

12-Mbit (512 K 24) Static RAM

Sequencing Successive Approximation ADC (ADC_SAR_Seq) Features. General Description. When to Use the ADC_SAR_Seq 2.0. Supports PSoC 5LP devices

Setting Oscillation Stabilization Wait Time of the main clock (CLKMO) and sub clock (CLKSO)

C4331E 4-DIGIT COUNTDOWN/UP TIMER CHINAIC SEMICONDUCTOR CORP., LTD. Edition Author Date Description V /4/6 C4331B

Use the Status Register when the firmware needs to query the state of internal digital signals.

FM3 MB9B100A/300A/400A/500A Series Inverter Solution GUI User Guide

This section describes the various input and output connections for the Voltage Fault Detector.

Use the Character LCD component to display text data to the user of the product or to a developer during design and debug.

ST Sitronix ST7565P. 65 x 132 Dot Matrix LCD Controller/Driver

DESCRIPTION FEATURES. PT6321 Fluorescent Display Tube Controller Driver

EZ-USB NX2LP USB 2.0 NAND Flash Controller

AN1090. NoBL : The Fast SRAM Architecture. Introduction. NoBL SRAM Description. Abstract. NoBL SRAM Operation

AN10210 Using the Philips 87LPC76x microcontroller as a remote control transmitter

THIS SPEC IS OBSOLETE

This section describes the various input and output connections for the SysInt Component.

64K x 32 Static RAM Module

This input determines the next value of the output. The output does not change until the next rising edge of the clock.

8. SED1565 Series. (Rev. 1.2)

Using the HT16C2x I 2 C Interface for LCD Driving and Control

MF RD700. PEGODA Contactless Smart Card Reader READER COMPONENTS. Preliminary Product Specification Revision 2.0 PUBLIC. July2002

Transcription:

Application Note AN LCD Driver Based on the HT Controller Author: Andrew Smetana Associated Project: Yes Associated Part Family: All PSoC Designer Version:. SP Associated Application Notes: AN8 Abstract This Application Note describes implementation of a liquid crystal display (LCD) driver based on the widely available HOLTEK HT LCD Controller. Methods and algorithms of display control are described and an API library is provided. The LCD used in this example was a customer s custom part. The proposed algorithms can be easily adapted to any custom LCD panel connected to the controller. Introduction LCDs are widely used as data display devices in embedded systems. Among the features that have made LCDs popular are low price, low power dissipation, lightweight, durability, reliability, and broad support by dedicated ICs for communication with microcontrollers. A good example of an LCD driver is the Hitachi character LCD driver HD8, the industry standard. This dotmatrix LCD controller is supported by PSoC APIs. It is useful in applications that permit alphanumeric data display. However, specialized displays are often needed. Specialized displays keep end- product prices low, simplify the interface between the microcontroller and LCD driver, and decrease weight and size parameters. Examples of specialized displays include clocks, calculators, telephones, and home and industrial appliances. This implementation is based on one of these dedicated drivers, the HT. This Application Note addresses the proposed implementation in two parts: General Description LCD Driver Implementation General Description The HT driver is a 8-segment (x), multifunctional LCD driver with memory mapping. The software configuration feature of HT makes it suitable for many LCD applications, including LCD modules and display subsystems. Only three or four connections are required for interfacing between the host controller and the HT. A structural schematic of the display system is shown in Figure. This structure requires few external components and uses only three interface connections. The system consists of the PSoC, HT controller, and an LCD panel. The HT, besides its primary function as an LCD controller, has peripherals including the watchdog timer, time base generator and the tone frequency generator. For more information about these features, refer to the HT data sheet. Note that the controller has an on-chip RC oscillator ( khz) for controlling the LCD and peripherals. This General Description focuses on the components and functions of the HT driver that relate directly to the LCD: Display Memory RAM LCD Driver in HT Command Format Interfacing with HT /8/ Rev. ** - -

AN Figure. Structural Schematic of the Display System HT +V OSCO OSCI Display RAM VDD P S o C VSS PRT PRT PRT +V CS RD WR DATA VDD VSS Control and Timing Circuits LCD Driver/ Bias Circuit.... COM... COM SEG. SEG VLCD LCD Panel WK- TH -RG-A BZ BZ Tone Frequency Generator Watchdog Timer and Time Base Generator IRQ K +V Display Memory RAM The static display memory (RAM) is organized in a x- bit matrix, which stores the displayed data. The contents of the RAM are directly mapped to the contents of the LCD driver. Data in the RAM can be accessed by READ, WRITE, and READ-MODIFY-WRITE commands. Note that in the schematic for the proposed LCD system, oneway communication is implemented (from PSoC to HT). The correspondence between RAM and the LCD pattern is shown in Figure. SEG SEG SEG SEG Figure. RAM Mapping COM COM COM COM Address bits (A, A,, A) LCD Driver in HT The HT is a 8 (x)-segment LCD driver. It can be configured as / or / bias, and is designed with two, three or four segments in common with the LCD driver. These configuration features make the HT suitable for multiple LCD applications. The LCD driving clock is derived from the system clock. The signal frequency of the display control is Hz. Some LCD commands are described in Table. In the table, the bold font of indicates the command code ID. The X in the code signifies any bit in a corresponding position. If successive commands are issued, the command code ID (except in the first command) is omitted. The LCD OFF command turns the LCD display off by disabling the LCD bias generator. The BIAS and COM commands relate to the LCD panel. LCD commands make the HT compatible with most types of LCD panels....... SEG D D D D Data bits (D, D, D, D) Addr Data /8/ Rev. ** - -

AN Table. LCD Commands Name Command Code Function LCD OFF X Turn off LCD outputs LCD ON X Turn on LCD outputs BIAS and COM abxcx c=: / bias option c=: / bias option ab=: commons option ab=: commons option ab=: commons option Command Format The HT can be configured by using the software settings. There are two instruction modes: Command mode For configuration of HT resources Data mode For transmission of display data to the LCD. Data mode includes READ, WRITE and READ- MODIFY-WRITE operations. These modes are summarized in Table. Table. HT Instruction Mode Parameters Operation Mode ID Interfacing with HT Only four lines are required to interface with the HT: CS, DATA, RD, and WR. The CS line is used to initialize the serial interface circuit and to terminate the connection between the host controller and the HT. The DATA line is the serial data input/output (IO) line. Data to be read or written, or commands to be written, must be passed through the DATA line. The RD line is the READ clock input, and the WR line is the WRITE clock input. The data, address or command on the DATA line are all clocked into the HT on the rising edge of the WR signal. In this proposed driver implementation, only three lines are used: CS, WR, and DATA. In this way, simplex communication is used to control the LCD. A time diagram of a WRITE operation is shown in Figure. READ Data WRITE Data READ-MODIFY-WRITE Data COMMAND Command The instruction mode ID must be issued before the data or command is sent. WRITE Operation (Command Code: ) Figure. Time Diagram of a WRITE Operation /8/ Rev. ** - -

AN WRITE Mode (Successive Address Writing) LCD Driver Implementation This project uses a custom LCD as an output device. The HOLTEK HT driver forms an image on the LCD. In this way, the LCD and its driver create a data display system. The following subsections guide you through key aspects of the LCD driver implementation: Algorithm of Logical Access to the LCD Segments / Symbols Digits and Segment Highlight Display APIs The code example in the following section describes how logical access to the individual LCD segment is organized; that is, how to switch on or switch off a segment). The code also describes how logical access to whole symbols (for example, digits) is organized. Algorithm of Logical Access to the LCD Segments / Symbols Analyzing the layout of the display segments, it can be observed that their organization has no defined regularity. Also, to access a given segment, it is necessary to know two of its coordinates [segment, common]. Therefore, it is necessary to work out a standard method by which each segment can be accessed. That is, to turn on a certain segment of a display, it is necessary to write in the HT video memory at a given address [segment, common], as shown in Figure. To standardize access to a set of disordered display segments, they must be enumerated in an easily mapped order. For the example shown in Figure, the LCD_segments[] array is declared, which contains information about each segment, but already in a known order. In this case, the array elements are addresses of the display segments, as shown in Figure. Convenient access to any display segment is thus organized according to indexes in the LCD_segments array. This array, like other functions and variables used by the LCD module, is located in the lcd.c file, and definitions of constants are in the corresponding lcd.h file. The indexes of individual segments are defined in the following view (from lcd.h): #define LCD_DIGIT_INDEX // next digit + #define LCD_ERROR_INDEX // ERROR #define LCD_PC_INDEX // PC #define LCD_CALC_INDEX // CALC #define LCD_MUSIC_INDEX // MUSIC #define LCD_VOLUME_INDEX // VOLUME #define LCD_NUM_LOCK_INDEX // NUM LOCK #define LCD_MINUS_INDEX // MINUS #define LCD_CAPS_LOCK_INDE // CAPS LOCK #define LCD_SCROLL_LOCK_INDEX 8 // SCROLL LOCK #define LCD_FUNCTION_INDEX 9 // FUNCTION #define LCD_BATTERY_INDEX 8 // BATTERY #define LCD_PM_INDEX 8 // PM #define LCD_AM_INDEX 8 // AM #define LCD_POINT_INDEX 8 // next point + #define LCD_COMMA_INDEX 9 // next comma + #define LCD_COLON_INDEX // next + /8/ Rev. ** - -

AN As can be seen in Figure, at first, the digital segments are enumerated in the determined order in the array in series. This standard method of storing enables easy access to any digital position on the display by adding a digital position multiplied by to the LCD_DIGIT_INDEX constant. Access to the points and commas can be arranged in a similar way. Digits and Segment Highlight Consider how indicating a digit in the single position is implemented. Digits on the screen are presented as a set of -character segments. It is necessary to define the template of each digit in order to achieve visualization. Screen images of some digits and the corresponding digits templates in memory are shown in Figure. /8/ Rev. ** - -

AN Figure. LCD Segment Enumeration 8 9 9 9 8 9 8 9 8 8 9 8 9 8 8 8 99 9 9 98 9 9 89 9 88 9 8 9 9 8 8 8 8 8 9 8 Figure. LCD Segment Presentation in the LCD_segments[] Array Figure. Digital Segment Enumeration S Segment No. S S S S Common No. C C /8/ Rev. ** - -

AN Figure. Images of Digits and Their Templates USED BITS USED BITS USED BITS A template of each digit is stored in the LCD_digit_segments[] array. In addition to the digits, this array contains the codes of special symbols: SPACE for turning off a digital position, and MINUS for drawing the minus sign ( ). To explain the process of any digit highlight in i position: Digits are enumerated from right to left, from to 9 on the LCD. First, you must obtain the digit template from the LCD_digit_segments[] array, using the following sequence: digit_template = LCD_digit_segment[digit] () Calculate the index of the first segment in i-digit position in the LCD_segments table: index = LCD_DIGIT_INDEX + *i () The elements of the LCD_segments array, in combination with the indexes (index..index+),yield the addresses of the working segments in i-digit position. Also, in the loop, each bit of a digit s template is examined and it is determined whether a segment must be turned on or off in the corresponding LCD_segments[index+j] element (j=..) in the display. This process is shown in Figure 8. The element LCD_segment[index+j] determines the physical address (coordinate) of a segment in video memory. Figure 8. Correspondence Between the Template of a Digit and the Template s Segment Indexes in the LCD_segments[] Array index+ index+ index+ index+ index+ index+ index /8/ Rev. ** - -

AN To provide convenient access to the video memory of the HT display driver, a local copy of the driver s memory was created in the RAM of the PSoC device and declared as BYTE LCD_memory[]. Also, a unidirectional communication interface requires this kind of LCD RAM usage. Each bit in this memory is responsible for the state ( - on, - off) of one segment in the LCD. After changes are made to the local copy of the display s video memory, it is copied to the memory of HT, and the screen image is automatically updated. Access to an individual segment in the LCD_memory array must be executed on the basis of a corresponding segment address [segment, common]. The video memory of HT is organized in a x-bit matrix, so bytes of device RAM is enough to save a local copy of the video memory. Display of the remaining LCD elements is simpler, because they occupy only one segment. For example, consider the output of a PC segment on the LCD: Addr = LCD_segments[LCD_PC_INDEX]; Segment = Addr >> ; // calculating Common = Addr & x; // physical address of segment By means of this physical address [segment, common], the corresponding bit in local video memory is modified. Next, the RAM video memory is copied to controller of the display. Display APIs After access is gained to the segments of the display, images are created on the LCD by means of the following functions: void LCD_show_digit(char pos, char digit) Displays a digit in a given position void LCD_show_minus(BOOL state) Shows/hides the minus (-) segment for a calculator s display, depending on the state parameter void LCD_show_colon(BOOL state) Shows/hides a colon (:), depending on the state parameter void LCD_show_point(char pos,bool state) Shows/hides a point in the given position, depending on the state parameter void LCD_show_segment(char segment_index, BOOL state) Shows/hides a given segment, depending on the state parameter. The segment is defined by the index in the LCD_segments array. Segment indexes definitions are presented in the lcd.h code example earlier in this Application Note. In addition to the above functions, other LCD APIs are implemented. They control the state of the special symbols on the screen (Calc, PC, AM, PM, and so on). The preceding bulleted list of functions works only with the local copy of video memory. The functions do not form images on the actual LCD. To enable images on the actual LCD, subroutines were written that implement the physical interface between PSoC and the HT driver. These subroutines are implemented fully in the firmware, without use of PSoC hardware resources. The subroutines that enable images on the actual LCD are the following: void LCM_Initial(void) Performs initializations actions to start the HT driver. This subroutine executes three functions: turns on the built-in oscillator, sets the / bias and / duty LCD properties, and turns on the built-in bias voltage generator to highlight the LCD panel. void SendLcdCommand(BYTE command) Sends a command to the HT driver void LcdWrite(void); Copies the local video memory to the HT driver The LCD driver and its corresponding library occupy about.k of Flash memory in the PSoC small memory model and.8k in the large memory model. RAM use is the same for both models and requires bytes of static memory. To save memory, a bidirectional driver interface must be implemented. Conclusion This Application Note has described a display system built on a PSoC, HT controller and LCD panel. The interface between the device and the HT driver has been described, as has access to the LCD. Using the proposed material, a customer-selected LCD panel can be applied, and a corresponding API library can be developed with a minimum of effort. Step-by-step implementation of the system has been detailed. An inexpensive, reliable, and durable display system is the result. /8/ Rev. ** - 8 -

AN LCD Photograph About the Author Name: Title: Background: Andrew Smetana Electrical Engineer Andrew Smetana received a Master of Science degree in from National University Lvivska Polytechnika (Ukraine). His interests include various aspects of embedded systems development. Contact: smetana@ukrwest.net Cypress Semiconductor 98 Champion Court San Jose, CA 9-9 Phone: 8-9- Fax: 8-9- http://www.cypress.com Cypress Semiconductor Corporation,. The information contained herein is subject to change without notice. Cypress Semiconductor Corporation assumes no responsibility for the use of any circuitry other than circuitry embodied in a Cypress product. Nor does it convey or imply any license under patent or other rights. Cypress products are not warranted nor intended to be used for medical, life support, life saving, critical control or safety applications, unless pursuant to an express written agreement with Cypress. Furthermore, Cypress does not authorize its products for use as critical components in life-support systems where a malfunction or failure may reasonably be expected to result in significant injury to the user. The inclusion of Cypress products in life-support systems application implies that the manufacturer assumes all risk of such use and in doing so indemnifies Cypress against all charges. /8/ Rev. ** - 9 -