AAAA LCD Clock Demo User's Guide

AAAA LCD Clock Demo
User’s Guide
 2010 Microchip Technology Inc.
DS41448A
Note the following details of the code protection feature on Microchip devices:
•
Microchip products meet the specification contained in their particular Microchip Data Sheet.
•
Microchip believes that its family of products is one of the most secure families of its kind on the market today, when used in the
intended manner and under normal conditions.
•
There are dishonest and possibly illegal methods used to breach the code protection feature. All of these methods, to our
knowledge, require using the Microchip products in a manner outside the operating specifications contained in Microchip’s Data
Sheets. Most likely, the person doing so is engaged in theft of intellectual property.
•
Microchip is willing to work with the customer who is concerned about the integrity of their code.
•
Neither Microchip nor any other semiconductor manufacturer can guarantee the security of their code. Code protection does not
mean that we are guaranteeing the product as “unbreakable.”
Code protection is constantly evolving. We at Microchip are committed to continuously improving the code protection features of our
products. Attempts to break Microchip’s code protection feature may be a violation of the Digital Millennium Copyright Act. If such acts
allow unauthorized access to your software or other copyrighted work, you may have a right to sue for relief under that Act.
Information contained in this publication regarding device
applications and the like is provided only for your convenience
and may be superseded by updates. It is your responsibility to
ensure that your application meets with your specifications.
MICROCHIP MAKES NO REPRESENTATIONS OR
WARRANTIES OF ANY KIND WHETHER EXPRESS OR
IMPLIED, WRITTEN OR ORAL, STATUTORY OR
OTHERWISE, RELATED TO THE INFORMATION,
INCLUDING BUT NOT LIMITED TO ITS CONDITION,
QUALITY, PERFORMANCE, MERCHANTABILITY OR
FITNESS FOR PURPOSE. Microchip disclaims all liability
arising from this information and its use. Use of Microchip
devices in life support and/or safety applications is entirely at
the buyer’s risk, and the buyer agrees to defend, indemnify and
hold harmless Microchip from any and all damages, claims,
suits, or expenses resulting from such use. No licenses are
conveyed, implicitly or otherwise, under any Microchip
intellectual property rights.
Trademarks
The Microchip name and logo, the Microchip logo, dsPIC,
KEELOQ, KEELOQ logo, MPLAB, PIC, PICmicro, PICSTART,
PIC32 logo, rfPIC and UNI/O are registered trademarks of
Microchip Technology Incorporated in the U.S.A. and other
countries.
FilterLab, Hampshire, HI-TECH C, Linear Active Thermistor,
MXDEV, MXLAB, SEEVAL and The Embedded Control
Solutions Company are registered trademarks of Microchip
Technology Incorporated in the U.S.A.
Analog-for-the-Digital Age, Application Maestro, CodeGuard,
dsPICDEM, dsPICDEM.net, dsPICworks, dsSPEAK, ECAN,
ECONOMONITOR, FanSense, HI-TIDE, In-Circuit Serial
Programming, ICSP, Mindi, MiWi, MPASM, MPLAB Certified
logo, MPLIB, MPLINK, mTouch, Omniscient Code
Generation, PICC, PICC-18, PICDEM, PICDEM.net, PICkit,
PICtail, REAL ICE, rfLAB, Select Mode, Total Endurance,
TSHARC, UniWinDriver, WiperLock and ZENA are
trademarks of Microchip Technology Incorporated in the
U.S.A. and other countries.
SQTP is a service mark of Microchip Technology Incorporated
in the U.S.A.
All other trademarks mentioned herein are property of their
respective companies.
© 2010, Microchip Technology Incorporated, Printed in the
U.S.A., All Rights Reserved.
Printed on recycled paper.
ISBN: 978-1-60932-601-2
Microchip received ISO/TS-16949:2002 certification for its worldwide
headquarters, design and wafer fabrication facilities in Chandler and
Tempe, Arizona; Gresham, Oregon and design centers in California
and India. The Company’s quality system processes and procedures
are for its PIC® MCUs and dsPIC® DSCs, KEELOQ® code hopping
devices, Serial EEPROMs, microperipherals, nonvolatile memory and
analog products. In addition, Microchip’s quality system for the design
and manufacture of development systems is ISO 9001:2000 certified.
DS41448A-page 2
 2010 Microchip Technology Inc.
