HT48 & HT46 LCM Interface Design

Similar documents
Controlling the HT1621 LCD Controller With the HT48 MCU Series

HT46R46/C46/R47/C47/R48A/C48A/R49 Cost-Effective A/D Type 8-Bit MCU

Read and Write Control of the HT1380

HT95R22 I/O Type Phone 8-bit MCU

HT48RA0-2/HT48CA0-2 Remote Type 8-Bit MCU

HT48 & HT46 MCU UART Software Implementation Method

Read and Write Control of the HT1380/HT1381

HT45R0072 I/O 8-Bit MCU with USB Interface

INTERFACING 16 2 LCD WITH 8051

HT1380 HT driver READ_ driver WRITE_1380

8051 I/O and 8051 Interrupts

Chapter 4. Address. data. Input / Output Programming. Simplified Z80 System Architecture. Memory. program. data. Z80 I/O Programming

Pin Assignment 2 ) # 2 ) % 2 ) $ 2 )! 2 ) 6 2 ) 2 )! " 4 # $ % /, & ' ' & % $ # "! 2 ) " : /, * ) 6 8,, * $ * 2 ) # 2 ) %

HT82B40R/HT82B40A I/O 8-Bit MCU with USB Interface

HT82K70E-L/HT82K70A-L/HT82K76E-L I/O Type 8-Bit MCU

HT46F46E/HT46F47E/HT46F48E/HT46F49E. Cost-Effective A/D Flash Type 8-Bit MCU with EEPROM. Technical Document. Features. General Description

HT48R05A-1/HT48C05/ HT48R06A-1/HT48C06/HT48R08A-1 Cost-Effective I/O Type 8-Bit MCU

HT46R01/HT46R02/HT46R03

HT48F06E/HT48F10E/HT48F30E I/O Flash Type MCU with EEPROM

HT48F70E I/O Flash Type MCU with EEPROM

HALT function and wake-up feature reduce power consumption Six-level subroutine nesting Bit manipulation instructions Crystal or RC oscillator

HT48R10A-1/HT48C10-1 I/O Type 8-Bit MCU

AN1745. Interfacing the HC705C8A to an LCD Module By Mark Glenewinkel Consumer Systems Group Austin, Texas. Introduction

HT46RU26/HT46CU26 A/D Type 8-Bit MCU with UART

HT48RAx/HT48CAx Software Application

I/O Type 8-Bit OTP MCU with High Current LED Driver

HT48R06A-1/HT48C06. 8-Bit Cost-Effective I/O Type MCU. Features. General Description. Block Diagram

HT49R50A-1/HT49C50-1/HT49C50L LCD Type 8-Bit MCU

If the display shift operation is used on a 20 x 4 display, the addressing is shifted as follows:

HT48R70A-1/HT48C Bit I/O Type MCU

Small Package 8-Bit OTP MCU HT48R005/HT46R005

Embedded Systems and Software. LCD Displays

CPEG300 Embedded System Design. Lecture 6 Interrupt System

Using the Data EEPROM in the HT66Fxx

HT46R46-H Cost-Effective A/D Type 8-Bit OTP MCU

~: Simple Programs in 8051 assembly language :~

Using the Library to jump from the User Code to the Bootloader Code in the HT66FB5x0 and HT68FB5x0

HT49R70A-1/HT49C70-1/HT49C70L LCD Type 8-Bit MCU

MICROCONTROLLER BASED WATER LEVEL CONTROL SYSTEM

HT48RA0-5 Remote Type 8-Bit OTP MCU

HT46R47/HT46R47-H Cost-Effective A/D Type 8-Bit OTP MCU

Enhanced I/O Type 8-Bit OTP MCU HT48R063B/HT48R064B HT48R065B/HT48R066B

HT45R36 C/R to F Type 8-Bit OTP MCU

A/D Type 8-Bit OTP MCU HT45R2W

1. LCD (Liquid Crystal Display)interface

HT49R30A-1/HT49C30-1/HT49C30L LCD Type 8-Bit MCU

Using the HT45R36 and HT45R38 to implement Touch Switches

Enhanced A/D Type 8-Bit OTP MCU HT46R064B/HT46R065B/HT46R066B

HT48R30A-1/HT48C30-1 I/O Type 8-Bit MCU

CPEG300 Embedded System Design. Lecture Interface with Peripheral Devices

