PR3 LCD Display. Version 1.1. May Cytron Technologies Sdn. Bhd.

Similar documents
MD10C Enhanced 10Amp DC Motor Driver

8-Channel RC RX MUX. User s Manual

Data Acquisition Module with I2C interface «I2C-FLEXEL» User s Guide

Programming PIC Microcontrollers in PicBasic Pro Lesson 1 Cornerstone Electronics Technology and Robotics II

SKP16C62P Tutorial 1 Software Development Process using HEW. Renesas Technology America Inc.

Chapter 13. PIC Family Microcontroller

Switch board datasheet EB

ET-BASE AVR ATmega64/128

AN4032 Application note

PICNet 1. PICNet 1 PIC18 Network & SD/MMC Development Board. Features. Applications. Description

User Manual. AS-Interface Programmer

RS232 Board datasheet

HD44780-Based LCD Modules. Introduction to the LM018L

EasyPIC4 User s Manual

POCKET SCOPE 2. The idea 2. Design criteria 3

Tutorial for MPLAB Starter Kit for PIC18F

2.0 Command and Data Handling Subsystem

K8048 PIC PROGRAMMER BOARD

Table 1 below is a complete list of MPTH commands with descriptions. Table 1 : MPTH Commands. Command Name Code Setting Value Description

Block 3 Size 0 KB 0 KB 16KB 32KB. Start Address N/A N/A F4000H F0000H. Start Address FA000H F8000H F8000H F8000H. Block 2 Size 8KB 16KB 16KB 16KB

AN-812 APPLICATION NOTE

LED board datasheet EB

STEPPER MOTOR SPEED AND POSITION CONTROL

M68EVB908QL4 Development Board for Motorola MC68HC908QL4

MEMS ACCELEROMETER BASED PASSWORD RECOGNITION SYSTEM USING GSM

Programming Flash Microcontrollers through the Controller Area Network (CAN) Interface

Single channel data transceiver module WIZ2-434

Develop a Dallas 1-Wire Master Using the Z8F1680 Series of MCUs

AXE033 SERIAL/I2C LCD

