Microchip Technology PICDEM Mechatronics Demo Board DM163029 DM163029 User Manual

Product codes
DM163029
Page of 64
Example Projects
©
 2006 Microchip Technology Inc.
DS51557C-page 27
2.3.4
Project 4: Digital Clock Using Timer1
Most appliances that have a LCD show a clock readout when the appliance is not in 
use. In this project, Timer1 is used to create a real-time clock readout on the LCD.
Objectives
1.
Configure the PIC16F917 to use the 32.768 kHz crystal to clock Timer1.
2.
Convert Timer1 into seconds, minutes and hours.
Applicable Technical Documents
Clock Design Using Low Power/Cost Techniques Application Note, AN615 (DS00615)
Jumper Configuration
• T1OSI (J13) to OSI (J4) – See note.
• T1OSO (J13) to OSO (J4) – See note.
• RA3 (J13) to SW2 (J4)
• RA4 (J13) to SW3 (J4)
• RA5 (J13) to SW4 (J4)
FIGURE 2-8:
PROJECT 4: JUMPER DIAGRAM
Note:
Crystal circuits are very sensitive to noise and stray capacitances. In 
general, the traces between a crystal and a microcontroller should be as 
short as possible. The reason the PICDEM Mechatronics Demo Board 
strayed from good design practice was to give you the option to use pins 
RA7 and RA6 for other functions.