PIC18F45K20-I/ML Microchip Technology, PIC18F45K20-I/ML Datasheet - Page 37

IC PIC MCU FLASH 16KX16 44QFN

PIC18F45K20-I/ML

Manufacturer Part Number
PIC18F45K20-I/ML
Description
IC PIC MCU FLASH 16KX16 44QFN
Manufacturer
Microchip Technology
Series
PIC® XLP™ 18Fr

Specifications of PIC18F45K20-I/ML

Program Memory Type
FLASH
Program Memory Size
32KB (16K x 16)
Package / Case
44-QFN
Core Processor
PIC
Core Size
8-Bit
Speed
64MHz
Connectivity
I²C, SPI, UART/USART
Peripherals
Brown-out Detect/Reset, HLVD, POR, PWM, WDT
Number Of I /o
35
Eeprom Size
256 x 8
Ram Size
1.5K x 8
Voltage - Supply (vcc/vdd)
1.8 V ~ 3.6 V
Data Converters
A/D 14x10b
Oscillator Type
Internal
Operating Temperature
-40°C ~ 85°C
Processor Series
PIC18F
Core
PIC
Data Bus Width
8 bit
Data Ram Size
1.5 KB
Interface Type
CCP/ECCP/EUSART/I2C/MSSP/SPI
Maximum Clock Frequency
64 MHz
Number Of Programmable I/os
36
Number Of Timers
4
Maximum Operating Temperature
+ 85 C
Mounting Style
SMD/SMT
3rd Party Development Tools
52715-96, 52716-328, 52717-734, 52712-325, EWPIC18
Development Tools By Supplier
PG164130, DV164035, DV244005, DV164005, PG164120, DV164136
Minimum Operating Temperature
- 40 C
On-chip Adc
14-ch x 10-bit
Package
44QFN EP
Device Core
PIC
Family Name
PIC18
Maximum Speed
64 MHz
Operating Supply Voltage
2.5|3.3 V
Lead Free Status / RoHS Status
Lead free / RoHS Compliant
For Use With
DM240313 - BOARD DEMO 8BIT XLPAC164112 - VOLTAGE LIMITER MPLAB ICD2 VPPDM164124 - KIT STARTER FOR PIC18F4XK20AC164322 - MODULE SOCKET MPLAB PM3 28/44QFN
Lead Free Status / Rohs Status
Lead free / RoHS Compliant
3.5
FIGURE 3-24:
© 2009 Microchip Technology Inc.
TCY (Fosc / 4)
or T0 CKI Pin
LESSON 5: USING TIMER0
Prescaler may be set to
divide by 2, 4, 8, 16, 32,
64, 128, or 256.
Prescaler
Timer0 is used to time delays while rotating the demo board LEDs, instead of using
program loop delays. The demo board switch reverses the direction of the rotation.
3.5.1
The Timer0 module is the timer/counter peripheral of the PIC18FXXXX microcontroller
that may be used to count oscillator clock cycles or external events on the T0CKI pin.
It can be configured as an 8-bit or 16-bit timer, which means it can count from 0 to 255
or 0 to 65535. A bit flag is set when the counter rolls over from the maximum value back
to zero.
The Timer0 module also includes an optional prescaler, which may be configured to
divide the timer clock source before it reaches the timer/counter itself. For example,
with a 1:1 prescaler, the timer would increment once every instruction clock cycle.
(Remember that the instruction clock cycle TCY is the F
1:8 prescaler, the timer would increment once every eight clock cycles. The prescaler
is cleared on every write to the timer.
SIMPLIFIED 16-BIT TIMER0 BLOCK DIAGRAM
When Timer0 is configured as a 16-bit timer, care must be taken when reading and
writing the timer value. The lower byte of the timer is directly readable and writable as
the SFR TMR0L. However, the high byte is not directly accessible. Instead, it is
buffered through the SFR TMR0H. TMR0H is updated with the value of timer high byte
when TMR0L is read. A write of TMR0L also writes the contents of TMR0H to the
Timer0 high byte. This allows the entire 16-bit timer to be read or written at once.
Therefore, to read the timer, always read TMR0L first, then TMR0H. To write the timer,
always write TMR0H first then TMR0L.
Timer0 operation is controlled by the T0CON SFR, shown in Figure 3-24.
Key Concepts
- Timer0 is hardware counter implemented in the microcontroller that can
- Using a timer instead of processor delay loops frees up the processor to do
- A timer “prescaler” sets the number of clock cycles or events required to
count clock cycles or external events.
useful work instead of counting cycles.
increment the timer by 1, allowing it to be run faster or slower off the same
frequency clock.
The PIC18F45K20 Timer0 Module
PICkit™ 3 Debug Express Lessons
Timer high byte is buffered into TMR0H on a read of TMR0L.
TMR0H is written to timer high byte on TMR0L write.
TMR0L
High Byte
TMR0H
TMR0
OSC
Flag bit set when TMR0
overflows, and must be
cleared in software.
oscillator clock/4.) With a
TMR0IF Bit
INTCON
DS41370C-page 33

Related parts for PIC18F45K20-I/ML