How To Program A Microcontroller Board (Eb064) With A Psp Microcontroller (B064-74) With An Ios 2.5V (Power) And A Ppt (Power Control) (Power Supply) (

Accurate Measurement of the Mains Electricity Frequency

Microtronics technologies Mobile:

PC Base Adapter Daughter Card UART GPIO. Figure 1. ToolStick Development Platform Block Diagram

PICmicro tm Development Board

Using Xbee in Serial Communication

ALL-USB-RS422/485. User Manual. USB to Serial Converter RS422/485. ALLNET GmbH Computersysteme Alle Rechte vorbehalten

GSM Interfacing Board

Fondamenti su strumenti di sviluppo per microcontrollori PIC

AUTOMATIC NIGHT LAMP WITH MORNING ALARM USING MICROPROCESSOR

BE635 User Manual. Rev. V Bolymin, Inc. All Rights Reserved.

NTE2053 Integrated Circuit 8 Bit MPU Compatible A/D Converter

SMARTCARD XPRO. Preface. SMART ARM-based Microcontrollers USER GUIDE

A+ Guide to Managing and Maintaining Your PC, 7e. Chapter 1 Introducing Hardware

Designing VM2 Application Boards

DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING Question Bank Subject Name: EC Microprocessor & Microcontroller Year/Sem : II/IV

Lecture N -1- PHYS Microcontrollers

UniPi technical documentation REV 1.1

CAN bus board. EB018

The I2C Bus. NXP Semiconductors: UM10204 I2C-bus specification and user manual HAW - Arduino 1

QUICK START GUIDE FOR DEMONSTRATION CIRCUIT BIT DIFFERENTIAL ADC WITH I2C LTC2485 DESCRIPTION

DK40 Datasheet & Hardware manual Version 2

RS-232 Communications Using BobCAD-CAM. RS-232 Introduction

CONCEPT1 RS232 COMMUNICATION

Lab Experiment 1: The LPC 2148 Education Board

Testing Data Radio Modem with Serial Port Tool V1.20

Interfacing Of PIC 18F252 Microcontroller with Real Time Clock via I2C Protocol

2011, The McGraw-Hill Companies, Inc. Chapter 3

8051 MICROCONTROLLER COURSE

RDF1. RF Receiver Decoder. Features. Applications. Description. Ordering Information. Part Number Description Packages available

NHD-0420D3Z-FL-GBW-V3

AN3252 Application note

PICAXE RF CONNECT KIT (AXE213)

PCAN-MicroMod Universal I/O Module with CAN Interface. User Manual. Document version ( )

CHAPTER 11: Flip Flops

HD44780U (LCD-II) (Dot Matrix Liquid Crystal Display Controller/Driver)

DATASHEET. ADAM Arduino Display Adaptor Module. Arduino Compatible Shield P/N: 4Display-Shield-FT843 For the 4D Systems 4DLCD-FT843 Display

Using Altera MAX Series as Microcontroller I/O Expanders

Controlling a Dot Matrix LED Display with a Microcontroller

GDM1602A SPECIFICATIONS OF LCD MODULE. Features. Outline dimension

AN2680 Application note

Implementing SPI Master and Slave Functionality Using the Z8 Encore! F083A

AVR151: Setup and Use of the SPI. Introduction. Features. Atmel AVR 8-bit Microcontroller APPLICATION NOTE

Chapter 11. Using MAX II User Flash Memory for Data Storage in Manufacturing Flow

Design And Implementation Of Bank Locker Security System Based On Fingerprint Sensing Circuit And RFID Reader

Microstep Driver Manual Version 6/13/2006

The Programming Interface

OPTREX CORP. LCD MODULE

KTA-223 Arduino Compatible Relay Controller

USB / Data-Acquisition Module NOW LEAD-FREE

Analog-to-Digital Converters

SPI. Overview and Use of the PICmicro Serial Peripheral Interface. Getting Started: SPI

LMB162ABC LCD Module User Manual

Design and Construction of Variable DC Source for Laboratory Using Solar Energy

Microcontroller Based Low Cost Portable PC Mouse and Keyboard Tester

User's Guide. Integrating Sound Level Datalogger. Model Introduction

EXERCISE 3: String Variables and ASCII Code

Controller for AD9850 DDS Modules Andy Talbot G4JNT

3.2 inch QVGA TFT Color LCD User s Guide Version 1 & 2

DOT MATRIX CHARACTER LCD MODULE USER S MANUAL

8-Bit Microcontroller with Flash. Application Note. Using a Personal Computer to Program the AT89C51/C52/LV51/LV52/C1051/C2051

How To Use An Ams 5812 Pressure Sensor With A Usb Starter Kit

Disturbance Recoder SPCR 8C27. Product Guide

An Introduction to MPLAB Integrated Development Environment

Evo Laser Firmware Developer s Manual

- 35mA Standby, mA Speaking pre-defined phrases with up to 1925 total characters.

QL-PROG Microchip MCU Programmer User s Manual Qianlongsheng Electronic Technology Co., Ltd.

RS-485 Protocol Manual

Software User Guide UG-461

EvB 5.1 v5 User s Guide

Advanced Data Capture and Control Systems

Transcription:

PR3 PR3 LCD Display Version 1.1 May 2010 Cytron Technologies Sdn. Bhd. Information contained in this publication regarding device applications and the like is intended through suggestion only and may be superseded by updates. It is your responsibility to ensure that your application meets with your specifications. No representation or warranty is given and no liability is assumed by Cytron Technologies Incorporated with respect to the accuracy or use of such information or infringement of patents or other intellectual property rights arising from such use or otherwise. Use of Cytron Technologies products as critical components in life support systems is not authorized except with express written approval by Cytron Technologies. No licenses are conveyed, implicitly or otherwise, under any intellectual property rights. OVERVIEW This document describes Cytron Technologies DIY (Do It Yourself) Project PR3. 2x16 characters parallel LCD will be used in PR3 to display character and numeric alphabet. Schematic and sample source code is provided. FEATURES PIC16F877A - 8 bit microcontroller with 33 I/O - Operate with 5V supply. - Operating speed: 20MHz 2x16 Characters LCD - 2x16 character LCD - Backlight

SYSTEM OVERVIEW SK40C + PIC 16F877A GENERAL DESCRIPTION 2x16 character LCD is the most common message display device used to display ASCII character. By using the SK40C, user is able to complete the circuit for this project easily. Information which includes sample source code, schematic and detail description (this document) can be downloaded from www.cytron.com.my SK40C PIC Start-Up Kit SK40C is enhanced version of SK40B. It is designed to offer an easy to start board for PIC MCU user. This board comes with basic components for user to begin project development. It offer plug and use features. Users are able to utilize the function of PIC by directly plug-in the external components in whatever way that is convenient. This kit comes WITHOUT PIC microcontroller to provide the freedom for user to choose PIC type. It can support 40-pin PIC16F and PIC18F. http://www.cytron.com.my/usr_attachment/sk40c_us ers_manual.pdf PIC16F877A This powerful (200 nanosecond instruction execution) yet easy-to-program (only 35 single word instructions) CMOS FLASH-based 8-bit microcontroller packs Microchip's powerful PIC architecture into an 40- or 44-pin package and is upwards compatible with the PIC16C5X, PIC12CXXX and PIC16C7X devices. Features of the device: 8 Kbytes of Flash Program Memory 368 bytes of Data Memory (RAM) 256 bytes of EEPROM data memory 8 channels of 10-bit Analog-to-Digital (A/D) converter 2 capture/compare/pwm functions MSSP (Master Synchronous Serial Port) can be configured as either 3-wire Serial Peripheral Interface(SPI ) or the 2-wire Inter-Integrated Circuit (I²C ) bus Universal Asynchronous Receiver Transmitter (USART) All of these features make it ideal for advanced applications in automotive, industrial, appliances and consumer product. Figure 2 shows the pin diagram for PIC16F877A. For more information about the PIC microcontroller, please refer to the datasheet. The datasheet can be obtained from microchip website at: http://www.microchip.com Figure 1

which is much easier for software development. Pin 15 and 16 of LCD are for backlight which is optional by connect or disconnect JP8.Switching on LCD backlight will consume more energy and further dry up the battery faster. The 3rd pin (VEE) needs to be connected to a variable resistor to control the LCD contrast, while the R/W (read or write) pin is connected to the ground which indicates the LCD is in write mode. R/S and E are connected to RB4 and RB5 of PIC respectively. For data communication pins, DB0-DB7 (8-bit) is connected directly to RD0-RD7 of PIC. For more detail about the LCD, please refer to the datasheet. It may be downloaded from Cytron website www.cytron.com.my Figure 2 Figure 2 shows the pin diagram for PIC16F877A. For more information about the PIC microcontroller, please refer to the datasheet. The datasheet can be obtained from microchip website at: http://www.microchip.com. Before display any ASCII character, LCD needs to be initialized. Table 1 is LCD protocol/functions and table 2 is LCD command bit function and the value. Users need both tables to initiate LCD display. Parallel LCD Protocol 2x16 Characters LCD In this project, a JHD162A (with backlight) 2x16 characters LCD will be used. It has the same pin configuration with Hitachi HD44780. LCD breakout pin and its function are shown below: Pin Name Pin Function Connection 1 VSS Ground GND 2 VCC Positive supply for LCD 5V 3 VEE Contrast adjust 4 RS 5 R/W 6 E Select register, select instruction or data register. Select read or write Start data read or Connected to a preset to adjust contrast RB4 GND (always write) RB5 write 7 DB0 Data bus pin RD0 8 DB1 Data bus pin RD1 9 DB2 Data bus pin RD2 10 DB3 Data bus pin RD3 11 DB4 Data bus pin RD4 12 DB5 Data bus pin RD5 13 DB6 Data bus pin RD6 14 DB7 Data bus pin RD7 15 LED+ 16 LED- Backlight positive input Backlight negative input 5V Connect to JP8 This LCD may be interfaced in either 8 pins (8-bit interface) or 4 pins (4-bit interface), depend on the I/O pins available. For 16F877A which has 33 I/O pins, there should be no problem using the 8-bit interface Table 1 LCD Command Bit function and value Table 2 To initiate LCD, R/S must be set to logic 0 (Low) to indicate the data send through data pin (8-bit) is command. R/S is set to logic 1 (High) to write an ASCII character to LCD. LCD will need to be initialized in PIC program according to Table 1 and Table 2. A character is not necessarily start at home position (top left corner). User may start it at the second line, centre of line or any location on LCD. Refer to Appendix A, Table 3 is DDRAM address for LCD. User may use the address to display character any location on LCD.

HARDWARE Connector for UIC00A/B Programmer This project will require following hardware: a. 1 x SK40C PIC Start-Up Kit b. PIC16F877A c. 2x16 Characters LCD d. Other necessary components Please refer to Component list to see related electronic components. Figure 4 Power Supply for Circuit Figure 3 There is DC power adapter for user to plug in DC adapter. The power supply must be in range from 7V to 15V. Power supply out of the range will spoil the circuit or return insufficient output voltage. Refer to Figure 3, the D2 is use to protect the circuit from wrong polarity supply. C2 is use to stabilize the voltage at the input side of the LM2940 voltage regulator, while the C1 and C3 is use to stabilize the voltage at the output side of the LM2940 voltage supply. Loading Program This project use UIC00A/B to load program into PIC. Connector for UIC00A/B provides simple and fast method to load program. Please refer SK40C User s Manual on method to load program into PIC using UIC00A/B programmer. Figure 5 Figure 4 shows the connector for UIC00A/B programmer which is ready on SK40C. Figure 5 shows the way of connection to program the PIC microcontroller. SK40C should be powered from DC adaptor when load program to the PIC microcontroller. The programmer (UIC00A/B) is not included in DIY project set since it can be used for different project set. User can also choose other type of PIC programmer to load the program; however, the interface and method to load program might differ from UIC00A/B. Please consult the manufacturer of that particular PIC programmer. For the instruction of using UIC00A/B, please refer to its user s manual at: www.cytron.com.my

SOFTWARE Flow Chart for LCD Initialization Flow Chart to Display ASCII Character Flow Chart 2 is showing whole program in PR3. After initiate I/O and LCD, user may send any numeric or alphabet in ASCII format to LCD. For example, if character A is wanted to be displayed, the data send from PORTD should be 01000001 (binary) and also can use 41 (hexadecimal), 65 (decimal) or 101 octet. Please refer to Appendix A for ASCII table. Flow Chart 1 Flow Chart 2 Listing 1 Flow chart 1 shows the steps to initiate 2x16 LCD. Listing 1 is the example source code to initiate LCD using Assembly code. From Listing 1, data is send from PORTD to LCD. On each pulse from E pin, LCD will read the data. Depend on RS pin, if it is logic 0 (low), LCD will interpret the data received into command and execute it. For example; when the data send from PORTD is 00111000, LCD will check the first bit that being set (1) from left. In this case, it is DB5 (bit 5), and referring to Table 1, this command is to configure Interface Length. DB4 will represent DL, and so forth. Please refer to table 2 for the value and function of DL, N, F. After initialization of LCD is done, user should see LCD display blinking cursor at home position. In this project, program will jump to 2 nd line of LCD to display next character. Send logic 0 to RS pin. The address for jump to 2 nd line is 0x40. Using move cursor to DDRAM function (refer Table 1), DB6-DB0 is address for second line (0x40-0x4F). DB7 is a command to jump to the address. By sending binary value of 10000111 or hexadecimal value of 87 to LCD, the cursor will move to 7 th column on the 1 st row of LCD. For more information about the sample code, please refer to the source code provided. The details explanation has been provided as the comment. The source code is provided free and Cytron Technologies will not be responsible for any further modification or improvement.

ii. To use the LCD, solder the LCD display at the reserve place as shown in figure 7. Caution: User is advice to check the connections using multi-meter to ensure all pin of LCD are connected to header pins. 2. Please download the necessary files and documents from Cytron Technologies website. These included documentation, sample source code, schematic, component list and necessary software. 3. Next step is to install MPLAB IDE. Please refer MPLAB installation step document to install the software. Figure 6 Every LCD data either 4 bits or 8 bits interface must be triggered by sending a Clock E. From figure 6, LCD will read data when pin E is at fall edge. Delay is needed for LCD to process and execute the data. The delay or clock E period is must be greater than 500ns. Usually the clock E period is in milliseconds (ms). 4. After the installation is complete, open the MPLAB program. Open the sample code PR3.asm file that user download from Cytron website. To open the file, click file>open>browse to sample code PR3.asm file. GETTING STARTED User may obtain the hardware set for this project (PR3) either by online purchase (www.cytron.com.my) or get it from Cytron Technologies Shop. 1. Once user has the hardware set, soldering process can begin. For PR3, user just need solder LCD to SK40C. It is optional for user to connect header pin at JP8 or not. Please refer Step to get LCD backlight. Steps to solder LCD to SK40C: 5. From MPLAB menu bar, click Configure> Select device> Select PIC16F877A>OK. Figure 7 i. Solder the 16 header pin provided to LCD as shown in figure 7.

6. Click Project>Quickbuild sample code P3.asm if user want to compile the program. 10. User may modify the program. After modified the program repeat steps 6-9 to compile and load the hex code into PIC. AC to DC adaptor: User may use the AC to DC adaptor as the power source to the circuit. Figure 9 (Not included in DIY project set) 7. If no error occurred, MPLAB will auto generate a hex file at the location where the asm file is located. Hex file is the file that needed for programmer to load into PIC. 8. Use UIC00A/B to load program into PIC. UIC00A/B programmer provides simple and fast method to load program. Please refer to the User s Manual of UIC00A/B for the correct steps to load program. 9. Figure 8 shows hardware connection of UIC00A/B to SK40C. Please refer UIC00A/B User s Manual for the method to load hex file into PIC. Step to get LCD backlight: 1. To get LCD backlight, user need to get header pin and mini jumper which are not provide in packaging. Figure 10 2. Solder the header pin to JP8 as shown in Figure 11. Figure 11 3. Put the mini jumper as shown in Figure 12 to get LCD backlight. User can choose to disable the LCD backlight by take off the mini jumper. Figure 8 Figure 12

Control LCD backlight contrast: The contrast of LCD display can be adjusted by tuning the potential meter as shown in Figure 13. WARRANTY Figure 13 No warranty will be provided as this is DIY project. Thus, user is advice to check the polarity of each electronic component before solder it into board.

Appendix A LCD Power supply SK40C UIC00A/B Figure 14: Complete connection Table 3: ASCII table

Table 4: DDRAM Address (in Hex value) * Cytron Technologies reserved the right to replace the component in the list with component of the same functionality without prior notice. Prepared by Cytron Technologies Sdn. Bhd. 19, Jalan Kebudayaan 1A, Taman Universiti, 81300 Skudai, Johor, Malaysia. Tel: +607-521 3178 Fax: +607-521 1861 URL: www.cytron.com.my Email: support@cytron.com.my sales@cytron.com.my