User manual

Table Of Contents
General Purpose Input/Output Labs
© 2009 Microchip Technology Inc. DS41369A-page 25
FIGURE 3-9: PICkit 2 PROGRAMMER/DEBUGGER TOOLBAR
8. Press button1 shown in Figure 3-9 to program the PIC16F690.
3.3.4.4 TESTING THE APPLICATION
Once programmed, the LEDs connected to the individual PORTC pins should now
resemble the output shown in Figure 3-10.
FIGURE 3-10: LAB 1 LED OUTPUT
The solution for this project is located in the
C:\PICDEM_Lab\GPIO_Labs\GPIO_Lab1\solution directory.
3.3.5 Lab 2: Flash LEDs (Delay Loop)
3.3.5.1 OVERVIEW
This lab implements a software delay to flash the LEDs connected to the PORTC pins
on/off in 1 second intervals. As configured, the PIC16F690 executes 1 million instruc-
tions per second. At this rate, the software loop execution needs to be slowed down so
that the LED flashing is visible to the eye. This is done using a delay routine within the
Timing() functional block called from the main() software control loop as shown in
Figure 3-11.
Legend:
1. Program the target device
2. Read target device memories
3. Read the target EEDATA memory
4. Verify the contents of the target device
5. Erase the target device memories
6. Verify that target memories are erased
7. Bring target MCLR
to VDD
8. Bring target MCLR to VIL
9. Re-establish PICkit 2 connection
1 2 3 4 5 6 7 8 9
R8
470
R4
470
R7
470
R6
470
R5
470
R3
470
R2
470
R1
470
LED8 LED7 LED6 LED4 LED3 LED2 LED1LED5
V
SSLED ON LED OFF