MICROCHIP TECHNOLOGY’S MICROSOLUTIONS eNEWSLETTER - November 2005
Tips ‘n Tricks - LCD PICmicro ? Microcontrollers
Using an LCD PICmicro ? microcontroller for any embedded application can provide the benefi ts of system control and human interface via an LCD. Design practices for LCD applications can
be further enhanced through the implementation of these suggested Tips ‘n Tricks. These tips describe basic circuits and software building blocks commonly used for driving LCD displays.
Additional tips and tricks can be found at: www.microchip.com .
in absence of the ticking sound or second hand that
accompanies the usual analog face clock. It serves an
TIP1. In-CircuitDebug(ICD)
There are two potential issues with using the MPLAB ? ICD to debug LCD applications.
First, the LCD controller can Freeze while the device is Halted. Second, the ICD pins
are shared with segments on the PIC16F917/916/914/913 MCUs. When debugging, the
device is Halted at breakpoints and by the user pressing the pause button. If MPLAB
ICD is confi gured to Halt the peripherals with the device, the LCD controller will Halt and
apply DC voltages to the LCD glass. Over time, these DC levels can cause damage to
the glass; however, for most debugging situations, this will not be a consideration. The
PIC18F LCD MCUs have a feature that allows the LCD module to continue operating
while the device has been Halted during debugging. This is useful for checking the image
of the display while the device is Halted and for preventing glass damage if the device will
be Halted for a long period of time. The PIC16F917/916/914/913 multiplex the ICSP?
and ICD pins onto pins shared with LCD segments 6 and 7. If an LCD is attached to these
pins, the device can be debugged with MPLAB ICD; however, all the segments driven
by those two pins will fl icker and be uncontrolled. As soon as debugging is fi nished and
the device is programmed with Debug mode disabled, these segments will be controlled
correctly.
TIP 2. LCD in Sleep Mode
If you have a power-sensitive application that must display data continuously, the LCD
PIC ? microcontroller can be put to Sleep while the LCD driver module continues to drive
the display.
To operate the LCD in Sleep, only two steps are required. First, a time source other
than the main oscillator must be selected as the LCD clock source, because during
Sleep, the main oscillator is Halted. Table 2-1 shows options for the various LCD PIC
microcontrollers.
When should you select the internal RC oscillator (or LFINTOSC) over the Timer1 oscillator? It
depends on whether your application is time-sensitive enough to require the accuracy of a crystal
on the Timer1 oscillator or not. If you have a timekeeping application, then you will probably have
a 32 kHz crystal oscillator connected to Timer1. Since Timer1 continues to operate during Sleep,
there is no penalty in using Timer1 as the LCD clock source. If you don’t need to use an external
oscillator on Timer1, then the internal RC oscillator (INTRC or LFINTOSC) is more than suffi cient to
use as the clock source for the LCD and it requires no external components.
TIP 3. Blinking LCD
Information can be displayed in more than one way with an LCD panel. For example, how can the
user ’s attention be drawn to a particular portion of the LCD panel? One way that does not require
any additional segments is to create a blinking effect.
Look at a common clock application ( Figure 3-1 ). The
: between the hours and minutes is commonly made to
blink once a second (“on” for half a second, and “off”
for half a second). This shows that the clock is counting
Figure 3-1: Common Clock Application
important purpose of letting the user know that the clock is operating.
If there is a power outage, then it is common for the entire clock display to blink. This gives the user
of the clock an immediate indication that the clock is no longer showing the correct time. When the
user sets the time, then blinking is commonly used to show that a new mode has been entered,
such as blinking the hours to identify that the hours are being set, or blinking the minutes to show
that the minutes are being set. In a simple clock, blinking is used for several different purposes.
Without blinking effects, the common digital clock would not be nearly as user friendly.
Part LCD Clock Source
PIC16C925/926 FOSC/256
T1OSC
Internal RC Oscillator
PIC16F917/916/914/913 FOSC/8192
T1OSC/32
LFINTOSC/32
PIC18F8490 (FOSC/4)/8192
T1OSC
INTRC/32
Table 2-1: Options for LCD in Sleep mode
Use in Sleep?
No
Yes
Yes
No
Yes
Yes
No
Yes
Yes
Fortunately, blinking is quite easy
to implement. There are many
ways to implement a blinking effect
in software. Any regular event
can be used to update a blink
period counter. A blink fl ag can be
toggled each time the blink period
elapses. Each character or display
element that you want to blink
can be assigned a corresponding
blink enable fl ag. The fl owchart for
updating the display would look as
pictured in Figure 3-2 .
Second, the Sleep Enable bit (SLPEN) must be cleared. The LCD will then continue to
display data while the part is in Sleep. It’s that easy!
Figure 3-2: Updating Display Chart Flowchart
Microcontrollers ? Digital Signal Controllers ? Analog ? Serial EEPROMs
8
相关PDF资料
MA180021 MODULE PLUG-IN 18F87J50 FS USB
MA180024 MODULE PLUG-IN 18F46J50 FS USB
MA180028 MOD PLUG-IN PIC18F87K22 PIM
MA2-4-34-625-2-A32-7C CIRCUIT BREAKER MAG 25A PANEL MT
MA240013 MODULE PLUG-IN PIC24 44-PIN
MA240017 MODULE PLUG-IN PIC24F16KA102 PIM
MA240021 MOD PLUG-IN PIC24FJ256GB210
MA240025-1 MOD PIM PIC24EP512GU810 GP
相关代理商/技术参数
MA160012 功能描述:子卡和OEM板 PIC16F193x 44P PIM For PIC18 Explorer RoHS:否 制造商:BeagleBoard by CircuitCo 产品:BeagleBone LCD4 Boards 用于:BeagleBone - BB-Bone - Open Source Development Kit
MA160012 制造商:Microchip Technology Inc 功能描述:PIC16F1937 Plug-in Module for PICDEM PIC
MA160014 功能描述:子卡和OEM板 PIC18LF45K22 Plug-In Module RoHS:否 制造商:BeagleBoard by CircuitCo 产品:BeagleBone LCD4 Boards 用于:BeagleBone - BB-Bone - Open Source Development Kit
MA160015 功能描述:子卡和OEM板 PIC16LF1947 PIM RoHS:否 制造商:BeagleBoard by CircuitCo 产品:BeagleBone LCD4 Boards 用于:BeagleBone - BB-Bone - Open Source Development Kit
MA160016 功能描述:子卡和OEM板 PIC16F1947 PIM RoHS:否 制造商:BeagleBoard by CircuitCo 产品:BeagleBone LCD4 Boards 用于:BeagleBone - BB-Bone - Open Source Development Kit
MA161 制造商:Panasonic Industrial Company 功能描述:DIODE
MA16101BAN 制造商:MURATA 制造商全称:Murata Manufacturing Co., Ltd. 功能描述:HIGH FREQUENCY CERAMIC CAPACITORS
MA16101BBN 制造商:MURATA 制造商全称:Murata Manufacturing Co., Ltd. 功能描述:HIGH FREQUENCY CERAMIC CAPACITORS