DM163045 Microchip Technology, DM163045 Datasheet - Page 90

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 86
TM
The audible frequency range is between 20-20000Hz. Therefore, the Timing()
delays from a maximum of 4.096 mS (244.1Hz) to a minimum of 1.536 mS (651Hz).
These values are determined using the internal instruction clock (F
clock source with a prescaler of 1:16. Other values could easily be used as long as the
frequency of the PWM remains within the audible range.
The software flowchart for this lab is shown in Figure 5-6.
FIGURE 5-6:
The Initialize() configures the peripherals as follows:
• Ports
• Timer0
• ADC
Lab Development Board User’s Guide
- Clear PORTB.
- Configure pin 13 as an analog input (using TRISB4).
- Clear the PORTC register.
- Configure RC0 pin as digital output.
- Select the F
- Increment TMR0 on the low-to-high transition of F
- Assign the prescaler to Timer0 and configure at a rate of 1:16.
- 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.
Global variables initialized:
• 8-bit variable TMR0_preload will be used to vary the
ADRESL<7:6>).
delay in Timing() to alter the frequency of the
PWM output on RC0
OSC
/4 internal instruction clock as the Timer0 clock source.
MAIN() SOFTWARE CONTROL LOOP FLOWCHART FOR
ADC LAB 2
Loop Forever
RC .
DD
.
OSC
Initialize()
Get_Inputs()
Do_Outputs()
Decide()
/4.
© 2009 Microchip Technology Inc.
Timing()
main()
OSC
/4) as the TMR0

Related parts for DM163045