Device Overview 1. The advantages of all PIC18Fxxxx microcontrollers: High computational...

Post on 17-Jan-2018

221 views 0 download

description

3

Transcript of Device Overview 1. The advantages of all PIC18Fxxxx microcontrollers: High computational...

Chapter 2

Device Overview

1

PIC 18F4520

The advantages of all PIC18Fxxxx microcontrollers:

High computational performance High-endurance Enhanced Flash program memory

2

PIC18F4520 Diagram

3

Power Management Features

Run: CPU on, Peripherals on Idle: CPU off, Peripherals on Sleep: CPU off, Peripherals off

Run mode 11 μA Typical Idle mode 2.5 μA Typical Sleep mode 100 nA Typical

Ultra Low 50nA Input Leakage Two-Speed Oscillator Start-up

4

Flexible Oscillator Structure Four Crystal modes, up to 40 MHz 4x Phase Lock Loop (PLL) – Available for Crystal

and Internal Oscillators Two External RC modes, up to 4 MHz Two External Clock modes, up to 40 MHz Internal Oscillator Block:

Fast wake from Sleep and Idle, 1 μs typical

Secondary Oscillator using Timer1 @ 32 kHz Fail-Safe Clock Monitor:

Allows for safe shutdown if peripheral clock stops

5

Peripheral Highlights

High-Current Sink/Source 25 mA/25 Ma Three Programmable External Interrupts Four Input Change Interrupts Enhanced Capture/Compare/PWM (ECCP)

module One, two or four PWM outputs Selectable polarity Programmable dead time Auto-shutdown and auto-restart

6

Peripheral Highlights

Enhanced Addressable USART module: Supports RS-485, RS-232 and LIN/J2602

10-Bit, up to 13-Channel Analog-to-Digital Converter module:

Auto-acquisition capability

Dual Analog Comparators with Input Multiplexing

7

NanoWatt TECHNOLOGY

Alternate Run Modes

Multiple Idle Modes

On-the-Fly Mode Switching

Low Consumption in Key Modules

8

Alternate Run Modes

By clocking the controller from the Timer1 source or the internal oscillator block, power consumption during code execution can be reduced by 90%.

9

Multiple Idle Modes

CPU core disabled but the peripherals still active.

Power consumption can be reduced even further, to as little as 4% of normal operation requirements.

10

On-the-Fly Mode Switching

The power managed modes are invoked by user code during operation

Allowing the user to incorporate power-saving ideas into their application’s software design

11

Low Consumption in Key Modules

The power requirements for both Timer1 and the Watchdog Timer are minimized

12

Other Special Features

Memory Endurance Self-Programmability Extended Instruction Set Enhanced CCP Module Enhanced Addressable USART 10-Bit A/D Converter Extended Watchdog Timer (WDT)

13

Memory Endurance

The Enhanced Flash cells are rated to last for many thousands of erase/write cycles.

Data retention without refresh is conservatively estimated to be greater than 40 years.

14

Self-Programmability

These devices can write to their own program memory spaces under internal software control.

possible to create an application that can update itself in the field.

15

Extended Instruction Set

Introduces an optional extension to the PIC18 instruction set: which adds 8 new instructions and an Indexed Addressing mode.

Enabled as a device configuration option: designed to optimize re-entrant

application code originally developed in high-level languages.

16

Enhanced CCP Module

In PWM mode, this module provides: 1, 2 or 4 modulated outputs for

controlling half-bridge and full-bridge drivers.

Auto-shutdown: for disabling PWM outputs on interrupt, or

other select conditions, and auto-restart to reactivate outputs once the

condition has cleared.17

Enhanced Addressable USART

Standard RS-232 operation Provides support for the LIN bus protocol. Automatic baud rate detection A 16-bit Baud Rate Generator for improved

resolution. Provides stable operation that talk to the outside

world.

18

10-Bit A/D Converter

This module incorporates programmable acquisition time.

Allowing for a channel to be selected A conversion to be initiated without waiting for a

sampling period Reducing code overhead.

19

Extended Watchdog Timer (WDT)

Incorporates a 16-bit prescaler allowing an extended time-out range stable across operating voltage and

temperature.

20

Device Features

21

Block Diagram

22

PORTA

23

X RA1 / AN1

X RA0 / AN0

X RA3 / AN3 / Vref +

X RA2 / AN2 /Vref - / cvREF

X RA5 / AN5/SS/

X RA4 / TOCK / C1OUT

X OSC1/CLK1 / RA7 AN0

X OSC2 / CLK0/ RA6

PIC

PORTA is a bidirectional I/O port

PORTB

24

X RB1 / INT1/AN10

X RB0 / NT0/FLTO/AN12

X RB3 / AN9 / CCP2

X RB2 / INT2 / AN8

X RB5 / KB1/ PGM

X RB4 / KB0 / AN11

X RB7C/CKB3 / PGO

X RB6 / KB2 / PGC

PIC

PORTB is a bidirectional I/O port

PORTC

25

X RC1 / T1OS /CCP2

X RC0 /T1OS0 /T13CK1

X RC3 /SCK/SCL

X RC2 / CCP1 /P1A

X RC5 / SD0

X RC4 / SO1 /SDA

X RC7 /RX /DT

X RC6 /TX /CK

PIC

PORTC is a bidirectional I/O port

PORTD

26

X RD5 / PSP5 /P1B

X RD0 /PSP0;RD4 / PSP4

X RD7 / PSP7 / P1D

X RD6 / PSP6/ P1CPIC

PORTD is a bidirectional I/O port or a Parallel Slave port

PORTE

27

X RE1 /WR / AN6

X RE0 /RD / AN5

X MCLR / Vpp / RE3

X RE2 / CS / AN7

PIC

PORTE is a bidirectional I/O port