DM163045 Microchip Technology, DM163045 Datasheet - Page 34

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 30
TM
Finally, TMR0 is a writable register. Meaning that a value can be added to the register
to offset the number of counts it takes for the overflow to occur. Equation 3-3 demon-
strates how to calculate the value to preload the TMR0 register with to create a 10mS
overflow period.
EQUATION 3-3:
The software flowchart to implement a 10mS delay is shown in Figure 3-13.
FIGURE 3-13:
prescaler is as shown in Equation 3-4.
Lab Development Board User’s Guide
The maximum overflow period that can be achieved using Timer0 only utilizes a 1:256
Desired TMR0 Overflow Period = (4/F
Using a 1:64 prescaler setting, a 4 MHz internal oscillator and requiring a 10 mS
overflow period:
10mS = 1
10mS/(1
Preload Value = 256 - [10mS/(1
Preload Value = 99.75 rounded up becomes 100
Therefore, to produce a 10 mS overflow period, using the internal instruction
clock with a 4 MHz internal oscillator and a TMR0 prescaler value of 1:64
requires that TMR0 be preloaded with a value of 100.
μ
μ
Second x 64) = 256 - Preload Value
Second x (256 - Preload Value) x 64
CALCULATING A TMR0 PRELOAD VALUE TO GENERATE A
10MS OVERFLOW PERIOD
DELAY_10MS() USING TIMER0
Preload TMR0 register with 100
Clear the TMR0 overflow flag
Delay_10mS()
T0IF = 0?
μ
(T0IF)
Second x 64)]
END
YES
OSC
) x (256 - Preload Value) x prescaler
NO
© 2009 Microchip Technology Inc.

Related parts for DM163045