DM163045 Microchip Technology, DM163045 Datasheet - Page 82

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
PICDEM
DS41369A-page 78
TM
The Initialize() configures the peripherals as follows:
• Ports
• ADC
Next, the Get_Inputs() performs an ADC on the voltage present on pin 13. The
internal capacitor connected to the input of the ADC peripheral needs time to charge to
the voltage present on the pin. Therefore, software will need to implement a short delay
to allow for this charging time. The ADC Module section “A/D Acquisition Require-
ments” of the data sheet goes into great detail and includes an equation for selecting
an appropriate acquisition time. For the purposes of this lab, a simple 1mS delay
should be more than sufficient. These parameters become important in high-speed
applications where every μS counts.
The GO/DONE bit in ADCON0 is used to start the ADC process when set to ‘1’. This
bit also serves as a flag that indicates when the ADC is completed (GO/DONE = 0).
Therefore, the Get_Inputs() initiates an ADC by setting GO/DONE then sits and
waits for the bit to clear indicating a completed conversion.
The software flowchart for the Get_Inputs() is shown in Figure 5-3.
Lab Development Board User’s Guide
- Configure pin 13 as an analog input (using TRISB4).
- Clear the PORTC register.
- Configure RC0, RC1, RC2 and RC3 pins as digital output.
- Select ADC conversion clock F
- Configure voltage reference using V
- Select channel 10 as the ADC input channel (Pin 13: RB4/AN10).
- Select result format left justified (10-bit result in ADRESH<7:0> and
- Turn on ADC module.
Note:
ADRESL<7:6>).
The ADC conversion clock is the time that will be used to convert the analog
voltage present on pin 13 to a 10-bit value in the ADRESH:ADRESL regis-
ters. It takes 11 of these conversion clock cycles to perform a complete
ADC. If the conversion clock period is insufficient, an incomplete ADC result
will occur. The electrical specifications for the PIC16F690 state that the
conversion clock must have a period of at least 1.5
quency of approximately 667 kHz. The ADC Module section of the data
sheet specifies acceptable conversion clock frequencies depending on the
main oscillator used to drive the microcontroller and should be referenced.
In this application, a dedicated internal oscillator for the ADC module is
used ensuring a conversion clock frequency of between 2-6
(see Table 17-16 in Section 17 of the PIC16F690 Data Sheet).
RC .
DD
.
© 2009 Microchip Technology Inc.
μ
Seconds or a fre-
μ
Seconds.

Related parts for DM163045