Project Report SOFTDRINK DISPENSER. Subject Code- ECE-316. Bachelor of Engineering. (Division of Electronics and Communication Engineering)

ELEC VIDEO BIOS ROUTINES

Driving Matrix LEDs Using the HT1632C to Display an Animated Figure

HT49RA0/HT49CA0 Remote Type 8-Bit MCU with LCD

Enhanced Flash MCU with EEPROM HT66F016/HT66F017 HT68F016/HT68F017 HT66F016R/HT66F017R HT68F016R/HT68F017R

HT49RU80/HT49CU80 LCD Type 8-Bit MCU

Preliminary. Technical Document. Features. General Description HT66F03C/ HT66F04C/HT68F03C/ HT68F04C. 8-Pin Enhanced Flash Type 8-Bit MCU with EEPROM

HT48F50E. I/O Type 8-Bit Flash MCU With EEPROM. Technical Document. Features. General Description. Tools Information FAQs Application Note

HT95R54/HT95R55 CID Phone 8-Bit MCU

HT48R32 8-bit OTP Microcontrollers

Lab 3 LCD Mar

HT56R67/HT56R668/HT56R678 TinyPower TM A/D Type with LCD 8-Bit OTP MCU

HT46R47/HT46C47 A/D Type 8-Bit MCU

HT46R32/HT46R34 A/D Type 8-Bit OTP MCU with OPA

HT49R50A-1 Using a thermistor to implement a thermometer

Using General I/O Ports to Drive LCD Displays

HT48F10E. I/O Type 8-Bit Flash MCU With EEPROM. Technical Document. Features. General Description. Tools Information FAQs Application Note

8-Bit Touch Key Flash MCU BS83B08A-3/BS83B08A-4 BS83B12A-3/BS83B12A-4 BS83B16A-3/BS83B16A-4

ELEG3924 Microprocessor

Enhanced I/O Flash Type MCU HT68F005/HT68F006

1. Write A Program to move a block of data within the internal RAM

HT48R11 8-bit OTP Microcontrollers

HTG Bit 320 Pixel Dot Matrix LCD MCU Series. Features. General Description

HT49R30A-1/HT49C30-1/HT49C30L 8-Bit LCD Type MCU

ELEG3923 Microprocessor Ch.2 Assembly Language Programming

AN1742. Programming the 68HC705J1A In-Circuit By Chris Falk CSG Product Engineering Austin, Texas. Introduction. Overview

HT48R50A-1/HT48C50-1 I/O Type 8-Bit MCU

HT47R20A-1/HT47C20-1 R-F Type 8-Bit MCU

AN587. Interfacing to an LCD Module. Interfacing to an LCD Module INTRODUCTION OPERATION CONTROL SIGNAL FUNCTIONS TABLE 2: CONDITIONAL ASSEMBLY FLAGS

Lecture 5. EEE3410 Microcontroller Applications Department of Electrical Engineering Assembly Language Programming (1)

LABORATORY 1 INTRODUCTION TO 8085 MICROPROCESSOR DEVELOPMENT SYSTEM BOARD

HT46R63/HT46C63 A/D with LCD Type 8-Bit MCU

HT48R05A-1 8-Bit OTP Microcontroller

Interfacing ahantronix 128x64 Graphic Module to an 8-bitMicrocontroller

HT49R10A-1/HT49C10-1 LCD Type 8-Bit MCU

MC68705P3 Bootstrap ROM

Lecture 6. Assembler Directives

8051 Programming using Assembly

LAB 1 Introduction to 8085 Microprocessor Development System Board

Using the HT45R38 to Measure Current and Voltage and Power Adjustment for Electric Hotplates

Introduction To MCS-51

WINTER 14 EXAMINATION Subject Code: Model Answer Page No: 1/ 26

LCD AND KEYBOARD INTERFACING

LCDD Application Note

Ultra-Low Voltage R to F Flash MCU BH67F2132

Lecture (09) x86 programming 8

reply db y prompt db Enter your favourite colour:, 0 colour db 80 dup(?) i db 20 k db? num dw 4000 large dd 50000

WZMICRO>COM

UNIVERSITY OF CONNECTICUT. ECE 3411 Microprocessor Application Lab: Fall Quiz II

Applications of 8051 Microcontrollers

Transcription:

HT48 & HT46 LCM Interface Design D/N HA0013E Introduction The following note introduces a way of using 8 bit MCUs to control a DV16100NRB LCD display driver. The LCM is driven and controlled by a built-in Hitachi HD44780. The emphasis will lie on how to make the MCU produce the correct signals to meet the LCM timing requirements. For time order and instrction details, please refer to the LCM data sheets. The LCM can work with a 4 bit or 8 bit mode. In the 4 bit mode, it takes two transmission periods to send one byte or one instruction. In the 8 bit mode, it takes only one single transmission period to send one byte however it requires 4 more I/O pins. For the coding type, examples of using the define, if, else and can be seen in the program. Circuit Set PB0~PB7 as I/O ports for data transmission, and PC0~PC2 as output ports for LCM control. Ports can be re-configured in order to meet the usersí need. 8,, 9. 8,, 4-5 2 * 2 * % %,, % # N %, J N $ 9 H @ +, = JH EN - 4 9 4 5 8 5 5 8 8,, $ # "! 8 5 5 8,, 5 + 2 + 0 2 + 5 + 2 + 0 6 " & 4! )

Program Example ;File name: lcm.asm ;writer Chris ;explanation main program of LCM control ;choose LCM mode ;four_bitg0,lcm work in 8 bit mode,four_bit=1 LCM work in 4 bit mode ;#define four_bit 0 ;LCM work in 8 mode #define four_bit 1 ;LCM work in 4 mode ;the next part cannot be modified #include ht48r30a-1.inc ;LCM.INC for DV-16100NRB LCM_CLS EQU 01H CURSOR_HOME EQU 02H CURSOR_SR EQU 14H CURSOR_SL EQU 10H INCDD_CG_SHF_C EQU 06H TURN_ON_DISP EQU 0FH LCD_ON_CSR_OFF EQU 0CH lcm_data equ pb ;define PORT B as data port lcm_data_ctrl equ pbc lcm_ctrl equ pc ;define PORT C as LCM control port ctrl_ctrl equ pcc extern busy_chk:near extern delay:near extern write_char:near extern snd_cmd:near ;LCM Display Commands and control Signal name. E equ 0 RW equ 1 RS equ 2 data.section data coun0 db? coun1 db? coun2 db? msg db? tmp db?

code.section at 0 code ;program ORG 00h ;set ISR address jmp start start: ;program start clr lcm_data_ctrl ;setup LCM data port as outputs clr ctrl_ctrl ;setup LCM control port as outputs clr lcm_data ;clear LCM data port to 0 clr lcm_ctrl ;clear LCM control port to 0 DISPLAY_INIT: LCM_DELAY: ;loop delay program for LCD control mov a,0ffh mov coun1,a mov coun0,a lp0: sdz coun1 jmp lp0 sdz coun0 jmp lp0 If four_bit mov a,28h ;4 bit mode else mov a,38h ;8 bit mode ;execute write-in CMD_SEQ: If four_bit mov a,28h ;4 bit mode else mov a,38h ;8 bit mode ;execute write-in mov a,80h else mov a, 38h ;execute write-in ;CALL busy check program mov a,lcm_cls ;define ACC to LCM_CLS

;CALL write-in program mov a,turn_on_disp ;define ACC to TURN_ON_DISP mov a,incdd_cg_shf_c ;define ACC to INCDD_CG_SHF_C ;inc addr of DD ram & shift ;the cursor to the right at ;the time of write to DD/CG ;RAM. loop: mov a,lcm_cls mov a,cursor_home ;define ACC to cursor_home Call busy_chk Clr tblp ;clear look up pointer to 0 ;initial display HOLTEK 8 bit uc agn: tabrdl msg ;define msg to data from the last page mov a,msg mov tmp,a mov a,24h xorm a,msg sz msg ;check if msg shows 0 jmp agn1 ;if msgg0, jump to agn1 jmp secn_line ;if msgg0, ;jump to secn_line.