AAAA LCD CLOCK DEMO
USER’S GUIDE
Table of Contents
Preface ........................................................................................................................... 5
Chapter 1. Introduction
Chapter 2. Operating Instructions
2.1 LCD Layout .................................................................................................. 10
2.2 Initial Power Up ............................................................................................ 10
2.3 Setting Time and Formats ............................................................................ 11
2.4 Additional Information ................................................................................... 11
Chapter 3. Bill of Materials
Chapter 4. Optional Features
4.1 Programming Port ........................................................................................ 16
4.2 The Piezo Buzzer ......................................................................................... 16
4.3 Auto Power-down ......................................................................................... 16
4.4 Energizer AAAA (E96) Battery ..................................................................... 17
Appendix A. Schematic Diagram
Worldwide Sales and Service .................................................................................... 20
 2010 Microchip Technology Inc.
DS41448A-page 3
AAAA LCD Clock Demo User’s Guide
NOTES:
DS41448A-page 4
 2010 Microchip Technology Inc.
AAAA LCD CLOCK DEMO
USER’S GUIDE
Preface
NOTICE TO CUSTOMERS
All documentation becomes dated, and this manual is no exception. Microchip tools and
documentation are constantly evolving to meet customer needs, so some actual dialogs
and/or tool descriptions may differ from those in this document. Please refer to our web site
(www.microchip.com) to obtain the latest documentation available.
Documents are identified with a “DS” number. This number is located on the bottom of each
page, in front of the page number. The numbering convention for the DS number is
“DSXXXXXA”, where “XXXXX” is the document number and “A” is the revision level of the
document.
For the most up-to-date information on development tools, see the MPLAB® IDE on-line help.
Select the Help menu, and then Topics to open a list of available on-line help files.
INTRODUCTION
This chapter contains general information that will be useful to know before using the
AAAA LCD Clock Demo User’s Guide. Items discussed in this chapter include:
•
•
•
•
•
•
•
About this Guide
Conventions Used in this Guide
Recommended Reading
The Microchip Web Site
Development Systems Customer Change Notification Service
Customer Support
Document Revision History
ABOUT THIS GUIDE
Document Layout
This document describes how to operate the AAAA Clock Demo Board and details on
its features. The manual layout is as follows:
Chapter 1. Introduction – an overview of the AAAA Clock demo and its features
Chapter 2. Operating Instructions – how to set the time and other settings
Chapter 3. Bill of Materials – a brief description of the power supply
Chapter 4. Optional Features – a brief description of the capacitive sense
Appendix A. Schematic Diagram – schematics for the AAAA Clock Demonstration
Board.
 2010 Microchip Technology Inc.
DS41448A-page 5
AAAA LCD Clock Demo User’s Guide
CONVENTIONS USED IN THIS GUIDE
This manual uses the following documentation conventions:
DOCUMENTATION CONVENTIONS
Description
Represents
Examples
Arial font:
Italic characters
Initial caps
Referenced books
PICDEM LCD 2 User’s Guide
Emphasized text
...is the only compiler...
A window
the Output window
A dialog
the Settings dialog
A menu selection
select Enable Programmer
Quotes
A field name in a window or
dialog
“Save project before build”
Underlined, italic text with
right angle bracket
A menu path
File>Save
Bold characters
A dialog button
Click OK
A tab
Click the Power tab
A key on the keyboard
Press <Enter>, <F1>
Sample source code
#define START
Filenames
autoexec.bat
File paths
c:\mcc18\h
Keywords
_asm, _endasm, static
Command-line options
-Opa+, -Opa-
Bit values
0, 1
A binary number
‘b00100, ‘b10
Italic Courier New
A variable argument
file.o, where file can be
any valid filename
0xnnnn
A hexadecimal number where 0xFFFF, 0x007A
n is a hexadecimal digit
Square brackets [ ]
Optional arguments
mcc18 [options] file
[options]
Curly brackets and pipe
character: { | }
Choice of mutually exclusive
arguments; an OR selection
errorlevel {0|1}
Ellipses...
Replaces repeated text
var_name [,
var_name...]
Represents code supplied by
user
void main (void)
{...
}
Text in angle brackets < >
Courier font:
Plain Courier New
DS41448A-page 6
 2010 Microchip Technology Inc.
