DM163045 Microchip Technology, DM163045 Datasheet - Page 77

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 4-5:
//Configure RC0,RC1,RC2 and RC3 as digital outputs
//Initialize PORTA pin connected to C12IN0-
//Make C1OUT pin an output
//Configure the Comparator 1 as follows:
//Turn on comparator 1
//Make C1OUT available externally
//Connect the non-inverting reference to CVREF
//Connect the inverting reference to C12IN0-
//Configure the CVREF as follows:
//Route CVREF output to Comparator 1 non-inverting reference
//Enable the 0.6V fixed reference voltage
//Configure Timer1 as follows
//Make T1CKI and input
//Select T1CKI as Timer1's clock source
//Initialize the 16-bit Timer1 register pair to 0
//Turn on Timer1
//Set up Timer0 as follows:
//Use FOSC/4 for Timer0 Clock Source
//assign the prescaler to TMR0
//set up prescaler for 1:256
//Enable Timer0 Interrupts
//Clear the Timer0 overflow interrupt flag
//Preload TMR0 with 10 to keep overflow period
//less than Timer1 overflow period
//Enable global interrupts
ANSEL = 0b00001111;
PORTC = 0;
TRISC0 = 0;
TRISC1 = 0;
TRISC2 = 0;
TRISC3 = 0;
TRISA1 = 1;
TRISA2 = 0;
C1ON = 1;
C1OE = 1;
C1R = 1;
C1CH0 = 0;
C1CH1 = 0;
VRCON = 0;
VP6EN = 1;
TRISA5 = 1;
T1CON = 0;
TMR1CS = 1;
TMR1H = 0;
TMR1L = 0;
TMR1ON = 1;
OPTION = 0;
T0CS = 0;
PSA = 0;
PS0 = 1;
PS1 = 1;
PS2 = 1;
T0IE = 1;
T0IF = 0;
TMR0 = 10;
GIE = 1;
INITIALIZE CODE FOR COMPARATOR LAB 3
Comparator Peripheral Labs
DS41369A-page 73

Related parts for DM163045