DM163045 Microchip Technology, DM163045 Datasheet - Page 37

no-image

DM163045

Manufacturer Part Number
DM163045
Description
PICDEM Lab Development Kit (with PICkit 3) General Purpose
Manufacturer
Microchip Technology
Series
PICDEM™r
Type
MCUr
Datasheet

Specifications of DM163045

Contents
Board, PIC kit 3
Lead Free Status / Rohs Status
Lead free / RoHS Compliant
For Use With/related Products
PIC Micro® MCU

Available stocks

Company
Part Number
Manufacturer
Quantity
Price
Part Number:
DM163045
Manufacturer:
MICROCHIP
Quantity:
12 000
© 2009 Microchip Technology Inc.
EXAMPLE 3-9:
3. Finally, copy/paste the code in Example 3-10 into the Timing() over the code
EXAMPLE 3-10:
4. The remaining code from the previous lab remains the same. Compile the proj-
3.3.6.4
Program the PIC16F690. The application should behave exactly as it did in the
previous lab. Using an oscilloscope to test individual PORTC pin level transitions would
be useful to analyze the accuracy of the delay.
The solution for this project is located in the
C:\PICDEM_Lab\GPIO_Labs\GPIO_Lab3\solution directory.
Note:
//Set all PORTC bits HIGH (to a known state)
from the previous lab
ect. There should be no errors.
PORTC = 0b11111111;
//Configure PORTC's ANALOG/DIGITAL pins as all Digital
ANS4 = 0;//Associated with RC0
ANS5 = 0;//Associated with RC1
ANS6 = 0;//Associated with RC2
ANS7 = 0;//Associated with RC3
ANS8 = 0;//Associated with RC6
ANS9 = 0;//Associated with RC7
//Configure PORTC pins as all output
//i.e. 1 = Input, 0 = Output
TRISC0 = 0;//Make RC0 (pin 16) output
TRISC1 = 0;//Make RC1 (pin 15) output
TRISC2 = 0;//Make RC2 (pin 14) output
TRISC3 = 0;//Make RC3 (pin 7) output
TRISC4 = 0;//Make RC4 (pin 6) output
TRISC5 = 0;//Make RC5 (pin 5) output
TRISC6 = 0;//Make RC6 (pin 8) output
TRISC7 = 0;//Make RC7 (pin 9) output
//Configure Timer0 as follows:
T0CS = 0; //Use the internal instruction clock
T0SE = 0;//Increment TMR0 on low-to-high
PSA = 0;//Assign the prescaler to
//Configure Timer0 prescaler to increment
//TMR0 every 256 FOSC/4 clock transitions
PS0 = 1;
PS1 = 1;
PS2 = 1;
Delay_1S(); //Call the 1 second delay
TESTING THE APPLICATION
More in-depth tutorials on the Timer0 peripheral are covered in “Timers:
Timer0 Tutorial (Part 1)” (5162a.pdf) and “Timers: Timer0 Tutorial (Part 2)”
(51702a.pdf) files included on the PICDEM™ Lab Development Kit CD.
General Purpose Input/Output Labs
//FOSC/4 as the clock source
//FOSC/4 transition
//Timer0
INITIALIZE() CODE FOR LAB 3
TIMING() CODE FOR LAB 3
DS41369A-page 33

Related parts for DM163045