Preface
RECOMMENDED READING
This user’s guide describes how to use the AAAA Clock Demo. Other useful
documents are listed below. The following Microchip documents are available and
recommended as supplemental reference resources.
Readme Files
For the latest information on using other tools, read the tool-specific Readme files in
the Readmes subdirectory of the MPLAB® IDE installation directory. The Readme files
contain update information and known issues that may not be included in this user’s
guide.
The following documents are comprehensive references for the AAAA Clock Demo:
“Capacitive Touch Using Only an ADC (CVD)” AN1298
“Design Practices for Low-Power External Oscillators” AN1288
“PIC16F1933 Data Sheet”
“MCP9701A Data Sheet”
“MCP1624 Data Sheet”
“Energizer Data Sheet” (http://data.energizer.com/PDFs/E96.pdf)
THE MICROCHIP WEB SITE
Microchip provides online support via our web site at www.microchip.com. This web
site is used as a means to make files and information easily available to customers.
Accessible by using your favorite Internet browser, the web site contains the following
information:
• Product Support – Data sheets and errata, application notes and sample
programs, design resources, user’s guides and hardware support documents,
latest software releases and archived software
• General Technical Support – Frequently Asked Questions (FAQs), technical
support requests, online discussion groups, Microchip consultant program
member listing
• Business of Microchip – Product selector and ordering guides, latest Microchip
press releases, listing of seminars and events, listings of Microchip sales offices,
distributors and factory representatives
 2010 Microchip Technology Inc.
DS41448A-page 7
AAAA LCD Clock Demo User’s Guide
DEVELOPMENT SYSTEMS CUSTOMER CHANGE NOTIFICATION SERVICE
Microchip’s customer notification service helps keep customers current on Microchip
products. Subscribers will receive e-mail notification whenever there are changes,
updates, revisions or errata related to a specified product family or development tool of
interest.
To register, access the Microchip web site at www.microchip.com, click on Customer
Change Notification and follow the registration instructions.
The Development Systems product group categories are:
• Compilers – The latest information on Microchip C compilers and other language
tools. These include the MPLAB C18 and MPLAB C30 C compilers; MPASM™
and MPLAB ASM30 assemblers; MPLINK™ and MPLAB LINK30 object linkers;
and MPLIB™ and MPLAB LIB30 object librarians.
• Emulators – The latest information on Microchip in-circuit emulators.This
includes the MPLAB ICE 2000 and MPLAB ICE 4000.
• In-Circuit Debuggers – The latest information on the Microchip in-circuit
debugger, MPLAB ICD 2.
• MPLAB® IDE – The latest information on Microchip MPLAB IDE, the Windows®
Integrated Development Environment for development systems tools. This list is
focused on the MPLAB IDE, MPLAB SIM simulator, MPLAB IDE Project Manager
and general editing and debugging features.
• Programmers – The latest information on Microchip programmers. These include
the MPLAB PM3 and PRO MATE® II device programmers and the PICSTART®
Plus and PICkit™ development programmers.
CUSTOMER SUPPORT
Users of Microchip products can receive assistance through several channels:
•
•
•
•
Distributor or Representative
Local Sales Office
Field Application Engineer (FAE)
Technical Support
Customers should contact their distributor, representative or field application engineer
(FAE) for support. Local sales offices are also available to help customers. A listing of
sales offices and locations is included in the back of this document.
Technical support is available through the web site at: http://support.microchip.com
DOCUMENT REVISION HISTORY
Revision A (October 2010)
• Original version of this document.
DS41448A-page 8
 2010 Microchip Technology Inc.
AAAA LCD CLOCK DEMO
USER’S GUIDE
Chapter 1. Introduction
The AAAA LCD Clock Demo demonstrates how a PIC® microcontroller can run from a
single AAAA 1.5V battery. An MCP1624 boost controller is used, which is capable of
starting with an input voltage as low as 0.65V to boost a single AAAA battery up to 3.3
volts. Also included are capacitive sense buttons for configuring the clock, an
MCP9701A analog temperature sensor, a custom LCD and the ability to measure the
battery voltage. The design also has the option for an external buzzer and auto shutdown by means of additional components, but these are not part of the standard
assembly.
The clock displays time, temperature and battery voltage. The PIC16F1933 uses the
32.768 KHz crystal to clock the internal timer, which then generates the interrupt that
causes the device to wake from Sleep. This interrupt updates the time, runs the capacitive sensors and samples the voltage and temperature. While the microcontroller is
awake, it runs using the internal 500 KHz oscillator, executing instructions quickly and
allowing more time in Sleep.
Please note that this demo board is not intended to be an extreme low-power demonstration. Changes can be made to the hardware and source code that will improve the
overall power consumption and extend the battery life. For example, utilizing low-power
modes on the LCD drive, reducing the sample rate of the capacitive sensors until an
initial touch is sensed, sampling temperature less often, optimizing code to run faster
and sleep longer will reduce power consumption to extend battery life.
Pads for connection to a PICkit™ 2 or PICkit 3 programmer have been included for
users who wish to modify or write new firmware. The source code is available at
http://www.microchip.com/AAAA.
The following features have not been implemented in the demo board, but are
additional possible projects:
• Add an audible alarm using a Piezo buzzer and drive it using the PWM
• Implement auto power-down on the power supply
• Take the current demo source code and, while keeping the same functionality,
reduce the current consumption as much as possible by only changing the code
• By using the auto power-down on the power supply, attempt to reduce the overall
current consumption even more without changing the functionality
Some hints and tips are found later in this document.
 2010 Microchip Technology Inc.
DS41448A-page 9
AAAA LCD CLOCK DEMO
USER’S GUIDE
Chapter 2. Operating Instructions
The following instructions are for version 1.04 of the firmware as shipped, which varies
slightly from the instructions on the packaging.
2.1
LCD LAYOUT
The LCD has five different zones that we use. They are highlighted in the image below.
FIGURE 2-1:
LCD ZONES
1. The battery level indicator is shown on the top left. When empty, the battery
should be replaced.
2. The top right has a single seven-segment digit that is used to indicate AM , PM
, Temperature , Battery Voltage or a 10 second count if in 24 hour mode.
3. On the right side, F3 and F4 are used to show when a capacitive button has been
pushed.
4. In the right bottom corner is the Microchip Technology Inc. logo, which blinks
every second.
5. The remainder of the display is a four-digit, seven-segment display which displays the time, temperature or battery voltage.
2.2
INITIAL POWER UP
On insertion of an AAAA battery (Energizer E96), the display will show the following:
1.
2.
3.
4.
5.
Firmware version (1.04)
Temperature in Centigrade
Battery voltage in Volts
The time of 12:00A
This sequence then repeats from 2
 2010 Microchip Technology Inc.
DS41448A-page 10
Operating Instructions
2.3
SETTING TIME AND FORMATS
FIGURE 2-2:
MODE AND SET BUTTONS
1. To enter the setup, press and hold the MODE button. After approximately 3
seconds, the hours should start flashing. Release the MODE button.
2. You can now set the hours by pressing and holding the SET button.
3. Press MODE until the minutes are flashing, then release the button.
4. You can now set the minutes by pressing and holding the SET button.
5. Press MODE until the , or is flashing, then release the button.
6. You can now choose between AM, PM and 24 hour modes
7. Press MODE until the temperature is displayed and the or is flashing, then
release the button.
8. You can now select between Centigrade and Fahrenheit by pressing SET.
9. Pressing MODE will now return you to the normal display.
2.4
ADDITIONAL INFORMATION
2.4.1
Boost Supply
The MCP1624 is a compact, high-efficiency, fixed frequency, synchronous step-up
DC-DC converter. It provides an easy-to-use power supply solution for applications
powered by one battery, making it ideal for this demonstration.
Low-voltage technology allows the regulator to start-up without high in-rush current or
output voltage overshoot from a low 0.65V input. High efficiency is accomplished by
integrating the low resistance N-Channel Boost switch and the synchronous P-Channel
switch. All compensation and protection circuitry are integrated to minimize external
components. For standby applications, the MCP1624 operates and consumes only 19
μA while operating at no load. Output voltage is set by a small external resistor divider.
Testing the AAAA LCD Clock Demo shows that the power supply would keep running
well below 0.65V. However, it is not recommended to run an alkaline battery at less
than 0.6V since the battery could corrode and potentially leak. An optional circuit can
be used to prevent current drain below 0.6V, which is described later in this user’s
guide.
For more information, please refer to the MCP1624 data sheet.
 2010 Microchip Technology Inc.
DS41448A-page 11
AAAA LCD Clock Demo User’s Guide
2.4.2
Capacitive Sense
This demonstration uses the Capacitive Voltage Divider (CVD) method for its simplicity
of operation and relatively low power consumption.
The AAAA LCD Clock Demo board runs the capacitive touch as part of the interrupt
routine every time the processor wakes from Sleep. In v1.04, this interrupt occurs eight
times per second giving enough samples to have a responsive button press without
consuming excessive amounts of power. Power consumption could be further reduced
by sampling at a slower rate until the first user touch is made.
For detailed information about CVD, please refer to AN1298 “Capacitive Touch Using
Only an ADC (CVD)”.
2.4.3
LCD
The PIC16LF1933 has a built-in multiplexed LCD peripheral driving the custom LCD
used. There are modes available that allow lower power consumption. However, these
are not used in this demo, so it is possible to reduce the power consumption further.
Source code to do this may be provided at a later date.
The LCD layout is shown in Figure 2-3.
FIGURE 2-3:
LCD LAYOUT
Because of the limited pins on the part used, the chevrons and one of the smaller
7-segment digits are not implemented, so only 48 out of the 64 segments are used in
this demo.
The full data sheet for this display can be downloaded from
http://www.microchip.com/AAAA.
This display is multiplexed in a 4x16 configuration with a total of 64 segments.
Driving conditions for the LCD are 1/4 Duty, 1/3 Bias, 3.3V.
The files lcd.c and lcd.h configure the LCD driver, map the individual LCD segments and create a basic character set that is used in the clock demo. This simple LCD
driver can easily be modified for use with other LCD displays and PIC microcontrollers.
The LCD controller is configured to use the medium power reference, which gives a
better contrast ratio and runs off the 32.768 KHz external oscillator. There are more
power efficient modes that can be used, but the contrast on the LCD will be reduced.
One of the LCD controller options shares the time between the higher power reference
and the low power reference. This reduces the average power consumption while still
maintaining good contrast. For details, see the PIC16F1933 Data Sheet section 26.4.3
“Automatic Power Mode Switching”, since it explains in detail how this mode operates
and can reduce power consumption.
2.4.4
Crystal Capacitor Calculation
The 32.768 KHz crystal for keeping time requires careful selection of the load capacitors. If the incorrect values are used, the time can be incorrect by minutes in a day.
Using a 20 ppm crystal, the clock should be able to achieve an accuracy of +/- 1.73
seconds per day (10.51minutes/year) or better.
DS41448A-page 12
 2010 Microchip Technology Inc.
Operating Instructions
To achieve this, the following information is needed:
1. The expected total capacitance loading on the crystal, usually given in the
crystal’s data sheet.
2. The total capacitance of the PCB and Microcontroller on the oscillator pins.
On the AAAA Clock Demo board, an Abracon ABS13-32.768 KHz-T crystal was used.
From its data sheet, this crystal requires an effective loading capacitance (CL) of 12.5
pF. Measuring the Capacitance of the OSC pins on the PIC16F1933 was around 1 pF.
The stray capacitance of the PCB was measured around 1 pF.
The equivalent circuit is shown in Figure 2-4.
FIGURE 2-4:
EQUIVALENT CIRCUIT
CSTRAY
CRYSTAL
CIN C1
C2
COUT
CL is the total load capacitance that the crystal sees. From this circuit, the calculation
is as follows:
EQUATION 2-1:
 CIN + C1  x  COUT + C2 
CL = ------------------------------------------------------------------------- + CSTRAY
CIN + COUT + C1 + C2
We need to solve for C1 and C2. Since we want C1 = C2, and since CIN = COUT, we
can use the following calculation:
EQUATION 2-2:
C1 + CIN  x  C1 + CIN  + CSTRAY
CL = ---------------------------------------------------------------- C1 + CIN  x 2
C1 + CIN
CL – STRAY = -----------------------2
C1 + CIN =  CL – CSTRAY  x 2
C1 =   CL – CSTRAY  x 2  – CIN
C1 =   12.5 – 1  x 2  – 1
C1 = C2 = 22pF
This is a standard value capacitor which was then fitted to the board and tested over a
72 hour period. Compared to an accurate clock, the time shift over the 72 hours was
less than 1 second, which is well within the 20 ppm specified for the crystal.
For more information, please read “Design Practices for Low-Power External Oscillators” (AN1288).
 2010 Microchip Technology Inc.
DS41448A-page 13
AAAA LCD Clock Demo User’s Guide
2.4.5
Temperature Sensor
An MCP9701A analog temperature sensor is used on this board. The default software
only allows for temperatures greater than zero degrees Centigrade.
The 10-bit ADC is used with the 2.048V internal voltage reference. The MCP9701A
uses 19.5 mV / °C and 0°C offset of 400 mV. To save power, the following sequence is
performed:
1.
2.
3.
4.
Power up the MCP9701A and the internal 2.048V reference.
Delay to allow outputs to stabilize.
Sample the ADC.
Power down the MCP9701A.
Calculating the temperature is done as follows:
1. Take the 10-bit result and multiply it by two (left shift by one bit). The resulting
value is now mV due to using the 2.048V reference.
2. Subtract 400 mV from the result.
3. Multiply by 10 since we are doing integer math only.
4. Divide by 195 (19.5 mV per °C x 10 = 195)
5. The result is now in °C (Tc)
To convert to °F (Tf), the standard formula is:
EQUATION 2-3:
Tf =  9 / 5  x Tc + 32
Since 9/5 = 1.8 and we are using integer math, the following calculation can be used:
EQUATION 2-4:
Tf =   18 * Tc  /10  + 32
The source code differs slightly because an additional x10 has been used after calculating °C. This was done to shift the resulting value one digit to the left so that or
could be displayed to the right of the temperature.
Using an MCP9700 temperature sensor would have simplified the math, since it uses
10 mV/°C. Since the LSB is 2 mV, this gives 5 LSBs per °C. The MCP9701 uses 19.5
mV/°C, which gives close to 10 LSBs per °C. This is ideal if we want to display 1/10°C
on the display.
DS41448A-page 14
 2010 Microchip Technology Inc.
AAAA LCD CLOCK DEMO
USER’S GUIDE
Chapter 3. Bill of Materials
TABLE 3-1:
Qty
BILL OF MATERIALS
Part
Value
Manufacturer
Manufacturer Part#
Digikey Part#
CAPACITORS
3
C1,C4,C9
0.1µF
Generic X7R
490-1524-2-ND
2
C2,C3
22 pF
Generic COG
445-1273-2-ND
1
C5
4.7µF
Generic Y5V
PCC2474TR-ND
1
C6
10 µF
Generic Y5V
445-1593-2-ND
1
R1
100K
Generic 5%
RMCF1/16100KJRTR-ND
1
R2
976K 1%
Generic 1%
311-976KHRCT-ND
1
R3
562K 1%
Generic 1%
311-562KHRTR-ND
1
R4
10K
Generic 5%
RMCF1/1610KJRTR-ND
2
R5,R8
4.7K
Generic 5%
RMCF1/164.7KJRTR-ND
1
R11
1K
Generic 5%
RMCF1/161KJRTR-ND
1
C8
0R
Populate C8 with 0R
RMCF1/160RTR-ND
1
L1
4.7µH
Murata
1
LCD1
Custom
Focus Displays
RESISTORS
INDUCTORS
LQM21FN4R7M70L
490-4028-2-ND
LCD
SEMICONDUCTOR
1
U1
PIC16LF1933
Microchip
1
U2
MCP9701AT
Microchip
PIC16LF1933-I/SO
MCP9701AT-E/TT
1
U3
MCP1624
Microchip
MCP1624T-I/CHY
1
Y2
32.768 KHz
ABRACON
ABS13-32.768KHZ-T
CRYSTAL
535-9165-2-ND
MISC
1
B2
AAAA
Energizer
UM6
1
AAAA Battery
AAAA Battery
Energizer
E96
 2010 Microchip Technology Inc.
DS41448A-page 15
AAAA LCD CLOCK DEMO
USER’S GUIDE
Chapter 4. Optional Features
Appendix A. “Schematic Diagram” shows additional options to program the clock,
add a piezo buzzer and an auto power-down option.
4.1
PROGRAMMING PORT
The programming port is based on the PICkit™ 3 header. To program the AAAA Clock
demo, there are two options for connecting to the board using a PICkit 3.
Option 1: Using a 0.1”x6-way pin header, insert it into the PICkit 3 and hold onto the
surface mount pads to program the part. The plastic stand will need to be
removed to do this, and it is not 100% reliable. Pogo pins would improve
reliability.
Option 2: Solder a 0.1”x6-way pin header to the surface mount pads. Use hot glue
to secure the header to the board to prevent it from breaking tracks. This
method is more difficult to implement, but is more reliable if you intend to
connect to the programmer on a regular basis. The hot glue is a crucial
step; if it is missed, the pads will delaminate and break connection after a
few uses.
4.2
THE PIEZO BUZZER
Connector J4 can be used to connect a disc type piezo buzzer to add an audible alarm
option. This pin is connected to RC6, which is the PWM output channel P3A. It is possible to add code to set the time for an alarm, and then use PWM to drive the Piezo to
generate a suitable alarm sound.
Please note that if the auto power-down circuit is used, you cannot add the piezo
buzzer.
4.3
AUTO POWER-DOWN
Since running a single cell battery below 0.6V risks battery leakage, there is an option
to add a self-booting and auto power-down circuit. Remove the resistor in C8’s position
and then add C8, R9 and R10, as shown in the schematic in Appendix A.
The theory behind this circuit is that when a fresh battery is inserted, the voltage at pin
2 on the MCP1624 spikes to 1.5V because of capacitor C8. The MCP1624 then starts
and remains running long enough to pull the EN pin high through R9. The
PIC16LF1933 checks the battery on a regular basis and, if the voltage on the battery
drops below a specific threshold (for example 0.63V), it then pulls the EN pin on the
MCP1624 Low, which turns the power supply off.
It may also be possible to use this feature to shut off the regulator for short periods of
time to let the output voltage drift down a little, then re-enable it to boost back up. This
may help reduce the overall power consumption by reducing the average quiescent
current used by the regulator itself. This would only be effective when the circuitry the
regulator is supplying is in its minimum current draw mode. Larger capacitance on the
3.3V rail may extend the time that the regulator can be off.
Please note that none of the above has been tested.
 2010 Microchip Technology Inc.
DS41448A-page 16
Optional Features
4.4
ENERGIZER AAAA (E96) BATTERY
The AAAA Clock Demo uses the Energizer E96, which is smaller than an AAA.
At the time of document publication, the AAAA was a very new release of battery which
is ideal for products that need a smaller diameter, for example laser pointers, LED
flashlights and other pen size devices.
•
•
•
•
Max Diameter: 8.3 mm (0.327”)
Max Length: 42.5 mm (1.673”)
Typical Weight: 6.5 grams (0.2 oz)
Nominal Capacity: 600 mA/H @ 10 mA (continuous discharge down to 0.8V)
For the Energizer E96 data sheet, refer to: http://data.energizer.com/PDFs/E96.pdf.
Note: Energizer and other marks are trademarks of Energizer and are used with
permission. Energizer is not affiliated with Microchip Technology Inc.
 2010 Microchip Technology Inc.
DS41448A-page 17
AAAA LCD CLOCK DEMO
USER’S GUIDE
Appendix A. Schematic Diagram
FIGURE A-1:
SCHEMATICS
 2010 Microchip Technology Inc.
DS41448A-page 18
AAAA LCD CLOCK DEMO
USER’S GUIDE
Index
Numerics
W
32.768 KHz Crystal .................................................... 9
500 KHz Oscillator ..................................................... 9
WWW Address........................................................... 7
A
AAAA Battery ........................................................... 10
B
Battery Level Indicator ............................................. 10
Battery Voltage ........................................................ 10
C
Customer Notification Service.................................... 8
Customer Support ...................................................... 8
D
Documentation
Conventions ........................................................ 6
Layout ................................................................. 5
E
Energizer E96 .......................................................... 10
I
Internet Address......................................................... 7
L
LCD Layout .............................................................. 10
lcd.c.......................................................................... 12
lcd.h ......................................................................... 12
M
Microchip Internet Web Site ....................................... 7
Microchip Technology Inc. logo................................ 10
MODE Button ........................................................... 11
Multiplexed LCD....................................................... 12
P
PIC16F1933 Data Sheet .......................................... 12
PICkit™ 2 ................................................................... 9
PICkit™ 3 ................................................................... 9
Piezo Buzzer .............................................................. 9
R
Reading, Recommended ........................................... 7
S
SET Button............................................................... 11
T
Temperature ............................................................ 10
Centigrade ........................................................ 11
Fahrenheit......................................................... 11
 2010 Microchip Technology Inc.
DS41448A-page 19
Worldwide Sales and Service
AMERICAS
ASIA/PACIFIC
ASIA/PACIFIC
EUROPE
Corporate Office
2355 West Chandler Blvd.
Chandler, AZ 85224-6199
Tel: 480-792-7200
Fax: 480-792-7277
Technical Support:
http://support.microchip.com
Web Address:
www.microchip.com
Asia Pacific Office
Suites 3707-14, 37th Floor
Tower 6, The Gateway
Harbour City, Kowloon
Hong Kong
Tel: 852-2401-1200
Fax: 852-2401-3431
India - Bangalore
Tel: 91-80-3090-4444
Fax: 91-80-3090-4123
India - New Delhi
Tel: 91-11-4160-8631
Fax: 91-11-4160-8632
Austria - Wels
Tel: 43-7242-2244-39
Fax: 43-7242-2244-393
Denmark - Copenhagen
Tel: 45-4450-2828
Fax: 45-4485-2829
India - Pune
Tel: 91-20-2566-1512
Fax: 91-20-2566-1513
France - Paris
Tel: 33-1-69-53-63-20
Fax: 33-1-69-30-90-79
Japan - Yokohama
Tel: 81-45-471- 6166
Fax: 81-45-471-6122
Germany - Munich
Tel: 49-89-627-144-0
Fax: 49-89-627-144-44
Atlanta
Duluth, GA
Tel: 678-957-9614
Fax: 678-957-1455
Boston
Westborough, MA
Tel: 774-760-0087
Fax: 774-760-0088
Chicago
Itasca, IL
Tel: 630-285-0071
Fax: 630-285-0075
Cleveland
Independence, OH
Tel: 216-447-0464
Fax: 216-447-0643
Dallas
Addison, TX
Tel: 972-818-7423
Fax: 972-818-2924
Detroit
Farmington Hills, MI
Tel: 248-538-2250
Fax: 248-538-2260
Kokomo
Kokomo, IN
Tel: 765-864-8360
Fax: 765-864-8387
Los Angeles
Mission Viejo, CA
Tel: 949-462-9523
Fax: 949-462-9608
Santa Clara
Santa Clara, CA
Tel: 408-961-6444
Fax: 408-961-6445
Toronto
Mississauga, Ontario,
Canada
Tel: 905-673-0699
Fax: 905-673-6509
Australia - Sydney
Tel: 61-2-9868-6733
Fax: 61-2-9868-6755
China - Beijing
Tel: 86-10-8528-2100
Fax: 86-10-8528-2104
China - Chengdu
Tel: 86-28-8665-5511
Fax: 86-28-8665-7889
Korea - Daegu
Tel: 82-53-744-4301
Fax: 82-53-744-4302
China - Chongqing
Tel: 86-23-8980-9588
Fax: 86-23-8980-9500
Korea - Seoul
Tel: 82-2-554-7200
Fax: 82-2-558-5932 or
82-2-558-5934
China - Hong Kong SAR
Tel: 852-2401-1200
Fax: 852-2401-3431
Malaysia - Kuala Lumpur
Tel: 60-3-6201-9857
Fax: 60-3-6201-9859
China - Nanjing
Tel: 86-25-8473-2460
Fax: 86-25-8473-2470
Malaysia - Penang
Tel: 60-4-227-8870
Fax: 60-4-227-4068
China - Qingdao
Tel: 86-532-8502-7355
Fax: 86-532-8502-7205
Philippines - Manila
Tel: 63-2-634-9065
Fax: 63-2-634-9069
China - Shanghai
Tel: 86-21-5407-5533
Fax: 86-21-5407-5066
Singapore
Tel: 65-6334-8870
Fax: 65-6334-8850
China - Shenyang
Tel: 86-24-2334-2829
Fax: 86-24-2334-2393
Taiwan - Hsin Chu
Tel: 886-3-6578-300
Fax: 886-3-6578-370
China - Shenzhen
Tel: 86-755-8203-2660
Fax: 86-755-8203-1760
Taiwan - Kaohsiung
Tel: 886-7-213-7830
Fax: 886-7-330-9305
China - Wuhan
Tel: 86-27-5980-5300
Fax: 86-27-5980-5118
Taiwan - Taipei
Tel: 886-2-2500-6610
Fax: 886-2-2508-0102
China - Xian
Tel: 86-29-8833-7252
Fax: 86-29-8833-7256
Thailand - Bangkok
Tel: 66-2-694-1351
Fax: 66-2-694-1350
Italy - Milan
Tel: 39-0331-742611
Fax: 39-0331-466781
Netherlands - Drunen
Tel: 31-416-690399
Fax: 31-416-690340
Spain - Madrid
Tel: 34-91-708-08-90
Fax: 34-91-708-08-91
UK - Wokingham
Tel: 44-118-921-5869
Fax: 44-118-921-5820
China - Xiamen
Tel: 86-592-2388138
Fax: 86-592-2388130
China - Zhuhai
Tel: 86-756-3210040
Fax: 86-756-3210049
08/04/10
DS41448A-page 20
 2010 Microchip Technology Inc.
Similar pages