agn1: mov a,tmp call write_char ;CALL write-in program Inc tblp Jmp agn secn_line: inc tblp ;add 1 to look up pointer mov a,0c0h ;second row address snd_line: tabrdl msg mov a,msg mov tmp,a mov a,24h xorm a,msg sz msg jmp snd_lin1 mov a,lcd_on_csr_off ;define ACC to lcd_on_csr_off jmp lp snd_lin1: mov a,tmp call write_char inc tblp ;add 1 to look up pointer jmp snd_line lp: ; jmp start jmp lp holtek_tbl.section at 700h code ;table at last page htk_tbl: ; dc 4800h,4f00h,4c00h,5400h,4500h,4b00h,2000h,3800h,2400h ; dc 2000h,6200h,6900h,7400h,2000h,7500h,4300h,2400h ; dc 0048h,004fh,004ch,0054h,0045h,004bh,0020h,0038h,0024h ; dc 0020h,0062h,0069h,0074h,0020h,0075h,0043h,0024h ;note the following parts is my correction dc 0057h,0075h,0020h,004ah,0069h,006eh,0067h,0020h,0024h dc 0020h,004ah,0069h,006eh,0067h,0020h,0020h,0020h,0024h end

;File name: lcmglob.inc ;writer Chris ;explanation define all constants lcm_data equ pb lcm_data_ctrl equ pbc lcm_ctrl equ pc ctrl_ctrl equ pcc E equ 0 RW equ 1 RS equ 2 ;File name: command.asm ;writer Chris ;explanation: use LCM control instruction document as an interface ;of the external main program LCM.ASM. Add it with the main program ;to the project ;choose LCM mode ;four_bitg0,lcm work in 8 bit mode,four_bit=1 LCM work in 4 bit mode ;#define four_bit 0 ;LCM work in 8 bit mode #define four_bit 1 ;LCM work in 4 bit mode ;the following part cannot be modified ;LCM command module begins here include ht48r30a-1.inc include lcmglob.inc public busy_chk public delay public write_char public snd_cmd scode.section code ;write LCM control instruction ;program snd_cmd: ;if in 4 bit mode mov dtmp,a and a,0f0h ;input high nibble 4 bit to ACC mov lcm_data,a ;write LCM control instruction into ;data port clr lcm_ctrl.rw ;set write-in mode Clr lcm_ctrl.rs ;write instruction to LCM

swapa dtmp and a,0f0h ;input low nibble 4 bit to ACC. mov lcm_data,a ret acode.section code busy_chk: set lcm_data_ctrl ;set LCM data port as input status clr lcm_ctrl.rs ;set LCM as test; in BUSY mode set lcm_ctrl.rw mov a,lcm_data ;define ACC to LCM data port and a,0f0h ;read high nibble to ACC in 4 bit mode mov dtmp,a swapa lcm_data and a,0fh ;read low nibble into ACC Or a,dtmp ;make 8 bit sz acc.7 ;check if LCM is in busy status jmp busy_chk ;if yes, return to busy signal clr lcm_ctrl.rw clr lcm_data_ctrl ;if not, reset LCD data port as ;output status ret wcode.section code write_char: mov dtmp,a and a,0f0h mov lcm_data,a clr lcm_ctrl.rw set lcm_ctrl.rs if four_bit swapa dtmp and a,0f0h mov lcm_data,a

ret dsec.section data dtmp db? dtmp2 db? code.section code delay: mov dtmp,a set dtmp2 drep: sdz dtmp2 jmp drep sdz dtmp jmp drep ret Program Instruction The program firstly executes the include section. Define PORT B as LCM data port and PORT C as LCM control ports. The LCD program can be compiled in 4 bit or 8 bit mode through define instructions. The LCM will reset automatically after power on yet most LCM programs can be initialized using software. In this application the initial program will go to START. In accordance with the HD44780 specifications, each instruction takes at least 4.5ms to execute. This is the function of the LCM_DELAY program. Before the LCM has fully initialized, there is no way to check if LCM is in the BUSY status. Instructions to the LCM must depend upon the code definition of the HD44780. LCM.INC has defined some common instructions. Before writing instructions to the LCM, check if the LCM is in BUSY status. This is the function of the BUSY_CHK program. Confirm that LCM is not in the BUSY status before transmitting data to the LCM. Place the ASCII code at the last page, save the data to the ACC by a look up process and show the code through the WRITE_CHAR program of the LCM.

RS, R/W and E signal Truth Table 4 5 4 9 - F A H = JE 9 HEJA E I JHK? JE? @ A 4 A = @ > K I O B = C = @ @ HA I I? K JA H 9 HEJA @ = J= 4 A = @ @ = J=