41639A
41639A
41639A
Data Sheet
14/20-Pin Flash, 8-Bit USB Microcontrollers
with XLP Technology
Preliminary
DS41639A
Note the following details of the code protection feature on Microchip devices:
Microchip products meet the specification contained in their particular Microchip Data Sheet.
Microchip believes that its family of products is one of the most secure families of its kind on the market today, when used in the
intended manner and under normal conditions.
There are dishonest and possibly illegal methods used to breach the code protection feature. All of these methods, to our
knowledge, require using the Microchip products in a manner outside the operating specifications contained in Microchips Data
Sheets. Most likely, the person doing so is engaged in theft of intellectual property.
Microchip is willing to work with the customer who is concerned about the integrity of their code.
Neither Microchip nor any other semiconductor manufacturer can guarantee the security of their code. Code protection does not
mean that we are guaranteeing the product as unbreakable.
Code protection is constantly evolving. We at Microchip are committed to continuously improving the code protection features of our
products. Attempts to break Microchips code protection feature may be a violation of the Digital Millennium Copyright Act. If such acts
allow unauthorized access to your software or other copyrighted work, you may have a right to sue for relief under that Act.
Trademarks
The Microchip name and logo, the Microchip logo, dsPIC,
KEELOQ, KEELOQ logo, MPLAB, PIC, PICmicro, PICSTART,
PIC32 logo, rfPIC and UNI/O are registered trademarks of
Microchip Technology Incorporated in the U.S.A. and other
countries.
FilterLab, Hampshire, HI-TECH C, Linear Active Thermistor,
MXDEV, MXLAB, SEEVAL and The Embedded Control
Solutions Company are registered trademarks of Microchip
Technology Incorporated in the U.S.A.
Analog-for-the-Digital Age, Application Maestro, chipKIT,
chipKIT logo, CodeGuard, dsPICDEM, dsPICDEM.net,
dsPICworks, dsSPEAK, ECAN, ECONOMONITOR,
FanSense, HI-TIDE, In-Circuit Serial Programming, ICSP,
Mindi, MiWi, MPASM, MPLAB Certified logo, MPLIB,
MPLINK, mTouch, Omniscient Code Generation, PICC,
PICC-18, PICDEM, PICDEM.net, PICkit, PICtail, REAL ICE,
rfLAB, Select Mode, Total Endurance, TSHARC,
UniWinDriver, WiperLock and ZENA are trademarks of
Microchip Technology Incorporated in the U.S.A. and other
countries.
SQTP is a service mark of Microchip Technology Incorporated
in the U.S.A.
All other trademarks mentioned herein are property of their
respective companies.
2012, Microchip Technology Incorporated, Printed in the
U.S.A., All Rights Reserved.
Printed on recycled paper.
ISBN: 9781620763476
== ISO/TS 16949 ==
DS41639A-page 2
Preliminary
PIC16(L)F1454/5/9
14/20-Pin, 8-Bit Flash USB Microcontroller with
XLP Technology
High-Performance RISC CPU:
Analog Features(1):
Analog-to-Digital Converter (ADC):
- 10-bit resolution
- Up to nine external channels
- Two internal channels:
- Fixed Voltage Reference channel
- DAC output channel
- Auto acquisition capability
- Conversion available during Sleep
Two Comparators:
- Rail-to-rail inputs
- Power mode control
- Software controllable hysteresis
Voltage Reference module:
- Fixed Voltage Reference (FVR) with 1.024V,
2.048V and 4.096V output levels
Up to One Rail-to-Rail Resistive 5-Bit DAC with
Positive Reference Selection
Note 1:
Preliminary
DS41639A-page 3
PIC16(L)F145X
Peripheral Features:
Up to 14 I/O Pins and Three Input-only Pins:
- High current sink/source 25 mA/25 mA
- Individually programmable weak pull-ups
- Individually programmable
Interrupt-On-Change (IOC) pins
Timer0: 8-Bit Timer/Counter with 8-Bit
Programmable Prescaler
Enhanced Timer1:
- 16-bit timer/counter with prescaler
- External Gate Input mode
Timer2: 8-Bit Timer/Counter with 8-Bit Period
Register, Prescaler and Postscaler
Two 10-bit PWM modules
Complementary Waveform Generator (CWG)(1):
- Up to four selectable signal sources
- Selectable falling and rising edge dead-band
control
- Polarity control
- Up to four auto-shutdown sources
- Multiple input sources: PWM, Comparators
Master Synchronous Serial Port (MSSP) with SPI
and I2C with:
- 7-bit address masking
- SMBus/PMBus compatibility
Enhanced Universal Synchronous
Asynchronous Receiver Transmitter (EUSART):
- RS-232, RS-485 and LIN compatible
- Auto-baud detect
- Auto-wake-up on Start
Note 1:
Note:
DS41639A-page 4
Preliminary
information,
XLP
1
1
PIC16(L)F1455 (1) 8192 1024 11 5
2
1
2/1
2
1
1
1
1
1
PIC16(L)F1459 (1) 8192 1024 17 9
2
1
2/1
2
1
1
1
1
1
Note 1: I - Debugging, Integrated on Chip; H - Debugging, Available using Debug Header;
E - Emulation, Available using Emulation Header.
2: Three pins are input-only.
Data Sheet Index:
1: DS41639 PIC16(L)F1454/1455/1459 Data Sheet, 14/20-Pin Flash, 8-Bit USB Microcontrollers.
Debug(1)
Clock Reference
USB
CWG
MSSP (I2C/SPI)
EUSART
PWM
Timers
(8/16-bit)
DAC
Comparators
I/Os(2)
Data SRAM
(bytes)
Program Memory
Flash (words)
Device
I/H
I/H
I/H
Y
Y
Y
please
visit
PIC16(L)F145X
FIGURE 1:
14
RA5
RA4
13
VSS
RA0/D+/ICSPDAT(1)
12
RA1/D-/ICSPCLK(1)
11
VUSB3V3
10
RC0/ICSPDAT
RC1/ICSPCLK
RC2
MCLR/VPP/RA3
3
4
RC5
RC4
RC3
PIC16(L)F1454
PIC16(L)F1455
VDD
FIGURE 2:
Vss
NC
NC
VDD
QFN (4x4)
16 15 14 13
RA5 1
RA4 2
MCLR/VPP/RA3 3
12 RA0/D+/ICSPDAT(1)
PIC16(L)F1454
PIC16(L)F1455
RC5 4
11 RA1/D-/ICSPCLK(1)
10 VUSB3V3
RC2
ICSPCLK/RC1
RC4
RC3
RC0/ICSPDAT
Preliminary
DS41639A-page 5
PIC16(L)F145X
FIGURE 3:
20
RA5
19
RA4
18 RA1/D-/ICSPCLK(1)
MCLR/VPP/RA3
3
4
RC5
RC4
RC3
RC6
RC7
RB7 10
PIC16(L)F1459
VDD
17 VUSB3V3
16 RC0/ICSPDAT
15
RC1/ICSPCLK
14
RC2
13
RB4
12
RB5
11
RB6
FIGURE 4:
RA4
RA5
VDD
Vss
RA0/D+/ICSPDAT(1)
QFN (4x4)
20 19 18 17 16
MCLR/VPP/RA3
RC5
RC4
RC3
RC6
1
2
3
4
5
PIC16(L)F1459
15
14
13
12
11
RA1/D-/ICSPCLK(1)
VUSB3V3
RC0/ICSPDAT
RC1/ICSPCLK
RC2
RC7
RB7
RB6
RB5
RB4
6 7 8 9 10
DS41639A-page 6
Preliminary
PIC16(L)F145X
14-Pin PDIP/SOIC/TSSOP
16-Pin QFN
ADC
Reference
Comparator
Timer
CWG
USB
EUSART
PWM
MSSP
Interrupt
Basic
I/O
TABLE 1:
RA0
13
12
D+
IOC
ICSPDAT(3)
RA1
12
11
D-
IOC
ICSPCLK(3)
RA2
RA3
T1G(2)
SS(2)
IOC
MCLR
VPP
RA4
SOSCO
T1G(1)
SDO(2)
IOC
CLKOUT
OSC2
CLKR(1)
RA5
SOSCI
T1CKI
PWM2(2)
IOC
CLKIN
OSC1
RC0
10
SCL
SCK
ICSPDAT
RC1
SDA
SDI
INT
ICSPCLK
RC2
SDO(1)
SS(1)
CLKR(2)
PWM2
(1)
RC3
RC4
TK
CK
RC5
T0CKI
RX
DT
PWM1
VDD
16
VDD
VSS
14
13
VSS
VUSB3V3
11
10
VUSB3V3
Note
1:
2:
3:
Default location for peripheral pin function. Alternate location can be selected using the APFCON register.
Alternate location for peripheral pin function selected by the APFCON register.
LVP support for PIC18(L)F1XK50 legacy designs.
Preliminary
DS41639A-page 7
PIC16(L)F145X
14-Pin PDIP/SOIC/TSSOP
16-Pin QFN
ADC
Reference
Comparator
Timer
CWG
USB
EUSART
PWM
MSSP
Interrupt
Basic
I/O
TABLE 2:
RA0
13
12
D+
IOC
ICSPDAT(3)
RA1
12
11
D-
IOC
ICSPCLK(3)
RA2
RA3
T1G(2)
SS(2)
IOC
MCLR
VPP
RA4
AN3
SOSCO
T1G(1)
SDO(2)
IOC
CLKOUT
OSC2
CLKR(1)
RA5
SOSCI
T1CKI
PWM2(2)
IOC
CLKIN
OSC1
RC0
10
AN4
VREF+
C1IN+
C2IN+
SCL
SCK
ICSPDAT
RC1
AN5
C1IN1C2IN1-
CWGFLT
SDA
SDI
INT
ICSPCLK
RC2
AN6
DACOUT1
C1IN2C2IN2-
SDO(1)
RC3
AN7
DACOUT2
C1IN3C2IN3-
PWM2(1)
SS(1)
CLKR(2)
RC4
C1OUT
C2OUT
CWG1B
TK
CK
RC5
T0CKI
CWG1A
RX
DT
PWM1
VDD
16
VDD
VSS
14
13
VSS
VUSB3V3
11
10
VUSB3V3
Note
1:
2:
3:
Default location for peripheral pin function. Alternate location can be selected using the APFCON register.
Alternate location for peripheral pin function selected by the APFCON register.
LVP support for PIC18(L)F1XK50 legacy designs.
DS41639A-page 8
Preliminary
PIC16(L)F145X
20-Pin PDIP/SOIC/SSOP
20-Pin QFN
ADC
Reference
Comparator
Timer
CWG
USB
EUSART
PWM
MSSP
Interrupt
Basic
I/O
TABLE 3:
RA0
19
16
D+
IOC
ICSPDAT(3)
RA1
18
15
D-
IOC
ICSPCLK(3)
RA2
RA3
T1G(2)
SS(2)
IOC
MCLR
VPP
RA4
20
AN3
SOSCO
T1G(1)
IOC
OSC2
CLKOUT
CLKR(1)
RA5
19
SOSCI
T1CKI
IOC
OSC1
CLKIN
RB4
13
10
AN10
SDA
SDI
IOC
RB5
12
AN11
RX
DX
IOC
RB6
11
SCL
SCK
IOC
RB7
10
TX
CK
IOC
RC0
16
13
AN4
VREF+
C1IN+
C2IN+
ICSPDAT
RC1
15
12
AN5
C1IN1C2IN1-
CWGFLT
INT
ICSPCLK
RC2
14
11
AN6
DACOUT1
C1IN2C2IN2-
RC3
AN7
DACOUT2
C1IN3C2IN3-
CLKR(2)
RC4
C1OUT
C2OUT
CWG1B
RC5
T0CKI
CWG1A
PWM1
RC6
AN8
PWM2
RC7
AN9
SDO
VDD
18
VDD
VSS
20
17
VSS
VUSB3V3
17
14
VUSB3V3
Note
1:
2:
3:
SS
(1)
Default location for peripheral pin function. Alternate location can be selected using the APFCON register.
Alternate location for peripheral pin function selected by the APFCON register.
LVP support for PIC18(L)F1XK50 legacy designs.
Preliminary
DS41639A-page 9
PIC16(L)F145X
Table of Contents
1.0
2.0
3.0
4.0
5.0
6.0
7.0
8.0
9.0
10.0
11.0
12.0
13.0
14.0
15.0
16.0
DS41639A-page 10
Preliminary
PIC16(L)F145X
TO OUR VALUED CUSTOMERS
It is our intention to provide our valued customers with the best documentation possible to ensure successful use of your Microchip
products. To this end, we will continue to improve our publications to better suit your needs. Our publications will be refined and
enhanced as new volumes and updates are introduced.
If you have any questions or comments regarding this publication, please contact the Marketing Communications Department via
E-mail at [email protected] or fax the Reader Response Form in the back of this data sheet to (480) 792-4150. We
welcome your feedback.
Errata
An errata sheet, describing minor operational differences from the data sheet and recommended workarounds, may exist for current
devices. As device/documentation issues become known to us, we will publish an errata sheet. The errata will specify the revision
of silicon and revision of document to which it applies.
To determine if an errata sheet exists for a particular device, please check with one of the following:
Microchips Worldwide Web site; http://www.microchip.com
Your local Microchip sales office (see last page)
When contacting a sales office, please specify which device, revision of silicon and data sheet (include literature number) you are
using.
Preliminary
DS41639A-page 11
PIC16(L)F145X
NOTES:
DS41639A-page 12
Preliminary
PIC16(L)F1454/5/9
1.0
DEVICE OVERVIEW
PIC16F1459
PIC16LF1459
Peripheral
PIC16F1455
PIC16LF1455
TABLE 1-1:
Temperature Indicator
C1
C2
Comparators
PWM1
PWM2
Timer0
Timer1
Timer2
PWM Modules
Timers
Preliminary
DS41639A-page 13
PIC16(L)F1454/5/9
FIGURE 1-1:
Program
Flash Memory
RAM
OSC2/CLKOUT
OSC1/CLKIN
Timing
Generation
PORTA
CPU
INTRC
Oscillator
PORTB(2)
(Figure 2-1)
MCLR
USB
EUSART
Note
DS41639A-page 14
1:
2:
CLKR
Temp.
Indicator(1)
PORTC
C1(1)
C2(1)
ADC
10-Bit(1)
Timer0
Timer1
Timer2
CWG1(1)
FVR(1)
PWM1
PWM2
MSSP1
DAC(1)
PIC16(L)F1455/9 only.
PIC16(L)F1459 only.
Preliminary
PIC16(L)F1454/5/9
TABLE 1-2:
Name
RA0/D+/ICSPDAT(3)
RA1/D-/ICSPCLK(3)
RA3/VPP/T1G(2)/SS(2)/MCLR
RA4/SOSCO/CLKOUT/
T1G(1)/SDO(2)/CLKR(1)/OSC2
RA5/CLKIN/SOSCI/T1CKI/
PWM2(2)/OSC1
RC0/SCL/SCK/ICSPDAT
RC1/SDA/SDI/INT/ICSPCLK
RC2/SDO(1)
RC3/PWM2(1)/SS(1)/CLKR(2)
Function
Input
Type
RA0
TTL
D+
XTAL
Output
Type
Description
ICSPDAT
ST
RA1
TTL
D-
XTAL
XTAL
ICSPCLK
ST
RA3
TTL
VPP
HV
Programming voltage.
T1G
ST
SS
ST
MCLR
ST
RA4
TTL
SOSCO
XTAL
CLKOUT
XTAL
T1G
ST
SDO
CLKR
OSC2
XTAL
XTAL
RA5
TTL
CLKIN
CMOS
SOSCI
XTAL
XTAL
T1CKI
ST
PWM2
OSC1
XTAL
RC0
TTL
SCL
I2C
I2C clock.
SCK
ST
ICSPDAT
ST
RC1
TTL
SDA
I2C
SDI
CMOS
INT
ST
External input.
ICSPCLK
ST
RC2
TTL
SDO
RC3
TTL
PWM2
SS
ST
CLKR
OD
Preliminary
DS41639A-page 15
PIC16(L)F1454/5/9
TABLE 1-2:
Name
RC4/TX/CK
RC5/T0CKI/RX/DT/PWM1
VDD
VSS
VUSB3V3
Function
Input
Type
RC4
TTL
Output
Type
Description
TX
CK
ST
RC5
TTL
T0CKI
ST
RX
ST
DT
ST
PWM1
VDD
Power
VSS
Power
Ground reference.
VUSB3V3
Power
Positive supply.
DS41639A-page 16
Preliminary
PIC16(L)F1454/5/9
TABLE 1-3:
Name
RA0/D+/ICSPDAT(3)
RA1/D-/ICSPCLK(3)
RA3/VPP/T1G(2)/SS(2)/MCLR
RA4/AN3/SOSCO/CLKOUT/
T1G(1)/SDO(2)/CLKR(1)/OSC2
RA5/CLKIN/SOSCI/T1CKI/
PWM2(2)/OSC1
RC0/AN4/VREF+/C1IN+/C2IN+/
SCL/SCK/ICSPDAT
Function
Input
Type
RA0
TTL
D+
XTAL
Output
Type
Description
ICSPDAT
ST
RA1
TTL
D-
XTAL
XTAL
ICSPCLK
ST
RA3
TTL
VPP
HV
Programming voltage.
T1G
ST
SS
ST
MCLR
ST
RA4
TTL
AN3
AN
SOSCO
XTAL
XTAL
CLKOUT
T1G
ST
SDO
CLKR
OSC2
XTAL
RA5
TTL
XTAL
CLKIN
CMOS
XTAL
XTAL
T1CKI
ST
OSC1
XTAL
RC0
TTL
SOSCI
PWM2
AN4
AN
VREF+
AN
C1IN+
AN
C2IN+
AN
SCL
I C
OD
I2C clock.
SCK
ST
ICSPDAT
ST
Preliminary
DS41639A-page 17
PIC16(L)F1454/5/9
TABLE 1-3:
Name
RC1/AN5/C1IN1-/
C2IN1-/CWGFLT/SDA/
SDI/INT/ICSPCLK
RC2/AN6/DACOUT1/
C1IN2-/C2IN2-/SDO(1)
RC3/AN7/DACOUT2/
C1IN3-/C2IN3-/PWM2(1)/
SS(1)/CLKR(2)
RC4/C1OUT/C2OUT/
CWG1B/TX/CK
RC5/T0CKI/CWG1A/RX/DT/
PWM1
Function
Input
Type
RC1
TTL
Output
Type
Description
AN5
AN
C1IN1-
AN
C2IN1-
AN
CWGFLT
ST
SDA
I C
OD
SDI
CMOS
INT
ST
External input.
ICSPCLK
ST
RC2
TTL
AN6
AN
DACOUT1
AN
C1IN2-
AN
C2IN2-
AN
SDO
RC3
TTL
AN7
AN
DACOUT2
AN
C1IN3-
AN
C2IN3-
AN
PWM2
CLC2IN0
ST
CLKR
RC4
TTL
C1OUT
C2OUT
CWG1B
TX
CK
ST
RC5
TTL
T0CKI
ST
CWG1A
RX
ST
DT
ST
PWM1
VDD
VDD
Power
Positive supply.
VSS
VSS
Power
Ground reference.
VUSB3V3
Power
VUSB3V3
DS41639A-page 18
Preliminary
PIC16(L)F1454/5/9
TABLE 1-4:
Name
RA0/D+/ICSPDAT(3)
RA1/D-/ICSPCLK(3)
RA3/VPP/T1G(2)/SS(2)/MCLR
RA4/AN3/SOSCO/CLKOUT/
T1G(1)/CLKR(1)/OSC2
RA5/CLKIN/SOSCI/T1CKI/
OSC1
RB4/AN10/SDA/SDI
RB5/AN11/RX/DT
RB6/SCL/SCK
RB7/TX/CK
Function
Input
Type
RA0
TTL
D+
XTAL
Output
Type
Description
ICSPDAT
ST
RA1
TTL
D-
XTAL
XTAL
ICSPCLK
ST
RA3
TTL
VPP
HV
Programming voltage.
T1G
ST
SS
ST
MCLR
ST
RA4
TTL
AN3
AN
SOSCO
XTAL
XTAL
CLKOUT
T1G
ST
CLKR
OSC2
XTAL
RA5
TTL
CLKIN
CMOS
SOSCI
XTAL
XTAL
T1CKI
ST
OSC1
XTAL
RB4
TTL
XTAL
AN10
AN
SDA
I2C
OD
SDI
CMOS
RB5
TTL
AN11
AN
RX
ST
DT
ST
RB6
TTL
SCL
I2C
SCK
ST
RB7
TTL
TX
CK
ST
OD
I2C clock.
Preliminary
DS41639A-page 19
PIC16(L)F1454/5/9
TABLE 1-4:
Name
RC0/AN4/VREF+/C1IN+/C2IN+/
ICSPDAT
RC1/AN5/C1IN1-/C2IN1-/
CWGFLT/INT/ICSPCLK
RC2/AN6/DACOUT1/
C1IN2-/C2IN2-
RC3/AN7/DACOUT2/
C1IN3-/C2IN3-/CLKR(2)
RC4/C1OUT/C2OUT/
CWG1B
RC5/T0CKI/CWG1A/PWM1
RC6/AN8/SS(1)/PWM2
RC7/AN9/SDO
Function
Input
Type
RC0
TTL
Output
Type
Description
AN4
AN
VREF+
AN
C1IN+
AN
C2IN+
AN
ICSPDAT
ST
RC1
TTL
AN5
AN
C1IN1-
AN
C2IN1-
AN
CWGFLT
ST
INT
ST
External input.
ICSPCLK
ST
RC2
TTL
AN6
AN
DACOUT1
AN
C1IN2-
AN
C2IN2-
AN
RC3
TTL
AN7
AN
DACOUT2
AN
C1IN3-
AN
C2IN3-
AN
CLKR
RC4
TTL
C1OUT
C2OUT
CWG1B
RC5
TTL
T0CKI
ST
CWG1A
PWM1
RC6
TTL
AN8
AN
SS
ST
PWM2
RC7
TTL
AN9
AN
SDO
VDD
VDD
Power
Positive supply.
VSS
VSS
Power
Ground reference.
VUSB3V3
Power
VUSB3V3
DS41639A-page 20
Preliminary
PIC16(L)F1454/5/9
2.0
FIGURE 2-1:
15
Configuration
15
MUX
Flash
Program
Memory
Program
Bus
16-Level
8 Level Stack
Stack
(13-bit)
(15-bit)
14
Instruction
Instruction Reg
reg
Data Bus
Program Counter
RAM
Program Memory
Read (PMR)
12
RAM Addr
Addr MUX
Indirect
Addr
12
12
Direct Addr 7
5
BSR
FSR Reg
reg
15
FSR0reg
Reg
FSR
FSR1
Reg
FSR reg
15
STATUS Reg
reg
STATUS
8
3
OSC1/CLKIN
OSC2/CLKOUT
Instruction
Decodeand
&
Decode
Control
Timing
Generation
Internal
Oscillator
Block
MUX
Power-up
Timer
Power-on
Reset
Watchdog
Timer
Brown-out
Reset
VDD
ALU
8
W Reg
VSS
Preliminary
DS41639A-page 21
PIC16(L)F1454/5/9
2.1
2.2
2.3
2.4
Instruction Set
DS41639A-page 22
Preliminary
PIC16(L)F1454/5/9
3.0
MEMORY ORGANIZATION
TABLE 3-1:
3.1
High-Endurance Flash
Memory Address Range (1)
PIC16F1454
PIC16LF1454
8,192
1FFFh
1F80h-1FFFh
PIC16F1455
PIC16LF1455
8,192
1FFFh
1F80h-1FFFh
PIC16F1459
PIC16LF1459
8,192
1FFFh
1F80h-1FFFh
Device
Note 1: High-endurance Flash applies to low byte of each address in the range.
Preliminary
DS41639A-page 23
PIC16(L)F1454/5/9
FIGURE 3-1:
CALL, CALLW
RETURN, RETLW
Interrupt, RETFIE
15
3.1.1
There are two methods of accessing constants in program memory. The first method is to use tables of
RETLW instructions. The second method is to set an
FSR to point to the program memory.
3.1.1.1
Stack Level 15
EXAMPLE 3-1:
Reset Vector
0000h
Interrupt Vector
0004h
0005h
constants
BRW
RETLW
RETLW
RETLW
RETLW
07FFh
0800h
Page 1
0FFFh
1000h
Page 2
Page 3
Rollover to Page 0
Rollover to Page 3
DS41639A-page 24
RETLW Instruction
Stack Level 0
Stack Level 1
Page 0
On-chip
Program
Memory
17FFh
1800h
1FFFh
2000h
DATA0
DATA1
DATA2
DATA3
RETLW INSTRUCTION
;Add Index in W to
;program counter to
;select data
;Index0 data
;Index1 data
my_function
; LOTS OF CODE
MOVLW
DATA_INDEX
call constants
; THE CONSTANT IS IN W
The BRW instruction makes this type of table very simple to implement. If your code must remain portable
with previous generations of microcontrollers, then the
BRW instruction is not available so the older table read
method must be used.
7FFFh
Preliminary
PIC16(L)F1454/5/9
3.1.1.2
The program memory can be accessed as data by setting bit 7 of the FSRxH register and reading the matching INDFx register. The MOVIW instruction will place the
lower eight bits of the addressed word in the W register.
Writes to the program memory cannot be performed via
the INDF registers. Instructions that access the program memory via the FSR require one extra instruction
cycle to complete. Example 3-2 demonstrates accessing the program memory via an FSR.
The High directive will set bit<7> if a label points to a
location in program memory.
EXAMPLE 3-2:
ACCESSING PROGRAM
MEMORY VIA FSR
constants
RETLW DATA0
;Index0 data
RETLW DATA1
;Index1 data
RETLW DATA2
RETLW DATA3
my_function
; LOTS OF CODE
MOVLW
LOW constants
MOVWF
FSR1L
MOVLW
HIGH constants
MOVWF
FSR1H
MOVIW
0[FSR1]
;THE PROGRAM MEMORY IS IN W
Preliminary
DS41639A-page 25
PIC16(L)F1454/5/9
3.2
3.2.1
12 core registers
20 Special Function Registers (SFR)
Up to 80 bytes of General Purpose RAM (GPR)
Up to 80 bytes of Dual-Port General Purpose
RAM (DPR)
16 bytes of common RAM
TABLE 3-2:
DS41639A-page 26
CORE REGISTERS
Preliminary
CORE REGISTERS
Addresses
BANKx
x00h or x80h
x01h or x81h
x02h or x82h
x03h or x83h
x04h or x84h
x05h or x85h
x06h or x86h
x07h or x87h
x08h or x88h
x09h or x89h
x0Ah or x8Ah
x0Bh or x8Bh
INDF0
INDF1
PCL
STATUS
FSR0L
FSR0H
FSR1L
FSR1H
BSR
WREG
PCLATH
INTCON
PIC16(L)F1454/5/9
3.2.1.1
STATUS Register
3.3
REGISTER 3-1:
U-0
U-0
R-1/q
TO
R-1/q
PD
R/W-0/u
R/W-0/u
R/W-0/u
DC(1)
C(1)
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7-5
Unimplemented: Read as 0
bit 4
bit 3
bit 2
Z: Zero bit
1 = The result of an arithmetic or logic operation is zero
0 = The result of an arithmetic or logic operation is not zero
bit 1
DC: Digit Carry/Digit Borrow bit (ADDWF, ADDLW, SUBLW, SUBWF instructions)(1)
1 = A carry-out from the 4th low-order bit of the result occurred
0 = No carry-out from the 4th low-order bit of the result
bit 0
Note 1:
For Borrow, the polarity is reversed. A subtraction is executed by adding the twos complement of the
second operand. For rotate (RRF, RLF) instructions, this bit is loaded with either the high-order or low-order
bit of the source register.
Preliminary
DS41639A-page 27
PIC16(L)F1454/5/9
3.3.1
3.3.3
3.3.2
3.3.2.1
TABLE 3-3:
DUAL-PORT RAM
3.3.4
COMMON RAM
Port 1
Note 1:
020 - 06F
2000 - 204F
020 - 06F
2000 - 204F
0A0 - 0EF
2050 - 209F
0A0 - 0EF
2050 - 209F
120 - 16F
20A0 - 20EF
120 - 16F
20A0 - 20EF
1A0 - 1EF
20F0 - 213F
1A0 - 1EF
20F0 - 213F
220 - 26F
2140 - 218F
220 - 26F
2140 - 218F
2A0 - 2EF
2190 - 21DF
2A0 - 2EF
2190 - 21DF
320 - 32F
21E0 - 21EF
320 - 32F
21E0 - 21EF
370 - 37F
(1)
370 - 37F
(1)
DS41639A-page 28
Preliminary
PIC16(L)F1454/5/9
FIGURE 3-2:
BANKED MEMORY
PARTITIONING
3.3.5
Memory Region
00h
0Bh
0Ch
Core Registers
(12 bytes)
(1)
Note 1:
Preliminary
DS41639A-page 29
BANK 0
000h
BANK 1
080h
Core Registers
(Table 3-2)
Preliminary
00Bh
00Ch
00Dh
00Eh
00Fh
010h
011h
012h
013h
014h
015h
016h
017h
018h
019h
01Ah
01Bh
01Ch
01Dh
01Eh
01Fh
020h
PORTA
PORTC
PIR1
PIR2
TMR0
TMR1L
TMR1H
T1CON
T1GCON
TMR2
PR2
T2CON
Core Registers
(Table 3-2)
08Bh
08Ch
08Dh
08Eh
08Fh
090h
091h
092h
093h
094h
095h
096h
097h
098h
099h
09Ah
09Bh
09Ch
09Dh
09Eh
09Fh
0A0h
Dual-Port
General
Purpose
Register
80 Bytes
Dual-Port
Common RAM
07Fh
Legend:
TRISA
TRISC
PIE1
PIE2
OPTION_REG
PCON
WDTCON
OSCTUNE
OSCCON
OSCSTAT
0FFh
Common RAM
(Accesses
70h 7Fh)
BANK 3
180h
Core Registers
(Table 3-2)
10Bh
10Ch
10Dh
10Eh
10Fh
110h
111h
112h
113h
114h
115h
116h
117h
118h
119h
11Ah
11Bh
11Ch
11Dh
11Eh
11Fh
120h
Dual-Port
General
Purpose
Register
80 Bytes
0EFh
0F0h
06Fh
070h
BANK 2
100h
LATA
LATC
BORCON
APFCON
Core Registers
(Table 3-2)
18Bh
18Ch
18Dh
18Eh
18Fh
190h
191h
192h
193h
194h
195h
196h
197h
198h
199h
19Ah
19Bh
19Ch
19Dh
19Eh
19Fh
1A0h
Dual-Port
General
Purpose
Register
80 Bytes
16Fh
170h
17Fh
Common RAM
(Accesses
70h 7Fh)
BANK 4
200h
PMADRL
PMADRH
PMDATL
PMDATH
PMCON1
PMCON2
VREGCON
RCREG
TXREG
SPBRG
SPBRGH
RCSTA
TXSTA
BAUDCON
Core Registers
(Table 3-2)
20Bh
20Ch
20Dh
20Eh
20Fh
210h
211h
212h
213h
214h
215h
216h
217h
218h
219h
21Ah
21Bh
21Ch
21Dh
21Eh
21Fh
220h
Dual-Port
General
Purpose
Register
80 Bytes
1EFh
1F0h
1FFh
Common RAM
(Accesses
70h 7Fh)
BANK 5
280h
WPUA
SSP1BUF
SSP1ADD
SSP1MSK
SSP1STAT
SSP1CON1
SSP1CON2
SSP1CON3
Core Registers
(Table 3-2)
28Bh
28Ch
28Dh
28Eh
28Fh
290h
291h
292h
293h
294h
295h
296h
297h
298h
299h
29Ah
29Bh
29Ch
29Dh
29Eh
29Fh
2A0h
Dual-Port
General
Purpose
Register
80 Bytes
26Fh
270h
27Fh
Common RAM
(Accesses
70h 7Fh)
BANK 6
300h
Dual-Port
General
Purpose
Register
80 Bytes
2EFh
2F0h
2FFh
Common RAM
(Accesses
70h 7Fh)
BANK 7
380h
Core Registers
(Table 3-2)
30Bh
30Ch
30Dh
30Eh
30Fh
310h
311h
312h
313h
314h
315h
316h
317h
318h
319h
31Ah
31Bh
31Ch
31Dh
31Eh
31Fh
320h
32Fh
330h
36Fh
370h
37Fh
Dual-Port
General
Purpose
Register
16Bytes
General
Purpose
Register
64 Bytes
Common RAM
(Accesses
70h 7Fh)
Core Registers
(Table 3-2)
38Bh
38Ch
38Dh
38Eh
38Fh
390h
391h
392h
393h
394h
395h
396h
397h
398h
399h
39Ah
39Bh
39Ch
39Dh
39Eh
39Fh
3A0h
IOCAP
IOCAN
IOCAF
CLKRCON
CRCON
General
Purpose
Register
80 Bytes
3EFh
3F0h
3FFh
Common RAM
(Accesses
70h 7Fh)
PIC16(L)F1454/5/9
DS41639A-page 30
TABLE 3-4:
TABLE 3-5:
BANK 0
000h
BANK 1
080h
Core Registers
(Table 3-2)
Preliminary
00Bh
00Ch
00Dh
00Eh
00Fh
010h
011h
012h
013h
014h
015h
016h
017h
018h
019h
01Ah
01Bh
01Ch
01Dh
01Eh
01Fh
020h
PORTA
PORTC
PIR1
PIR2
TMR0
TMR1L
TMR1H
T1CON
T1GCON
TMR2
PR2
T2CON
Core Registers
(Table 3-2)
08Bh
08Ch
08Dh
08Eh
08Fh
090h
091h
092h
093h
094h
095h
096h
097h
098h
099h
09Ah
09Bh
09Ch
09Dh
09Eh
09Fh
0A0h
Legend:
ADCON0
ADCON1
ADCON2
Core Registers
(Table 3-2)
10Bh
10Ch
10Dh
10Eh
10Fh
110h
111h
112h
113h
114h
115h
116h
117h
118h
119h
11Ah
11Bh
11Ch
11Dh
11Eh
11Fh
120h
Dual-Port
General
Purpose
Register
80 Bytes
0EFh
0F0h
Dual-Port
Common RAM
07Fh
TRISA
TRISC
PIE1
PIE2
OPTION_REG
PCON
WDTCON
OSCTUNE
OSCCON
OSCSTAT
ADRESL
ADRESH
0FFh
Common RAM
(Accesses
70h 7Fh)
BANK 3
180h
LATA
LATC
CM1CON0
CM1CON1
CM2CON0
CM2CON1
CMOUT
BORCON
FVRCON
DACCON0
DACCON1
APFCON
Core Registers
(Table 3-2)
18Bh
18Ch
18Dh
18Eh
18Fh
190h
191h
192h
193h
194h
195h
196h
197h
198h
199h
19Ah
19Bh
19Ch
19Dh
19Eh
19Fh
1A0h
Dual-Port
General
Purpose
Register
80 Bytes
16Fh
170h
17Fh
Common RAM
(Accesses
70h 7Fh)
BANK 4
200h
ANSELA
ANSELC
PMADRL
PMADRH
PMDATL
PMDATH
PMCON1
PMCON2
VREGCON
RCREG
TXREG
SPBRG
SPBRGH
RCSTA
TXSTA
BAUDCON
Core Registers
(Table 3-2)
20Bh
20Ch
20Dh
20Eh
20Fh
210h
211h
212h
213h
214h
215h
216h
217h
218h
219h
21Ah
21Bh
21Ch
21Dh
21Eh
21Fh
220h
Dual-Port
General
Purpose
Register
80 Bytes
1EFh
1F0h
1FFh
Common RAM
(Accesses
70h 7Fh)
BANK 5
280h
WPUA
SSP1BUF
SSP1ADD
SSP1MSK
SSP1STAT
SSP1CON1
SSP1CON2
SSP1CON3
Core Registers
(Table 3-2)
28Bh
28Ch
28Dh
28Eh
28Fh
290h
291h
292h
293h
294h
295h
296h
297h
298h
299h
29Ah
29Bh
29Ch
29Dh
29Eh
29Fh
2A0h
Dual-Port
General
Purpose
Register
80 Bytes
26Fh
270h
27Fh
Common RAM
(Accesses
70h 7Fh)
BANK 6
300h
Dual-Port
General
Purpose
Register
80 Bytes
2EFh
2F0h
2FFh
Common RAM
(Accesses
70h 7Fh)
BANK 7
380h
Core Registers
(Table 3-2)
30Bh
30Ch
30Dh
30Eh
30Fh
310h
311h
312h
313h
314h
315h
316h
317h
318h
319h
31Ah
31Bh
31Ch
31Dh
31Eh
31Fh
320h
32Fh
330h
36Fh
370h
37Fh
Dual-Port
General
Purpose
Register
16Bytes
General
Purpose
Register
64 Bytes
Common RAM
(Accesses
70h 7Fh)
Core Registers
(Table 3-2)
38Bh
38Ch
38Dh
38Eh
38Fh
390h
391h
392h
393h
394h
395h
396h
397h
398h
399h
39Ah
39Bh
39Ch
39Dh
39Eh
39Fh
3A0h
IOCAP
IOCAN
IOCAF
CLKRCON
CRCON
General
Purpose
Register
80 Bytes
3EFh
3F0h
3FFh
Common RAM
(Accesses
70h 7Fh)
DS41639A-page 31
PIC16(L)F1454/5/9
Dual-Port
General
Purpose
Register
80 Bytes
06Fh
070h
BANK 2
100h
BANK 0
000h
BANK 1
080h
Core Registers
(Table 3-2)
Preliminary
00Bh
00Ch
00Dh
00Eh
00Fh
010h
011h
012h
013h
014h
015h
016h
017h
018h
019h
01Ah
01Bh
01Ch
01Dh
01Eh
01Fh
020h
PORTA
PORTB
PORTC
PIR1
PIR2
TMR0
TMR1L
TMR1H
T1CON
T1GCON
TMR2
PR2
T2CON
Core Registers
(Table 3-2)
08Bh
08Ch
08Dh
08Eh
08Fh
090h
091h
092h
093h
094h
095h
096h
097h
098h
099h
09Ah
09Bh
09Ch
09Dh
09Eh
09Fh
0A0h
Dual-Port
General
Purpose
Register
80 Bytes
06Fh
070h
Legend:
TRISA
TRISB
TRISC
PIE1
PIE2
OPTION_REG
PCON
WDTCON
OSCTUNE
OSCCON
OSCSTAT
ADRESL
ADRESH
ADCON0
ADCON1
ADCON2
0EFh
0F0h
0FFh
Common RAM
(Accesses
70h 7Fh)
BANK 3
180h
Core Registers
(Table 3-2)
10Bh
10Ch
10Dh
10Eh
10Fh
110h
111h
112h
113h
114h
115h
116h
117h
118h
119h
11Ah
11Bh
11Ch
11Dh
11Eh
11Fh
120h
Dual-Port
General
Purpose
Register
80 Bytes
Dual-Port
Common RAM
07Fh
BANK 2
100h
LATA
LATB
LATC
CM1CON0
CM1CON1
CM2CON0
CM2CON1
CMOUT
BORCON
FVRCON
DACCON0
DACCON1
APFCON
Core Registers
(Table 3-2)
18Bh
18Ch
18Dh
18Eh
18Fh
190h
191h
192h
193h
194h
195h
196h
197h
198h
199h
19Ah
19Bh
19Ch
19Dh
19Eh
19Fh
1A0h
Dual-Port
General
Purpose
Register
80 Bytes
16Fh
170h
17Fh
Common RAM
(Accesses
70h 7Fh)
BANK 4
200h
ANSELA
ANSELB
ANSELC
PMADRL
PMADRH
PMDATL
PMDATH
PMCON1
PMCON2
VREGCON
RCREG
TXREG
SPBRG
SPBRGH
RCSTA
TXSTA
BAUDCON
Core Registers
(Table 3-2)
20Bh
20Ch
20Dh
20Eh
20Fh
210h
211h
212h
213h
214h
215h
216h
217h
218h
219h
21Ah
21Bh
21Ch
21Dh
21Eh
21Fh
220h
Dual-Port
General
Purpose
Register
80 Bytes
1EFh
1F0h
1FFh
Common RAM
(Accesses
70h 7Fh)
BANK 5
280h
WPUA
WPUB
SSP1BUF
SSP1ADD
SSP1MSK
SSP1STAT
SSP1CON1
SSP1CON2
SSP1CON3
Core Registers
(Table 3-2)
28Bh
28Ch
28Dh
28Eh
28Fh
290h
291h
292h
293h
294h
295h
296h
297h
298h
299h
29Ah
29Bh
29Ch
29Dh
29Eh
29Fh
2A0h
Dual-Port
General
Purpose
Register
80 Bytes
26Fh
270h
27Fh
Common RAM
(Accesses
70h 7Fh)
BANK 6
300h
Dual-Port
General
Purpose
Register
80 Bytes
2EFh
2F0h
2FFh
Common RAM
(Accesses
70h 7Fh)
BANK 7
380h
Core Registers
(Table 3-2)
30Bh
30Ch
30Dh
30Eh
30Fh
310h
311h
312h
313h
314h
315h
316h
317h
318h
319h
31Ah
31Bh
31Ch
31Dh
31Eh
31Fh
320h
32Fh
330h
36Fh
370h
37Fh
Dual-Port
General
Purpose
Register
16Bytes
General
Purpose
Register
64 Bytes
Common RAM
(Accesses
70h 7Fh)
Core Registers
(Table 3-2)
38Bh
38Ch
38Dh
38Eh
38Fh
390h
391h
392h
393h
394h
395h
396h
397h
398h
399h
39Ah
39Bh
39Ch
39Dh
39Eh
39Fh
3A0h
IOCAP
IOCAN
IOCAF
IOCBP
IOCBN
IOCBF
CLKRCON
CRCON
General
Purpose
Register
80 Bytes
3EFh
3F0h
3FFh
Common RAM
(Accesses
70h 7Fh)
PIC16(L)F1454/5/9
DS41639A-page 32
TABLE 3-6:
TABLE 3-7:
BANK 8
400h
BANK 9
480h
Core Registers
(Table 3-2)
Core Registers
(Table 3-2)
Preliminary
40Bh
40Ch
40Dh
40Eh
40Fh
410h
411h
412h
413h
414h
415h
416h
417h
418h
419h
41Ah
41Bh
41Ch
41Dh
41Eh
41Fh
420h
48Bh
48Ch
48Dh
48Eh
48Fh
490h
491h
492h
493h
494h
495h
496h
497h
498h
499h
49Ah
49Bh
49Ch
49Dh
49Eh
49Fh
4A0h
General
Purpose
Register
80 Bytes
Common RAM
(Accesses
70h 7Fh)
47Fh
4FFh
BANK 16
Common RAM
(Accesses
70h 7Fh)
DS41639A-page 33
86Fh
870h
87Fh
Legend:
Common RAM
(Accesses
70h 7Fh)
56Fh
570h
57Fh
8FFh
General
Purpose
Register
80 Bytes
5EFh
5F0h
5FFh
64Fh
650h
66Fh
670h
67Fh
9FFh
Unimplemented
Read as 0
Common RAM
(Accesses
70h 7Fh)
Common RAM
(Accesses
70h 7Fh)
68Bh
68Ch
68Dh
68Eh
68Fh
690h
691h
692h
693h
694h
695h
696h
697h
698h
699h
69Ah
69Bh
69Ch
69Dh
69Eh
69Fh
6A0h
6EFh
6F0h
6FFh
76Fh
770h
77Fh
78Bh
78Ch
78Dh
78Eh
78Fh
790h
791h
792h
793h
794h
795h
796h
797h
798h
799h
79Ah
79Bh
79Ch
79Dh
79Eh
79Fh
7A0h
7EFh
7F0h
7FFh
BANK 23
Core Registers
(Table 3-2)
B8Bh
B8Ch
Unimplemented
Read as 0
B7Fh
Common RAM
(Accesses
70h 7Fh)
B80h
Core Registers
(Table 3-2)
B6Fh
B70h
Unimplemented
Read as 0
BANK 22
Unimplemented
Read as 0
AFFh
Common RAM
(Accesses
70h 7Fh)
B0Bh
B0Ch
Common RAM
(Accesses
70h 7Fh)
Core Registers
(Table 3-2)
Unimplemented
Read as 0
Core Registers
(Table 3-2)
AEFh
AF0h
B00h
A8Bh
A8Ch
Common RAM
(Accesses
70h 7Fh)
70Bh
70Ch
70Dh
70Eh
70Fh
710h
711h
712h
713h
714h
715h
716h
717h
718h
719h
71Ah
71Bh
71Ch
71Dh
71Eh
71Fh
720h
BANK 21
Unimplemented
Read as 0
A7Fh
Common RAM
(Accesses
70h 7Fh)
BANK 15
780h
Core Registers
(Table 3-2)
Unimplemented
Read as 0
Core Registers
(Table 3-2)
A6Fh
A70h
A80h
A0Bh
A0Ch
BANK 14
700h
Core Registers
(Table 3-2)
BANK 20
Unimplemented
Read as 0
9EFh
9F0h
PWM1DCL
PWM1DCH
PWM1CON
PWM2DCL
PWM2DCH
PWM2CON
General
Purpose
Register
48 Bytes
A00h
98Bh
98Ch
Common RAM
(Accesses
70h 7Fh)
60Bh
60Ch
60Dh
60Eh
60Fh
610h
611h
612h
613h
614h
615h
616h
617h
618h
619h
61Ah
61Bh
61Ch
61Dh
61Eh
61Fh
620h
Core Registers
(Table 3-2)
Unimplemented
Read as 0
97Fh
Common RAM
(Accesses
70h 7Fh)
BANK 13
680h
Core Registers
(Table 3-2)
BANK 19
Core Registers
(Table 3-2)
96Fh
970h
980h
90Bh
90Ch
Common RAM
(Accesses
70h 7Fh)
58Bh
58Ch
58Dh
58Eh
58Fh
590h
591h
592h
593h
594h
595h
596h
597h
598h
599h
59Ah
59Bh
59Ch
59Dh
59Eh
59Fh
5A0h
BANK 18
Unimplemented
Read as 0
8EFh
8F0h
Common RAM
(Accesses
70h 7Fh)
900h
88Bh
88Ch
Unimplemented
Read as 0
BANK 12
600h
Core Registers
(Table 3-2)
General
Purpose
Register
80 Bytes
Core Registers
(Table 3-2)
Core Registers
(Table 3-2 )
80Bh
80Ch
50Bh
50Ch
50Dh
50Eh
50Fh
510h
511h
512h
513h
514h
515h
516h
517h
518h
519h
51Ah
51Bh
51Ch
51Dh
51Eh
51Fh
520h
BANK 17
880h
800h
Core Registers
(Table 3-2)
General
Purpose
Register
80 Bytes
4EFh
4F0h
BANK 11
580h
Common RAM
(Accesses
70h 7Fh)
Unimplemented
Read as 0
BEFh
BF0h
BFFh
Common RAM
(Accesses
70h 7Fh)
PIC16(L)F1454/5/9
46Fh
470h
BANK 10
500h
BANK 8
400h
BANK 9
480h
Core Registers
(Table 3-2)
Core Registers
(Table 3-2)
Preliminary
40Bh
40Ch
40Dh
40Eh
40Fh
410h
411h
412h
413h
414h
415h
416h
417h
418h
419h
41Ah
41Bh
41Ch
41Dh
41Eh
41Fh
420h
48Bh
48Ch
48Dh
48Eh
48Fh
490h
491h
492h
493h
494h
495h
496h
497h
498h
499h
49Ah
49Bh
49Ch
49Dh
49Eh
49Fh
4A0h
General
Purpose
Register
80 Bytes
46Fh
470h
Common RAM
(Accesses
70h 7Fh)
47Fh
4EFh
4F0h
4FFh
Common RAM
(Accesses
70h 7Fh)
86Fh
870h
87Fh
Legend:
Common RAM
(Accesses
70h 7Fh)
56Fh
570h
57Fh
8FFh
General
Purpose
Register
80 Bytes
5EFh
5F0h
5FFh
64Fh
650h
66Fh
670h
67Fh
9FFh
Unimplemented
Read as 0
Common RAM
(Accesses
70h 7Fh)
Common RAM
(Accesses
70h 7Fh)
68Bh
68Ch
68Dh
68Eh
68Fh
690h
691h
692h
693h
694h
695h
696h
697h
698h
699h
69Ah
69Bh
69Ch
69Dh
69Eh
69Fh
6A0h
6EFh
6F0h
6FFh
76Fh
770h
77Fh
78Bh
78Ch
78Dh
78Eh
78Fh
790h
791h
792h
793h
794h
795h
796h
797h
798h
799h
79Ah
79Bh
79Ch
79Dh
79Eh
79Fh
7A0h
7EFh
7F0h
7FFh
BANK 23
Core Registers
(Table 3-2)
B8Bh
B8Ch
Unimplemented
Read as 0
B7Fh
Common RAM
(Accesses
70h 7Fh)
B80h
Core Registers
(Table 3-2)
B6Fh
B70h
Unimplemented
Read as 0
BANK 22
Unimplemented
Read as 0
AFFh
Common RAM
(Accesses
70h 7Fh)
B0Bh
B0Ch
Common RAM
(Accesses
70h 7Fh)
Core Registers
(Table 3-2)
Unimplemented
Read as 0
Core Registers
(Table 3-2)
AEFh
AF0h
B00h
A8Bh
A8Ch
Common RAM
(Accesses
70h 7Fh)
70Bh
70Ch
70Dh
70Eh
70Fh
710h
711h
712h
713h
714h
715h
716h
717h
718h
719h
71Ah
71Bh
71Ch
71Dh
71Eh
71Fh
720h
BANK 21
Unimplemented
Read as 0
A7Fh
Common RAM
(Accesses
70h 7Fh)
BANK 15
780h
Core Registers
(Table 3-2)
Unimplemented
Read as 0
Core Registers
(Table 3-2)
A6Fh
A70h
CWG1DBR
CWG1DBF
CWG1CON0
CWG1CON1
CWG1CON2
A80h
A0Bh
A0Ch
BANK 14
700h
Core Registers
(Table 3-2)
BANK 20
Unimplemented
Read as 0
9EFh
9F0h
PWM1DCL
PWM1DCH
PWM1CON
PWM2DCL
PWM2DCH
PWM2CON
General
Purpose
Register
48 Bytes
A00h
98Bh
98Ch
Common RAM
(Accesses
70h 7Fh)
60Bh
60Ch
60Dh
60Eh
60Fh
610h
611h
612h
613h
614h
615h
616h
617h
618h
619h
61Ah
61Bh
61Ch
61Dh
61Eh
61Fh
620h
Core Registers
(Table 3-2)
Unimplemented
Read as 0
97Fh
Common RAM
(Accesses
70h 7Fh)
BANK 13
680h
Core Registers
(Table 3-2)
BANK 19
Core Registers
(Table 3-2)
96Fh
970h
980h
90Bh
90Ch
Common RAM
(Accesses
70h 7Fh)
58Bh
58Ch
58Dh
58Eh
58Fh
590h
591h
592h
593h
594h
595h
596h
597h
598h
599h
59Ah
59Bh
59Ch
59Dh
59Eh
59Fh
5A0h
BANK 18
Unimplemented
Read as 0
8EFh
8F0h
Common RAM
(Accesses
70h 7Fh)
900h
88Bh
88Ch
Unimplemented
Read as 0
BANK 12
600h
Core Registers
(Table 3-2)
General
Purpose
Register
80 Bytes
Core Registers
(Table 3-2)
Core Registers
(Table 3-2 )
80Bh
80Ch
50Bh
50Ch
50Dh
50Eh
50Fh
510h
511h
512h
513h
514h
515h
516h
517h
518h
519h
51Ah
51Bh
51Ch
51Dh
51Eh
51Fh
520h
BANK 17
880h
BANK 11
580h
Core Registers
(Table 3-2)
General
Purpose
Register
80 Bytes
BANK 16
800h
BANK 10
500h
Common RAM
(Accesses
70h 7Fh)
Unimplemented
Read as 0
BEFh
BF0h
BFFh
Common RAM
(Accesses
70h 7Fh)
PIC16(L)F1454/5/9
DS41639A-page 34
TABLE 3-8:
TABLE 3-9:
BANK 24
C00h
BANK 25
C80h
Core Registers
(Table 3-2)
Preliminary
C0Bh
C0Ch
C0Dh
C0Eh
C0Fh
C10h
C11h
C12h
C13h
C14h
C15h
C16h
C17h
C18h
C19h
C1Ah
C1Bh
C1Ch
C1Dh
C1Eh
C1Fh
C20h
Core Registers
(Table 3-2)
C8Bh
C8Ch
C8Dh
C8Eh
C8Fh
C90h
C91h
C92h
C93h
C94h
C95h
C96h
C97h
C98h
C99h
C9Ah
C9Bh
C9Ch
C9Dh
C9Eh
C9Fh
CA0h
CFFh
Legend:
Common RAM
(Accesses
70h 7Fh)
Core Registers
(Table 3-2)
D0Bh
D0Ch
D0Dh
D0Eh
D0Fh
D10h
D11h
D12h
D13h
D14h
D15h
D16h
D17h
D18h
D19h
D1Ah
D1Bh
D1Ch
D1Dh
D1Eh
D1Fh
D20h
Unimplemented
Read as 0
CEFh
CF0h
CFFh
Common RAM
(Accesses
70h 7Fh)
BANK 27
D80h
Core Registers
(Table 3-2)
D8Bh
D8Ch
D8Dh
D8Eh
D8Fh
D90h
D91h
D92h
D93h
D94h
D95h
D96h
D97h
D98h
D99h
D9Ah
D9Bh
D9Ch
D9Dh
D9Eh
D9Fh
DA0h
Unimplemented
Read as 0
D6Fh
D70h
D7Fh
Common RAM
(Accesses
70h 7Fh)
BANK 28
E00h
Core Registers
(Table 3-2)
E0Bh
E0Ch
E0Dh
E0Eh
E0Fh
E10h
E11h
E12h
E13h
E14h
E15h
E16h
E17h
E18h
E19h
E1Ah
E1Bh
E1Ch
E1Dh
E1Eh
E1Fh
E20h
Unimplemented
Read as 0
DEFh
DF0h
DFFh
Common RAM
(Accesses
70h 7Fh)
BANK 29
E80h
Core Registers
(Table 3-2)
E8Bh
E8Ch
E8Dh
E8Eh
E8Fh
E90h
E91h
E92h
E93h
E94h
E95h
E96h
E97h
E98h
E99h
E9Ah
E9Bh
E9Ch
E9Dh
E9Eh
E9Fh
EA0h
Unimplemented
Read as 0
E6Fh
E70h
E7Fh
Common RAM
(Accesses
70h 7Fh)
BANK 30
F00h
UCON
USTAT
UIR
UCFG
UIE
UEIR
UFRMH
UFRML
UADDR
UEIE
UEP0
UEP1
UEP2
UEP3
UEP4
UEP5
UEP6
UEP7
Core Registers
(Table 3-2)
F0Bh
F0Ch
F0Dh
F0Eh
F0Fh
F10h
F11h
F12h
F13h
F14h
F15h
F16h
F17h
F18h
F19h
F1Ah
F1Bh
F1Ch
F1Dh
F1Eh
F1Fh
F20h
Unimplemented
Read as 0
EEFh
EF0h
EFFh
Common RAM
(Accesses
70h 7Fh)
BANK 31
F80h
Core Registers
(Table 3-2)
F8Bh
F8Ch
F8Dh
F8Eh
F8Fh
F90h
F91h
F92h
F93h
F94h
F95h
F96h
F97h
See Table 3-10
F98h for register mapF99h
ping details
F9Ah
F9Bh
F9Ch
F9Dh
F9Eh
F9Fh
FA0h
Unimplemented
Read as 0
F6Fh
F70h
F7Fh
Common RAM
(Accesses
70h 7Fh)
FEFh
FF0h
FFFh
Common RAM
(Accesses
70h 7Fh)
DS41639A-page 35
PIC16(L)F1454/5/9
Unimplemented
Read as 0
C6Fh
C70h
BANK 26
D00h
PIC16(L)F1454/5/9
TABLE 3-10:
PIC16(L)F1454/5/9 MEMORY
MAP, BANK 30-31
Bank 31
F8Ch
Unimplemented
Read as 0
FE3h
FE4h
FE5h
FE6h
FE7h
FE8h
FE9h
FEAh
FEBh
FECh
FEDh
FEEh
FEFh
Legend:
STATUS_SHAD
WREG_SHAD
BSR_SHAD
PCLATH_SHAD
FSR0L_SHAD
FSR0H_SHAD
FSR1L_SHAD
FSR1H_SHAD
STKPTR
TOSL
TOSH
DS41639A-page 36
Preliminary
PIC16(L)F1454/5/9
3.3.6
TABLE 3-11:
Addr
Name
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Value on
POR, BOR
Value on all
other Resets
Bank 0-31
x00h or
INDF0
x80h
xxxx xxxx
uuuu uuuu
x01h or
INDF1
x81h
xxxx xxxx
uuuu uuuu
x02h or
PCL
x82h
0000 0000
0000 0000
---1 1000
---q quuu
x03h or
STATUS
x83h
TO
PD
DC
x04h or
FSR0L
x84h
0000 0000
uuuu uuuu
x05h or
FSR0H
x85h
0000 0000
0000 0000
x06h or
FSR1L
x86h
0000 0000
uuuu uuuu
x07h or
FSR1H
x87h
0000 0000
0000 0000
---0 0000
---0 0000
0000 0000
uuuu uuuu
-000 0000
-000 0000
0000 0000
0000 0000
x08h or
BSR
x88h
x09h or
WREG
x89h
BSR<4:0>
Working Register
x0Ah or
PCLATH
x8Ah
x0Bh or
INTCON
x8Bh
GIE
Legend:
TMR0IE
INTE
IOCIE
TMR0IF
INTF
IOCIF
Preliminary
DS41639A-page 37
PIC16(L)F1454/5/9
TABLE 3-12:
Addres
s
Name
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Value on
POR, BOR
Value on all
other
Resets
Bank 0
00Ch
PORTA
00Dh
PORTB(1)
RA5
RA4
RA3
RA1
RA0
RB7
RB6
RB5
RB4
00Eh
PORTC
RC7(1)
RC6(1)
00Fh
Unimplemented
RC5
RC4
RC3
RC2
RC1
RC0
010h
Unimplemented
011h
PIR1
TMR1GIF
ADIF
RCIF
TXIF
SSP1IF
TMR2IF
TMR1IF
OSFIF
C2IF
C1IF
BCL1IF
USBIF
ACTIF
012h
PIR2
013h
Unimplemented
014h
Unimplemented
015h
TMR0
016h
TMR1L
Holding Register for the Least Significant Byte of the 16-bit TMR1 Count
017h
TMR1H
Holding Register for the Most Significant Byte of the 16-bit TMR1 Count
018h
T1CON
019h
T1GCON
01Ah
TMR2
01Bh
PR2
01Ch
T2CON
01Dh
Unimplemented
01Eh
Unimplemented
01Fh
Unimplemented
TMR1CS<1:0>
TMR1GE
T1CKPS<1:0>
T1GPOL
T1GTM
T1GSPM
T1OSCEN
T1SYNC
T1GGO/
DONE
T1GVAL
TMR1ON
T1GSS<1:0>
T2OUTPS<3:0>
TMR2ON
T2CKPS<1:0>
Bank 1
08Ch
TRISA
(1)
TRISA5
TRISA4
(2)
(2)
(2)
08Dh
TRISB
TRISB7
TRISB6
TRISB5
TRISB4
08Eh
TRISC
TRISC7(1)
TRISC6(1)
TRISC5
TRISC4
TRISC3
TRISC2
TRISC1
TRISC0
08Fh
Unimplemented
090h
Unimplemented
091h
PIE1
TMR1GIE
ADIE
RCIE
TXIE
SSP1IE
TMR2IE
TMR1IE
OSFIE
C2IE
C1IE
BCL1IE
USBIE
ACTIE
092h
PIE2
093h
Unimplemented
094h
Unimplemented
095h
OPTION_REG
WPUEN
INTEDG
TMR0CS
TMR0SE
STKOVF
STKUNF
RWDT
PSA
PS<2:0>
096h
PCON
097h
WDTCON
098h
OSCTUNE
099h
OSCCON
SPLLEN
SPLLMULT
09Ah
OSCSTAT
SOSCR
PLLRDY
09Bh
ADRESL(2)
09Ch
ADRESH(2)
09Dh
ADCON0(2)
09Eh
ADCON1(2)
ADFM
ADCS<2:0>
09Fh
ADCON2(2)
TRIGSEL<2:0>
RMCLR
RI
POR
WDTPS<4:0>
SWDTEN
TUN<6:0>
IRCF<3:0>
OSTS
HFIOFR
SCS<1:0>
LFIOFR
HFIOFS
CHS<4:0>
GO/DONE
ADON
ADPREF<1:0>
Legend:
x = unknown, u = unchanged, q = value depends on condition, - = unimplemented, r = reserved. Shaded locations are unimplemented, read as 0.
Note 1:
PIC16(L)F1459 only.
2:
PIC16(L)F1455/9 only.
3:
Unimplemented, read as 1.
DS41639A-page 38
Preliminary
PIC16(L)F1454/5/9
TABLE 3-12:
Addres
s
Name
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Value on
POR, BOR
Value on all
other
Resets
Bank 2
10Ch
LATA
10Dh
LATB(1)
LATA5
LATA4
LATB7
LATB6
LATB5
LATB4
10Eh
LATC
LATC7(1)
LATC6(1)
LATC5
LATC4
LATC3
LATC2
LATC1
LATC0
10Fh
Unimplemented
110h
Unimplemented
111h
CM1CON0(2)
C1ON
C1OUT
112h
CM1CON1(2)
C1INTP
C1INTN
113h
CM2CON0(2)
C2ON
C2OUT
114h
CM2CON1(2)
C2INTP
C2INTN
115h
CMOUT(2)
C1OE
C1POL
C1PCH<1:0>
C2OE
C2POL
C2PCH<1:0>
C1SP
C1SYNC
C1NCH<2:0>
C2SP
C2HYS
116h
BORCON
SBOREN
BORFS
FVRCON(2)
FVREN
FVRRDY
TSEN
TSRNG
CDAFVR<1:0>
118h
DACCON0(2)
DACEN
DACOE1
DACOE2
DACPSS<1:0>
119h
DACCON1(2)
MC2OUT
MC1OUT
BORRDY
ADFVR<1:0>
C2SYNC
C2NCH<2:0>
117h
11Ah
to
11Ch
C1HYS
DACR<4:0>
Unimplemented
11Dh
APFCON
CLKRSEL SDOSEL(1)
11Eh
Unimplemented
11Fh
Unimplemented
SSSEL
T1GSEL
P2SEL(1)
Bank 3
18Ch
ANSELA(2)
ANSA4
18Dh
ANSELB(1)
ANSB5
ANSB4
18Eh
ANSELC(2)
ANSC7(1)
ANSC6(1)
ANSC3
ANSC2
ANSC1
ANSC0
18Fh
Unimplemented
190h
Unimplemented
191h
PMADRL
192h
PMADRH
193h
PMDATL
194h
PMDATH
195h
PMCON1
(2)
CFGS
196h
PMCON2
197h
VREGCON(1)
(2)
FREE
WRERR
WREN
WR
RD
VREGPM
Reserved
198h
Unimplemented
199h
RCREG
19Ah
TXREG
19Bh
SPBRGL
19Ch
SPBRGH
19Dh
RCSTA
SPEN
RX9
SREN
CREN
ADDEN
FERR
OERR
RX9D
19Eh
TXSTA
CSRC
TX9
TXEN
SYNC
SENDB
BRGH
TRMT
TX9D
19Fh
BAUDCON
ABDOVF
RCIDL
SCKP
BRG16
WUE
ABDEN
Legend:
x = unknown, u = unchanged, q = value depends on condition, - = unimplemented, r = reserved. Shaded locations are unimplemented, read as 0.
Note 1:
PIC16(L)F1459 only.
2:
PIC16(L)F1455/9 only.
3:
Unimplemented, read as 1.
Preliminary
DS41639A-page 39
PIC16(L)F1454/5/9
TABLE 3-12:
Addres
s
Name
Value on
POR, BOR
Value on all
other
Resets
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
WPUA5
WPUA4
WPUA3
WPUB7
WPUB6
WPUB5
WPUB4
Bank 4
20Ch
WPUA
20Dh
WPUB(1)
20Eh
to
210h
Unimplemented
211h
SSP1BUF
212h
SSP1ADD
ADD<7:0>
213h
SSP1MSK
MSK<7:0>
214h
SSP1STAT
SMP
CKE
D/A
215h
SSP1CON1
WCOL
SSPOV
SSPEN
CKP
216h
SSP1CON2
GCEN
ACKSTAT
ACKDT
ACKEN
RCEN
PEN
RSEN
SEN
217h
SSP1CON3
ACKTIM
PCIE
SCIE
BOEN
SDAHT
SBCDE
AHEN
DHEN
218h
to
21Fh
UA
BF
SSPM<3:0>
Unimplemented
Unimplemented
Unimplemented
Unimplemented
Bank 5
28Ch
to
29Fh
Bank 6
30Ch
to
31Fh
Bank 7
38Ch
to
390h
391h
IOCAP
IOCAP5
IOCAP4
IOCAP3
IOCAP1
IOCAP0
392h
IOCAN
IOCAN5
IOCAN4
IOCAN3
IOCAN1
IOCAN0
393h
IOCAF
IOCAF5
IOCAF4
IOCAF3
IOCAF1
IOCAF0
394h
IOCBP(1)
IOCBP7
IOCBP6
IOCBP5
IOCBP4
395h
IOCBN(1)
IOCBN7
IOCBN6
IOCBN5
IOCBN4
396h
IOCBF(1)
IOCBF7
IOCBF6
IOCBF5
IOCBF4
397h
to
399h
39Ah
CLKRCON
39Bh
ACTCON
39Ch
to
39Fh
Unimplemented
CLKREN
CLKROE
CLKRSLR
ACTEN
ACTUD
CLKRDC<1:0>
ACTSRC
ACTLOCK
CLKRDIV<2:0>
ACTORS
Unimplemented
Unimplemented
Unimplemented
Bank 8
40Ch
to
41Fh
Bank 9
48Ch
to
49Fh
Legend:
x = unknown, u = unchanged, q = value depends on condition, - = unimplemented, r = reserved. Shaded locations are unimplemented, read as 0.
Note 1:
PIC16(L)F1459 only.
2:
PIC16(L)F1455/9 only.
3:
Unimplemented, read as 1.
DS41639A-page 40
Preliminary
PIC16(L)F1454/5/9
TABLE 3-12:
Addres
s
Name
Value on
POR, BOR
Value on all
other
Resets
Unimplemented
Unimplemented
Unimplemented
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Bank 10
50Ch
to
51Fh
Bank 11
58Ch
to
59Fh
Bank 12
60Ch
to
610h
611h
PWM1DCL
612h
PWM1DCH
613h
PWM1CON0
614h
PWM2DCL
615h
PWM2DCH
616h
PWM2CON0
617h
to
61Fh
PWM1DCL<7:6>
PWM1DCH<7:0>
PWM1EN
PWM2DCL<7:6>
PWM2DCH<7:0>
PWM2EN
Unimplemented
Unimplemented
Bank 13
68Ch
to
690h
691h
CWG1DBR(2)
CWG1DBR<5:0>
692h
CWG1DBF(2)
CWG1DBF<5:0>
693h
CWG1CON0(2)
G1EN
G1OEB
694h
CWG1CON1(2)
695h
CWG1CON2(2)
696h
to
69Fh
G1ASDLB<1:0>
G1ASE
G1ARSEN
G1OEA
G1POLB
G1ASDLA<1:0>
G1POLA
G1ASDC2
G1CS0
G1IS<1:0>
G1ASDC1 G1ASDSFLT
Unimplemented
Unimplemented
Banks 14-28
x0Ch/
x8Ch
x1Fh/
x9Fh
Legend:
x = unknown, u = unchanged, q = value depends on condition, - = unimplemented, r = reserved. Shaded locations are unimplemented, read as 0.
Note 1:
PIC16(L)F1459 only.
2:
PIC16(L)F1455/9 only.
3:
Unimplemented, read as 1.
Preliminary
DS41639A-page 41
PIC16(L)F1454/5/9
TABLE 3-12:
Addres
s
Name
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Value on
POR, BOR
Value on all
other
Resets
Bank 29
E8Ch
Unimplemented
E8Dh
Unimplemented
E8Eh
UCON
E8Fh
USTAT
E90h
UIR
SOFIF
STALLIF
IDLEIF
E91h
UCFG
UTEYE
Reserved
SOFIE
BTSEF
E92h
UIE
E93h
UEIR
E94h
UFRMH
E95h
RESUME
SUSPND
DIR
PPBI
TRNIF
ACTVIF
UERRIF
URSTIF
UPUEN
Reserved
FSEN
STALLIE
IDLEIE
TRNIE
ACTVIE
UERRIE
URSTIE
BTOEF
DFN8EF
CRC16EF
CRC5EF
PIDEF
FRM10
FRM9
FRM8
FRM6
FRM5
FRM4
FRM3
FRM2
FRM1
FRM0
PPBRST
SE0
PKTDIS
USBEN
ENDP<3:0>
PPB<1:0>
UFRML
FRM7
E96h
UADDR
ADDR6
ADDR5
ADDR4
ADDR3
ADDR2
ADDR1
ADDR0
E97h
UEIE
BTSEE
BTOEE
DFN8EE
CRC16EE
CRC5EE
PIDEE
E98h
UEP7
EPHSHK
EPCONDIS EPOUTEN
EPINEN
EPSTALL
E99h
UEP6
EPHSHK
EPCONDIS EPOUTEN
EPINEN
EPSTALL
E9Ah
UEP5
EPHSHK
EPCONDIS EPOUTEN
EPINEN
EPSTALL
E9Bh
UEP4
EPHSHK
EPCONDIS EPOUTEN
EPINEN
EPSTALL
E9Ch
UEP3
EPHSHK
EPCONDIS EPOUTEN
EPINEN
EPSTALL
E9Dh
UEP2
EPHSHK
EPCONDIS EPOUTEN
EPINEN
EPSTALL
E9Eh
UEP1
EPHSHK
EPCONDIS EPOUTEN
EPINEN
EPSTALL
E9Fh
UEP0
EPHSHK
EPCONDIS EPOUTEN
EPINEN
EPSTALL
Bank 30
F0Ch
F1Fh
Unimplemented
Legend:
x = unknown, u = unchanged, q = value depends on condition, - = unimplemented, r = reserved. Shaded locations are unimplemented, read as 0.
Note 1:
PIC16(L)F1459 only.
2:
PIC16(L)F1455/9 only.
3:
Unimplemented, read as 1.
DS41639A-page 42
Preliminary
PIC16(L)F1454/5/9
TABLE 3-12:
Addres
s
Name
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Value on
POR, BOR
Value on all
other
Resets
Bank 31
F8Ch
FE3h
FE4h
STATUS_
Unimplemented
Z_SHAD
DC_SHAD
C_SHAD
SHAD
FE5h
WREG_
SHAD
FE6h
BSR_
SHAD
FE7h
PCLATH_
SHAD
FE8h
FSR0L_
SHAD
FE9h
FSR0H_
SHAD
FEAh
FSR1L_
SHAD
FEBh
FSR1H_
SHAD
FECh
FEDh
STKPTR
FEEh
TOSL
FEFh
TOSH
Unimplemented
Legend:
x = unknown, u = unchanged, q = value depends on condition, - = unimplemented, r = reserved. Shaded locations are unimplemented, read as 0.
Note 1:
PIC16(L)F1459 only.
2:
PIC16(L)F1455/9 only.
3:
Unimplemented, read as 1.
Preliminary
DS41639A-page 43
PIC16(L)F1454/5/9
3.4
3.4.2
FIGURE 3-3:
14
LOADING OF PC IN
DIFFERENT SITUATIONS
PCH
PCL
PC
6
PCLATH
Instruction with
PCL as
Destination
ALU Result
14
PCH
PCL
PC
6 4
PCLATH
GOTO, CALL
PCH
PCL
PCLATH
CALLW
PCH
PCL
BRW
15
PC + W
14
PCH
PCL
PC
BRA
15
PC + OPCODE <8:0>
3.4.1
BRANCHING
PC
3.4.4
14
3.4.3
The CALLW instruction enables computed calls by combining PCLATH and W to form the destination address.
A computed CALLW is accomplished by loading the W
register with the desired address and executing CALLW.
The PCL register is loaded with the value of W and
PCH is loaded with PCLATH.
OPCODE <10:0>
14
11
PC
COMPUTED GOTO
MODIFYING PCL
DS41639A-page 44
Preliminary
PIC16(L)F1454/5/9
3.5
Stack
3.5.1
Note:
FIGURE 3-4:
TOSH:TOSL
0x0F
STKPTR = 0x1F
0x0E
0x0D
0x0C
0x0B
0x0A
0x09
0x08
0x07
0x06
0x05
0x04
0x03
0x02
0x01
0x00
TOSH:TOSL
0x1F
0x0000
Preliminary
STKPTR = 0x1F
DS41639A-page 45
PIC16(L)F1454/5/9
FIGURE 3-5:
0x08
0x07
0x06
0x05
0x04
0x03
0x02
0x01
TOSH:TOSL
FIGURE 3-6:
0x00
Return Address
STKPTR = 0x00
0x0F
0x0E
0x0D
0x0C
0x0B
0x0A
0x09
0x08
0x07
TOSH:TOSL
DS41639A-page 46
0x06
Return Address
0x05
Return Address
0x04
Return Address
0x03
Return Address
0x02
Return Address
0x01
Return Address
0x00
Return Address
Preliminary
STKPTR = 0x06
PIC16(L)F1454/5/9
FIGURE 3-7:
TOSH:TOSL
3.5.2
0x0F
Return Address
0x0E
Return Address
0x0D
Return Address
0x0C
Return Address
0x0B
Return Address
0x0A
Return Address
0x09
Return Address
0x08
Return Address
0x07
Return Address
0x06
Return Address
0x05
Return Address
0x04
Return Address
0x03
Return Address
0x02
Return Address
0x01
Return Address
0x00
Return Address
STKPTR = 0x10
OVERFLOW/UNDERFLOW RESET
3.6
Indirect Addressing
Preliminary
DS41639A-page 47
PIC16(L)F1454/5/9
FIGURE 3-8:
INDIRECT ADDRESSING
0x0000
0x0000
Traditional
Data Memory
0x0FFF
0x0FFF
0x1000
Reserved
0x1FFF
0x2000
Linear
Data Memory
0x29AF
0x29B0
FSR
Address
Range
Reserved
0x7FFF
0x8000
0x0000
Program
Flash Memory
0xFFFF
Note:
0x7FFF
Not all memory regions are completely implemented. Consult device memory tables for memory limits.
DS41639A-page 48
Preliminary
PIC16(L)F1454/5/9
3.6.1
FIGURE 3-9:
BSR
Indirect Addressing
From Opcode
7
0
Bank Select
Location Select
0x00
FSRxH
0
FSRxL
0
Bank Select
11111
Bank 31
Location Select
0x7F
Preliminary
DS41639A-page 49
PIC16(L)F1454/5/9
3.6.2
3.6.3
FIGURE 3-10:
7
FSRnH
0 0 1
FSRnL
FIGURE 3-11:
7
1
FSRnH
PROGRAM FLASH
MEMORY MAP
0
Location Select
Location Select
0x2000
FSRnL
0x8000
0x0000
0x020
Bank 0
0x06F
0x0A0
Bank 1
0x0EF
0x120
Program
Flash
Memory
(low 8
bits)
Bank 2
0x16F
0xF20
Bank 30
0x29AF
DS41639A-page 50
0xF6F
Preliminary
0xFFFF
0x7FFF
PIC16(L)F1454/5/9
4.0
DEVICE CONFIGURATION
4.1
Configuration Words
Preliminary
DS41639A-page 51
PIC16(L)F1454/5/9
4.2
REGISTER 4-1:
R/P-1
R/P-1
FCMEN
IESO
CLKOUTEN
R/P-1
R/P-1
BOREN<1:0>
bit 13
R/P-1
R/P-1
R/P-1
CP
MCLRE
PWRTE
U-1
bit 8
R/P-1
R/P-1
R/P-1
WDTE<1:0>
R/P-1
R/P-1
FOSC<2:0>
bit 7
bit 0
Legend:
R = Readable bit
P = Programmable bit
0 = Bit is cleared
1 = Bit is set
bit 13
bit 12
bit 11
bit 10-9
bit 8
Unimplemented: Read as 1
bit 7
bit 6
bit 5
bit 4-3
DS41639A-page 52
Preliminary
PIC16(L)F1454/5/9
REGISTER 4-1:
bit 2-0
Note 1:
2:
Preliminary
DS41639A-page 53
PIC16(L)F1454/5/9
REGISTER 4-2:
R/P-1
DEBUG
(3)
R/P-1
R/P-1
R/P-1
R/P-1
LPBOR
BORV
STVREN
PLLEN
bit 13
R/P-1
R/P-1
PLLMULT
USBLSCLK
bit 8
R/P-1
R/P-1
CPUDIV<1:0>
U-1
U-1
R/P-1
R/P-1
WRT<1:0>
bit 7
bit 0
Legend:
R = Readable bit
P = Programmable bit
0 = Bit is cleared
1 = Bit is set
bit 13
bit 12
bit 11
bit 10
bit 9
bit 8
bit 7
bit 6
bit 5-4
bit 3-2
Unimplemented: Read as 1
bit 1-0
Note 1:
2:
3:
The LVP bit cannot be programmed to 0 when Programming mode is entered via LVP.
See Vbor parameter for specific trip point voltages.
The DEBUG bit in Configuration Words is managed automatically by device development tools including
debuggers and programmers. For normal device operation, this bit should be maintained as a '1'.
DS41639A-page 54
Preliminary
PIC16(L)F1454/5/9
4.3
Code Protection
4.3.1
4.4
Write Protection
4.5
User ID
Preliminary
DS41639A-page 55
PIC16(L)F1454/5/9
4.6
4.7
REGISTER 4-3:
DEV<13:8>
bit 13
R
bit 8
R
DEV<7:0>
bit 7
bit 0
Legend:
R = Readable bit
1 = Bit is set
bit 13-0
0 = Bit is cleared
DEV<13:0>: Device ID bits
Device
DEVICEID<13:0> Values
PIC16F1454
PIC16LF1454
PIC16F1455
PIC16LF1455
PIC16F1459
PIC16LF1459
REGISTER 4-4:
REV<13:8>
bit 13
R
bit 8
R
REV<7:0>
bit 7
bit 0
Legend:
R = Readable bit
1 = Bit is set
bit 13-0
0 = Bit is cleared
REV<13:0>: Revision ID bits
DS41639A-page 56
Preliminary
PIC16(L)F1454/5/9
5.0
5.1
Overview
Preliminary
DS41639A-page 57
PIC16(L)F1454/5/9
FIGURE 5-1:
FOSC<2:0>
3
SPLLMULT
PLLMULT
INTOSC
CLKIN/ OSC1/
SOSCI/ T1CKI
(16 or 8 MHz)
Secondary
Oscillator
(SOSC)
SOSC_clk
Secondary Clock
IRCF<3:0>
Postscaler
HFINTOSC
Start-up
Control Logic
DS41639A-page 58
1
0
Start-Up
OSC
31 kHz
Source
CPU
Divider
Primary Clock
Active Clock
Tuning
16 MHz
Internal OSC
CPUDIV<1:0>
3x/4x PLL
Primary
Oscillator
(OSC)
CLKOUT / OSC2
SOSCO/ T1G
SPLLEN
PLLEN
FSEN
48 MHz
INTOSC
USB
Divider
16 MHz
8 MHz
4 MHz
2 MHz
1 MHz
500 kHz
250 kHz
125 kHz
62.5 kHz
31.25 kHz
31 kHz
LFINTOSC
6 MHz
1
0
USB
Clock
Source
USBLSCLK
Clock
Control
Sleep
2
3
LFINTOSC
Preliminary
FOSC
to
CPU and
Peripherals
SCS<1:0>
FOSC<2:0>
to WDT, PWRT
and other Modules
PIC16(L)F1454/5/9
5.2
FIGURE 5-2:
5.2.1
5.2.1.1
EC Mode
PIC MCU
FOSC/4 or I/O(1)
Note 1:
OSC1/CLKIN
Clock from
Ext. System
5.2.1.2
OSC2/CLKOUT
Preliminary
DS41639A-page 59
PIC16(L)F1454/5/9
FIGURE 5-3:
QUARTZ CRYSTAL
OPERATION (LP, XT OR
HS MODE)
FIGURE 5-4:
CERAMIC RESONATOR
OPERATION
(XT OR HS MODE)
PIC MCU
PIC MCU
OSC1/CLKIN
C1
C1
To Internal
Logic
Quartz
Crystal
C2
OSC1/CLKIN
RS(1)
RF(2)
Sleep
RP(3)
OSC2/CLKOUT
2:
Note 1: Quartz
crystal
characteristics
vary
according to type, package and
manufacturer. The user should consult the
manufacturer data sheets for specifications
and recommended application.
2: Always verify oscillator performance over
the VDD and temperature range that is
expected for the application.
3: For oscillator design assistance, reference
the following Microchip Applications Notes:
DS41639A-page 60
RF(2)
C2 Ceramic
RS(1)
Resonator
Note 1:
To Internal
Logic
Note 1:
Sleep
OSC2/CLKOUT
5.2.1.3
Preliminary
PIC16(L)F1454/5/9
5.2.1.4
3x PLL or 4x PLL
Note 1: Quartz
crystal
characteristics
vary
according to type, package and
manufacturer. The user should consult the
manufacturer data sheets for specifications
and recommended application.
ECH/HS
(MHz)
System
Clock (MHz)
4x
8 - 12
32 - 48
3x
16, 8
8 - 16
24 - 48
PLL
5.2.1.5
Secondary Oscillator
FIGURE 5-5:
QUARTZ CRYSTAL
OPERATION
(SECONDARY
OSCILLATOR)
PIC MCU
SOSCI
C1
To Internal
Logic
32.768 kHz
Quartz
Crystal
C2
SOSCO
Preliminary
DS41639A-page 61
PIC16(L)F1454/5/9
5.2.1.6
External RC Mode
5.2.2
FIGURE 5-6:
VDD
EXTERNAL RC MODES
REXT
Internal
Clock
CEXT
VSS
FOSC/4 or I/O(1)
OSC2/CLKOUT
The device may be configured to use the internal oscillator block as the system clock by performing one of the
following actions:
PIC MCU
OSC1/CLKIN
2.
5.2.2.1
HFINTOSC
DS41639A-page 62
Preliminary
PIC16(L)F1454/5/9
5.2.2.2
5.2.2.4
5.2.2.3
LFINTOSC
Preliminary
DS41639A-page 63
PIC16(L)F1454/5/9
5.2.2.5
5.2.2.6
5.
6.
7.
The PLL is not available for use with the internal oscillator when the SCS bits of the OSCCON register are
set to '1x'. The SCS bits must be set to '00' to use the
PLL with the internal oscillator.
DS41639A-page 64
Preliminary
PIC16(L)F1454/5/9
FIGURE 5-7:
HFINTOSC
HFINTOSC
Start-up Time
2-cycle Sync
Running
LFINTOSC
IRCF <3:0>
System Clock
HFINTOSC
HFINTOSC
2-cycle Sync
Running
LFINTOSC
IRCF <3:0>
System Clock
LFINTOSC
HFINTOSC
LFINTOSC
Start-up Time
2-cycle Sync
Running
HFINTOSC
IRCF <3:0>
=0
System Clock
Preliminary
DS41639A-page 65
PIC16(L)F1454/5/9
5.3
5.4.1
Setting the CPUDIV bits will set the system clock to:
5.4.2
HIGH-SPEED OPERATION
5.4
LOW-SPEED OPERATION
USB Operation
TABLE 5-1:
Clock Mode
Clock
Frequency
16 MHz
PLL Value
3x
USBLSCLK
CPUDIV<1:0>
System Clock
Frequency
(MHz)
11
10
01
00
8
16
24
48
11
10
01
00
4
8
12
24
11
10
01
00
8
16
24
48
11
10
01
00
8
16
24
48
11
10
01
00
4
8
12
24
HFINTOSC
8 MHz
16 MHz
ECH or HS mode
12 MHz
8 MHz
DS41639A-page 66
3x
3x
4x
3x
Preliminary
PIC16(L)F1454/5/9
TABLE 5-2:
Clock Mode
HFINTOSC
Clock
Frequency
16 MHz
16 MHz
PLL Value
3x
3x
USBLSCLK
CPUDIV<1:0>
System Clock
Frequency
(MHz)
11
10
01
00
8
16
24
48
11
10
01
00
8
16
24
48
11
10
01
00
8
16
24
48
ECH or HS mode
12 MHz
4x
Preliminary
DS41639A-page 67
PIC16(L)F1454/5/9
5.5
Clock Switching
5.5.3
SECONDARY OSCILLATOR
5.5.1
5.5.4
5.5.2
DS41639A-page 68
Preliminary
PIC16(L)F1454/5/9
5.6
5.6.1
Note:
TABLE 5-3:
Switch From
Switch To
(1)
Frequency
Oscillator Delay
Sleep/POR
LFINTOSC
HFINTOSC
31 kHz
31.25 kHz-16 MHz
Sleep/POR
EC, RC
DC 20 MHz
2 cycles
LFINTOSC
EC, RC
DC 20 MHz
1 cycle of each
Sleep/POR
Secondary Oscillator,
32 kHz-20 MHz
LP, XT, HS(1)
HFINTOSC(1)
2 s (approx.)
LFINTOSC(1)
31 kHz
1 cycle of each
PLL Inactive
PLL Active
2 ms (approx.)
Note 1:
24-48 MHz
PLL inactive.
Preliminary
DS41639A-page 69
PIC16(L)F1454/5/9
5.6.2
1.
2.
3.
4.
5.
6.
7.
TWO-SPEED START-UP
SEQUENCE
5.6.3
FIGURE 5-8:
TWO-SPEED START-UP
INTOSC
TOST
OSC1
1022 1023
OSC2
Program Counter
PC - N
PC + 1
PC
System Clock
DS41639A-page 70
Preliminary
PIC16(L)F1454/5/9
5.7
5.7.3
FIGURE 5-9:
External
Clock
LFINTOSC
Oscillator
64
31 kHz
(~32 s)
488 Hz
(~2 ms)
Sample Clock
5.7.1
5.7.4
Clock
Failure
Detected
FAIL-SAFE DETECTION
5.7.2
FAIL-SAFE OPERATION
Preliminary
DS41639A-page 71
PIC16(L)F1454/5/9
FIGURE 5-10:
Sample Clock
Oscillator
Failure
System
Clock
Output
Clock Monitor Output
(Q)
Failure
Detected
OSCFIF
Test
Note:
DS41639A-page 72
Test
Test
The system clock is normally at a much higher frequency than the sample clock. The relative frequencies in
this example have been chosen for clarity.
Preliminary
PIC16(L)F1454/5/9
5.8
5.8.2
5.8.1
FIGURE 5-11:
5.8.3
5.8.4
ACTSRC
FSUSB_clk
SOSC_clk
ACT_clk
Enable
Active
Clock
Tuning
16 MHz
Internal OSC
ACT data
7
ACTUD
ACTEN
sfr data
7
OSCTUNE<6:0>
Preliminary
Write
OSCTUNE
ACTEN
DS41639A-page 73
PIC16(L)F1454/5/9
5.8.5
5.8.6
INTERRUPTS
The ACT will set the ACT Interrupt Flag, (ACTIF) when
either of the ACT Status bits (ACTLOCK or ACTORS)
change state, regardless if the interrupt is enabled,
(ACTIE = 1). The ACTIF and ACTIE bits are in the PIRx
and PIEx registers, respectively. When ACTIE = 1, an
interrupt will be generated whenever the ACT Status
bits change.
The ACTIF bit must be cleared in software, regardless
of the interrupt enable setting.
5.8.7
This ACT does not run during Sleep and will not generate interrupts during Sleep.
DS41639A-page 74
Preliminary
PIC16(L)F1454/5/9
5.9
REGISTER 5-1:
R/W-0/0
R/W-0/0
SPLLEN
SPLLMULT
R/W-0/0
R/W-1/1
R/W-1/1
R/W-1/1
R/W-0/0
IRCF<3:0>
bit 7
R/W-0/0
SCS<1:0>
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7
bit 6
bit 5-2
bit 1-0
Note 1:
Preliminary
DS41639A-page 75
PIC16(L)F1454/5/9
REGISTER 5-2:
R-1/q
R-0/q
R-q/q
R-0/q
U-0
U-0
R-0/q
R-0/q
SOSCR
PLLRDY
OSTS
HFIOFR
LFIOFR
HFIOFS
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
q = Conditional
bit 7
bit 6
bit 5
bit 4
bit 3-2
Unimplemented: Read as 0
bit 1
bit 0
DS41639A-page 76
Preliminary
PIC16(L)F1454/5/9
OSCTUNE: OSCILLATOR TUNING REGISTER(1,2)
REGISTER 5-3:
U-0
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
TUN<6:0>
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7
Unimplemented: Read as 0
bit 6-0
1111111 =
0000000 = Oscillator module is running at the factory-calibrated frequency.
0000001 =
0111110 =
0111111 = Maximum frequency
Note 1:
2:
When active clock tuning is enabled (ACTSEL = 1) the oscillator is tuned automatically, the user cannot
write to OSCTUNE.
Oscillator is tuned monotonically.
Preliminary
DS41639A-page 77
PIC16(L)F1454/5/9
REGISTER 5-4:
R/W-0/0
R/W-0/0
U-0
R/W-0/0
R-0/0
U-0
R-0/0
U-0
ACTEN
ACTUD
ACTSRC(1)
ACTLOCK
ACTORS
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7
bit 6
bit 5
Unimplemented: Read as 0
bit 4
bit 3
bit 2
Unimplemented: Read as 0
bit 1
bit 0
Unimplemented: Read as 0
Note 1:
TABLE 5-4:
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Register
on Page
ACTCON
ACTEN
ACTUD
ACTSRC
ACTLOCK
ACTORS
75
OSCCON
SPLLEN
SPLLMULT
OSCSTAT
SOSCR
PLLRDY
OSTS
HFIOFR
LFIOFR
HFIOFS
76
Name
IRCF<3:0>
OSCTUNE
SCS<1:0>
75
TUNE<6:0>
77
PIR2
OSFIF
C2IF
C1IF
BCL1IF
USBIF
ACTIF
PIE2
OSFIE
C2IE
C1IE
BCL1IE
USBIE
ACTIE
100
T1OSCEN
T1SYNC
TMR1ON
195
TMR1CS<1:0>
T1CON
Legend:
= unimplemented location, read as 0. Shaded cells are not used by clock sources.
TABLE 5-5:
Name
CONFIG1
Legend:
T1CKPS<1:0>
98
Bits
Bit -/6
Bit 13/5
Bit 12/4
Bit 11/3
IESO
CLKOUTEN
13:8
FCMEN
7:0
CP
MCLRE
PWRTE
Bit 10/2
Bit 9/1
BOREN<1:0>
WDTE<1:0>
FOSC<2:0>
Bit 8/0
Register
on Page
52
= unimplemented location, read as 0. Shaded cells are not used by clock sources.
DS41639A-page 78
Preliminary
PIC16(L)F1454/5/9
6.0
RESETS
FIGURE 6-1:
MCLRE
MCLR
Sleep
WDT
Time-out
Device
Reset
Power-on
Reset
VDD
Brown-out
Reset
PWRT
Done
LPBOR
Reset
PWRTE
LFINTOSC
BOR
Active(1)
Note 1:
Preliminary
DS41639A-page 79
PIC16(L)F1454/5/9
6.1
6.2
The POR circuit holds the device in Reset until VDD has
reached an acceptable level for minimum operation.
Slow rising VDD, fast operating speeds or analog
performance may require greater than minimum VDD.
The PWRT, BOR or MCLR features can be used to
extend the start-up period until all device operation
conditions have been met.
6.1.1
TABLE 6-1:
BOREN<1:0>
SBOREN
Device Mode
BOR Mode
11
Active
10
Awake
Active
Sleep
Disabled
1
01
00
Active
Disabled
Disabled
Note 1: In these specific cases, release of POR and wake-up from Sleep, there is no delay in start-up. The BOR
ready flag, (BORRDY = 1), will be set before the CPU is ready to execute instructions because the BOR
circuit is forced on by the BOREN<1:0> bits.
6.2.1
BOR IS ALWAYS ON
When the BOREN bits of Configuration Words are programmed to 11, the BOR is always on. The device
start-up will be delayed until the BOR is ready and VDD
is higher than the BOR threshold.
BOR protection is active during Sleep. The BOR does
not delay wake-up from Sleep.
6.2.2
When the BOREN bits of Configuration Words are programmed to 10, the BOR is on, except in Sleep. The
device start-up will be delayed until the BOR is ready
and VDD is higher than the BOR threshold.
DS41639A-page 80
6.2.3
Preliminary
PIC16(L)F1454/5/9
FIGURE 6-2:
BROWN-OUT SITUATIONS
VDD
VBOR
Internal
Reset
TPWRT(1)
VDD
VBOR
Internal
Reset
< TPWRT
TPWRT(1)
VDD
VBOR
Internal
Reset
Note 1:
6.3
TPWRT(1)
REGISTER 6-1:
R/W-1/u
R/W-0/u
U-0
U-0
U-0
U-0
U-0
R-q/u
SBOREN
BORFS
BORRDY
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7
bit 6
bit 5-1
Unimplemented: Read as 0
bit 0
Note 1:
Preliminary
DS41639A-page 81
PIC16(L)F1454/5/9
6.4
6.6
6.4.1
ENABLING LPBOR
6.4.1.1
6.5
MCLR
6.7
RESET Instruction
6.8
6.9
6.10
TABLE 6-2:
MCLR CONFIGURATION
MCLRE
LVP
MCLR
Disabled
Enabled
Enabled
6.5.1
MCLR ENABLED
MCLR DISABLED
DS41639A-page 82
Start-up Sequence
6.5.2
6.11
Note:
Power-Up Timer
1.
2.
The total time-out will vary based on oscillator configuration and Power-up Timer configuration. See
Section 6.0 Active Clock Tuning (ACT) Module for
more information.
The Power-up Timer runs independently of MCLR
Reset. If MCLR is kept low long enough, the Power-up
Timer will expire. Upon bringing MCLR high, the device
will begin execution immediately (see Figure 6-3). This
is useful for testing purposes or to synchronize more
than one device operating in parallel.
Preliminary
PIC16(L)F1454/5/9
FIGURE 6-3:
VDD
Internal POR
TPWRT
Power-Up Timer
MCLR
TMCLR
Internal RESET
Internal Oscillator
Oscillator
FOSC
FOSC
Preliminary
DS41639A-page 83
PIC16(L)F1454/5/9
6.12
TABLE 6-3:
RMCLR
RI
POR
BOR
TO
PD
Condition
Power-on Reset
Brown-out Reset
WDT Reset
TABLE 6-4:
STATUS
Register
PCON
Register
Power-on Reset
0000h
---1 1000
00-- 110x
0000h
---u uuuu
uu-- 0uuu
0000h
---1 0uuu
uu-- 0uuu
WDT Reset
0000h
---0 uuuu
uu-- uuuu
PC + 1
---0 0uuu
uu-- uuuu
Brown-out Reset
0000h
---1 1uuu
00-- 11u0
---1 0uuu
uu-- uuuu
---u uuuu
uu-- u0uu
Condition
PC + 1
(1)
0000h
0000h
---u uuuu
1u-- uuuu
0000h
---u uuuu
u1-- uuuu
DS41639A-page 84
Preliminary
PIC16(L)F1454/5/9
6.13
6.14
REGISTER 6-2:
R/W/HS-0/q
R/W/HS-0/q
U-0
STKOVF
STKUNF
R/W/HC-1/q R/W/HC-1/q
RWDT
R/W/HC-1/q
R/W/HC-q/u
R/W/HC-q/u
RI
POR
BOR
RMCLR
bit 7
bit 0
Legend:
HC = Bit is cleared by hardware
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7
bit 6
bit 5
Unimplemented: Read as 0
bit 4
bit 3
bit 2
bit 1
bit 0
Preliminary
DS41639A-page 85
PIC16(L)F1454/5/9
TABLE 6-5:
Name
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Register
on Page
BORCON
SBOREN
BORFS
BORRDY
81
PCON
STKOVF
STKUNF
RWDT
RMCLR
RI
POR
BOR
85
STATUS
TO
PD
DC
27
WDTCON
SWDTEN
110
WDTPS<4:0>
Legend: = unimplemented bit, reads as 0. Shaded cells are not used by Resets.
Note 1: Other (non Power-up) Resets include MCLR Reset and Watchdog Timer Reset during normal operation.
TABLE 6-6:
Name
CONFIG1
CONFIG2
Legend:
Bits
Bit -/7
Bit -/6
Bit 13/5
Bit 12/4
Bit 11/3
IESO
CLKOUTEN
13:8
FCMEN
7:0
CP
MCLRE
PWRTE
LVP
13:8
7:0
PLLMULT USBLSCLK
Bit 10/2
BOREN<1:0>
WDTE<1:0>
DEBUG
CPUDIV<1:0>
Bit 9/1
Bit 8/0
FOSC<2:0>
LPBOR
BORV
STVREN
PLLEN
WRT<1:0>
Register
on Page
52
54
DS41639A-page 86
Preliminary
PIC16(L)F1454/5/9
7.0
7.3.1
OSCILLATOR MODES
7.3.2
7.1
7.3
CLKOUT FUNCTION
The CLKOUT function has a higher priority than the reference clock module. Therefore, if the CLKOUT function is enabled by the CLKOUTEN bit in Configuration
Words, FOSC/4 will always be output on the port pin.
Reference Section 4.0 Device Configuration for
more information.
7.4
Slew Rate
7.2
Effects of a Reset
Preliminary
DS41639A-page 87
PIC16(L)F1454/5/9
7.5
REGISTER 7-1:
R/W-0/0
R/W-0/0
R/W-1/1
CLKREN
CLKROE
CLKRSLR
R/W-1/1
R/W-0/0
R/W-0/0
CLKRDC<1:0>
R/W-0/0
R/W-0/0
CLKRDIV<2:0>
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7
bit 6
bit 5
bit 4-3
bit 2-0
Note 1: In this mode, the 25% and 75% duty cycle accuracy will be dependent on the source clock duty cycle.
2: In this mode, the duty cycle will always be equal to the source clock duty cycle, unless a duty cycle of 0%
is selected.
3: To route CLKR to pin, CLKOUTEN of Configuration Words = 1 is required. CLKOUTEN of Configuration
Words = 0 will result in FOSC/4. See Section 7.3 Conflicts with the CLKR Pin for details.
DS41639A-page 88
Preliminary
PIC16(L)F1454/5/9
TABLE 7-1:
Name
CLKRCON
Legend:
Bit 7
Bit 6
Bit 5
CLKREN
CLKROE
CLKRSLR
CONFIG1
Legend:
Bit 3
CLKRDC<1:0>
Bit 2
Bit 1
Bit 0
Register
on Page
88
CLKRDIV<2:0>
= unimplemented locations read as 0. Shaded cells are not used by reference clock sources.
TABLE 7-2:
Name
Bit 4
Bits
Bit -/6
Bit 13/5
Bit 12/4
Bit 11/3
IESO
CLKOUTEN
13:8
FCMEN
7:0
CP
MCLRE
PWRTE
WDTE<1:0>
Bit 10/2
Bit 9/1
BOREN<1:0>
FOSC<2:0>
Bit 8/0
CPD
Register
on Page
52
= unimplemented locations read as 0. Shaded cells are not used by reference clock sources.
Preliminary
DS41639A-page 89
PIC16(L)F1454/5/9
NOTES:
DS41639A-page 90
Preliminary
PIC16(L)F1454/5/9
8.0
INTERRUPTS
Operation
Interrupt Latency
Interrupts During Sleep
INT Pin
Automatic Context Saving
FIGURE 8-1:
INTERRUPT LOGIC
TMR0IF
TMR0IE
Peripheral Interrupts
(TMR1IF) PIR1<0>
(TMR1IF) PIR1<0>
Wake-up
(If in Sleep mode)
INTF
INTE
IOCIF
IOCIE
Interrupt
to CPU
PEIE
PIRn<7>
PIEn<7>
GIE
Preliminary
DS41639A-page 91
PIC16(L)F1454/5/9
8.1
Operation
8.2
Interrupt Latency
The INTCON, PIR1 and PIR2 registers record individual interrupts via interrupt flag bits. Interrupt flag bits will
be set, regardless of the status of the GIE, PEIE and
individual interrupt enable bits.
The following events happen when an interrupt event
occurs while the GIE bit is set:
Current prefetched instruction is flushed
GIE bit is cleared
Current Program Counter (PC) is pushed onto the
stack
Critical registers are automatically saved to the
shadow registers (See Section 8.5 Automatic
Context Saving.)
PC is loaded with the interrupt vector 0004h
The firmware within the Interrupt Service Routine (ISR)
should determine the source of the interrupt by polling
the interrupt flag bits. The interrupt flag bits must be
cleared before exiting the ISR to avoid repeated
interrupts. Because the GIE bit is cleared, any interrupt
that occurs while executing the ISR will be recorded
through its interrupt flag, but will not cause the
processor to redirect to the interrupt vector.
The RETFIE instruction exits the ISR by popping the
previous address from the stack, restoring the saved
context from the shadow registers and setting the GIE
bit.
For additional information on a specific interrupts
operation, refer to its peripheral chapter.
Note 1: Individual interrupt flag bits are set,
regardless of the state of any other
enable bits.
2: All interrupts will be ignored while the GIE
bit is cleared. Any interrupt occurring
while the GIE bit is clear will be serviced
when the GIE bit is set again.
DS41639A-page 92
Preliminary
PIC16(L)F1454/5/9
FIGURE 8-2:
INTERRUPT LATENCY
Fosc
Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4
CLKR
Interrupt Sampled
during Q1
Interrupt
GIE
PC
Execute
PC-1
PC
1 Cycle Instruction at PC
PC+1
0004h
0005h
Inst(PC)
NOP
NOP
Inst(0004h)
PC+1/FSR
ADDR
New PC/
PC+1
0004h
0005h
Inst(PC)
NOP
NOP
Inst(0004h)
FSR ADDR
PC+1
PC+2
0004h
0005h
INST(PC)
NOP
NOP
NOP
Inst(0004h)
Inst(0005h)
FSR ADDR
PC+1
0004h
0005h
INST(PC)
NOP
NOP
Inst(0004h)
Interrupt
GIE
PC
Execute
PC-1
PC
2 Cycle Instruction at PC
Interrupt
GIE
PC
Execute
PC-1
PC
3 Cycle Instruction at PC
Interrupt
GIE
PC
Execute
PC-1
PC
3 Cycle Instruction at PC
Preliminary
PC+2
NOP
NOP
DS41639A-page 93
PIC16(L)F1454/5/9
FIGURE 8-3:
Q2
Q3
Q4
Q1
Q2
Q3
Q4
Q1
Q2
Q3
Q4
Q1
Q2
Q3
Q4
Q1
Q2
Q3
Q4
OSC1
CLKOUT (3)
(4)
INT pin
(1)
(1)
INTF
(5)
GIE
INSTRUCTION FLOW
PC
Instruction
Fetched
Instruction
Executed
Note 1:
PC
Inst (PC)
Inst (PC 1)
PC + 1
Inst (PC + 1)
PC + 1
Forced NOP
Inst (PC)
0004h
Inst (0004h)
Forced NOP
0005h
Inst (0005h)
Inst (0004h)
2:
Asynchronous interrupt latency = 3-5 TCY. Synchronous latency = 3-4 TCY, where TCY = instruction cycle time.
Latency is the same whether Inst (PC) is a single cycle or a 2-cycle instruction.
3:
4:
For minimum width of INT pulse, refer to AC specifications in Section 29.0 Electrical Specifications
5:
DS41639A-page 94
Preliminary
PIC16(L)F1454/5/9
8.3
8.4
INT Pin
8.5
W register
STATUS register (except for TO and PD)
BSR register
FSR registers
PCLATH register
Upon exiting the Interrupt Service Routine, these registers are automatically restored. Any modifications to
these registers during the ISR will be lost. If modifications to any of these registers are desired, the corresponding shadow register should be modified and the
value will be restored when exiting the ISR. The
shadow registers are available in Bank 31 and are
readable and writable. Depending on the users application, other registers may also need to be saved.
Preliminary
DS41639A-page 95
PIC16(L)F1454/5/9
8.6
REGISTER 8-1:
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
R-0/0
GIE
PEIE
TMR0IE
INTE
IOCIE
TMR0IF
INTF
IOCIF(1)
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7
bit 6
bit 5
bit 4
bit 3
bit 2
bit 1
bit 0
Note 1:
Note:
The IOCIF Flag bit is read-only and cleared when all the interrupt-on-change flags in the IOCBF register
have been cleared by software.
Interrupt flag bits are set when an interrupt
condition occurs, regardless of the state of
its corresponding enable bit or the Global
Interrupt Enable bit, GIE, of the INTCON
register. User software should ensure the
appropriate interrupt flag bits are clear
prior to enabling an interrupt.
DS41639A-page 96
Preliminary
PIC16(L)F1454/5/9
REGISTER 8-2:
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
U-0
R/W-0/0
R/W-0/0
TMR1GIE
ADIE(1)
RCIE
TXIE
SSP1IE
TMR2IE
TMR1IE
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7
bit 6
bit 5
bit 4
bit 3
bit 2
Unimplemented: Read as 0
bit 1
bit 0
Note 1:
Note:
PIC16(L)F1455/9 only.
Preliminary
DS41639A-page 97
PIC16(L)F1454/5/9
REGISTER 8-3:
R/W-0/0
R/W-0/0
R/W-0/0
U-0
R/W-0/0
R/W-0/0
R/W-0/0
U-0
OSFIE
C2IE
C1IE
BCL1IE
USBIE
ACTIE
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7
bit 6
bit 5
bit 4
Unimplemented: Read as 0
bit 3
bit 2
bit 1
bit 0
Unimplemented: Read as 0
Note:
DS41639A-page 98
Preliminary
PIC16(L)F1454/5/9
REGISTER 8-4:
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
U-0
R/W-0/0
R/W-0/0
TMR1GIF
ADIF(1)
RCIF
TXIF
SSP1IF
TMR2IF
TMR1IF
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7
bit 6
bit 5
bit 4
bit 3
bit 2
Unimplemented: Read as 0
bit 1
bit 0
Note 1:
Note:
PIC16(L)F1455/9 only.
Preliminary
DS41639A-page 99
PIC16(L)F1454/5/9
REGISTER 8-5:
R/W-0/0
R/W-0/0
R/W-0/0
U-0
R/W-0/0
R/W-0/0
R/W-0/0
U-0
OSFIF
C2IF
C1IF
BCL1IF
USBIF
ACTIF
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7
bit 6
bit 5
bit 4
Unimplemented: Read as 0
bit 3
bit 2
bit 1
bit 0
Unimplemented: Read as 0
Note:
DS41639A-page 100
Preliminary
PIC16(L)F1454/5/9
TABLE 8-1:
Name
INTCON
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Register
on Page
GIE
PEIE
TMR0IE
INTE
IOCIE
TMR0IF
INTF
IOCIF
96
OPTION_REG WPUEN
PIE1
TMR1GIE
ADIE
RCIE
PSA
PS<2:0>
TXIE
SSP1IE
TMR2IE
185
TMR1IE
97
PIE2
OSFIE
C2IE
C1IE
BCL1IE
USBIE
ACTIE
98
PIR1
TMR1GIF
ADIF(1)
RCIF
TXIF
SSP1IF
TMR2IF
TMR1IF
99
PIR2
OSFIF
C2IF
C1IF
BCL1IF
USBIF
ACTIF
100
Legend: = unimplemented location, read as 0. Shaded cells are not used by interrupts.
Note 1: PIC16(L)F1455/9 only.
Preliminary
DS41639A-page 101
PIC16(L)F1454/5/9
NOTES:
DS41639A-page 102
Preliminary
PIC16(L)F1454/5/9
9.0
6.
7.
8.
9.1
Preliminary
DS41639A-page 103
PIC16(L)F1454/5/9
9.1.1
FIGURE 9-1:
Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1
Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4
CLKIN(1)
T1OSC(3)
CLKOUT(2)
Interrupt flag
GIE bit
(INTCON reg.)
Processor in
Sleep
Instruction Flow
PC
Instruction
Fetched
Instruction
Executed
Note
1:
2:
3:
4:
PC
Inst(PC) = Sleep
Inst(PC - 1)
PC + 1
PC + 2
PC + 2
Inst(PC + 1)
Inst(PC + 2)
Sleep
Inst(PC + 1)
PC + 2
Forced NOP
0004h
0005h
Inst(0004h)
Inst(0005h)
Forced NOP
Inst(0004h)
DS41639A-page 104
Preliminary
PIC16(L)F1454/5/9
9.2
9.2.2
9.2.1
The Low-Power Sleep mode is beneficial for applications that stay in Sleep mode for long periods of time.
The Normal mode is beneficial for applications that
need to wake from Sleep quickly and frequently.
Preliminary
DS41639A-page 105
PIC16(L)F1454/5/9
9.3
REGISTER 9-1:
U-0
U-0
U-0
U-0
U-0
U-0
R/W-0/0
R/W-1/1
VREGPM
Reserved
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7-2
Unimplemented: Read as 0
bit 1
bit 0
Note 1:
2:
PIC16LF1454/5/9 only.
See Section 29.0 Electrical Specifications.
TABLE 9-1:
Name
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Register on
Page
INTCON
GIE
PEIE
TMR0IE
INTE
IOCIE
TMR0IF
INTF
IOCIF
96
IOCAF
IOCAF5
IOCAF4
IOCAF3
IOCAF1
IOCAF0
146
IOCAN
IOCAN5
IOCAN4
IOCAN3
IOCAN1
IOCAN0
145
IOCAP
IOCAP5
IOCAP4
IOCAP3
IOCAP1
IOCAP0
145
IOCBF(2)
IOCBF7
IOCBF6
IOCBF5
IOCBF4
147
IOCBN(2)
IOCBN7
IOCBN6
IOCBN5
IOCBN4
147
IOCBP(2)
IOCBP7
IOCBP6
IOCBP5
IOCBP4
146
PIE1
TMR1GIE
ADIE(1)
RCIE
TXIE
SSP1IE
TMR2IE
TMR1IE
97
PIE2
OSFIE
C2IE
C1IE
BCL1IE
USBIE
ACTIE
98
RCIF
TXIF
SSP1IF
TMR2IF
TMR1IF
99
PIR1
TMR1GIF
PIR2
(1)
ADIF
OSFIF
C2IF
C1IF
BCL1IF
USBIF
ACTIF
100
STATUS
TO
PD
DC
27
WDTCON
SWDTEN
110
WDTPS<4:0>
Legend: = unimplemented, read as 0. Shaded cells are not used in Power-Down mode.
Note 1: PIC16(L)F1455/9 only.
2: PIC16(L)F1459 only.
DS41639A-page 106
Preliminary
PIC16(L)F1454/5/9
10.0
FIGURE 10-1:
WDTE<1:0> = 01
SWDTEN
WDTE<1:0> = 11
LFINTOSC
23-bit Programmable
Prescaler WDT
WDT Time-out
WDTE<1:0> = 10
Sleep
WDTPS<4:0>
Preliminary
DS41639A-page 107
PIC16(L)F1454/5/9
10.1
10.4
10.2
10.2.1
10.2.3
TABLE 10-1:
by
Sleep.
See
WDTE<1:0>
SWDTEN
Device
Mode
WDT
Mode
11
Active
10
Awake
Active
Sleep
Disabled
01
00
10.3
1
0
X
Any Reset
CLRWDT instruction is executed
Device enters Sleep
Device wakes up from Sleep
Oscillator fail
WDT is disabled
Oscillator Start-up Timer (OST) is running
WDT IS ALWAYS ON
10.2.2
X
X
10.5
Active
Disabled
Disabled
Time-Out Period
DS41639A-page 108
Preliminary
PIC16(L)F1454/5/9
TABLE 10-2:
WDT
WDTE<1:0> = 00
WDTE<1:0> = 01 and SWDTEN = 0
WDTE<1:0> = 10 and enter Sleep
Cleared
CLRWDT Command
Oscillator Fail Detected
Exit Sleep + System Clock = EXTRC, INTOSC, EXTCLK
Exit Sleep + System Clock = XT, HS, LP
Unaffected
Preliminary
DS41639A-page 109
PIC16(L)F1454/5/9
10.6
REGISTER 10-1:
U-0
U-0
R/W-0/0
R/W-1/1
R/W-0/0
R/W-1/1
R/W-1/1
WDTPS<4:0>
R/W-0/0
SWDTEN
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7-6
Unimplemented: Read as 0
bit 5-1
bit 0
Note 1:
DS41639A-page 110
Preliminary
PIC16(L)F1454/5/9
TABLE 10-3:
Name
Bit 7
Bit 6
OSCCON
SPLLEN
SPLLMULT
PCON
STKOVF
STKUNF
RWDT
STATUS
TO
WDTCON
Legend:
CONFIG1
Legend:
Bit 4
Bit 3
Bit 2
Bit 1
IRCF<3:0>
Bit 0
SCS<1:0>
RMCLR
RI
POR
PD
DC
WDTPS<4:0>
Register
on Page
75
BOR
85
27
SWDTEN
110
x = unknown, u = unchanged, = unimplemented locations read as 0. Shaded cells are not used by Watchdog Timer.
TABLE 10-4:
Name
Bit 5
Bits
Bit -/7
Bit -/6
Bit 13/5
Bit 12/4
Bit 11/3
13:8
FCMEN
IESO
CLKOUTEN
7:0
CP
MCLRE
PWRTE
WDTE<1:0>
Bit 10/2
Bit 9/1
BOREN<1:0>
FOSC<2:0>
Bit 8/0
Register
on Page
52
= unimplemented location, read as 0. Shaded cells are not used by Watchdog Timer.
Preliminary
DS41639A-page 111
PIC16(L)F1454/5/9
11.0
11.1.1
PMCON1
PMCON2
PMDATL
PMDATH
PMADRL
PMADRH
11.2
DS41639A-page 112
11.1
See Table 11-1 for Erase Row size and the number of
write latches for Flash program memory.
Preliminary
PIC16(L)F1454/5/9
TABLE 11-1:
FLASH MEMORY
ORGANIZATION BY DEVICE
Device
PIC16(L)F1454/5/9
11.2.1
Row Erase
(words)
Write
Latches
(words)
32
32
FIGURE 11-1:
FLASH PROGRAM
MEMORY READ
FLOWCHART
Start
Read Operation
Select
Program or Configuration Memory
(CFGS)
Write
the
desired
address
to
the
PMADRH:PMADRL register pair.
Clear the CFGS bit of the PMCON1 register.
Then, set control bit RD of the PMCON1 register.
Select
Word Address
(PMADRH:PMADRL)
End
Read Operation
Preliminary
DS41639A-page 113
PIC16(L)F1454/5/9
FIGURE 11-2:
Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4
PC
Flash ADDR
Flash Data
PC + 1
INSTR (PC)
INSTR(PC - 1)
executed here
PC
+3
PC+3
PMADRH,PMADRL
INSTR (PC + 1)
BSF PMCON1,RD
executed here
PMDATH,PMDATL
INSTR(PC + 1)
instruction ignored
Forced NOP
executed here
PC + 4
INSTR (PC + 3)
INSTR(PC + 2)
instruction ignored
Forced NOP
executed here
PC + 5
INSTR (PC + 4)
INSTR(PC + 3)
executed here
INSTR(PC + 4)
executed here
RD bit
PMDATH
PMDATL
Register
EXAMPLE 11-1:
PMADRL
PROG_ADDR_LO
PMADRL
PROG_ADDR_HI
PMADRH
BCF
BSF
NOP
NOP
PMCON1,CFGS
PMCON1,RD
;
;
;
;
MOVF
MOVWF
MOVF
MOVWF
PMDATL,W
PROG_DATA_LO
PMDATH,W
PROG_DATA_HI
;
;
;
;
DS41639A-page 114
Preliminary
PIC16(L)F1454/5/9
11.2.2
FIGURE 11-3:
FLASH PROGRAM
MEMORY UNLOCK
SEQUENCE FLOWCHART
Start
Unlock Sequence
Write 055h to
PMCON2
Write 0AAh to
PMCON2
End
Unlock Sequence
Preliminary
DS41639A-page 115
PIC16(L)F1454/5/9
11.2.3
FIGURE 11-4:
FLASH PROGRAM
MEMORY ERASE
FLOWCHART
Start
Erase Operation
Disable Interrupts
(GIE = 0)
Select
Program or Configuration Memory
(CFGS)
Unlock Sequence
Figure 11-3
(FIGURE
x-x)
Re-enable Interrupts
(GIE = 1)
End
Erase Operation
DS41639A-page 116
Preliminary
PIC16(L)F1454/5/9
EXAMPLE 11-2:
Required
Sequence
BCF
BANKSEL
MOVF
MOVWF
MOVF
MOVWF
BCF
BSF
BSF
INTCON,GIE
PMADRL
ADDRL,W
PMADRL
ADDRH,W
PMADRH
PMCON1,CFGS
PMCON1,FREE
PMCON1,WREN
MOVLW
MOVWF
MOVLW
MOVWF
BSF
NOP
NOP
55h
PMCON2
0AAh
PMCON2
PMCON1,WR
BCF
BSF
PMCON1,WREN
INTCON,GIE
; Disable writes
; Enable interrupts
Preliminary
DS41639A-page 117
PIC16(L)F1454/5/9
11.2.4
1.
2.
3.
DS41639A-page 118
Preliminary
r10
0 7
5 4
PMADRH
r9
r8
r7
r6
PMADRL
r5
r4
r3
r2
r1
r0
c3
c2
c1
PMDATH
6
c0
0
PMDATL
8
14
10
14
Write Latch #0
00h
PMADRL<4:0>
14
Write Latch #1
01h
Preliminary
14
CFGS = 0
PMADRH<6:0>
:PMADRL<7:4>
Row
Address
Decode
14
14
14
14
14
Row
Addr
Addr
Addr
Addr
000h
0000h
0001h
001Eh
001Fh
001h
0010h
0011h
003Eh
003Fh
002h
0020h
0021h
005Eh
005Fh
7FEh
7FE0h
7FE1h
7FDEh
7FDFh
7FFh
7FF0h
7FF1h
7FFEh
7FFFh
800h
8000h - 8003h
USER ID 0 - 3
CFGS = 1
8004h
reserved
8005h
REVID
8006h
8007h 8008h
8009h - 801Fh
DEVID
Configuration
Words
reserved
Configuration Memory
PIC16(L)F1454/5/9
DS41639A-page 119
FIGURE 11-5:
PIC16(L)F1454/5/9
FIGURE 11-6:
Start
Write Operation
Disable Interrupts
(GIE = 0)
Select
Program or Config. Memory
(CFGS)
Enable Write/Erase
Operation (WREN = 1)
Last word to
write ?
Yes
No
Unlock Sequence
(Figure11-3
x-x)
Figure
Increment Address
(PMADRH:PMADRL++)
Unlock Sequence
(Figure11-3
x-x)
Figure
Disable
Write/Erase Operation
(WREN = 0)
Re-enable Interrupts
(GIE = 1)
End
Write Operation
DS41639A-page 120
Preliminary
PIC16(L)F1454/5/9
EXAMPLE 11-3:
;
;
;
;
;
;
;
INTCON,GIE
PMADRH
ADDRH,W
PMADRH
ADDRL,W
PMADRL
LOW DATA_ADDR
FSR0L
HIGH DATA_ADDR
FSR0H
PMCON1,CFGS
PMCON1,WREN
PMCON1,LWLO
;
;
;
;
;
;
;
;
;
;
;
;
;
MOVIW
MOVWF
MOVIW
MOVWF
FSR0++
PMDATL
FSR0++
PMDATH
MOVF
XORLW
ANDLW
BTFSC
GOTO
PMADRL,W
0x1F
0x1F
STATUS,Z
START_WRITE
MOVLW
MOVWF
MOVLW
MOVWF
BSF
NOP
55h
PMCON2
0AAh
PMCON2
PMCON1,WR
;
;
;
;
;
;
;
;
PMADRL,F
LOOP
PMCON1,LWLO
55h
PMCON2
0AAh
PMCON2
PMCON1,WR
;
;
;
;
;
;
;
;
;
;
;
;
;
Required
Sequence
LOOP
NOP
INCF
GOTO
Required
Sequence
START_WRITE
BCF
MOVLW
MOVWF
MOVLW
MOVWF
BSF
NOP
NOP
BCF
BSF
PMCON1,WREN
INTCON,GIE
Preliminary
DS41639A-page 121
PIC16(L)F1454/5/9
11.3
FIGURE 11-7:
FLASH PROGRAM
MEMORY MODIFY
FLOWCHART
Start
Modify Operation
Read Operation
(Figure11-2
x.x)
Figure
Modify Image
The words to be modified are
changed in the RAM image
Erase Operation
(Figure11-4
x.x)
Figure
WRITE Operation
use RAM image
(Figure11-5
x.x)
Figure
End
Modify Operation
DS41639A-page 122
Preliminary
PIC16(L)F1454/5/9
11.4
TABLE 11-2:
Address
Function
Read Access
Write Access
8000h-8003h
8005h-8006h
8007h-8008h
User IDs
Revision ID-Device ID
Configuration Words 1 and 2
Yes
Yes
Yes
Yes
No
No
EXAMPLE 11-4:
* This code block will read 1 word of program memory at the memory address:
*
PROG_ADDR_LO (must be 00h-08h) data will be returned in the variables;
*
PROG_DATA_HI, PROG_DATA_LO
BANKSEL
MOVLW
MOVWF
CLRF
PMADRL
PROG_ADDR_LO
PMADRL
PMADRH
BSF
BCF
BSF
NOP
NOP
BSF
PMCON1,CFGS
INTCON,GIE
PMCON1,RD
INTCON,GIE
;
;
;
;
;
;
MOVF
MOVWF
MOVF
MOVWF
PMDATL,W
PROG_DATA_LO
PMDATH,W
PROG_DATA_HI
;
;
;
;
Preliminary
DS41639A-page 123
PIC16(L)F1454/5/9
11.5
Write Verify
FIGURE 11-8:
FLASH PROGRAM
MEMORY VERIFY
FLOWCHART
Start
Verify Operation
Read Operation
(Figure
x.x)
Figure
11-2
PMDAT =
RAM image
?
Yes
No
No
Fail
Verify Operation
Last
Word ?
Yes
End
Verify Operation
DS41639A-page 124
Preliminary
PIC16(L)F1454/5/9
11.6
REGISTER 11-1:
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
PMDAT<7:0>
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7-0
REGISTER 11-2:
U-0
U-0
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
PMDAT<13:8>
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7-6
Unimplemented: Read as 0
bit 5-0
Preliminary
DS41639A-page 125
PIC16(L)F1454/5/9
REGISTER 11-3:
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
PMADR<7:0>
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7-0
PMADR<7:0>: Specifies the Least Significant bits for program memory address
REGISTER 11-4:
U-1(1)
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
PMADR<14:8>
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7
bit 6-0
Note 1:
Unimplemented: Read as 1
PMADR<14:8>: Specifies the Most Significant bits for program memory address
Unimplemented bit, read as 1.
DS41639A-page 126
Preliminary
PIC16(L)F1454/5/9
REGISTER 11-5:
U-1(1)
R/W-0/0
R/W-0/0
CFGS
LWLO
R/W/HC-0/0 R/W/HC-x/q(2)
FREE
WRERR
R/W-0/0
R/S/HC-0/0
R/S/HC-0/0
WREN
WR
RD
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7
Unimplemented: Read as 1
bit 6
bit 5
bit 4
bit 3
bit 2
bit 1
bit 0
Note 1:
2:
3:
Preliminary
DS41639A-page 127
PIC16(L)F1454/5/9
REGISTER 11-6:
W-0/0
W-0/0
W-0/0
W-0/0
W-0/0
W-0/0
W-0/0
bit 0
Legend:
R = Readable bit
W = Writable bit
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7-0
TABLE 11-3:
Name
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
INTCON
GIE
PEIE
TMR0IE
INTE
IOCIE
TMR0IF
INTF
IOCIF
96
CFGS
LWLO
FREE
WRERR
WREN
WR
RD
127
(1)
PMCON1
PMCON2
128
PMADRL
PMADRL<7:0>
126
(1)
PMADRH
PMADRH<6:0>
PMDATL
PMDATH
Legend:
Note 1:
CONFIG1
CONFIG2
Legend:
125
PMDATH<5:0>
125
= unimplemented location, read as 0. Shaded cells are not used by Flash program memory.
Unimplemented, read as 1.
TABLE 11-4:
Name
126
PMDATL<7:0>
Bits
Bit -/7
Bit -/6
Bit 13/5
Bit 12/4
Bit 11/3
IESO
CLKOUTEN
13:8
FCMEN
7:0
CP
MCLRE
PWRTE
13:8
LVP
7:0
PLLMULT USBLSCLK
Bit 10/2
FOSC<2:0>
LPBOR
BORV
CPUDIV<1:0>
Bit 8/0
BOREN<1:0>
WDTE<1:0>
DEBUG
Bit 9/1
STVREN
PLLEN
WRT<1:0>
Register
on Page
52
54
= unimplemented location, read as 0. Shaded cells are not used by Flash program memory.
DS41639A-page 128
Preliminary
PIC16(L)F1454/5/9
12.0
I/O PORTS
FIGURE 12-1:
Read LATx
D
Write LATx
Write PORTx
CK
VDD
Data Register
Data Bus
I/O pin
Read PORTx
To peripherals
ANSELx
PIC16(L)F1454/5
PIC16(L)F1459
PORTC
Device
PORTB
TABLE 12-1:
TRISx
EXAMPLE 12-1:
;
;
;
;
VSS
INITIALIZING PORTA
BANKSEL
CLRF
BANKSEL
CLRF
BANKSEL
CLRF
BANKSEL
MOVLW
MOVWF
PORTA
PORTA
LATA
LATA
ANSELA
ANSELA
TRISA
B'00111000'
TRISA
;
;Init PORTA
;Data Latch
;
;
;digital I/O
;
;Set RA<5:3> as inputs
;and set RA<2:0> as
;outputs
Preliminary
DS41639A-page 129
PIC16(L)F1454/5/9
12.1
CLKR
SDO
SS
T1G
P2
12.2
REGISTER 12-1:
R/W-0/0
CLKRSEL
R/W-0/0
SDOSEL
(1)
R/W-0/0
SSSEL
U-0
R/W-0/0
R/W-0/0
U-0
U-0
T1GSEL
P2SEL(1)
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7
bit 6
bit 5
bit 4
Unimplemented: Read as 0
bit 3
bit 2
bit 1-0
Unimplemented: Read as 0
Note 1:
PIC16(L)F1454/5 only.
DS41639A-page 130
Preliminary
PIC16(L)F1454/5/9
12.3
12.3.1
PORTA Registers
EXAMPLE 12-2:
DATA REGISTER
12.3.2
DIRECTION CONTROL
12.3.3
BANKSEL
CLRF
BANKSEL
CLRF
BANKSEL
CLRF
BANKSEL
MOVLW
MOVWF
12.3.4
TABLE 12-2:
Pin Name
;
;Init PORTA
;Data Latch
;
;
;digital I/O
;
;Set RA<5:3> as inputs
;and set RA<2:0> as
;outputs
ANALOG CONTROL
PORTA
PORTA
LATA
LATA
ANSELA
ANSELA
TRISA
B'00111000'
TRISA
Note:
INITIALIZING PORTA
Note 1:
2:
3:
4:
Preliminary
RA0
ICSPDAT(4)
RA1
ICSPCLK(4)
RA2
VUSB3V3
RA3
None
RA4
CLKOUT
SOSCO
CLKR(2)
SDO(3)
RA4
RA5
PWM2(3)
RA5
DS41639A-page 131
PIC16(L)F1454/5/9
12.4
REGISTER 12-2:
U-0
U-0
R/W-x/x
R/W-x/x
R-x/x
U-0
R-x/x
R-x/x
RA5
RA4
RA3
RA1
RA0
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7-6
Unimplemented: Read as 0
bit 5-3
bit 2
Unimplemented: Read as 0
bit 1-0
Note 1:
Writes to PORTA are actually written to corresponding LATA register. Reads from PORTA register is return
of actual I/O pin values.
REGISTER 12-3:
U-0
R/W-1/1
TRISA5
R/W-1/1
U-1
TRISA4
(1)
U-0
U-1
U-1
(1)
(1)
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7-6
Unimplemented: Read as 0
bit 5-4
bit 3
Unimplemented: Read as 1
bit 2
Unimplemented: Read as 0
bit 1-0
Unimplemented: Read as 1
Note 1:
Unimplemented, read as 1.
DS41639A-page 132
Preliminary
PIC16(L)F1454/5/9
REGISTER 12-4:
U-0
U-0
R/W-x/u
R/W-x/u
U-0
U-0
U-0
U-0
LATA5
LATA4
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7-6
Unimplemented: Read as 0
bit 5-4
bit 3-0
Unimplemented: Read as 0
Note 1:
Writes to PORTA are actually written to corresponding LATA register. Reads from PORTA register is return
of actual I/O pin values.
REGISTER 12-5:
U-0
U-0
U-0
R/W-1/1
U-0
U-0
U-0
U-0
ANSA4
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7-5
Unimplemented: Read as 0
bit 4
ANSA4: Analog Select between Analog or Digital Function on pins RA4, respectively
1 = Analog input. Pin is assigned as analog input(1). Digital input buffer disabled.
0 = Digital I/O. Pin is assigned to port or digital special function.
bit 3-0
Unimplemented: Read as 0
Note 1:
2:
When setting a pin to an analog input, the corresponding TRIS bit must be set to Input mode in order to
allow external control of the voltage on the pin.
PIC16(L)F1455/9 only.
Preliminary
DS41639A-page 133
PIC16(L)F1454/5/9
REGISTER 12-6:
U-0
U-0
R/W-1/1
R/W-1/1
R/W-1/1
U-0
U-0
U-0
WPUA5
WPUA4
WPUA3
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7-6
Unimplemented: Read as 0
bit 5-3
bit 2-0
Unimplemented: Read as 0
Note 1:
2:
3:
Global WPUEN bit of the OPTION_REG register must be cleared for individual pull-ups to be enabled.
The weak pull-up device is automatically disabled if the pin is configured as an output.
For the WPUA3 bit, when MCLRE = 1, weak pull-up is internally enabled, but not reported here.
TABLE 12-3:
Name
Bit 7
ANSELA(3)
APFCON
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Register
on Page
ANSA4
133
CLKRSEL
SDOSEL(2)
SSSEL
T1GSEL
P2SEL(2)
130
LATA5
LATA4
133
LATA
WPUEN
INTEDG
TMR0CS
TMR0SE
PSA
PORTA
RA5
RA4
RA3
RA1
RA0
132
TRISA
TRISA5
TRISA4
(1)
(1)
(1)
132
WPUA
WPUA5
WPUA4
WPUA3
134
OPTION_REG
Legend:
Note 1:
2:
3:
CONFIG1
Legend:
185
x = unknown, u = unchanged, = unimplemented locations read as 0. Shaded cells are not used by PORTA.
Unimplemented, read as 1.
PIC16(L)F1454/5 only.
PIC16(L)F1455/9 only.
TABLE 12-4:
Name
PS<2:0>
Bits
Bit -/7
Bit -/6
Bit 13/5
Bit 12/4
Bit 11/3
IESO
CLKOUTEN
13:8
FCMEN
7:0
CP
MCLRE
PWRTE
Bit 10/2
WDTE<1:0>
Bit 9/1
BOREN<1:0>
FOSC<2:0>
Bit 8/0
Register
on Page
52
DS41639A-page 134
Preliminary
PIC16(L)F1454/5/9
12.5
12.5.1
PORTB Registers
(PIC16(L)F1455/9 only)
12.5.4
DATA REGISTER
12.5.2
TABLE 12-5:
DIRECTION CONTROL
ANALOG CONTROL
Pin Name
12.5.3
RB4
SDA
RB4
RB5
RX
RB5
RB6
SCL
SCK
RB6
RB7
TX
RB7
Note 1:
2:
3:
Preliminary
DS41639A-page 135
PIC16(L)F1454/5/9
12.6
REGISTER 12-7:
R/W-x/x
R/W-x/x
R/W-x/x
R/W-x/x
U-0
U-0
U-0
U-0
RB7
RB6
RB5
RB4
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7-4
bit 3-0
Unimplemented: Read as 0
Note 1:
Writes to PORTB are actually written to corresponding LATB register. Reads from PORTB register is
return of actual I/O pin values.
REGISTER 12-8:
R/W-1/1
R/W-1/1
R/W-1/1
R/W-1/1
U-0
U-0
U-0
U-0
TRISB7
TRISB6
TRISB5
TRISB4
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7-4
bit 3-0
Unimplemented: Read as 0
DS41639A-page 136
Preliminary
PIC16(L)F1454/5/9
REGISTER 12-9:
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
U-0
U-0
U-0
U-0
LATB7
LATB6
LATB5
LATB4
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7-4
bit 3-0
Unimplemented: Read as 0
Note 1:
Writes to PORTB are actually written to corresponding LATB register. Reads from PORTB register is
return of actual I/O pin values.
U-0
R/W-1/1
R/W-1/1
U-0
U-0
U-0
U-0
ANSB5
ANSB4
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7-6
Unimplemented: Read as 0
bit 5-4
ANSB<5:4>: Analog Select between Analog or Digital Function on pins RB<5:4>, respectively
1 = Analog input. Pin is assigned as analog input(1). Digital input buffer disabled.
0 = Digital I/O. Pin is assigned to port or digital special function.
bit 3-0
Unimplemented: Read as 0
Note 1:
When setting a pin to an analog input, the corresponding TRIS bit must be set to Input mode in order to
allow external control of the voltage on the pin.
Preliminary
DS41639A-page 137
PIC16(L)F1454/5/9
REGISTER 12-11: WPUB: WEAK PULL-UP PORTB REGISTER
R/W-1/1
R/W-1/1
R/W-1/1
R/W-1/1
U-0
U-0
U-0
U-0
WPUB7
WPUB6
WPUB5
WPUB4
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7-4
bit 3-0
Unimplemented: Read as 0
Note 1:
2:
Global WPUEN bit of the OPTION_REG register must be cleared for individual pull-ups to be enabled.
The weak pull-up device is automatically disabled if the pin is configured as an output.
TABLE 12-6:
Name
Bit 7
Bit 6
ANSELB
CLKRSEL
APFCON
LATB
OPTION_REG
SDOSEL
(1)
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Register
on Page
ANSB5
ANSB4
137
130
137
SSSEL
T1GSEL
LATB7
LATB6
LATB5
LATB4
WPUEN
INTEDG
TMR0CS
TMR0SE
PSA
P2SEL
(1)
PS<2:0>
185
PORTB
RB7
RB6
RB5
RB4
136
TRISB
TRISB7
TRISB6
TRISB5
TRISB4
136
WPUB7
WPUB6
WPUB5
WPUB4
138
WPUB
Legend:
Note 1:
x = unknown, u = unchanged, = unimplemented locations read as 0. Shaded cells are not used by PORTB.
PIC16(L)F1459 only.
TABLE 12-7:
Name
CONFIG1
Legend:
Bits
Bit -/7
Bit -/6
Bit 13/5
Bit 12/4
Bit 11/3
13:8
FCMEN
IESO
CLKOUTEN
7:0
CP
MCLRE
PWRTE
Bit 10/2
WDTE<1:0>
Bit 9/1
BOREN<1:0>
FOSC<2:0>
Bit 8/0
Register
on Page
52
DS41639A-page 138
Preliminary
PIC16(L)F1454/5/9
12.7
12.7.1
PORTC Registers
12.7.4
DATA REGISTER
12.7.2
TABLE 12-8:
Pin Name
DIRECTION CONTROL
12.7.3
ANALOG CONTROL
Function Priority(1)
RC0
ICSPDAT
SCL(4)
SCK(4)
RC1
ICSPCLK
SDA(4)
SDI(4)
RC1
RC2
DACOUT1
SDO(2)
RC2
RC3
DACOUT2
CLKR(3)
PWM2(2)
RC3
RC4
CWG1B
C1OUT
C2OUT
TX(4)
RC4
RC5
CWG1A
PWM1
RX(4)
RC5
RC6
PWM2(5)
RC6
RC7
SDO(5)
RC7
Note 1:
2:
3:
4:
5:
Preliminary
DS41639A-page 139
PIC16(L)F1454/5/9
12.8
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
RC7(1)
RC6(1)
RC5
RC4
RC3
RC2
RC1
RC0
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7-0
Note 1:
R/W-1/1
R/W-1/1
R/W-1/1
R/W-1/1
R/W-1/1
R/W-1/1
R/W-1/1
TRISC7(1)
TRISC6(1)
TRISC5
TRISC4
TRISC3
TRISC2
TRISC1
TRISC0
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7-0
Note 1:
DS41639A-page 140
Preliminary
PIC16(L)F1454/5/9
REGISTER 12-14: LATC: PORTC DATA LATCH REGISTER
R/W-x/u
R/W-x/u
(1)
(1)
LATC7
LATC6
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
LATC5
LATC4
LATC3
LATC2
LATC1
LATC0
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
LATC<7:0>: PORTC Output Latch Value bits(1)
bit 7-0
Note 1:
2:
Writes to PORTC are actually written to corresponding LATC register. Reads from PORTC register is
return of actual I/O pin values.
PIC16(L)F1459 only.
R/W-1/1
U-0
U-0
R/W-1/1
R/W-1/1
R/W-1/1
R/W-1/1
ANSC7(1)
ANSC6(1)
ANSC3
ANSC2
ANSC1
ANSC0
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7-6
ANSC<7:6>: Analog Select between Analog or Digital Function on pins RC<7:6>, respectively
1 = Analog input. Pin is assigned as analog input(1). Digital input buffer disabled.
0 = Digital I/O. Pin is assigned to port or digital special function.
bit 5-4
Unimplemented: Read as 0
bit 3-0
ANSC<3:0>: Analog Select between Analog or Digital Function on pins RC<3:0>, respectively
1 = Analog input. Pin is assigned as analog input(1). Digital input buffer disabled.
0 = Digital I/O. Pin is assigned to port or digital special function.
Note 1:
2:
When setting a pin to an analog input, the corresponding TRIS bit must be set to Input mode in order to
allow external control of the voltage on the pin.
PIC16(L)F1459 only.
TABLE 12-9:
Name
ANSELC(2)
LATC
PORTC
TRISC
Legend:
Note 1:
2:
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Register
on Page
ANSC7(1)
ANSC6(1)
ANSC3
ANSC2
ANSC1
ANSC0
141
(1)
(1)
LATC5
LATC4
LATC3
LATC2
LATC1
LATC0
141
LATC7
RC7
(1)
LATC6
RC6
(1)
TRISC7(1) TRISC6(1)
RC5
RC4
RC3
RC2
RC1
RC0
140
TRISC5
TRISC4
TRISC3
TRISC2
TRISC1
TRISC0
140
x = unknown, u = unchanged, - = unimplemented locations read as 0. Shaded cells are not used by PORTC.
PIC16(L)F1459 only.
PIC16(L)F1455/9 only.
Preliminary
DS41639A-page 141
PIC16(L)F1454/5/9
NOTES:
DS41639A-page 142
Preliminary
PIC16(L)F1454/5/9
13.0
INTERRUPT-ON-CHANGE
13.3
13.4
13.1
Interrupt Flags
13.2
EXAMPLE 13-1:
MOVLW
XORWF
ANDWF
13.5
CLEARING INTERRUPT
FLAGS
(PORTA EXAMPLE)
0xff
IOCAF, W
IOCAF, F
Operation in Sleep
Preliminary
DS41639A-page 143
PIC16(L)F1454/5/9
FIGURE 13-1:
IOCANx
Q4Q1
CK
Edge
Detect
RAx
IOCAPx
Data Bus =
0 or 1
Write IOCAFx
CK
To Data Bus
IOCAFx
CK
IOCIE
R
Q2
From all other
IOCAFx individual
Pin Detectors
Q1
Q2
Q3
Q4
Q4Q1
DS41639A-page 144
Q1
Q1
Q2
Q2
Q3
Q4
Q4Q1
IOC interrupt
to CPU core
Q3
Q4
Q4
Q4Q1
Preliminary
Q4Q1
PIC16(L)F1454/5/9
13.6
REGISTER 13-1:
U-0
U-0
R/W-0/0
R/W-0/0
R/W-0/0
U-0
R/W-0/0
R/W-0/0
IOCAP5
IOCAP4
IOCAP3
IOCAP1
IOCAP0
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7-6
Unimplemented: Read as 0
bit 5-3
bit 2
Unimplemented: Read as 0
bit 1-0
REGISTER 13-2:
U-0
U-0
R/W-0/0
R/W-0/0
R/W-0/0
U-0
R/W-0/0
R/W-0/0
IOCAN5
IOCAN4
IOCAN3
IOCAN1
IOCAN0
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7-6
Unimplemented: Read as 0
bit 5-3
bit 2
Unimplemented: Read as 0
bit 1-0
Preliminary
DS41639A-page 145
PIC16(L)F1454/5/9
REGISTER 13-3:
U-0
U-0
IOCAF4
IOCAF3
U-0
R/W/HS-0/0
R/W/HS-0/0
IOCAF1
IOCAF0
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7-6
Unimplemented: Read as 0
bit 5-3
bit 2
Unimplemented: Read as 0
bit 1-0
REGISTER 13-4:
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
U-0
U-0
U-0
U-0
IOCBP7
IOCBP6
IOCBP5
IOCBP4
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7-4
bit 3-0
Unimplemented: Read as 0
Note 1:
PIC16(L)F1459 only.
DS41639A-page 146
Preliminary
PIC16(L)F1454/5/9
REGISTER 13-5:
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
U-0
U-0
U-0
U-0
IOCBN7
IOCBN6
IOCBN5
IOCBN4
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7-4
bit 3-0
Unimplemented: Read as 0
Note 1:
PIC16(L)F1459 only.
REGISTER 13-6:
R/W/HS-0/0
R/W/HS-0/0
IOCBF7
IOCBF6
R/W/HS-0/0 R/W/HS-0/0
IOCBF5
IOCBF4
U-0
U-0
U-0
U-0
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7-4
bit 3-0
Unimplemented: Read as 0
Note 1:
PIC16(L)F1459 only.
Preliminary
DS41639A-page 147
PIC16(L)F1454/5/9
TABLE 13-1:
Name
ANSELA(3)
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Register
on Page
133
ANSA4
GIE
PEIE
TMR0IE
INTE
IOCIE
TMR0IF
INTF
IOCIF
96
IOCAF
IOCAF5
IOCAF4
IOCAF3
IOCAF1
IOCAF0
146
IOCAN
IOCAN5
IOCAN4
IOCAN3
IOCAN1
IOCAN0
145
IOCAP
IOCAP5
IOCAP4
IOCAP3
IOCAP1
IOCAP0
145
IOCBF(2)
IOCBF7
IOCBF6
IOCBF5
IOCBF4
147
IOCBN(2)
IOCBN7
IOCBN6
IOCBN5
IOCBN4
147
(2)
IOCBP
IOCBP7
IOCBP6
IOCBP5
IOCBP4
146
TRISA
TRISA5
TRISA4
(1)
(1)
(1)
132
TRISB7
TRISB6
TRISB5
TRISB4
136
INTCON
TRISB(2)
Legend:
Note 1:
2:
3:
DS41639A-page 148
Preliminary
PIC16(L)F1454/5/9
14.0
FIGURE 14-1:
14.2
14.1
CDAFVR<1:0>
2
X1
X2
X4
FVR BUFFER1
(To ADC Module)
X1
X2
X4
FVR BUFFER2
(To Comparators, DAC)
FVREN
+
FVRRDY
TABLE 14-1:
Peripheral
HFINTOSC
BOR
LDO
Description
BOREN<1:0> = 11
Preliminary
DS41639A-page 149
PIC16(L)F1454/5/9
14.3
REGISTER 14-1:
R/W-0/0
R-q/q
R/W-0/0
R/W-0/0
FVREN
FVRRDY(1)
TSEN
TSRNG
R/W-0/0
R/W-0/0
R/W-0/0
CDAFVR<1:0>
R/W-0/0
ADFVR<1:0>
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7
bit 6
bit 5
bit 4
bit 3-2
bit 1-0
Note 1:
2:
3:
TABLE 14-2:
Name
FVRCON
Legend:
Bit 6
Bit 5
Bit 4
FVREN
FVRRDY
TSEN
TSRNG
Bit 3
Bit 2
CDAFVR>1:0>
Bit 1
Bit 0
ADFVR<1:0>
Register
on page
150
DS41639A-page 150
Preliminary
PIC16(L)F1454/5/9
15.0
TEMPERATURE INDICATOR
MODULE (PIC16(L)F1455/9
ONLY)
FIGURE 15-1:
VDD
15.1
Circuit Operation
TEMPERATURE CIRCUIT
DIAGRAM
TSEN
TSRNG
VOUT
15.2
To ADC
EQUATION 15-1:
VOUT RANGES
TABLE 15-1:
3.6V
1.8V
15.3
Temperature Output
15.4
Preliminary
DS41639A-page 151
PIC16(L)F1454/5/9
TABLE 15-2:
Name
FVRCON
Legend:
Bit 6
Bit 5
Bit 4
FVREN
FVRRDY
TSEN
TSRNG
Bit 3
Bit 2
CDAFVR<1:0>
Bit 1
Bit 0
ADFVR<1:0>
Register
on page
118
DS41639A-page 152
Preliminary
PIC16(L)F1454/5/9
16.0
ANALOG-TO-DIGITAL
CONVERTER (ADC) MODULE
(PIC16(L)F1455/9 ONLY)
Preliminary
DS41639A-page 153
PIC16(L)F1454/5/9
FIGURE 16-1:
Reserved
00000
Reserved
00001
Reserved
00010
AN3
00011
VREF+/AN4
00100
AN5
00101
AN6
00110
AN7
AN8
00111
01000
AN9
01001
AN10
01010
AN11
Reserved
01011
01100
Reserved
11100
ADPREF = 10
VREF- = VSS
VREF+
ref+ refADC
10
GO/DONE
ADFM
0 = Left Justify
1 = Right Justify
16
ADON
Temp Indicator
11101
DAC
FVR Buffer1
11110
VSS
ADRESH
ADRESL
11111
CHS<4:0>
Note 1:
DS41639A-page 154
Preliminary
PIC16(L)F1454/5/9
16.1
ADC Configuration
16.1.4
Port configuration
Channel selection
ADC voltage reference selection
ADC conversion clock source
Interrupt control
Result formatting
16.1.1
16.1.2
The source of the conversion clock is software selectable via the ADCS bits of the ADCON1 register. There
are seven possible clock options:
PORT CONFIGURATION
FOSC/2
FOSC/4
FOSC/8
FOSC/16
FOSC/32
FOSC/64
FRC (dedicated internal oscillator)
CHANNEL SELECTION
CONVERSION CLOCK
AN<11:3> pins
Temperature Indicator
DAC
FVR (Fixed Voltage Reference) Output
16.1.3
Preliminary
DS41639A-page 155
PIC16(L)F1454/5/9
TABLE 16-1:
ADC
Clock Source
ADCS<2:0>
20 MHz
16 MHz
8 MHz
4 MHz
1 MHz
Fosc/2
000
100 ns(2)
125 ns(2)
250 ns(2)
500 ns(2)
2.0 s
Fosc/4
100
(2)
200 ns
(2)
250 ns
(2)
Fosc/8
001
400 ns(2)
0.5 s(2)
Fosc/16
101
800 ns
1.0 s
Fosc/32
1.6 s
010
2.0 s
Fosc/64
110
3.2 s
4.0 s
FRC
x11
1.0-6.0 s(1,4)
1.0-6.0 s(1,4)
Legend:
Note 1:
2:
3:
4:
1.0 s
4.0 s
1.0 s
2.0 s
8.0 s(3)
2.0 s
4.0 s
16.0 s(3)
500 ns
4.0 s
(3)
8.0 s
1.0-6.0 s(1,4)
(3)
8.0 s
(3)
16.0 s
1.0-6.0 s(1,4)
32.0 s(3)
64.0 s(3)
1.0-6.0 s(1,4)
FIGURE 16-2:
TCY - TAD TAD1 TAD2 TAD3 TAD4 TAD5 TAD6 TAD7 TAD8 TAD9 TAD10 TAD11
b4
b1
b0
b6
b7
b2
b8
b3
b9
b5
Conversion starts
Holding capacitor is disconnected from analog input (typically 100 ns)
Set GO bit
On the following cycle:
ADRESH:ADRESL is loaded, GO bit is cleared,
ADIF bit is set, holding capacitor is connected to analog input.
DS41639A-page 156
Preliminary
PIC16(L)F1454/5/9
16.1.5
INTERRUPTS
16.1.6
RESULT FORMATTING
FIGURE 16-3:
(ADFM = 0)
ADRESL
MSB
LSB
bit 7
bit 0
bit 7
Unimplemented: Read as 0
bit 0
MSB
bit 7
LSB
bit 0
Unimplemented: Read as 0
bit 7
bit 0
10-bit A/D Result
Preliminary
DS41639A-page 157
PIC16(L)F1454/5/9
16.2
16.2.1
ADC Operation
16.2.4
STARTING A CONVERSION
16.2.2
COMPLETION OF A CONVERSION
16.2.3
TERMINATING A CONVERSION
DS41639A-page 158
16.2.5
AUTO-CONVERSION TRIGGER
The auto-conversion trigger allows periodic ADC measurements without software intervention. When a rising
edge of the selected source occurs, the GO/DONE bit
is set by hardware.
The auto-conversion trigger source is selected with the
TRIGSEL<2:0> bits of the ADCON2 register.
Using the auto-conversion trigger does not assure
proper ADC timing. It is the users responsibility to
ensure that the ADC timing requirements are met.
Auto-Conversion sources are:
TMR0
TMR1
TMR2
C1
C2
Preliminary
PIC16(L)F1454/5/9
16.2.6
EXAMPLE 16-1:
2.
3.
4.
5.
6.
7.
8.
Configure Port:
Disable pin output driver (Refer to the TRIS
register)
Configure pin as analog (Refer to the ANSEL
register)
Configure the ADC module:
Select ADC conversion clock
Configure voltage reference
Select ADC input channel
Turn on ADC module
Configure ADC interrupt (optional):
Clear ADC interrupt flag
Enable ADC interrupt
Enable peripheral interrupt
Enable global interrupt(1)
Wait the required acquisition time(2).
Start conversion by setting the GO/DONE bit.
Wait for ADC conversion to complete by one of
the following:
Polling the GO/DONE bit
Waiting for the ADC interrupt (interrupts
enabled)
Read ADC Result.
Clear the ADC interrupt flag (required if interrupt
is enabled).
A/D CONVERSION
Preliminary
DS41639A-page 159
PIC16(L)F1454/5/9
16.3
REGISTER 16-1:
U-0
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
CHS<4:0>
R/W-0/0
R/W-0/0
R/W-0/0
GO/DONE
ADON
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7
Unimplemented: Read as 0
bit 6-2
bit 1
bit 0
Note 1:
2:
3:
See Section 15.0 Temperature Indicator Module (PIC16(L)F1455/9 only) for more information.
See Section 17.0 Digital-to-Analog Converter (DAC) Module (PIC16(L)F1455/9 only) for more information.
See Section 14.0 Fixed Voltage Reference (FVR) (PIC16(L)F1455/9 only) for more information.
DS41639A-page 160
Preliminary
PIC16(L)F1454/5/9
REGISTER 16-2:
R/W-0/0
R/W-0/0
ADFM
R/W-0/0
R/W-0/0
ADCS<2:0>
U-0
U-0
R/W-0/0
bit 7
R/W-0/0
ADPREF<1:0>
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7
bit 6-4
bit 3-2
Unimplemented: Read as 0
bit 1-0
Note 1:
When selecting the VREF+ pin as the source of the positive reference, be aware that a minimum voltage
specification exists. See Section 29.0 Electrical Specifications for details.
Preliminary
DS41639A-page 161
PIC16(L)F1454/5/9
REGISTER 16-3:
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
TRIGSEL<2:0>
U-0
U-0
U-0
U-0
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7
Unimplemented: Read as 0
bit 6-4
bit 3-0
Unimplemented: Read as 0
Note 1:
2:
DS41639A-page 162
Preliminary
PIC16(L)F1454/5/9
REGISTER 16-4:
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
ADRES<9:2>
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7-0
REGISTER 16-5:
R/W-x/u
R/W-x/u
ADRES<1:0>
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7-6
bit 5-0
Preliminary
DS41639A-page 163
PIC16(L)F1454/5/9
REGISTER 16-6:
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
ADRES<9:8>
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7-2
bit 1-0
REGISTER 16-7:
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
ADRES<7:0>
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7-0
DS41639A-page 164
Preliminary
PIC16(L)F1454/5/9
16.4
EQUATION 16-1:
Assumptions:
T ACQ = Amplifier Settling Time + Hold Capacitor Charging Time + Temperature Coefficient
= T AMP + T C + T COFF
= 2s + T C + Temperature - 25C 0.05s/C
The value for TC can be approximated with the following equations:
1
= V CHOLD
V AP P LI ED 1 -------------------------n+1
2
1
TC
----------
RC
V AP P LI ED 1 e = V CHOLD
Tc
---------
1
RC
;combining [1] and [2]
V AP P LI ED 1 e = V A PP LIE D 1 -------------------------n+1
2
1
T C = C HOLD R IC + R SS + R S ln(1/2047)
= 12.5pF 1k + 7k + 10k ln(0.0004885)
= 1.12 s
Therefore:
T A CQ = 5s + 1.12 s + 50C- 25C 0.05 s/C
= 7.37s
Note 1: The reference voltage (VREF+) has no effect on the equation, since it cancels itself out.
2: The charge holding capacitor (CHOLD) is not discharged after each conversion.
3: The maximum recommended impedance for analog sources is 10 k. This is required to meet the pin
leakage specification.
Preliminary
DS41639A-page 165
PIC16(L)F1454/5/9
FIGURE 16-4:
Analog
Input
pin
Rs
VT 0.6V
CPIN
5 pF
VA
RIC 1k
Sampling
Switch
SS Rss
I LEAKAGE(1)
VT 0.6V
CHOLD = 10 pF
VREF-
Legend: CHOLD
CPIN
6V
5V
VDD 4V
3V
2V
= Sample/Hold Capacitance
= Input Capacitance
RSS
= Sampling Switch
VT
= Threshold Voltage
Note 1:
FIGURE 16-5:
5 6 7 8 9 10 11
Sampling Switch
(k)
Full-Scale Range
3FFh
3FEh
3FDh
3FCh
3FBh
03h
02h
01h
00h
VREF-
DS41639A-page 166
1.5 LSB
Zero-Scale
Transition
Full-Scale
Transition
Preliminary
VREF+
PIC16(L)F1454/5/9
TABLE 16-2:
Name
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
CHS<4:0>
Bit 1
Bit 0
GO/DONE
ADON
ADCON0
ADCON1
ADFM
ADCS<2:0>
ADPREF<1:0>
ADCON2
TRIGSEL<2:0>
ADRESH
ADRESL
ANSELA(3)
ANSELB
(2)
ANSELC(3)
INTCON
PIE1
PIR1
TRISA
TRISB(2)
TRISC
FVRCON
Legend:
Note 1:
2:
3:
Register
on Page
160
161
162
163, 164
163, 164
ANSA4
ANSB5
ANSB4
ANSC7(1)
ANSC6(1)
ANSC3
ANSC2
133
137
ANSC1
ANSC0
141
GIE
PEIE
TMR0IE
INTE
IOCIE
TMR0IF
INTF
IOCIF
96
TMR1GIE
ADIE(3)
RCIE
TXIE
SSP1IE
TMR2IE
TMR1IE
97
TMR1GIF
ADIF(3)
RCIF
TXIF
SSP1IF
TMR2IF
TMR1IF
99
TRISA5
TRISA4
(1)
(1)
(1)
132
TRISB7
TRISB6
TRISB5
TRISB4
136
TRISC7(2)
TRISC6(2)
TRISC5
TRISC4
TRISC3
TRISC2
TRISC1
TRISC0
140
FVREN
FVRRDY
TSEN
TSRNG
CDAFVR<1:0>
ADFVR<1:0>
150
x = unknown, u = unchanged, = unimplemented read as 0, q = value depends on condition. Shaded cells are not
used for ADC module.
Unimplemented, read as 1.
PIC16(L)F1459 only.
PIC16(L)F1455/9 only.
Preliminary
DS41639A-page 167
PIC16(L)F1454/5/9
NOTES:
DS41639A-page 168
Preliminary
PIC16(L)F1454/5/9
17.0
DIGITAL-TO-ANALOG
CONVERTER (DAC) MODULE
(PIC16(L)F1455/9 ONLY)
17.1
EQUATION 17-1:
IF DACEN = 1
DACR 4:0
VOUT = VSOURCE+ VSOURCE- ----------------------------+ VSOURCE5
2
IF DACEN = 0 and DACLPS = 1 and DACR[4:0] = 11111
V OUT = V SOURCE +
IF DACEN = 0 and DACLPS = 0 and DACR[4:0] = 00000
V OUT = V SOURCE
VSOURCE+ = VDD, VREF, or FVR BUFFER 2
VSOURCE- = VSS
17.2
17.3
Preliminary
DS41639A-page 169
PIC16(L)F1454/5/9
FIGURE 17-1:
VSOURCE+
VDD
DACR<4:0>
VREF+
R
R
DACPSS
DACEN
R
32
Steps
R
32-to-1 MUX
DAC
(To Comparator and
ADC Module)
DACOUT1
DACOE1
VSOURCE-
DACOUT2
DACOE2
FIGURE 17-2:
DAC
Module
R
Voltage
Reference
Output
Impedance
DS41639A-page 170
DACOUTX
Preliminary
PIC16(L)F1454/5/9
17.4
17.5
Effects of a Reset
Preliminary
DS41639A-page 171
PIC16(L)F1454/5/9
17.6
REGISTER 17-1:
R/W-0/0
U-0
R/W-0/0
R/W-0/0
DACEN
DACOE1
DACOE2
R/W-0/0
R/W-0/0
DACPSS<1:0>
U-0
U-0
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7
bit 6
Unimplemented: Read as 0
bit 5
bit 4
bit 3-2
bit 1-0
Unimplemented: Read as 0
REGISTER 17-2:
U-0
U-0
U-0
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
DACR<4:0>
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7-5
Unimplemented: Read as 0
bit 4-0
TABLE 17-1:
Name
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
FVRCON
FVREN
FVRRDY
TSEN
TSRNG
CDAFVR<1:0>
DACCON0
DACEN
DACOE1
DACOE2
DACPSS<1:0>
DACCON1
Legend:
Note 1:
Bit 1
Bit 0
ADFVR<1:0>
DACR<4:0>
Register
on page
356
172
172
= Unimplemented location, read as 0. Shaded cells are not used with the DAC module.
PIC16(L)F1455/9 only.
DS41639A-page 172
Preliminary
PIC16(L)F1454/5/9
18.0
COMPARATOR MODULE
(PIC16(L)F1455/9 ONLY)
FIGURE 18-1:
18.1
SINGLE COMPARATOR
VIN+
VIN-
Output
VINVIN+
Output
Note:
Comparator Overview
TABLE 18-1:
COMPARATOR AVAILABILITY
PER DEVICE
Device
C1
C2
PIC16(L)F1455
PIC16(L)F1459
Preliminary
DS41639A-page 173
PIC16(L)F1454/5/9
FIGURE 18-2:
CxNCH<2:0>
CxON(1)
det
Reserved
CXIN2-
1
MUX
2 (2)
CXIN3-
FVR Buffer2
CXIN1-
Set CxIF
0
MUX
1 (2)
DAC
FVR Buffer2
CxINTN
Interrupt
det
CXPOL
CxVN
Cx
CxVP
CXIN+
CxINTP
Interrupt
CXOUT
MCXOUT
+
EN
Q1
CxHYS
CxSP
async_CxOUT
2
3
CXSYNC
CxON
CXPCH<1:0>
To CWG
CXOE
TRIS bit
CXOUT
0
2
D
(from Timer1)
T1CLK
SYNCCXOUT
Note
1:
2:
DS41639A-page 174
Preliminary
To Timer1,
ADC
PIC16(L)F1454/5/9
18.2
Comparator Control
18.2.3
Enable
Output selection
Output polarity
Speed/Power selection
Hysteresis enable
Output synchronization
TABLE 18-2:
Interrupt enable
Interrupt edge polarity
Positive input channel selection
Negative input channel selection
18.2.1
CxPOL
CxOUT
18.2.4
COMPARATOR ENABLE
18.2.2
COMPARATOR OUTPUT
SELECTION
COMPARATOR OUTPUT
STATE VS. INPUT
CONDITIONS
Input Condition
COMPARATOR SPEED/POWER
SELECTION
The trade-off between speed or power can be optimized during program execution with the CxSP control
bit. The default state for this bit is 1 which selects the
Normal-Speed mode. Device power consumption can
be optimized at the cost of slower comparator propagation delay by clearing the CxSP bit to 0.
Preliminary
DS41639A-page 175
PIC16(L)F1454/5/9
18.3
Comparator Hysteresis
18.5
Comparator Interrupt
When either edge detector is triggered and its associated enable bit is set (CxINTP and/or CxINTN bits of
the CMxCON1 register), the Corresponding Interrupt
Flag bit (CxIF bit of the PIR2 register) will be set.
18.4
18.4.1
COMPARATOR OUTPUT
SYNCHRONIZATION
18.6
DS41639A-page 176
Preliminary
PIC16(L)F1454/5/9
18.7
18.8
18.9
Preliminary
DS41639A-page 177
PIC16(L)F1454/5/9
FIGURE 18-3:
Rs < 10K
Analog
Input
pin
VT 0.6V
RIC
To Comparator
VA
CPIN
5 pF
VT 0.6V
ILEAKAGE(1)
Vss
Legend: CPIN
= Input Capacitance
ILEAKAGE = Leakage Current at the pin due to various junctions
= Interconnect Resistance
RIC
= Source Impedance
RS
= Analog Voltage
VA
= Threshold Voltage
VT
Note 1:
DS41639A-page 178
Preliminary
PIC16(L)F1454/5/9
18.11 Register Definitions: Comparator Control
REGISTER 18-1:
R/W-0/0
R-0/0
R/W-0/0
R/W-0/0
U-0
R/W-1/1
R/W-0/0
R/W-0/0
CxON
CxOUT
CxOE
CxPOL
CxSP
CxHYS
CxSYNC
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7
bit 6
bit 5
bit 4
bit 3
Unimplemented: Read as 0
bit 2
bit 1
bit 0
Preliminary
DS41639A-page 179
PIC16(L)F1454/5/9
REGISTER 18-2:
R/W-0/0
R/W-0/0
CxINTP
CxINTN
R/W-0/0
R/W-0/0
CxPCH<1:0>
U-0
R/W-0/0
R/W-0/0
R/W-0/0
CxNCH<2:0>
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7
bit 6
bit 5-4
bit 3
Unimplemented: Read as 0
bit 2-0
REGISTER 18-3:
U-0
U-0
U-0
U-0
U-0
R-0/0
R-0/0
MC2OUT
MC1OUT
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7-2
Unimplemented: Read as 0
bit 1
bit 0
DS41639A-page 180
Preliminary
PIC16(L)F1454/5/9
TABLE 18-3:
Name
ANSELA
ANSELC
CM1CON0
Bit 6
ANSC7
(2)
C1ON
ANSC6
(2)
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Register
on Page
ANSA4
133
ANSC3
ANSC2
ANSC1
ANSC0
141
C1OUT
C1OE
C1POL
C1SP
C1HYS
C1SYNC
179
C2OE
C2POL
C2SP
C2HYS
C2SYNC
179
CM2CON0
C2ON
C2OUT
CM1CON1
C1NTP
C1INTN
CM2CON1
C2NTP
C2INTN
DACCON0
DACEN
DACOE1
DACOE2
DACCON1
FVRCON
FVREN
FVRRDY
TSEN
TSRNG
INTCON
GIE
PEIE
TMR0IE
INTE
IOCIE
TMR0IF
INTF
IOCIF
96
PIE2
OSFIE
C2IE
C1IE
BCL1IE
USBIE
ACTIE
98
PIR2
OSFIF
C2IF
C1IF
BCL1IF
USBIF
ACTIF
100
RA5
RA4
RA3
RA1
RA0
132
RC5
RC4
RC3
RC2
RC1
RC0
140
LATA5
LATA4
133
CMOUT
PORTA
PORTC
RC7
(2)
RC6
(2)
C1PCH<1:0>
C2PCH<1:0>
C1NCH<2:0>
180
C2NCH<2:0>
DACPSS<1:0>
180
MC2OUT
MC1OUT
180
172
DACR<4:0>
CDAFVR<1:0>
172
ADFVR<1:0>
150
LATA
LATC
LATC7(2)
LATC6(2)
LATC5
LATC4
LATC3
LATC2
LATC1
LATC0
141
TRISA4
(1)
(1)
(1)
132
TRISC4
TRISC3
TRISC2
TRISC1
TRISC0
140
TRISA
TRISA5
TRISC
TRISC7(2)
TRISC6(2)
TRISC5
Legend:
Note 1:
2:
3:
= unimplemented location, read as 0. Shaded cells are unused by the comparator module.
Unimplemented, read as 1.
PIC16(L)F1459 only.
PIC16(L)F1455/9 only,
Preliminary
DS41639A-page 181
PIC16(L)F1454/5/9
NOTES:
DS41639A-page 182
Preliminary
PIC16(L)F1454/5/9
19.0
TIMER0 MODULE
Note:
19.1.2
Timer0 Operation
19.1.1
19.1
FIGURE 19-1:
FOSC/4
Data Bus
0
T0CKI
1
1
8
Sync
2 TCY
TMR0
0
TMR0SE TMR0CS
8-bit
Prescaler
PSA
PS<2:0>
Preliminary
DS41639A-page 183
PIC16(L)F1454/5/9
19.1.3
SOFTWARE PROGRAMMABLE
PRESCALER
There are eight prescaler options for the Timer0 module ranging from 1:2 to 1:256. The prescale values are
selectable via the PS<2:0> bits of the OPTION_REG
register. In order to have a 1:1 prescaler value for the
Timer0 module, the prescaler must be disabled by setting the PSA bit of the OPTION_REG register.
The prescaler is not readable or writable. All instructions
writing to the TMR0 register will clear the prescaler.
19.1.4
TIMER0 INTERRUPT
19.1.5
19.1.6
DS41639A-page 184
Preliminary
PIC16(L)F1454/5/9
19.2
REGISTER 19-1:
R/W-1/1
R/W-1/1
R/W-1/1
R/W-1/1
R/W-1/1
WPUEN
INTEDG
TMR0CS
TMR0SE
PSA
R/W-1/1
R/W-1/1
R/W-1/1
PS<2:0>
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7
bit 6
bit 5
bit 4
bit 3
bit 2-0
TABLE 19-1:
Name
OPTION_REG
TRISA
Legend:
*
Note 1:
2:
000
001
010
011
100
101
110
111
1:2
1:4
1:8
1 : 16
1 : 32
1 : 64
1 : 128
1 : 256
Bit 6
Bit 5
Bit 4
TRIGSEL<2:0>
INTCON
TMR0
Timer0 Rate
ADCON2(2)
Bit Value
Bit 3
Bit 2
Bit 1
Bit 0
Register
on Page
162
TMR0IF
INTF
IOCIF
96
GIE
PEIE
TMR0IE
INTE
IOCIE
WPUEN
INTEDG
TMR0CS
TMR0SE
PSA
PS<2:0>
185
TRISA5
TRISA4
183*
(1)
(1)
(1)
132
= Unimplemented location, read as 0. Shaded cells are not used by the Timer0 module.
Page provides register information.
Unimplemented, read as 1.
PIC16(L)F1455/9 only.
Preliminary
DS41639A-page 185
PIC16(L)F1454/5/9
NOTES:
DS41639A-page 186
Preliminary
PIC16(L)F1454/5/9
20.0
FIGURE 20-1:
T1GSS<1:0>
T1GSPM
00
T1G
From Timer0
Overflow
01
sync_C1OUT
10
sync_C2OUT
11
T1GVAL
0
Single-Pulse
TMR1ON
T1GPOL
t1g_in
CK
R
Acq. Control
Q1
Data Bus
D
Q
RD
T1GCON
EN
Interrupt
T1GGO/DONE
Set
TMR1GIF
det
T1GTM
TMR1GE
TMR1ON
To Comparator Module(4)
TMR1(2)
TMR1H
EN
TMR1L
T1CLK
Synchronized
clock input
0
1
TMR1CS<1:0>
T1OSO
LFINTOSC
T1OSC
T1OSI
T1SYNC
OUT
11
Synchronize(3)
Prescaler
1, 2, 4, 8
det
10
EN
0
T1OSCEN
(1)
FOSC
Internal
Clock
01
FOSC/4
Internal
Clock
00
2
T1CKPS<1:0>
FOSC/2
Internal
Clock
Sleep input
T1CKI
To Clock Switching Modules
Note 1:
2:
3:
4:
Preliminary
DS41639A-page 187
PIC16(L)F1454/5/9
20.1
Timer1 Operation
20.2
TABLE 20-1:
TIMER1 ENABLE
SELECTIONS
20.2.1
Timer1
Operation
TMR1ON
TMR1GE
Off
Off
20.2.2
Always On
Count Enabled
TABLE 20-2:
TMR1CS<1:0>
T1OSCEN
11
LFINTOSC
10
01
00
DS41639A-page 188
Clock Source
Preliminary
PIC16(L)F1454/5/9
20.3
Timer1 Prescaler
20.5.1
20.4
Timer1 Oscillator
20.6
Note:
20.5
Timer1 Operation in
Asynchronous Counter Mode
20.6.1
TABLE 20-3:
T1CLK
T1GPOL
T1G
Counts
Holds Count
Holds Count
Counts
Timer1 Gate
Preliminary
Timer1 Operation
DS41639A-page 189
PIC16(L)F1454/5/9
20.6.2
20.6.3
TABLE 20-4:
T1GSS
01
Overflow of Timer0
(TMR0 increments from FFh to 00h)
10
11
20.6.2.1
20.6.4
When Timer0 increments from FFh to 00h, a low-tohigh pulse will automatically be generated and internally supplied to the Timer1 gate circuitry.
20.6.2.3
20.6.2.4
Note:
20.6.2.2
When Timer1 Gate Toggle mode is enabled, it is possible to measure the full-cycle length of a Timer1 gate
signal, as opposed to the duration of a single level
pulse.
00
20.6.5
20.6.6
When Timer1 Gate Event Interrupt is enabled, it is possible to generate an interrupt upon the completion of a
gate event. When the falling edge of T1GVAL occurs,
the TMR1GIF flag bit in the PIR1 register will be set. If
the TMR1GIE bit in the PIE1 register is set, then an
interrupt will be recognized.
The TMR1GIF flag bit operates even when the Timer1
gate is not enabled (TMR1GE bit is cleared).
DS41639A-page 190
Preliminary
PIC16(L)F1454/5/9
20.7
Timer1 Interrupt
20.8
FIGURE 20-2:
T1CKI = 1
when TMR1
Enabled
T1CKI = 0
when TMR1
Enabled
Note 1:
2:
Preliminary
DS41639A-page 191
PIC16(L)F1454/5/9
FIGURE 20-3:
TMR1GE
T1GPOL
t1g_in
T1CKI
T1GVAL
Timer1
FIGURE 20-4:
N+1
N+2
N+3
N+4
TMR1GE
T1GPOL
T1GTM
t1g_in
T1CKI
T1GVAL
Timer1
DS41639A-page 192
N+4
Preliminary
N+8
PIC16(L)F1454/5/9
FIGURE 20-5:
TMR1GE
T1GPOL
T1GSPM
T1GGO/
Cleared by hardware on
falling edge of T1GVAL
Set by software
DONE
Counting enabled on
rising edge of T1G
t1g_in
T1CKI
T1GVAL
Timer1
TMR1GIF
N+1
Set by hardware on
falling edge of T1GVAL
Cleared by software
N+2
Preliminary
Cleared by
software
DS41639A-page 193
PIC16(L)F1454/5/9
FIGURE 20-6:
TMR1GE
T1GPOL
T1GSPM
T1GTM
T1GGO/
Cleared by hardware on
falling edge of T1GVAL
Set by software
DONE
Counting enabled on
rising edge of T1G
t1g_in
T1CKI
T1GVAL
Timer1
TMR1GIF
DS41639A-page 194
Cleared by software
N+1
N+2
N+3
N+4
Set by hardware on
falling edge of T1GVAL
Preliminary
Cleared by
software
PIC16(L)F1454/5/9
20.9
REGISTER 20-1:
R/W-0/u
R/W-0/u
TMR1CS<1:0>
R/W-0/u
R/W-0/u
T1CKPS<1:0>
R/W-0/u
R/W-0/u
U-0
R/W-0/u
T1OSCEN
T1SYNC
TMR1ON
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7-6
bit 5-4
bit 3
bit 2
bit 1
Unimplemented: Read as 0
bit 0
Preliminary
DS41639A-page 195
PIC16(L)F1454/5/9
REGISTER 20-2:
R/W-0/u
R/W-0/u
R/W-0/u
R/W-0/u
R/W/HC-0/u
R-x/x
TMR1GE
T1GPOL
T1GTM
T1GSPM
T1GGO/
DONE
T1GVAL
R/W-0/u
R/W-0/u
T1GSS<1:0>
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7
bit 6
bit 5
bit 4
bit 3
bit 2
bit 1-0
DS41639A-page 196
Preliminary
PIC16(L)F1454/5/9
TABLE 20-5:
Name
ANSELA(3)
APFCON
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Register
on Page
ANSA4
133
CLKRSEL
SDOSEL(2)
SSSEL
T1GSEL
P2SEL(2)
130
GIE
PEIE
TMR0IE
INTE
IOCIE
TMR0IF
INTF
IOCIF
96
PIE1
TMR1GIE
ADIE(3)
RCIE
TXIE
SSP1IE
TMR2IE
TMR1IE
97
PIR1
TMR1GIF
ADIF(3)
RCIF
TXIF
SSP1IF
TMR2IF
TMR1IF
INTCON
TMR1H
Holding Register for the Most Significant Byte of the 16-bit TMR1 Count
TMR1L
Holding Register for the Least Significant Byte of the 16-bit TMR1 Count
TRISA
T1CON
T1GCON
Legend:
*
Note 1:
2:
3:
TMR1CS<1:0>
TMR1GE
T1GPOL
TRISA5
TRISA4
T1CKPS<1:0>
T1GTM
T1GSPM
99
187*
187*
(1)
(1)
(1)
132
T1OSCEN
T1SYNC
TMR1ON
195
T1GGO/
DONE
T1GVAL
T1GSS<1:0>
196
= unimplemented location, read as 0. Shaded cells are not used by the Timer1 module.
Page provides register information.
Unimplemented, read as 1.
PIC16(L)F1455 only.
PIC16(L)F1455/9 only.
Preliminary
DS41639A-page 197
PIC16(L)F1454/5/9
NOTES:
DS41639A-page 198
Preliminary
PIC16(L)F1454/5/9
21.0
TIMER2 MODULE
FIGURE 21-1:
FOSC/4
Prescaler
1:1, 1:4, 1:16, 1:64
2
TMR2
Comparator
Sets Flag
bit TMR2IF
Reset
Postscaler
1:1 to 1:16
EQ
T2CKPS<1:0>
4
PR2
T2OUTPS<3:0>
Preliminary
DS41639A-page 199
PIC16(L)F1454/5/9
21.1
Timer2 Operation
21.3
Timer2 Output
21.4
21.2
Timer2 Interrupt
DS41639A-page 200
Preliminary
PIC16(L)F1454/5/9
21.5
REGISTER 21-1:
U-0
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
T2OUTPS<3:0>
R/W-0/0
R/W-0/0
TMR2ON
bit 7
R/W-0/0
T2CKPS<1:0>
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7
Unimplemented: Read as 0
bit 6-3
bit 2
bit 1-0
Preliminary
DS41639A-page 201
PIC16(L)F1454/5/9
TABLE 21-1:
Name
INTCON
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Register
on Page
GIE
PEIE
TMR0IE
INTE
IOCIE
TMR0IF
INTF
IOCIF
96
PIE1
TMR1GIE
ADIE(1)
RCIE
TXIE
SSP1IE
TMR2IE
TMR1IE
97
PIR1
TMR1GIF
ADIF(1)
RCIF
TXIF
SSP1IF
TMR2IF
TMR1IF
PR2
99
199*
PWM1CON
PWM1EN
PWM1OE
PWM1OUT PWM1POL
291
PWM2CON
PWM2EN
PWM2OE
PWM2OUT PWM2POL
291
T2CON
TMR2
Legend:
*
Note 1:
T2OUTPS<3:0>
TMR2ON
T2CKPS<1:0>
201
199*
= unimplemented location, read as 0. Shaded cells are not used for Timer2 module.
Page provides register information.
PIC16(L)F1455/9 only.
DS41639A-page 202
Preliminary
PIC16(L)F1454/5/9
22.0
MASTER SYNCHRONOUS
SERIAL PORT (MSSP)
MODULE
22.1
Master mode
Slave mode
Clock Parity
Slave Select Synchronization (Slave mode only)
Daisy-chain connection of slave devices
FIGURE 22-1:
Write
SSPBUF Reg
SDI
SDO_out
SSPSR Reg
SDO
bit 0
SS
SS Control
Enable
Shift
Clock
2 (CKP, CKE)
Clock Select
Edge
Select
SCK_out
SSPM<3:0>
4
SCK
Edge
Select
TRIS bit
Preliminary
( TMR22Output )
Prescaler TOSC
4, 16, 64
Baud Rate
Generator
(SSPADD)
DS41639A-page 203
PIC16(L)F1454/5/9
The I2C interface supports the following modes and
features:
Master mode
Slave mode
Byte NACKing (Slave mode)
Limited Multi-master support
7-bit and 10-bit addressing
Start and Stop interrupts
Interrupt masking
Clock stretching
Bus collision detection
General call address matching
Address masking
Address Hold and Data Hold modes
Selectable SDA hold times
Figure 22-2 is a block diagram of the I2C interface module in Master mode. Figure 22-3 is a diagram of the I2C
interface module in Slave mode.
[SSPM<3:0>]
Write
SSP1BUF
Shift
Clock
SDA in
SCL
SCL in
Bus Collision
DS41639A-page 204
LSb
Preliminary
Clock Cntl
SSPSR
MSb
SDA
Baud Rate
Generator
(SSPADD)
FIGURE 22-2:
PIC16(L)F1454/5/9
FIGURE 22-3:
Write
SSPBUF Reg
SCL
Shift
Clock
SSPSR Reg
SDA
MSb
LSb
SSPMSK Reg
Match Detect
Addr Match
SSPADD Reg
Start and
Stop bit Detect
Preliminary
Set, Reset
S, P bits
(SSPSTAT Reg)
DS41639A-page 205
PIC16(L)F1454/5/9
22.2
its SDO pin) and the slave device is reading this bit and
saving it as the LSb of its shift register, that the slave
device is also sending out the MSb from its shift register
(on its SDO pin) and the master device is reading this
bit and saving it as the LSb of its shift register.
After eight bits have been shifted out, the master and
slave have exchanged register values.
If there is more data to exchange, the shift registers are
loaded with new data and the process repeats itself.
Whether the data is meaningful or not (dummy data),
depends on the application software. This leads to
three scenarios for data transmission:
DS41639A-page 206
Preliminary
PIC16(L)F1454/5/9
FIGURE 22-4:
SPI Master
SCK
SCK
SDO
SDI
SDI
SDO
General I/O
General I/O
SS
General I/O
SCK
SDI
SDO
SPI Slave
#1
SPI Slave
#2
SS
SCK
SDI
SDO
SPI Slave
#3
SS
22.2.1
Preliminary
DS41639A-page 207
PIC16(L)F1454/5/9
22.2.2
FIGURE 22-5:
SDI
SDI
Shift Register
(SSPSR)
MSb
LSb
SCK
General I/O
Processor 1
DS41639A-page 208
SDO
Serial Clock
Slave Select
(optional)
Preliminary
Shift Register
(SSPSR)
MSb
LSb
SCK
SS
Processor 2
PIC16(L)F1454/5/9
22.2.3
FIGURE 22-6:
Write to
SSPBUF
SCK
(CKP = 0
CKE = 0)
SCK
(CKP = 1
CKE = 0)
4 Clock
Modes
SCK
(CKP = 0
CKE = 1)
SCK
(CKP = 1
CKE = 1)
SDO
(CKE = 0)
bit 7
bit 6
bit 5
bit 4
bit 3
bit 2
bit 1
bit 0
SDO
(CKE = 1)
bit 7
bit 6
bit 5
bit 4
bit 3
bit 2
bit 1
bit 0
SDI
(SMP = 0)
bit 0
bit 7
Input
Sample
(SMP = 0)
SDI
(SMP = 1)
bit 0
bit 7
Input
Sample
(SMP = 1)
SSPIF
SSPSR to
SSPBUF
Preliminary
DS41639A-page 209
PIC16(L)F1454/5/9
22.2.4
22.2.5
Daisy-Chain Configuration
SLAVE SELECT
SYNCHRONIZATION
The Slave Select can also be used to synchronize communication. The Slave Select line is held high until the
master device is ready to communicate. When the
Slave Select line is pulled low, the slave knows that a
new transmission is starting.
If the slave fails to receive the communication properly,
it will be reset at the end of the transmission, when the
Slave Select line returns to a high state. The slave is
then ready to receive a new transmission when the
Slave Select line is pulled low again. If the Slave Select
line is not used, there is a risk that the slave will eventually become out of sync with the master. If the slave
misses a bit, it will always be one bit off in future transmissions. Use of the Slave Select line allows the slave
and master to align themselves at the beginning of
each transmission.
The SS pin allows a Synchronous Slave mode. The
SPI must be in Slave mode with SS pin control enabled
(SSPCON1<3:0> = 0100).
When the SS pin is low, transmission and reception are
enabled and the SDO pin is driven.
When the SS pin goes high, the SDO pin is no longer
driven, even if in the middle of a transmitted byte and
becomes a floating output. External pull-up/pull-down
resistors may be desirable depending on the application.
Note 1: When the SPI is in Slave mode with SS pin
control enabled (SSPCON1<3:0> =
0100), the SPI module will reset if the SS
pin is set to VDD.
2: When the SPI is used in Slave mode with
CKE set; the user must enable SS pin
control.
3: While operated in SPI Slave mode the
SMP bit of the SSPSTAT register must
remain clear.
DS41639A-page 210
Preliminary
PIC16(L)F1454/5/9
FIGURE 22-7:
SPI Master
SCK
SCK
SDO
SDI
SDI
SPI Slave
#1
SDO
General I/O
SS
SCK
SDI
SPI Slave
#2
SDO
SS
SCK
SDI
SPI Slave
#3
SDO
SS
FIGURE 22-8:
SS
SCK
(CKP = 0
CKE = 0)
SCK
(CKP = 1
CKE = 0)
Write to
SSPBUF
SSPBUF to
SSPSR
SDO
bit 7
bit 6
bit 7
SDI
bit 6
bit 0
bit 0
bit 7
bit 7
Input
Sample
SSPIF
Interrupt
Flag
SSPSR to
SSPBUF
Preliminary
DS41639A-page 211
PIC16(L)F1454/5/9
FIGURE 22-9:
SS
Optional
SCK
(CKP = 0
CKE = 0)
SCK
(CKP = 1
CKE = 0)
Write to
SSPBUF
Valid
SDO
bit 7
bit 6
bit 5
bit 4
bit 3
bit 2
bit 1
bit 0
SDI
bit 0
bit 7
Input
Sample
SSPIF
Interrupt
Flag
SSPSR to
SSPBUF
Write Collision
detection active
FIGURE 22-10:
SS
Not Optional
SCK
(CKP = 0
CKE = 1)
SCK
(CKP = 1
CKE = 1)
Write to
SSPBUF
Valid
SDO
bit 7
bit 6
bit 5
bit 4
bit 3
bit 2
bit 1
bit 0
SDI
bit 0
bit 7
Input
Sample
SSPIF
Interrupt
Flag
SSPSR to
SSPBUF
Write Collision
detection active
DS41639A-page 212
Preliminary
PIC16(L)F1454/5/9
22.2.6
TABLE 22-1:
Name
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Register
on Page
ANSELA(3)
ANSA4
133
INTCON
PIE1
PIR1
SSP1BUF
GIE
PEIE
TMR0IE
INTE
IOCIE
TMR0IF
INTF
IOCIF
96
TMR1GIE
ADIE(3)
RCIE
TXIE
SSP1IE
TMR2IE
TMR1IE
97
TMR1GIF
ADIF(3)
RCIF
TXIF
SSP1IF
TMR2IF
TMR1IF
SSP1CON1
WCOL
SSPOV
SSPEN
CKP
SSP1CON3
ACKTIM
PCIE
SCIE
BOEN
SSP1STAT
99
207*
SSPM<3:0>
SDAHT
SBCDE
AHEN
253
DHEN
255
SMP
CKE
D/A
R/W
UA
BF
251
TRISA
TRISA5
TRISA4
(1)
(1)
(1)
132
TRISC
TRISC7(2)
TRISC6(2)
TRISC5
TRISC4
TRISC3
TRISC2
TRISC1
TRISC0
140
Legend:
*
Note 1:
2:
3:
= Unimplemented location, read as 0. Shaded cells are not used by the MSSP in SPI mode.
Page provides register information.
Unimplemented, read as 1.
PIC16(L)F1459 only.
PIC16(L)F1455/9 only.
Preliminary
DS41639A-page 213
PIC16(L)F1454/5/9
22.3
FIGURE 22-11:
VDD
SCL
SDA
DS41639A-page 214
Slave
SDA
SCL
VDD
Master
I2C MASTER/
SLAVE CONNECTION
Preliminary
PIC16(L)F1454/5/9
When one device is transmitting a logical one, or letting
the line float, and a second device is transmitting a logical zero, or holding the line low, the first device can
detect that the line is not a logical one. This detection,
when used on the SCL line, is called clock stretching.
Clock stretching gives slave devices a mechanism to
control the flow of data. When this detection is used on
the SDA line, it is called arbitration. Arbitration ensures
that there is only one master device communicating at
any single time.
22.3.1
CLOCK STRETCHING
22.3.2
ARBITRATION
Each master device must monitor the bus for Start and
Stop bits. If the device detects that the bus is busy, it
cannot begin a new message until the bus returns to an
Idle state.
However, two master devices may try to initiate a transmission on or about the same time. When this occurs,
the process of arbitration begins. Each transmitter
checks the level of the SDA data line and compares it
to the level that it expects to find. The first transmitter to
observe that the two levels do not match, loses arbitration, and must stop transmitting on the SDA line.
For example, if one transmitter holds the SDA line to a
logical one (lets it float) and a second transmitter holds
it to a logical zero (pulls it low), the result is that the
SDA line will be low. The first transmitter then observes
that the level of the line is different than expected and
concludes that another transmitter is communicating.
The first transmitter to notice this difference is the one
that loses arbitration and must stop driving the SDA
line. If this transmitter is also a master device, it also
must stop driving the SCL line. It then can monitor the
lines for a Stop condition before trying to reissue its
transmission. In the meantime, the other device that
has not noticed any difference between the expected
and actual levels on the SDA line continues with its
original transmission. It can do so without any complications, because so far, the transmission appears
exactly as expected with no other transmitter disturbing
the message.
Slave Transmit mode can also be arbitrated, when a
master addresses multiple slaves, but this is less common.
If two master devices are sending a message to two different slave devices at the address stage, the master
sending the lower slave address always wins arbitration. When two master devices send messages to the
same slave address, and addresses can sometimes
refer to multiple slaves, the arbitration process must
continue into the data stage.
Arbitration usually occurs very rarely, but it is a necessary process for proper multi-master support.
Preliminary
DS41639A-page 215
PIC16(L)F1454/5/9
22.4
TABLE 22-2:
BYTE FORMAT
22.4.4
DS41639A-page 216
TERM
Transmitter
Preliminary
PIC16(L)F1454/5/9
22.4.5
START CONDITION
22.4.7
STOP CONDITION
RESTART CONDITION
FIGURE 22-12:
SDA
SCL
S
Start
P
Change of
Change of
Data Allowed
Data Allowed
Condition
Stop
Condition
Preliminary
DS41639A-page 217
PIC16(L)F1454/5/9
FIGURE 22-13:
Sr
Change of
Change of
Data Allowed
Restart
Data Allowed
Condition
DS41639A-page 218
Preliminary
PIC16(L)F1454/5/9
22.4.9
22.5
ACKNOWLEDGE SEQUENCE
Preliminary
DS41639A-page 219
PIC16(L)F1454/5/9
22.5.2
22.5.2.2
SLAVE RECEPTION
DS41639A-page 220
Preliminary
Preliminary
SSPOV
BF
SSPIF
A7
A6
A5
A4
A3
Receiving Address
A2
A1
ACK
D7
D6
D3
D2
D1
SSPBUF is read
Cleared by software
D4
Receiving Data
D5
D6
First byte
of data is
available
in SSPBUF
D0 ACK D7
D3
D2
D1
Cleared by software
D4
Receiving Data
D5
D0
ACK = 1
FIGURE 22-14:
SCL
SDA
PIC16(L)F1454/5/9
DS41639A-page 221
DS41639A-page 222
Preliminary
CKP
SSPOV
BF
SSPIF
SCL
A7
A6
A5
A4
A3
A2
A1
R/W=0 ACK
SEN
2
D6
D5
D4
D3
D2
D1
D0
SSPBUF is read
Cleared by software
D7
Receive Data
ACK
SEN
3
D5
D4
D3
First byte
of data is
available
in SSPBUF
D2
D1
Cleared by software
D6
D7
Receive Data
D0
ACK
FIGURE 22-15:
SDA
Receive Address
PIC16(L)F1454/5/9
I2C SLAVE, 7-BIT ADDRESS, RECEPTION (SEN = 1, AHEN = 0, DHEN = 0)
Preliminary
ACKTIM
CKP
ACKDT
BF
SSPIF
Receiving Address
Slave software
clears ACKDT to
Address is
read from
SSBUF
If AHEN = 1:
SSPIF is set
When AHEN=1:
CKP is cleared by hardware
and SCL is stretched
A7 A6 A5 A4 A3 A2 A1
Receiving Data
9
2
ACKTIM cleared by
hardware in 9th
rising edge of SCL
When DHEN=1:
CKP is cleared by
hardware on 8th falling
edge of SCL
SSPIF is set on
9th falling edge of
SCL, after ACK
ACK D7 D6 D5 D4 D3 D2 D1 D0
Received Data
Slave software
sets ACKDT to
not ACK
Cleared by software
D7 D6 D5 D4 D3 D2 D1 D0
ACK
No interrupt
after not ACK
from Slave
ACK=1
Master sends
Stop condition
FIGURE 22-16:
SCL
SDA
PIC16(L)F1454/5/9
DS41639A-page 223
DS41639A-page 224
Preliminary
ACKTIM
CKP
ACKDT
BF
SSPIF
Receiving Address
4
5
6 7
When AHEN = 1;
on the 8th falling edge
of SCL of an address
byte, CKP is cleared
Received
address is loaded into
SSPBUF
2 3
A7 A6 A5 A4 A3 A2 A1
ACK
Receive Data
2 3
6 7
When DHEN = 1;
on the 8th falling edge
of SCL of a received
data byte, CKP is cleared
Received data is
available on SSPBUF
Cleared by software
D7 D6 D5 D4 D3 D2 D1 D0
ACK
Receive Data
1
3 4
6 7
Set by software,
release SCL
Slave sends
not ACK
SSPBUF can be
read any time before
next byte is loaded
D7 D6 D5 D4 D3 D2 D1 D0
ACK
No interrupt after
if not ACK
from Slave
Master sends
Stop condition
FIGURE 22-17:
SCL
SDA
R/W = 0
Master releases
SDA to slave for ACK sequence
PIC16(L)F1454/5/9
I2C SLAVE, 7-BIT ADDRESS, RECEPTION (SEN = 1, AHEN = 1, DHEN = 1)
PIC16(L)F1454/5/9
22.5.3
SLAVE TRANSMISSION
22.5.3.2
7-bit Transmission
1.
22.5.3.1
Preliminary
DS41639A-page 225
DS41639A-page 226
Preliminary
D/A
R/W
ACKSTAT
CKP
BF
SSPIF
Received address
is read from SSPBUF
Indicates an address
has been received
Automatic
Set by software
Data to transmit is
loaded into SSPBUF
Cleared by software
D7 D6 D5 D4 D3 D2 D1 D0 ACK
Transmitting Data
CKP is not
held for not
ACK
BF is automatically
cleared after 8th falling
edge of SCL
D7 D6 D5 D4 D3 D2 D1 D0
Transmitting Data
ACK
FIGURE 22-18:
SCL
SDA
R/W = 1 Automatic
A7 A6 A5 A4 A3 A2 A1
ACK
Receiving Address
Master sends
Stop condition
PIC16(L)F1454/5/9
I2C SLAVE, 7-BIT ADDRESS, TRANSMISSION (AHEN = 0)
PIC16(L)F1454/5/9
22.5.3.3
Preliminary
DS41639A-page 227
DS41639A-page 228
Preliminary
D/A
R/W
ACKTIM
CKP
ACKSTAT
ACKDT
BF
SSPIF
Receiving Address
Slave clears
ACKDT to ACK
address
ACK
When R/W = 1;
CKP is always
cleared after ACK
R/W = 1
Received address
is read from SSPBUF
When AHEN = 1;
CKP is cleared by hardware
after receiving matching
address.
A7 A6 A5 A4 A3 A2 A1
3
Cleared by software
Set by software,
releases SCL
Data to transmit is
loaded into SSPBUF
Transmitting Data
Automatic
D7 D6 D5 D4 D3 D2 D1 D0 ACK
ACKTIM is cleared
on 9th rising edge of SCL
Automatic
Transmitting Data
Masters ACK
response is copied
to SSPSTAT
BF is automatically
cleared after 8th falling
edge of SCL
D7 D6 D5 D4 D3 D2 D1 D0
9
ACK
Master sends
Stop condition
FIGURE 22-19:
SCL
SDA
PIC16(L)F1454/5/9
I2C SLAVE, 7-BIT ADDRESS, TRANSMISSION (AHEN = 1)
PIC16(L)F1454/5/9
22.5.4
22.5.5
3.
4.
5.
6.
7.
8.
9.
Preliminary
DS41639A-page 229
DS41639A-page 230
Preliminary
CKP
UA
BF
SSPIF
1
5
0 A9 A8
Set by hardware
on 9th falling edge
When UA = 1;
SCL is held low
If address matches
SSPADD it is loaded into
SSPBUF
ACK
A7 A6 A5 A4 A3 A2 A1 A0 ACK
9
1
Data is read
from SSPBUF
D7 D6 D5 D4 D3 D2 D1 D0 ACK
Receive Data
Set by software,
When SEN = 1;
releasing SCL
CKP is cleared after
9th falling edge of received byte
Receive address is
read from SSPBUF
Cleared by software
D7 D6 D5 D4 D3 D2 D1 D0 ACK
Receive Data
FIGURE 22-20:
SCL
SDA
Master sends
Stop condition
PIC16(L)F1454/5/9
I2C SLAVE, 10-BIT ADDRESS, RECEPTION (SEN = 1, AHEN = 0, DHEN = 0)
Preliminary
ACKTIM
CKP
UA
ACKDT
BF
A9
A8
Set by hardware
on 9th falling edge
R/W = 0
If when AHEN = 1;
on the 8th falling edge
of SCL of an address
byte, CKP is cleared
ACK
UA
2
A5
A4
A2
A1
Update to SSPADD is
not allowed until 9th
falling edge of SCL
SSPBUF can be
read anytime before
the next received byte
A3
Cleared by software
A7
A0
ACK
UA
D6
D5
D4
D2
D1
Update of SSPADD,
clears UA and releases
SCL
D3
Receive Data
Cleared by software
D7
Received data
is read from
SSPBUF
D6 D5
Receive Data
D0 ACK D7
FIGURE 22-21:
SSPIF
SCL
SDA
PIC16(L)F1454/5/9
DS41639A-page 231
DS41639A-page 232
Preliminary
D/A
R/W
ACKSTAT
CKP
UA
BF
SSPIF
Set by hardware
Indicates an address
has been received
UA indicates SSPADD
must be updated
SSPBUF loaded
with received address
SCL
1
3
7 8
After SSPADD is
updated, UA is cleared
and SCL is released
Cleared by software
A7 A6 A5 A4 A3 A2 A1 A0 ACK
1
4
7 8
Set by hardware
2 3
When R/W = 1;
CKP is cleared on
9th falling edge of SCL
Received address is
read from SSPBUF
Sr
1 1 1 1 0 A9 A8
ACK
Set by software
releases SCL
Data to transmit is
loaded into SSPBUF
D7 D6 D5 D4 D3 D2 D1 D0
Master sends
Stop condition
ACK = 1
Master sends
not ACK
FIGURE 22-22:
SDA
Master sends
Restart event
PIC16(L)F1454/5/9
I2C SLAVE, 10-BIT ADDRESS, TRANSMISSION (SEN = 0, AHEN = 0, DHEN = 0)
PIC16(L)F1454/5/9
22.5.6
22.5.6.2
CLOCK STRETCHING
FIGURE 22-23:
22.5.6.3
Byte NACKing
Any time the CKP bit is cleared, the module will wait
for the SCL line to go low and then hold it. However,
clearing the CKP bit will not assert the SCL output low
until the SCL output is already sampled low. Therefore, the CKP bit will not assert the SCL line until an
external I2C master device has already asserted the
SCL line. The SCL output will remain low until the CKP
bit is set and all other devices on the I2C bus have
released SCL. This ensures that a write to the CKP bit
will not violate the minimum high time requirement for
SCL (see Figure 22-23).
Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4
SDA
DX 1
DX
SCL
CKP
Master device
asserts clock
Master device
releases clock
WR
SSPCON1
Preliminary
DS41639A-page 233
PIC16(L)F1454/5/9
22.5.8
FIGURE 22-24:
SDA
SCL
S
Receiving Data
ACK
D6
D5
D4
D3
D2
D1
D0
SSPIF
BF (SSPSTAT<0>)
Cleared by software
SSPBUF is read
GCEN (SSPCON2<7>)
22.5.9
DS41639A-page 234
Preliminary
PIC16(L)F1454/5/9
22.6
22.6.1
In Master Receive mode, the first byte transmitted contains the slave address of the transmitting device
(7 bits) and the R/W bit. In this case, the R/W bit will be
logic 1. Thus, the first byte transmitted is a 7-bit slave
address followed by a 1 to indicate the receive bit.
Serial data is received via SDA, while SCL outputs the
serial clock. Serial data is received eight bits at a time.
After each byte is received, an Acknowledge bit is
transmitted. Start and Stop conditions indicate the
beginning and end of transmission.
A Baud Rate Generator is used to set the clock
frequency output on SCL. See Section 22.7 Baud
Rate Generator for more detail.
2: When in Master mode, Start/Stop detection is masked and an interrupt is generated when the SEN/PEN bit is cleared and
the generation is complete.
Preliminary
DS41639A-page 235
PIC16(L)F1454/5/9
22.6.2
CLOCK ARBITRATION
FIGURE 22-25:
SDA
DX 1
DX
SCL deasserted but slave holds
SCL low (clock arbitration)
SCL
BRG decrements on
Q2 and Q4 cycles
BRG
Value
03h
02h
01h
03h
02h
22.6.3
DS41639A-page 236
Preliminary
PIC16(L)F1454/5/9
22.6.4
CONDITION TIMING
FIGURE 22-26:
SDA = 1,
SCL = 1
TBRG
TBRG
SDA
1st bit
2nd bit
TBRG
SCL
S
Preliminary
TBRG
DS41639A-page 237
PIC16(L)F1454/5/9
22.6.5
FIGURE 22-27:
Write to SSPCON2
occurs here
SDA = 1,
SCL (no change)
SDA = 1,
SCL = 1
TBRG
TBRG
TBRG
1st bit
SDA
Sr
TBRG
Repeated Start
DS41639A-page 238
Preliminary
PIC16(L)F1454/5/9
22.6.6
22.6.6.3
22.6.6.1
7.
8.
9.
10.
11.
12.
13.
BF Status Flag
22.6.6.2
Preliminary
DS41639A-page 239
DS41639A-page 240
S
Preliminary
R/W
PEN
SEN
BF (SSPSTAT<0>)
SSPIF
SCL
SDA
A6
A5
A4
A3
A2
A1
Cleared by software
SSPBUF written
D7
1
SCL held low
while CPU
responds to SSPIF
ACK = 0
R/W = 0
A7
D5
D4
D3
D2
D1
D0
D6
Cleared by software
ACK
ACKSTAT in
SSPCON2 = 1
FIGURE 22-28:
SEN = 0
PIC16(L)F1454/5/9
I2C MASTER MODE WAVEFORM (TRANSMISSION, 7 OR 10-BIT ADDRESS)
PIC16(L)F1454/5/9
22.6.7
22.6.7.4
22.6.7.1
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
BF Status Flag
11.
22.6.7.2
12.
13.
14.
22.6.7.3
15.
Preliminary
DS41639A-page 241
DS41639A-page 242
Preliminary
RCEN
ACKEN
SSPOV
BF
(SSPSTAT<0>)
SDA = 0, SCL = 1
while CPU
responds to SSPIF
SSPIF
A7
4
5
Cleared by software
A6 A5 A4 A3 A2
7
8
ACK
D0
ACK
RCEN cleared
automatically
5
6
Cleared by software
Cleared in
software
ACK
P
Set SSPIF interrupt
at end of Acknowledge sequence
Bus master
terminates
transfer
Set P bit
(SSPSTAT<4>)
and SSPIF
PEN bit = 1
written here
D0
RCEN cleared
automatically
D7 D6 D5 D4 D3 D2 D1
RCEN cleared
automatically
RCEN = 1, start
next receive
Cleared by software
Cleared by software
D7 D6 D5 D4 D3 D2 D1
RCEN cleared
automatically
A1 R/W
FIGURE 22-29:
SCL
SDA
SEN = 0
Write to SSPBUF occurs here,
start XMIT
Write to SSPCON2<4>
to start Acknowledge sequence
SDA = ACKDT (SSPCON2<5>) = 0
PIC16(L)F1454/5/9
I2C MASTER MODE WAVEFORM (RECEPTION, 7-BIT ADDRESS)
PIC16(L)F1454/5/9
22.6.8
ACKNOWLEDGE SEQUENCE
TIMING
22.6.9
22.6.8.1
22.6.9.1
FIGURE 22-30:
TBRG
SDA
ACK
D0
SCL
SSPIF
SSPIF set at
the end of receive
Cleared in
software
SSPIF set at the end
of Acknowledge sequence
Cleared in
software
FIGURE 22-31:
Write to SSPCON2,
set PEN
Falling edge of
9th clock
TBRG
SCL
SDA
ACK
P
TBRG
TBRG
TBRG
Preliminary
DS41639A-page 243
PIC16(L)F1454/5/9
22.6.10
SLEEP OPERATION
22.6.13
22.6.11
EFFECTS OF A RESET
22.6.12
MULTI-MASTER MODE
Address Transfer
Data Transfer
A Start Condition
A Repeated Start Condition
An Acknowledge Condition
Multi-Master mode support is achieved by bus arbitration. When the master outputs address/data bits onto
the SDA pin, arbitration takes place when the master
outputs a 1 on SDA, by letting SDA float high and
another master asserts a 0. When the SCL pin floats
high, data should be stable. If the expected data on
SDA is a 1 and the data sampled on the SDA pin is 0,
then a bus collision has taken place. The master will set
the Bus Collision Interrupt Flag, BCLIF and reset the
I2C port to its Idle state (Figure 22-32).
If a transmit was in progress when the bus collision
occurred, the transmission is halted, the BF flag is
cleared, the SDA and SCL lines are deasserted and the
SSPBUF can be written to. When the user services the
bus collision Interrupt Service Routine and if the I2C
bus is free, the user can resume communication by
asserting a Start condition.
If a Start, Repeated Start, Stop or Acknowledge condition was in progress when the bus collision occurred, the
condition is aborted, the SDA and SCL lines are deasserted and the respective control bits in the SSPCON2
register are cleared. When the user services the bus collision Interrupt Service Routine and if the I2C bus is free,
the user can resume communication by asserting a Start
condition.
The master will continue to monitor the SDA and SCL
pins. If a Stop condition occurs, the SSPIF bit will be set.
A write to the SSPBUF will start the transmission of
data at the first data bit, regardless of where the
transmitter left off when the bus collision occurred.
In Multi-Master mode, the interrupt generation on the
detection of Start and Stop conditions allows the determination of when the bus is free. Control of the I2C bus
can be taken when the P bit is set in the SSPSTAT
register, or the bus is Idle and the S and P bits are
cleared.
FIGURE 22-32:
SDA
SCL
BCLIF
DS41639A-page 244
Preliminary
PIC16(L)F1454/5/9
22.6.13.1
FIGURE 22-33:
The reason that bus collision is not a factor during a Start condition is that no two
bus masters can assert a Start condition
at the exact same time. Therefore, one
master will always assert SDA before the
other. This condition does not cause a bus
collision because the two masters must be
allowed to arbitrate the first address following the Start condition. If the address is
the same, arbitration must be allowed to
continue into the data portion, Repeated
Start or Stop conditions.
SDA
SCL
Set SEN, enable Start
condition if SDA = 1, SCL = 1
SEN
BCLIF
SSPIF
SSPIF and BCLIF are
cleared by software
Preliminary
DS41639A-page 245
PIC16(L)F1454/5/9
FIGURE 22-34:
TBRG
SDA
Set SEN, enable Start
sequence if SDA = 1, SCL = 1
SCL
SEN
SCL = 0 before BRG time-out,
bus collision occurs. Set BCLIF.
BCLIF
Interrupt cleared
by software
S
SSPIF
FIGURE 22-35:
SDA
SCL
TBRG
S
SCL pulled low after BRG
time-out
SEN
BCLIF
Set SSPIF
SSPIF
SDA = 0, SCL = 1,
set SSPIF
DS41639A-page 246
Preliminary
Interrupts cleared
by software
PIC16(L)F1454/5/9
22.6.13.2
FIGURE 22-36:
If, at the end of the BRG time-out, both SCL and SDA
are still high, the SDA pin is driven low and the BRG is
reloaded and begins counting. At the end of the count,
regardless of the status of the SCL pin, the SCL pin is
driven low and the Repeated Start condition is
complete.
SDA
SCL
Sample SDA when SCL goes high.
If SDA = 0, set BCLIF and release SDA and SCL.
RSEN
BCLIF
Cleared by software
S
SSPIF
FIGURE 22-37:
TBRG
SDA
SCL
BCLIF
RSEN
S
SSPIF
Preliminary
DS41639A-page 247
PIC16(L)F1454/5/9
22.6.13.3
b)
FIGURE 22-38:
TBRG
SDA sampled
low after TBRG,
set BCLIF
TBRG
SDA
SDA asserted low
SCL
PEN
BCLIF
P
SSPIF
FIGURE 22-39:
TBRG
TBRG
SDA
SCL goes low before SDA goes high,
set BCLIF
Assert SDA
SCL
PEN
BCLIF
P
SSPIF
DS41639A-page 248
Preliminary
PIC16(L)F1454/5/9
TABLE 22-3:
Name
INTCON
Bit 2
Bit 1
Bit 0
Reset
Values on
Page:
INTE
IOCIE
TMR0IF
INTF
IOCIF
96
Bit 7
Bit 6
Bit 5
Bit 4
GIE
PEIE
TMR0IE
(2)
PIE1
TMR1GIE
RCIE
TXIE
SSP1IE
TMR2IE
TMR1IE
97
PIE2
OSFIE
C2IE
C1IE
BCL1IE
USBIE
ACTIE
98
PIR1
TMR1GIF
ADIF(2)
RCIF
TXIF
SSP1IF
TMR2IF
TMR1IF
99
PIR2
OSFIF
C2IF
C1IF
BCL1IF
USBIF
ACTIF
100
TRISA5
TRISA4
(1)
(1)
(1)
132
TRISA
ADIE
SSP1ADD
SSP1BUF
SSP1CON1
ADD<7:0>
256
207*
WCOL
SSPOV
SSPEN
CKP
SSP1CON2
GCEN
ACKSTAT
ACKDT
ACKEN
RCEN
PEN
RSEN
SEN
254
SSP1CON3
ACKTIM
PCIE
SCIE
BOEN
SDAHT
SBCDE
AHEN
DHEN
255
SSP1MSK
SSP1STAT
Legend:
*
Note 1:
2:
SSPM<3:0>
253
MSK<7:0>
SMP
CKE
D/A
256
S
R/W
UA
BF
251
= unimplemented location, read as 0. Shaded cells are not used by the MSSP module in I2C mode.
Page provides register information.
Unimplemented, read as 1.
PIC16(L)F1455/9 only.
Preliminary
DS41639A-page 249
PIC16(L)F1454/5/9
22.7
The MSSP module has a Baud Rate Generator available for clock generation in both I2C and SPI Master
modes. The Baud Rate Generator (BRG) reload value
is placed in the SSPADD register (Register 22-6).
When a write occurs to SSPBUF, the Baud Rate Generator will automatically begin counting down.
Once the given operation is complete, the internal clock
will automatically stop counting and the clock pin will
remain in its last state.
EQUATION 22-1:
FOSC
FCLOCK = ------------------------------------------------ SSPxADD + 1 4
FIGURE 22-40:
SSPM<3:0>
Reload
SSPADD<7:0>
Reload
Control
SCL
SSPCLK
FOSC/2
TABLE 22-4:
Note 1:
FOSC
FCY
BRG Value
FCLOCK
(2 Rollovers of BRG)
16 MHz
4 MHz
09h
400 kHz(1)
16 MHz
4 MHz
0Ch
308 kHz
16 MHz
4 MHz
27h
100 kHz
4 MHz
1 MHz
09h
100 kHz
The I2C interface does not conform to the 400 kHz I2C specification (which applies to rates greater than
100 kHz) in all details, but may be used with care where higher rates are required by the application.
DS41639A-page 250
Preliminary
PIC16(L)F1454/5/9
22.8
REGISTER 22-1:
R/W-0/0
R/W-0/0
R-0/0
R-0/0
R-0/0
R-0/0
R-0/0
R-0/0
SMP
CKE
D/A
R/W
UA
BF
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7
bit 6
bit 5
bit 4
bit 3
S: Start bit
(I2C mode only. This bit is cleared when the MSSP module is disabled, SSPEN is cleared.)
1 = Indicates that a Start bit has been detected last (this bit is 0 on Reset)
0 = Start bit was not detected last
bit 2
bit 1
Preliminary
DS41639A-page 251
PIC16(L)F1454/5/9
REGISTER 22-1:
bit 0
DS41639A-page 252
Preliminary
PIC16(L)F1454/5/9
REGISTER 22-2:
R/C/HS-0/0
R/C/HS-0/0
R/W-0/0
R/W-0/0
WCOL
SSPOV
SSPEN
CKP
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
SSPM<3:0>
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
C = User cleared
bit 7
bit 6
bit 5
bit 4
bit 3-0
Note
1:
2:
3:
4:
5:
In Master mode, the overflow bit is not set since each new reception (and transmission) is initiated by writing to the SSPBUF register.
When enabled, these pins must be properly configured as input or output.
When enabled, the SDA and SCL pins must be configured as inputs.
SSPADD values of 0, 1 or 2 are not supported for I2C mode.
SSPADD value of 0 is not supported. Use SSPM = 0000 instead.
Preliminary
DS41639A-page 253
PIC16(L)F1454/5/9
REGISTER 22-3:
R/W-0/0
R-0/0
R/W-0/0
R/S/HS-0/0
R/S/HS-0/0
R/S/HS-0/0
R/S/HS-0/0
R/W/HS-0/0
GCEN
ACKSTAT
ACKDT
ACKEN
RCEN
PEN
RSEN
SEN
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
HC = Cleared by hardware
S = User set
bit 7
GCEN: General Call Enable bit (in I2C Slave mode only)
1 = Enable interrupt when a general call address (0x00 or 00h) is received in the SSPSR
0 = General call address disabled
bit 6
bit 5
bit 4
ACKEN: Acknowledge Sequence Enable bit (in I2C Master mode only)
In Master Receive mode:
1 = Initiate Acknowledge sequence on SDA and SCL pins, and transmit ACKDT data bit.
Automatically cleared by hardware.
0 = Acknowledge sequence idle
bit 3
bit 2
PEN: Stop Condition Enable bit (in I2C Master mode only)
SCKMSSP Release Control:
1 = Initiate Stop condition on SDA and SCL pins. Automatically cleared by hardware.
0 = Stop condition Idle
bit 1
RSEN: Repeated Start Condition Enable bit (in I2C Master mode only)
1 = Initiate Repeated Start condition on SDA and SCL pins. Automatically cleared by hardware.
0 = Repeated Start condition Idle
bit 0
Note 1:
For bits ACKEN, RCEN, PEN, RSEN, SEN: If the I2C module is not in the Idle mode, this bit may not be
set (no spooling) and the SSPBUF may not be written (or writes to the SSPBUF are disabled).
DS41639A-page 254
Preliminary
PIC16(L)F1454/5/9
REGISTER 22-4:
R-0/0
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
ACKTIM
PCIE
SCIE
BOEN
SDAHT
SBCDE
AHEN
DHEN
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7
bit 6
bit 5
bit 4
bit 3
bit 2
SBCDE: Slave Mode Bus Collision Detect Enable bit (I2C Slave mode only)
If on the rising edge of SCL, SDA is sampled low when the module is outputting a high state, the
BCL1IF bit of the PIR2 register is set, and bus goes idle
1 = Enable slave bus collision interrupts
0 = Slave bus collision interrupts are disabled
bit 1
bit 0
Note 1:
2:
3:
For daisy-chained SPI operation; allows the user to ignore all but the last received byte. SSPOV is still set
when a new byte is received and BF = 1, but hardware continues to write the most recent byte to SSPBUF.
This bit has no effect in Slave modes that Start and Stop condition detection is explicitly listed as enabled.
The ACKTIM Status bit is only active when the AHEN bit or DHEN bit is set.
Preliminary
DS41639A-page 255
PIC16(L)F1454/5/9
REGISTER 22-5:
R/W-1/1
R/W-1/1
R/W-1/1
R/W-1/1
R/W-1/1
R/W-1/1
R/W-1/1
R/W-1/1
MSK<7:0>
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7-1
bit 0
REGISTER 22-6:
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
ADD<7:0>
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
Master mode:
bit 7-0
bit 7-3
Not used: Unused for Most Significant Address Byte. Bit state of this register is a dont care. Bit pattern sent by master is fixed by I2C specification and must be equal to 11110. However, those bits are
compared by hardware and are not affected by the value in this register.
bit 2-1
bit 0
bit 7-0
bit 7-1
bit 0
DS41639A-page 256
Preliminary
PIC16(L)F1454/5/9
23.0
ENHANCED UNIVERSAL
SYNCHRONOUS
ASYNCHRONOUS RECEIVER
TRANSMITTER (EUSART)
FIGURE 23-1:
TXIE
Interrupt
TXIF
TXREG Register
8
MSb
TX/CK pin
LSb
(8)
Pin Buffer
and Control
TRMT
SPEN
TXEN
Baud Rate Generator
FOSC
TX9
BRG16
+1
SPBRGH
SPBRGL
Multiplier
x4
x16 x64
SYNC
1 X 0 0
BRGH
X 1 1 0
BRG16
X 1 0 1
TX9D
Preliminary
DS41639A-page 257
PIC16(L)F1454/5/9
FIGURE 23-2:
CREN
RX/DT pin
Data
Recovery
FOSC
SPBRGH
SPBRGL
x4
x16 x64
SYNC
1 X 0 0
BRGH
X 1 1 0
BRG16
X 1 0 1
(8)
LSb
0 START
RX9
BRG16
Multiplier
Stop
RCIDL
RSR Register
MSb
Pin Buffer
and Control
+1
OERR
FERR
RX9D
RCREG Register
8
FIFO
Data Bus
RCIF
RCIE
Interrupt
DS41639A-page 258
Preliminary
PIC16(L)F1454/5/9
23.1
23.1.1.2
Transmitting Data
23.1.1.3
23.1.1
23.1.1.4
EUSART ASYNCHRONOUS
TRANSMITTER
23.1.1.1
Preliminary
DS41639A-page 259
PIC16(L)F1454/5/9
23.1.1.5
TSR Status
23.1.1.7
23.1.1.6
1.
2.
3.
FIGURE 23-3:
Write to TXREG
BRG Output
(Shift Clock)
8.
Word 1
Start bit
bit 0
bit 1
bit 7/8
Stop bit
Word 1
TXIF bit
(Transmit Buffer
Reg. Empty Flag)
FIGURE 23-4:
7.
ASYNCHRONOUS TRANSMISSION
TX/CK
pin
TRMT bit
(Transmit Shift
Reg. Empty Flag)
6.
1 TCY
Word 1
Transmit Shift Reg.
Write to TXREG
BRG Output
(Shift Clock)
Word 1
TX/CK
pin
TXIF bit
(Transmit Buffer
Reg. Empty Flag)
TRMT bit
(Transmit Shift
Reg. Empty Flag)
Note:
Word 2
Start bit
bit 0
1 TCY
bit 1
Word 1
bit 7/8
Stop bit
Start bit
bit 0
Word 2
1 TCY
Word 1
Transmit Shift Reg.
Word 2
Transmit Shift Reg.
DS41639A-page 260
Preliminary
PIC16(L)F1454/5/9
TABLE 23-1:
Name
BAUDCON
INTCON
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Register
on Page
ABDOVF
RCIDL
SCKP
BRG16
WUE
ABDEN
269
GIE
PEIE
TMR0IE
INTE
IOCIE
TMR0IF
INTF
IOCIF
96
RCIE
TXIE
SSP1IE
TMR2IE
TMR1IE
97
TMR1GIE
PIE1
TMR1GIF
PIR1
RCSTA
SPEN
(2)
ADIE
ADIF
(2)
RX9
RCIF
TXIF
SSP1IF
TMR2IF
TMR1IF
99
SREN
CREN
ADDEN
FERR
OERR
RX9D
268*
SPBRGL
SPBRGH
(1)
(1)
TRISC6
TRISC5
TRISC
TRISC7
TXREG
TXSTA
CSRC
TX9
TXEN
BRG<7:0>
270*
BRG<15:8>
270*
TRISC4
TRISC3
TRISC2
TRISC1
TRISC0
140
259
SYNC
SENDB
BRGH
TRMT
TX9D
267
Legend: = unimplemented location, read as 0. Shaded cells are not used for asynchronous transmission.
* Page provides register information.
Note 1: PIC16(L)F1459 only.
2: PIC16(L)F1455/9 only.
Preliminary
DS41639A-page 261
PIC16(L)F1454/5/9
23.1.2
EUSART ASYNCHRONOUS
RECEIVER
23.1.2.2
23.1.2.1
Receiving Data
23.1.2.3
Receive Interrupts
DS41639A-page 262
Preliminary
PIC16(L)F1454/5/9
23.1.2.4
23.1.2.7
23.1.2.5
Address Detection
23.1.2.6
Preliminary
DS41639A-page 263
PIC16(L)F1454/5/9
23.1.2.8
23.1.2.9
1.
FIGURE 23-5:
Rcv Shift
Reg
Rcv Buffer Reg.
RCIDL
ASYNCHRONOUS RECEPTION
Start
bit
bit 0
RX/DT pin
bit 1
Start
bit
bit 0
Word 1
RCREG
Start
bit
Word 2
RCREG
Read Rcv
Buffer Reg.
RCREG
RCIF
(Interrupt Flag)
OERR bit
CREN
Note:
This timing diagram shows three words appearing on the RX input. The RCREG (receive buffer) is read after the third word,
causing the OERR (overrun) bit to be set.
DS41639A-page 264
Preliminary
PIC16(L)F1454/5/9
TABLE 23-2:
Name
BAUDCON
INTCON
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Register
on Page
ABDOVF
RCIDL
SCKP
BRG16
WUE
ABDEN
269
GIE
PEIE
TMR1GIE
PIE1
TMR1GIF
PIR1
TMR0IE
INTE
IOCIE
TMR0IF
INTF
IOCIF
96
(2)
RCIE
TXIE
SSP1IE
TMR2IE
TMR1IE
97
(2)
RCIF
TXIF
SSP1IF
TMR2IF
TMR1IF
ADIE
ADIF
RCREG
RCSTA
RX9
SREN
SPBRGL
CREN
ADDEN
FERR
OERR
RX9D
BRG<7:0>
SPBRGH
TRISC
TRISC7
TXSTA
CSRC
268*
270*
BRG<15:8>
(1)
99
262*
270*
TRISC6(1)
TRISC5
TRISC4
TRISC3
TRISC2
TRISC1
TRISC0
140
TX9
TXEN
SYNC
SENDB
BRGH
TRMT
TX9D
267
Legend: = unimplemented location, read as 0. Shaded cells are not used for asynchronous reception.
* Page provides register information.
Note 1: PIC16(L)F1459 only.
2: PIC16(L)F1455/9 only.
Preliminary
DS41639A-page 265
PIC16(L)F1454/5/9
23.2
The factory calibrates the internal oscillator block output (INTOSC). However, the INTOSC frequency may
drift as VDD or temperature changes, and this directly
affects the asynchronous baud rate. Two methods may
be used to adjust the baud rate clock, but both require
a reference clock source of some kind.
The first (preferred) method uses the OSCTUNE
register to adjust the INTOSC output. Adjusting the
value in the OSCTUNE register allows for fine resolution
changes to the system clock source. See Section 5.2.2
Internal Clock Sources for more information.
The other method adjusts the value in the Baud Rate
Generator. This can be done automatically with the
Auto-Baud Detect feature (see Section 23.4.1
Auto-Baud Detect). There may not be fine enough
resolution when adjusting the Baud Rate Generator to
compensate for a gradual change in the peripheral
clock frequency.
DS41639A-page 266
Preliminary
PIC16(L)F1454/5/9
23.3
REGISTER 23-1:
R/W-/0
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
R-1/1
R/W-0/0
CSRC
TX9
TXEN(1)
SYNC
SENDB
BRGH
TRMT
TX9D
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7
bit 6
bit 5
bit 4
bit 3
bit 2
bit 1
bit 0
Note 1:
Preliminary
DS41639A-page 267
PIC16(L)F1454/5/9
RCSTA: RECEIVE STATUS AND CONTROL REGISTER(1)
REGISTER 23-2:
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
R-0/0
R-0/0
R-0/0
SPEN
RX9
SREN
CREN
ADDEN
FERR
OERR
RX9D
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7
bit 6
bit 5
bit 4
bit 3
bit 2
bit 1
bit 0
DS41639A-page 268
Preliminary
PIC16(L)F1454/5/9
REGISTER 23-3:
R-0/0
R-1/1
U-0
R/W-0/0
R/W-0/0
U-0
R/W-0/0
R/W-0/0
ABDOVF
RCIDL
SCKP
BRG16
WUE
ABDEN
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7
bit 6
bit 5
Unimplemented: Read as 0
bit 4
bit 3
bit 2
Unimplemented: Read as 0
bit 1
bit 0
Preliminary
DS41639A-page 269
PIC16(L)F1454/5/9
23.4
EXAMPLE 23-1:
CALCULATING BAUD
RATE ERROR
16000000
-----------------------9600
= ------------------------ 1
64
= 25.042 = 25
16000000
Calculated Baud Rate = --------------------------64 25 + 1
= 9615
Calc. Baud Rate Desired Baud Rate
Error = -------------------------------------------------------------------------------------------Desired Baud Rate
9615 9600
= ---------------------------------- = 0.16%
9600
DS41639A-page 270
Preliminary
PIC16(L)F1454/5/9
TABLE 23-3:
Configuration Bits
BRG/EUSART Mode
8-bit/Asynchronous
FOSC/[64 (n+1)]
8-bit/Asynchronous
16-bit/Asynchronous
16-bit/Asynchronous
8-bit/Synchronous
16-bit/Synchronous
SYNC
BRG16
BRGH
Legend:
Name
BAUDCON
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Register
on Page
ABDOVF
RCIDL
SCKP
BRG16
WUE
ABDEN
269
SPEN
RX9
SREN
CREN
ADDEN
FERR
OERR
RX9D
SPBRGL
BRG<7:0>
SPBRGH
BRG<15:8>
TXSTA
FOSC/[4 (n+1)]
TABLE 23-4:
RCSTA
FOSC/[16 (n+1)]
CSRC
TX9
TXEN
SYNC
SENDB
268
270*
270*
BRGH
TRMT
TX9D
267
Legend: = unimplemented location, read as 0. Shaded cells are not used for the Baud Rate Generator.
* Page provides register information.
Preliminary
DS41639A-page 271
PIC16(L)F1454/5/9
TABLE 23-5:
BAUD
RATE
%
Error
SPBRG
value
(decimal)
%
Error
SPBRG
value
(decimal)
%
Error
SPBRG
value
(decimal)
Actual
Rate
%
Error
SPBRG
value
(decimal)
300
1200
1221
1.73
255
1200
0.00
239
1202
0.16
207
1200
0.00
143
2400
2404
0.16
129
2400
0.00
119
2404
0.16
103
2400
0.00
71
9600
9470
-1.36
32
9600
0.00
29
9615
0.16
25
9600
0.00
17
10417
10417
0.00
29
10286
-1.26
27
10417
0.00
23
10165
-2.42
16
19.2k
19.53k
1.73
15
19.20k
0.00
14
19.23k
0.16
12
19.20k
0.00
57.6k
57.60k
0.00
57.60k
0.00
115.2k
%
Error
SPBRG
value
(decimal)
%
Error
SPBRG
value
(decimal)
%
Error
SPBRG
value
(decimal)
Actual
Rate
%
Error
SPBRG
value
(decimal)
300
300
0.16
207
300
0.00
191
300
0.16
51
1200
1202
0.16
103
1202
0.16
51
1200
0.00
47
1202
0.16
12
2400
2404
0.16
51
2404
0.16
25
2400
0.00
23
9600
9615
0.16
12
9600
0.00
10417
10417
0.00
11
10417
0.00
19.2k
19.20k
0.00
57.6k
57.60k
0.00
115.2k
%
Error
SPBRG
value
(decimal)
%
Error
SPBRG
value
(decimal)
%
Error
SPBRG
value
(decimal)
Actual
Rate
%
Error
SPBRG
value
(decimal)
300
1200
2400
9600
9615
0.16
129
9600
0.00
119
9615
0.16
103
9600
0.00
71
10417
10417
0.00
119
10378
-0.37
110
10417
0.00
95
10473
0.53
65
19.2k
19.23k
0.16
64
19.20k
0.00
59
19.23k
0.16
51
19.20k
0.00
35
57.6k
56.82k
-1.36
21
57.60k
0.00
19
58.82k
2.12
16
57.60k
0.00
11
115.2k
113.64k
-1.36
10
115.2k
0.00
111.1k
-3.55
115.2k
0.00
DS41639A-page 272
Preliminary
PIC16(L)F1454/5/9
TABLE 23-5:
BAUD
RATE
300
1200
1202
0.16
207
1200
0.00
191
300
1202
0.16
0.16
207
51
2400
2404
0.16
207
2404
0.16
103
2400
0.00
95
2404
0.16
25
9600
9615
0.16
51
9615
0.16
25
9600
0.00
23
10417
10417
0.00
47
10417
0.00
23
10473
0.53
21
10417
0.00
19.2k
19231
0.16
25
19.23k
0.16
12
19.2k
0.00
11
57.6k
55556
-3.55
57.60k
0.00
115.2k
115.2k
0.00
%
Error
SPBRG
value
(decimal)
Actual
Rate
%
Error
SPBRG
value
(decimal)
Actual
Rate
%
Error
SPBRG
value
(decimal)
Actual
Rate
%
Error
SPBRG
value
(decimal)
300
300.0
-0.01
4166
300.0
0.00
3839
300.03
0.01
3332
300.0
0.00
2303
1200
1200
-0.03
1041
1200
0.00
959
1200.5
0.04
832
1200
0.00
575
2400
2399
-0.03
520
2400
0.00
479
2398
-0.08
416
2400
0.00
287
9600
9615
0.16
129
9600
0.00
119
9615
0.16
103
9600
0.00
71
10417
10417
0.00
119
10378
-0.37
110
10417
0.00
95
10473
0.53
65
19.2k
19.23k
0.16
64
19.20k
0.00
59
19.23k
0.16
51
19.20k
0.00
35
57.6k
56.818
-1.36
21
57.60k
0.00
19
58.82k
2.12
16
57.60k
0.00
11
115.2k
113.636
-1.36
10
115.2k
0.00
111.11k
-3.55
115.2k
0.00
%
Error
SPBRG
value
(decimal)
Actual
Rate
%
Error
SPBRG
value
(decimal)
Actual
Rate
%
Error
SPBRG
value
(decimal)
Actual
Rate
%
Error
SPBRG
value
(decimal)
300
299.9
-0.02
1666
300.1
0.04
832
300.0
0.00
767
300.5
0.16
207
1200
1199
-0.08
416
1202
0.16
207
1200
0.00
191
1202
0.16
51
2400
2404
0.16
207
2404
0.16
103
2400
0.00
95
2404
0.16
25
9600
9615
0.16
51
9615
0.16
25
9600
0.00
23
10417
10417
0.00
47
10417
0.00
23
10473
0.53
21
10417
0.00
19.2k
19.23k
0.16
25
19.23k
0.16
12
19.20k
0.00
11
57.6k
55556
-3.55
57.60k
0.00
115.2k
115.2k
0.00
Preliminary
DS41639A-page 273
PIC16(L)F1454/5/9
TABLE 23-5:
300
1200
300.0
1200
0.00
-0.01
16665
4166
300.0
1200
0.00
0.00
15359
3839
300.0
1200.1
0.00
0.01
13332
3332
300.0
1200
0.00
0.00
9215
2303
2400
2400
0.02
2082
2400
0.00
1919
2399.5
-0.02
1666
2400
0.00
1151
9600
9597
-0.03
520
9600
0.00
479
9592
-0.08
416
9600
0.00
287
10417
10417
0.00
479
10425
0.08
441
10417
0.00
383
10433
0.16
264
BAUD
RATE
19.2k
19.23k
0.16
259
19.20k
0.00
239
19.23k
0.16
207
19.20k
0.00
143
57.6k
57.47k
-0.22
86
57.60k
0.00
79
57.97k
0.64
68
57.60k
0.00
47
115.2k
116.3k
0.94
42
115.2k
0.00
39
114.29k
-0.79
34
115.2k
0.00
23
%
Error
SPBRG
value
(decimal)
Actual
Rate
%
Error
SPBRG
value
(decimal)
Actual
Rate
%
Error
SPBRG
value
(decimal)
Actual
Rate
%
Error
SPBRG
value
(decimal)
300
300.0
0.00
6666
300.0
0.01
3332
300.0
0.00
3071
300.1
0.04
832
1200
1200
-0.02
1666
1200
0.04
832
1200
0.00
767
1202
0.16
207
2400
2401
0.04
832
2398
0.08
416
2400
0.00
383
2404
0.16
103
9600
9615
0.16
207
9615
0.16
103
9600
0.00
95
9615
0.16
25
10417
10417
191
10417
0.00
95
10473
0.53
87
10417
0.00
23
19.2k
19.23k
0.16
103
19.23k
0.16
51
19.20k
0.00
47
19.23k
0.16
12
57.6k
57.14k
-0.79
34
58.82k
2.12
16
57.60k
0.00
15
115.2k
117.6k
2.12
16
111.1k
-3.55
115.2k
0.00
DS41639A-page 274
Preliminary
PIC16(L)F1454/5/9
23.4.1
AUTO-BAUD DETECT
FIGURE 23-6:
TABLE 23-6:
BRG16
BRGH
BRG Base
Clock
BRG ABD
Clock
FOSC/64
FOSC/512
FOSC/16
FOSC/128
FOSC/16
FOSC/128
FOSC/4
FOSC/32
1
Note:
BRG Value
RX pin
0000h
001Ch
Start
Edge #1
bit 1
bit 0
Edge #2
bit 3
bit 2
Edge #3
bit 5
bit 4
Edge #4
bit 7
bit 6
Edge #5
Stop bit
BRG Clock
Auto Cleared
Set by User
ABDEN bit
RCIDL
RCIF bit
(Interrupt)
Read
RCREG
SPBRGL
XXh
1Ch
SPBRGH
XXh
00h
Note 1:
The ABD sequence requires the EUSART module to be configured in Asynchronous mode.
Preliminary
DS41639A-page 275
PIC16(L)F1454/5/9
23.4.2
AUTO-BAUD OVERFLOW
23.4.3.1
23.4.3
AUTO-WAKE-UP ON BREAK
Special Considerations
Break Character
To avoid character errors or character fragments during
a wake-up event, the wake-up character must be all
zeros.
When the wake-up is enabled the function works
independent of the low time on the data stream. If the
WUE bit is set and a valid non-zero character is
received, the low time from the Start bit to the first rising
edge will be interpreted as the wake-up event. The
remaining bits in the character will be received as a
fragmented character and subsequent characters can
result in framing or overrun errors.
Therefore, the initial character in the transmission must
be all 0s. This must be ten or more bit times, 13-bit
times recommended for LIN bus, or any number of bit
times for standard RS-232 devices.
Oscillator Start-up Time
Oscillator start-up time must be considered, especially
in applications using oscillators with longer start-up
intervals (i.e., LP, XT or HS/PLL mode). The Sync
Break (or wake-up signal) character must be of
sufficient length, and be followed by a sufficient
interval, to allow enough time for the selected oscillator
to start and provide proper initialization of the EUSART.
WUE Bit
The wake-up event causes a receive interrupt by
setting the RCIF bit. The WUE bit is cleared in
hardware by a rising edge on RX/DT. The interrupt
condition is then cleared in software by reading the
RCREG register and discarding its contents.
To ensure that no actual data is lost, check the RCIDL
bit to verify that a receive operation is not in process
before setting the WUE bit. If a receive operation is not
occurring, the WUE bit may then be set just prior to
entering the Sleep mode.
DS41639A-page 276
Preliminary
PIC16(L)F1454/5/9
FIGURE 23-7:
Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4
OSC1
Auto Cleared
WUE bit
RX/DT Line
RCIF
Note 1:
FIGURE 23-8:
Q1
Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1Q2 Q3 Q4
OSC1
Auto Cleared
Note 1
RCIF
Sleep Command Executed
Note 1:
2:
Sleep Ends
If the wake-up event requires long oscillator warm-up time, the automatic clearing of the WUE bit can occur while the stposc signal is
still active. This sequence should not depend on the presence of Q clocks.
The EUSART remains in Idle while the WUE bit is set.
Preliminary
DS41639A-page 277
PIC16(L)F1454/5/9
23.4.4
23.4.4.1
23.4.5
FIGURE 23-9:
Write to TXREG
BRG Output
(Shift Clock)
TX (pin)
Start bit
bit 0
bit 1
bit 11
Stop bit
Break
TXIF bit
(Transmit
Interrupt Flag)
TRMT bit
(Transmit Shift
Empty Flag)
SENDB
(send Break
control bit)
DS41639A-page 278
Preliminary
Auto Cleared
PIC16(L)F1454/5/9
23.5
23.5.1
Clearing the SCKP bit sets the Idle state as low. When
the SCKP bit is cleared, the data changes on the rising
edge of each clock.
23.5.1.3
23.5.1.4
SYNC = 1
CSRC = 1
SREN = 0 (for transmit); SREN = 1 (for receive)
CREN = 0 (for transmit); CREN = 1 (for receive)
SPEN = 1
1.
23.5.1.1
23.5.1.2
2.
3.
4.
5.
6.
Master Clock
7.
8.
Clock Polarity
Preliminary
DS41639A-page 279
PIC16(L)F1454/5/9
FIGURE 23-10:
SYNCHRONOUS TRANSMISSION
RX/DT
pin
bit 0
bit 1
Word 1
bit 2
bit 7
bit 0
bit 1
Word 2
bit 7
TX/CK pin
(SCKP = 0)
TX/CK pin
(SCKP = 1)
Write to
TXREG Reg
Write Word 1
Write Word 2
TXIF bit
(Interrupt Flag)
TRMT bit
TXEN bit
1
Sync Master mode, SPBRGL = 0, continuous transmission of two 8-bit words.
Note:
FIGURE 23-11:
bit 0
bit 2
bit 1
bit 6
bit 7
TX/CK pin
Write to
TXREG reg
TXIF bit
TRMT bit
TXEN bit
TABLE 23-7:
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Register on
Page
ABDOVF
RCIDL
SCKP
BRG16
WUE
ABDEN
269
GIE
PEIE
TMR0IE
INTE
IOCIE
TMR0IF
INTF
IOCIF
96
PIE1
TMR1GIE
ADIE(2)
RCIE
TXIE
SSP1IE
TMR2IE
TMR1IE
97
PIR1
TMR1GIF
ADIF(2)
RCIF
TXIF
SSP1IF
TMR2IF
TMR1IF
99
SPEN
RX9
SREN
CREN
ADDEN
FERR
OERR
RX9D
268
Name
BAUDCON
INTCON
RCSTA
SPBRGL
BRG<7:0>
SPBRGH
BRG<15:8>
TRISC7(1)
TRISC
TRISC6(1)
TRISC5
TXREG
TRISC4
TRISC3
270*
270*
TRISC2
TRISC1
TRISC0
BRGH
TRMT
TX9D
TXSTA
CSRC
TX9
TXEN
SYNC
SENDB
140
259*
267
Legend:
= unimplemented location, read as 0. Shaded cells are not used for synchronous master transmission.
* Page provides register information.
Note 1: PIC16(L)F1459 only.
2:
PIC16(L)F1455/9 only.
DS41639A-page 280
Preliminary
PIC16(L)F1454/5/9
23.5.1.5
23.5.1.6
Slave Clock
23.5.1.7
23.5.1.8
23.5.1.9
1.
Preliminary
DS41639A-page 281
PIC16(L)F1454/5/9
FIGURE 23-12:
RX/DT
pin
bit 0
bit 1
bit 2
bit 3
bit 4
bit 5
bit 6
bit 7
TX/CK pin
(SCKP = 0)
TX/CK pin
(SCKP = 1)
Write to
bit SREN
SREN bit
CREN bit 0
RCIF bit
(Interrupt)
Read
RCREG
Timing diagram demonstrates Sync Master mode with bit SREN = 1 and bit BRGH = 0.
Note:
TABLE 23-8:
Name
Bit 7
Bit 6
BAUDCON
ABDOVF
GIE
INTCON
PIE1
PIR1
Bit 1
Bit 0
Register
on Page
BRG16
WUE
ABDEN
269
IOCIE
TMR0IF
INTF
IOCIF
96
TXIE
SSP1IE
TMR2IE
TMR1IE
97
TXIF
SSP1IF
TMR2IF
TMR1IF
99
FERR
OERR
RX9D
Bit 4
Bit 3
RCIDL
SCKP
PEIE
TMR0IE
INTE
TMR1GIE
ADIE(2)
RCIE
TMR1GIF
ADIF(2)
RCIF
SPEN
RX9
SREN
RCREG
RCSTA
Bit 2
Bit 5
SPBRGL
SPBRGH
(1)
TRISC
TRISC7
TXSTA
CSRC
CREN
ADDEN
262*
268
BRG<7:0>
270*
BRG<15:8>
270*
TRISC6(1)
TRISC5
TRISC4
TRISC3
TRISC2
TRISC1
TRISC0
140
TX9
TXEN
SYNC
SENDB
BRGH
TRMT
TX9D
267
Legend: = unimplemented location, read as 0. Shaded cells are not used for synchronous master reception.
* Page provides register information.
Note 1: PIC16(L)F1459 only.
2: PIC16(L)F1455/9 only.
DS41639A-page 282
Preliminary
PIC16(L)F1454/5/9
23.5.2
SYNC = 1
CSRC = 0
SREN = 0 (for transmit); SREN = 1 (for receive)
CREN = 0 (for transmit); CREN = 1 (for receive)
SPEN = 1
1.
2.
3.
4.
23.5.2.1
5.
23.5.2.2
1.
2.
3.
4.
5.
6.
7.
8.
TABLE 23-9:
Name
BAUDCON
Bit 6
ABDOVF
Bit 2
Bit 1
Bit 0
Register
on Page
BRG16
WUE
ABDEN
269
IOCIE
TMR0IF
INTF
IOCIF
96
97
Bit 5
Bit 4
Bit 3
RCIDL
SCKP
INTE
GIE
PEIE
TMR0IE
PIE1
TMR1GIE
ADIE(2)
RCIE
TXIE
SSP1IE
TMR2IE
TMR1IE
PIR1
TMR1GIF
ADIF(2)
RCIF
TXIF
SSP1IF
TMR2IF
TMR1IF
99
SPEN
RX9
SREN
CREN
ADDEN
FERR
OERR
RX9D
268
TRISC5
TRISC4
TRISC3
TRISC2
TRISC1
TRISC0
140
INTCON
RCSTA
TRISC
TRISC7(1) TRISC6(1)
TXREG
TXSTA
TX9
TXEN
SYNC
SENDB
BRGH
259*
TRMT
TX9D
267
Legend: = unimplemented location, read as 0. Shaded cells are not used for synchronous slave transmission.
* Page provides register information.
Note 1: PIC16(L)F1459 only.
2: PIC16(L)F1455/9 only.
Preliminary
DS41639A-page 283
PIC16(L)F1454/5/9
23.5.2.3
23.5.2.4
1.
2.
3.
4.
5.
6.
7.
8.
9.
BAUDCON
Bit 7
Bit 6
ABDOVF
Bit 2
Bit 1
Bit 0
Register
on Page
BRG16
WUE
ABDEN
269
IOCIE
TMR0IF
INTF
IOCIF
96
97
Bit 5
Bit 4
Bit 3
RCIDL
SCKP
INTE
GIE
PEIE
TMR0IE
PIE1
TMR1GIE
ADIE(2)
RCIE
TXIE
SSP1IE
TMR2IE
TMR1IE
PIR1
TMR1GIF
ADIF(2)
RCIF
TXIF
SSP1IF
TMR2IF
TMR1IF
INTCON
RCREG
99
262*
RCSTA
SPEN
RX9
SREN
CREN
ADDEN
FERR
OERR
RX9D
268
TRISC
TRISC7(1)
TRISC6(1)
TRISC5
TRISC4
TRISC3
TRISC2
TRISC1
TRISC0
140
TXSTA
CSRC
TX9
TXEN
SYNC
SENDB
BRGH
TRMT
TX9D
267
Legend: = unimplemented location, read as 0. Shaded cells are not used for synchronous slave reception.
* Page provides register information.
Note 1: PIC16(L)F1459 only.
2: PIC16(L)F1455/9 only.
DS41639A-page 284
Preliminary
PIC16(L)F1454/5/9
23.6
23.6.1
23.6.2
SYNCHRONOUS TRANSMIT
DURING SLEEP
23.6.3
Preliminary
DS41639A-page 285
PIC16(L)F1454/5/9
NOTES:
DS41639A-page 286
Preliminary
PIC16(L)F1454/5/9
24.0
FIGURE 24-1:
PWM OUTPUT
Period
PR2
T2CON
PWMxDCH
PWMxDCL
PWMxCON
Pulse Width
TMR2 = 0
TMR2 = PR2
TMR2 =
PWMxDCH<7:0>:PWMxDCL<7:6>
FIGURE 24-2:
PWMxDCL<7:6>
PWMxDCH
PWMxOUT
to other peripherals: CWG
Latched
(Not visible to user)
Comparator
0
PWMx
TMR2 Module
TMR2
(1)
Comparator
PR2
Note 1:
Clear Timer,
PWMx pin and
latch Duty Cycle
8-bit timer is concatenated with the two Least Significant bits of 1/FOSC adjusted by
the Timer2 prescaler to create a 10-bit time base.
Preliminary
DS41639A-page 287
PIC16(L)F1454/5/9
24.1
24.1.1
FUNDAMENTAL OPERATION
24.1.2
24.1.4
EQUATION 24-2:
EQUATION 24-3:
PWM PERIOD
PULSE WIDTH
EQUATION 24-1:
PWMxDCH:PWMxDCL<7:6>
Duty Cycle Ratio = ----------------------------------------------------------------------------------4 PR2 + 1
24.1.3
PWM PERIOD
TOSC = 1/FOSC
DS41639A-page 288
Preliminary
PIC16(L)F1454/5/9
24.1.5
PWM RESOLUTION
EQUATION 24-4:
PWM RESOLUTION
log 4 PR2 + 1
Resolution = ------------------------------------------ bits
log 2
Note:
TABLE 24-1:
PWM Frequency
0.31 kHz
78.12 kHz
156.3 kHz
208.3 kHz
64
0xFF
0xFF
0x3F
0x1F
0x17
10
10
10
6.6
PWM Frequency
0.31 kHz
4.90 kHz
19.61 kHz
76.92 kHz
153.85 kHz
200.0 kHz
64
0x65
0x65
0x65
0x19
0x0C
0x09
24.1.6
19.53 kHz
0xFF
TABLE 24-2:
4.88 kHz
24.1.7
24.1.8
EFFECTS OF RESET
Any Reset will force all ports to Input mode and the
PWM registers to their Reset states.
Preliminary
DS41639A-page 289
PIC16(L)F1454/5/9
24.1.9
6.
7.
8.
DS41639A-page 290
Preliminary
PIC16(L)F1454/5/9
24.2
REGISTER 24-1:
R/W-0/0
R/W-0/0
R-0/0
R/W-0/0
U-0
U-0
U-0
U-0
PWMxEN
PWMxOE
PWMxOUT
PWMxPOL
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7
bit 6
bit 5
bit 4
bit 3-0
Unimplemented: Read as 0
Preliminary
DS41639A-page 291
PIC16(L)F1454/5/9
REGISTER 24-2:
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
PWMxDCH<7:0>
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7-0
REGISTER 24-3:
R/W-x/u
R/W-x/u
PWMxDCL<7:6>
U-0
U-0
U-0
U-0
U-0
U-0
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7-6
bit 5-0
Unimplemented: Read as 0
TABLE 24-3:
Name
Bit 6
Bit 5
PWM1EN
PWM1OE
PWM1OUT
PR2
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
PWM1CON
PWM1DCH
PWM1DCL
PWM2CON
PWM1POL
199*
PWM1DCH<7:0>
PWM1DCL<7:6>
PWM2EN
PWM2OE
PWM2POL
PWM2DCH<7:0>
PWM2DCL
PWM2DCL<7:6>
T2CON
T2OUTPS<3:0>
TMR2
291
292
PWM2OUT
PWM2DCH
Register
on Page
292
292
292
TMR2ON
T2CKPS<1:0>
292
201
199*
TRISA
TRISA5
TRISA4
(1)
(1)
(1)
132
TRISC
TRISC7(2)
TRISC6(2)
TRISC5
TRISC4
TRISC3
TRISC2
TRISC1
TRISC0
140
Legend:
Note
*
1:
2:
- = Unimplemented locations, read as 0, u = unchanged, x = unknown. Shaded cells are not used by the PWM.
Page provides register information.
Unimplemented, read as 1.
PIC16(L)F1459 only.
DS41639A-page 292
Preliminary
PIC16(L)F1454/5/9
25.0
COMPLEMENTARY WAVEFORM
GENERATOR (CWG) MODULE
(PIC16(L)F1455/9 ONLY)
The Complementary Waveform Generator (CWG) produces a complementary waveform with dead-band
delay from a selection of input sources.
The CWG module has the following features:
Preliminary
DS41639A-page 293
FIGURE 25-1:
GxASDLA
GxCS
00
FOSC
10
11
cwg_clock
GxASDLA = 01
GxOEA
CWGxDBR
HFINTOSC
GxIS
Preliminary
async_C1OUT
async_C2OUT
PWM1OUT
PWM2OUT
EN
R
S
TRISx
GxPOLA
Input Source
CWGxDBF
6
EN
GxOEB
R
TRISx
0
GxPOLB
async_C2OUT
GxASDC2
DS41639A-page 294
GxASE
Auto-Shutdown
Source
GxARSEN
set dominate
shutdown
10
11
GxASDLB
CWGxB
PIC16(L)F1454/5/9
GxASDLB = 01
00
async_C1OUT
GxASDC1
CWGxA
PIC16(L)F1454/5/9
FIGURE 25-2:
cwg_clock
PWM1
CWGxA
Rising Edge
Deadband
Rising Edge D
Falling Edge Deadband
CWGxB
Preliminary
DS41639A-page 295
PIC16(L)F1454/5/9
25.1
Fundamental Operation
25.4.2
POLARITY CONTROL
25.5
Dead-Band Control
25.6
25.2
Clock Source
25.3
async_C1OUT
async_C2OUT
PWM1OUT
PWM2OUT
25.4
Output Control
25.4.1
OUTPUT ENABLES
DS41639A-page 296
Preliminary
PIC16(L)F1454/5/9
25.7
25.8
Dead-Band Uncertainty
Preliminary
DS41639A-page 297
FIGURE 25-3:
cwg_clock
Input Source
CWGxA
CWGxB
FIGURE 25-4:
DEAD-BAND OPERATION, CWGxDBR = 03H, CWGxDBF = 04H, SOURCE SHORTER THAN DEAD BAND
Preliminary
cwg_clock
Input Source
DS41639A-page 298
PIC16(L)F1454/5/9
CWGxA
PIC16(L)F1454/5/9
EQUATION 25-1:
DEAD-BAND
UNCERTAINTY
1
TDEADBAND_UNCERTAINTY = ----------------------------Fcwg_clock
Example:
Fcwg_clock = 16 MHz
Therefore:
1
TDEADBAND_UNCERTAINTY = ----------------------------Fcwg_clock
1
= ------------------16 MHz
= 625ns
Preliminary
DS41639A-page 299
PIC16(L)F1454/5/9
25.9
Auto-Shutdown Control
25.9.1
SHUTDOWN
25.9.1.1
25.9.1.2
DS41639A-page 300
Preliminary
PIC16(L)F1454/5/9
25.11 Configuring the CWG
25.11.1
1.
2.
3.
4.
5.
6.
7.
8.
9.
25.11.2
AUTO-SHUTDOWN RESTART
25.11.2.1
25.11.2.2
Auto-Restart
Preliminary
DS41639A-page 301
FIGURE 25-5:
CWG Input
Source
Shutdown Source
GxASE
CWG1A
CWG1B
Preliminary
Output Resumes
Shutdown
FIGURE 25-6:
Shutdown Source
GxASE
DS41639A-page 302
CWG1A
CWG1B
Output Resumes
PIC16(L)F1454/5/9
CWG Input
Source
PIC16(L)F1454/5/9
25.12 Register Definitions: CWG Control
REGISTER 25-1:
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
U-0
U-0
R/W-0/0
GxEN
GxOEB
GxOEA
GxPOLB
GxPOLA
GxCS0
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7
bit 6
bit 5
bit 4
bit 3
bit 2-1
Unimplemented: Read as 0
bit 0
Preliminary
DS41639A-page 303
PIC16(L)F1454/5/9
REGISTER 25-2:
R/W-x/u
R/W-x/u
GxASDLB<1:0>
R/W-x/u
R/W-x/u
U-0
GxASDLA<1:0>
U-0
R/W-0/0
R/W-0/0
GxIS<1:0>
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7-6
bit 5-4
bit 3-2
Unimplemented: Read as 0
bit 1-0
DS41639A-page 304
Preliminary
PIC16(L)F1454/5/9
REGISTER 25-3:
R/W-0/0
R/W-0/0
GxASE
GxARSEN
U-0
U-0
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
GxASDC2
GxASDC1
GxASDFLT
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7
bit 6
bit 5-4
Unimplemented: Read as 0
bit 3
bit 2
bit 1
bit 0
Unimplemented: Read as 0
Preliminary
DS41639A-page 305
PIC16(L)F1454/5/9
REGISTER 25-4:
U-0
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
CWGxDBR<5:0>
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7-6
Unimplemented: Read as 0
bit 5-0
REGISTER 25-5:
U-0
U-0
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
CWGxDBF<5:0>
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7-6
Unimplemented: Read as 0
bit 5-0
DS41639A-page 306
Preliminary
PIC16(L)F1454/5/9
TABLE 25-1:
Name
ANSELA
CWGxCON0
CWGxCON1
CWGxCON2
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Registe
r on
Page
ANSA4
133
GxEN
GxOEB
GxOEA
GxPOLB
GxPOLA
G1CS0
303
GxASDC2
GxASDC1
GxASDLB<1:0>
GxASE
GxARSEN
GxASDLA<1:0>
GxIS<1:0>
GxASDFLT
304
305
CWGxDBF<5:0>
306
CWGxDBR<5:0>
306
LATA
LATA5
LATA4
133
TRISA
TRISA5
TRISA4
(1)
(1)
(1)
132
TRISC5
TRISC4
TRISC3
TRISC2
TRISC1
TRISC0
140
CWGxDBF
CWGxDBR
TRISC
Legend:
Note 1:
2:
TRISC7(1) TRISC6(1)
x = unknown, u = unchanged, = unimplemented locations read as 0. Shaded cells are not used by CWG.
Unimplemented, read as 1.
PIC16(L)F1455/9 only.
Preliminary
DS41639A-page 307
PIC16(L)F1454/5/9
NOTES:
DS41639A-page 308
Preliminary
PIC16(L)F1454/5/9
26.0
26.1
FIGURE 26-1:
Overview
(1)
VUSB3V3
(2)
Vcap
VDD
External 3.3V
Supply
P
Internal Pull-ups
FSEN
UPUEN
P
Transceiver
D+
FS
EN
USB
D-
USB
SIE
512 byte
USB RAM
Note 1: Possible optional setup for LF parts only. F parts should use internal LDO to power VUSB3V3.
2: On F devices the regulator is powered by Vdd. On LF devices the regulator is internally bypassed to Vdd.
3: 496 bytes accessible in both linear and banked data space. 16 bytes accessible in access data space only.
Preliminary
DS41639A-page 309
PIC16(L)F1454/5/9
26.2
26.2.1
26.2.2
DS41639A-page 310
Preliminary
PIC16(L)F1454/5/9
26.2.2.1
Internal Transceiver
26.2.2.3
26.2.2.4
Note:
26.2.2.2
Preliminary
DS41639A-page 311
PIC16(L)F1454/5/9
26.2.3
FIGURE 26-2:
USTAT FIFO
USTAT from SIE
26.2.4
Data Bus
DS41639A-page 312
Clearing TRNIF
Advances FIFO
26.2.5
26.2.6
4-Byte FIFO
for USTAT
Preliminary
PIC16(L)F1454/5/9
26.3
USB RAM
26.4
FIGURE 26-3:
IMPLEMENTATION OF
USB RAM IN DATA
MEMORY SPACE
2000h
512 Byte
CPU Dual-Port RAM
21FFh
2200h
512 Byte
CPU Single-Port RAM
23FFh
2400h
USB RAM Port Remap
(TSTDPEN = 1)
25FFh
2600h
Unimplemented
Read 0
29AFh
Preliminary
DS41639A-page 313
PIC16(L)F1454/5/9
FIGURE 26-4:
2000h
2001h
2002h
2003h
EXAMPLE OF A BUFFER
DESCRIPTOR
BD0STAT
BD0CNT
BD0ADRL
BD0ADRH
(xxh)
(40h)
(80h)
(20h)
Size of Block
Starting
Address
2080h
Buffer
USB Data
20BFh
Note:
26.4.1
26.4.1.1
Buffer Ownership
DS41639A-page 314
26.4.1.2
Preliminary
PIC16(L)F1454/5/9
TABLE 26-1:
OUT Packet
from Host
DTSEN
DTS
Handshake
UOWN
TRNIF
DATA0
ACK
Updated
DATA1
ACK
Not Updated
DATA0
ACK
Not Updated
DATA1
ACK
Updated
Either
ACK
Updated
NAK
Not Updated
26.4.1.3
When the BD and its buffer are owned by the SIE, most
of the bits in BDnSTAT take on a different meaning. The
configuration is shown in Register 26-6. Once the
UOWN bit is set, any data or control settings previously
written there by the user will be overwritten with data
from the SIE.
The BDnSTAT register is updated by the SIE with the
token Packet Identifier (PID), which is stored in the PID
bits of the BDnSTAT register. The transfer count in the
corresponding BDnCNT register is updated. Values
that overflow the 8-bit register carry over to the two
Most Significant digits of the count, BD bits of the
BDnSTAT register.
26.4.2
BD BYTE COUNT
26.4.3
BD ADDRESS VALIDATION
26.4.4
PING-PONG BUFFERING
No ping-pong support
Ping-pong buffer support for OUT Endpoint 0 only
Ping-pong buffer support for all endpoints
Ping-pong buffer support for all other Endpoints
except Endpoint 0
Preliminary
DS41639A-page 315
PIC16(L)F1454/5/9
FIGURE 26-5:
PPB<1:0> = 00
No Ping-Pong
Buffers
2000h
PPB<1:0> = 01
Ping-Pong Buffer
on EP0 OUT
PPB<1:0> = 10
Ping-Pong
Buffers on all EPs
2000h
EP0 OUT
Even Descriptor
EP0 IN
Descriptor
EP0 OUT
Odd Descriptor
EP0 IN
Descriptor
EP0 OUT
Odd Descriptor
EP0 IN
Descriptor
EP1 OUT
Descriptor
EP0 IN
Even Descriptor
EP1 IN
Descriptor
EP1 OUT
Descriptor
EP1 OUT
Even Descriptor
EP0 IN
Odd Descriptor
EP1 IN
Descriptor
EP1 OUT
Odd Descriptor
EP1 OUT
Even Descriptor
EP1 IN
Even Descriptor
EP1 OUT
Odd Descriptor
EP1 IN
Odd Descriptor
Available
as
Data RAM
EP0 OUT
Descriptor
EP1 IN
Even Descriptor
EP7 IN
Descriptor
2043h
2000h
EP0 OUT
Even Descriptor
EP7 IN
Descriptor
203Fh
PPB<1:0> = 11
Ping-Pong Buffers on all
other EPs except EP0
EP1 IN
Odd Descriptor
EP7 IN
Odd Descriptor
2077h
Available
as
Data RAM
2200h
207Fh
2200h
Maximum Memory
Used: 64 bytes
Maximum BDs:
16 (BD0 to BD15)
EP7 IN
Odd Descriptor
Available
as
Data RAM
2200h
Maximum Memory
Used: 68 bytes
Maximum BDs:
17 (BD0 to BD15)
Available
as
Data RAM
2200h
Maximum Memory
Used: 128 bytes
Maximum BDs:
32 (BD0 to BD31)
Maximum Memory
Used: 120 bytes
Maximum BDs:
30 (BD0 to BD14
TABLE 26-2:
Endpoint
Mode 0
(No Ping-Pong)
Mode 1
(Ping-Pong on EP0 OUT)
Mode 3
(Ping-Pong on all other EPs,
except EP0)
Mode 2
(Ping-Pong on all EPs)
Out
In
Out
In
Out
In
Out
In
0 (E), 1 (O)
0 (E), 1 (O)
2 (E), 3 (O)
4 (E), 5 (O)
6 (E), 7 (O)
2 (E), 3 (O)
4 (E), 5 (O)
8 (E), 9 (O)
10 (E), 11 (O)
12 (E), 13 (O)
14 (E), 15 (O)
6 (E), 7 (O)
8 (E), 9 (O)
10
16 (E), 17 (O)
18 (E), 19 (O)
10
11
11
12
20 (E), 21 (O)
22 (E), 23 (O)
12
13
13
14
24 (E), 25 (O)
26 (E), 27 (O)
14
15
15
16
28 (E), 29 (O)
Legend:
DS41639A-page 316
Preliminary
PIC16(L)F1454/5/9
TABLE 26-3:
Name
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
BDnSTAT(1)
UOWN
DTS(4)
PID3(2)
PID2(2)
PID1(2)
DTSEN(3)
PID0(2)
BSTALL(3)
BC9
BC8
BDnCNT(1)
Byte Count
BDnADRL(1)
BDnADRH(1)
Note 1:
2:
3:
4:
For buffer descriptor registers, n may have a value of 0 to 31. For the sake of brevity, all 32 registers are
shown as one generic prototype. All registers have indeterminate Reset values (xxxx xxxx).
Bits <5:2> of the BDnSTAT register are used by the SIE to return PID<3:0> values once the register is
turned over to the SIE (UOWN bit is set). Once the registers have been under SIE control, the values
written for DTSEN and BSTALL are no longer valid.
Prior to turning the buffer descriptor over to the SIE (UOWN bit is cleared), bits 5 through 2 of the
BDnSTAT register are used to configure the DTSEN and BSTALL settings.
This bit is ignored unless DTSEN = 1.
Preliminary
DS41639A-page 317
PIC16(L)F1454/5/9
26.5
USB Interrupts
FIGURE 26-6:
BTSEF
BTSEE
TRNIF
TRNIE
BTOEF
BTOEE
USBIF
IDLEIF
IDLEIE
DFN8EF
DFN8EE
UERRIF
UERRIE
CRC16EF
CRC16EE
STALLIF
STALLIE
CRC5EF
CRC5EE
PIDEF
PIDEE
ACTVIF
ACTVIE
URSTIF
URSTIE
FIGURE 26-7:
From Host
To Host
SETUP Token
Data
ACK
To Host
From Host
Data
ACK
From Host
To Host
Empty Data
ACK
From Host
IN Token
USB Reset
URSTIF
From Host
Start-of-Frame (SOF)
SOFIF
OUT Token
Set TRNIF
Set TRNIF
Set TRNIF
Transaction
Transaction
Complete
RESET
SOF
SETUP
DATA
SOF
STATUS
Differential Data
Control Transfer(1)
1 ms Frame
Note
1:
The control transfer shown here is only an example showing events that can occur for every transaction. Typical control transfers
will spread across multiple frames.
DS41639A-page 318
Preliminary
PIC16(L)F1454/5/9
26.5.1
26.5.2
The USB Interrupt Status register (Register 26-7) contains the flag bits for each of the USB Status interrupt
sources. Each of these sources has a corresponding
interrupt enable bit in the UIE register. All of the USB
status flags are ORed together to generate the USBIF
interrupt flag for the microcontroller's interrupt funnel.
Once an interrupt bit has been set by the SIE, it must
be cleared by software. The flag bits can also be set in
software which can aid in firmware debugging.
Note:
26.5.1.1
EXAMPLE 26-1:
Assembly:
BCF
LOOP:
BTFSS
BRA
BCF
BRA
DONE:
UCON, SUSPND
UIR, ACTVIF
DONE
UIR, ACTVIF
LOOP
The USB Interrupt Enable register (Register 26-8) contains the enable bits for the USB Status interrupt
sources. Setting any of these bits will enable the
respective interrupt source in the UIR register.
The values in this register only affect the propagation of
an interrupt condition to the microcontroller's interrupt
logic. The flag bits are set by their interrupt conditions,
allowing them to be polled and serviced without actually generating an interrupt.
26.5.3
26.5.4
C:
UCONbits.SUSPND = 0;
while (UIRbits.ACTVIF) { UIRbits.ACTVIF = 0; }
Preliminary
DS41639A-page 319
PIC16(L)F1454/5/9
26.6
FIGURE 26-9:
VSELF
26.6.1
VSS
VBUS
26.6.3
FIGURE 26-10:
VDD
VBUS
~5V
VUSB3V3
VDD
100 k
VSELF
~5V
VSS
26.6.2
VDD
VUSB3V3
FIGURE 26-8:
SELF-POWER ONLY
VUSB3V3
VSS
SELF-POWER ONLY
DS41639A-page 320
Note:
Preliminary
PIC16(L)F1454/5/9
26.6.4
Preliminary
DS41639A-page 321
PIC16(L)F1454/5/9
EQUATION 26-1:
Legend:
VUSB3V3:
PZERO:
Percentage of the IN traffic bits sent by the PIC device that are a value of 0.
PIN:
LCABLE:
Length (in meters) of the USB cable. The USB 2.0 specification requires that full-speed applications
use cables no longer than 5m.
IPULLUP:
Current which the nominal, 1.5 k pull-up resistor (when enabled) must supply to the USB cable. On
the host or hub end of the USB cable, 15 k nominal resistors (14.25 k to 24.8 k) are present which
pull both the D+ and D- lines to ground. During bus Idle conditions (such as between packets or during
USB Suspend mode), this results in up to 218 A of quiescent current drawn at 3.3V.
IPULLUP is also dependant on bus traffic conditions and can be as high as 2.2 mA when the USB bandwidth
is fully utilized (either IN or OUT traffic) for data that drives the lines to the K state most of the time.
EXAMPLE 26-2:
For this example, the following assumptions are made about the application:
3.3V will be applied to VUSB3V3 and VDD, with the core voltage regulator enabled.
This is a full-speed application that uses one interrupt IN endpoint that can send one packet of 64 bytes every
1 ms, with no restrictions on the values of the bytes being sent. The application may or may not have
additional traffic on OUT endpoints.
A regular USB B or mini-B connector will be used on the application circuit board.
In this case, PZERO = 100% = 1, because there should be no restriction on the value of the data moving through
the IN endpoint. All 64 kBps of data could potentially be bytes of value, 00h. Since 0 bits cause toggling of the
output state of the transceiver, they cause the USB transceiver to consume extra current charging/discharging the
cable. In this case, 100% of the data bits sent can be of value 0. This should be considered the max value, as
normal data will consist of a fair mix of ones and zeros.
This application uses 64 kBps for IN traffic out of the total bus bandwidth of 1.5 MBps (12 Mbps), therefore:
64 kBps
Pin =
= 4.3% = 0.043
1.5 MBps
Since a regular B or mini-B connector is used in this application, the end user may plug in any type of cable up
to the maximum allowed 5 m length. Therefore, we use the worst-case length:
LCABLE = 5 meters
Assume IPULLUP = 2.2 mA. The actual value of IPULLUP will likely be closer to 218 A, but allow for the worst-case.
USB bandwidth is shared between all the devices which are plugged into the root port (via hubs). If the application
is plugged into a USB 1.1 hub that has other devices plugged into it, your device may see host to device traffic on
the bus, even if it is not addressed to your device. Since any traffic, regardless of source, can increase the IPULLUP
current above the base 218 A, it is safest to allow for the worst-case of 2.2 mA.
Therefore:
IXCVR =
The calculated value should be considered an approximation and additional guardband or application-specific product testing is recommended. The transceiver current is in addition to the rest of the current consumed by the
microcontroller.
DS41639A-page 322
Preliminary
PIC16(L)F1454/5/9
26.7
Oscillator
26.8
The microcontroller has interrupt-on-change functionality on both D+ and D- data pins, which allows the
device to detect voltage level changes when first connected to a USB host/hub. This feature is not available
when the USB module is enabled.
The USB host/hub has 15K pull-down resistors on the
D+ and D- pins. When the microcontroller attaches to
the bus, the D+ and D- pins can detect voltage
changes. External resistors are needed for each pin to
maintain a high state on the pins when the
microcontroller is detached.
The USB module must be disabled (USBEN = 0) for the
interrupt-on-change to function. Enabling the USB
module (USBEN = 1) will automatically disable the
interrupt-on-change for D+ and D- pins. Refer to
Section 13.0 Interrupt-On-Change for more detail.
26.9
Preliminary
DS41639A-page 323
PIC16(L)F1454/5/9
26.10 USB Operation Overview
26.10.2
26.10.1
26.10.3
LAYERED FRAMEWORK
FRAMES
TRANSFERS
While full-speed devices support all transfer types, lowspeed devices are limited to interrupt and control
transfers only.
FIGURE 26-11:
USB LAYERS
Device
To other Configurations (if any)
Configuration
To other Interfaces (if any)
Interface
Interface
Endpoint
DS41639A-page 324
Endpoint
Endpoint
Endpoint
Preliminary
Endpoint
Endpoint
PIC16(L)F1454/5/9
26.10.4
POWER
26.10.6
Power is available from the USB. The USB specification defines the bus power requirements. Devices may
either be self-powered or bus powered. Self-powered
devices draw power from an external source, while bus
powered devices use power supplied from the bus.
The USB specification limits the power taken from the
bus. Refer to USB Specification 2.0, 7.2.3 for power
limits information. Note that power above one unit load
is a request and the host or hub is not obligated to
provide the extra current. Thus, a device capable of
consuming more than one unit load must be able to
maintain a low-power configuration of a one unit load or
less, if necessary.
The USB specification also defines a Suspend mode.
In this situation, current must be limited. A device must
enter a Suspend state after 3 ms of inactivity (i.e., no
SOF tokens for 3 ms). A device entering Suspend
mode must drop current consumption within 10 ms
after Suspend. Likewise, when signaling a wake-up,
the device must signal a wake-up within 10 ms of
drawing current above the suspend limit. Refer to USB
Specification 2.0, 7.2.3 for current limit information.
26.10.5
ENUMERATION
26.10.6.1
26.10.6.2
Configuration Descriptors
26.10.6.3
Interface Descriptors
26.10.6.4
Endpoint Descriptors
26.10.6.5
String Descriptors
26.10.7
BUS SPEED
8. Set a configuration.
The exact enumeration process depends on the host.
Device Descriptors
26.10.8
DESCRIPTORS
Preliminary
DS41639A-page 325
PIC16(L)F1454/5/9
26.11 Register Definitions: USB
REGISTER 26-1:
U-0
PPBRST
R-x
SE0
R/C-0
PKTDIS
R/W-0
(1)
USBEN
R/W-0
R/W-0
U-0
RESUME
SUSPND
bit 7
bit 0
Legend:
C = Clearable bit
R = Readable bit
W = Writable bit
-n = Value at POR
1 = Bit is set
0 = Bit is cleared
x = Bit is unknown
bit 7
Unimplemented: Read as 0
bit 6
bit 5
bit 4
bit 3
bit 2
bit 1
bit 0
Unimplemented: Read as 0
Note 1:
This bit cannot be set if the USB module does not have an appropriate clock source.
DS41639A-page 326
Preliminary
PIC16(L)F1454/5/9
REGISTER 26-2:
R/W-0
UTEYE
Reserved
U-0
R/W-0
UPUEN
(1)
R/W-0
Reserved
R/W-0
R/W-0
(1)
FSEN
R/W-0
PPB<1:0>
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
-n = Value at POR
1 = Bit is set
0 = Bit is cleared
bit 7
x = Bit is unknown
bit 5
bit 4
bit 3
bit 2
bit 1-0
Note 1:
The UPUEN, and FSEN bits should never be changed while the USB module is enabled. These values
must be preconfigured prior to enabling the module.
Preliminary
DS41639A-page 327
PIC16(L)F1454/5/9
REGISTER 26-3:
U-0
R-x
R-x
R-x
ENDP<3:0>
R-x
R-x
U-0
DIR
PPBI(1)
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
-n = Value at POR
1 = Bit is set
0 = Bit is cleared
bit 7
Unimplemented: Read as 0
bit 6-3
0001 = Endpoint 1
0000 = Endpoint 0
bit 2
bit 1
bit 0
Unimplemented: Read as 0
Note 1:
x = Bit is unknown
This bit is only valid for endpoints with available Even and Odd BD registers.
DS41639A-page 328
Preliminary
PIC16(L)F1454/5/9
REGISTER 26-4:
U-0
U-0
U-0
R/W-0
R/W-0
R/W-0
R/W-0
R/W-0
EPHSHK
EPCONDIS
EPOUTEN
EPINEN
EPSTALL(1)
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
-n = Value at POR
1 = Bit is set
0 = Bit is cleared
x = Bit is unknown
bit 7-5
Unimplemented: Read as 0
bit 4
bit 3
bit 2
bit 1
bit 0
Note 1:
Preliminary
DS41639A-page 329
PIC16(L)F1454/5/9
REGISTER 26-5:
R/W-x
UOWN(1)
U-0
U-0
(2)
(3)
(3)
DTS
R/W-x
R/W-x
R/W-x
R/W-x
DTSEN
BSTALL
BC9
BC8
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
-n = Value at POR
1 = Bit is set
0 = Bit is cleared
x = Bit is unknown
bit 7
bit 6
bit 5-4
Unimplemented: Read as 0
bit 3
bit 2
bit 1-0
Note 1:
2:
3:
This bit must be initialized by the user to the desired value prior to enabling the USB module.
This bit is ignored unless DTSEN = 1.
If these bits are set, USB communication may not work. Hence, these bits should always be maintained as 0.
DS41639A-page 330
Preliminary
PIC16(L)F1454/5/9
REGISTER 26-6:
R/W-x
U-x
R/W-x
R/W-x
R/W-x
R/W-x
R/W-x
R/W-x
UOWN
PID3
PID2
PID1
PID0
BC9
BC8
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
-n = Value at POR
1 = Bit is set
0 = Bit is cleared
x = Bit is unknown
bit 7
bit 6
bit 5-2
bit 1-0
Preliminary
DS41639A-page 331
PIC16(L)F1454/5/9
REGISTER 26-7:
U-0
SOFIF
R/W-0
STALLIF
R/W-0
IDLEIF
R/W-0
(1)
TRNIF
(2)
R/W-0
ACTVIF
(3)
R-0
UERRIF
R/W-0
(4)
URSTIF
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
-n = Value at POR
1 = Bit is set
0 = Bit is cleared
x = Bit is unknown
bit 7
Unimplemented: Read as 0
bit 6
bit 5
bit 4
bit 3
bit 2
bit 1
bit 0
Note 1:
2:
3:
4:
Once an Idle state is detected, the user may want to place the USB module in Suspend mode.
Clearing this bit will cause the USTAT FIFO to advance (valid only for IN, OUT and SETUP tokens).
This bit is typically unmasked only following the detection of a UIDLE interrupt event.
Only error conditions enabled through the UEIE register will set this bit. This bit is a status bit only and
cannot be set or cleared by the user.
DS41639A-page 332
Preliminary
PIC16(L)F1454/5/9
REGISTER 26-8:
U-0
R/W-0
R/W-0
R/W-0
R/W-0
R/W-0
R/W-0
R/W-0
SOFIE
STALLIE
IDLEIE
TRNIE
ACTVIE
UERRIE
URSTIE
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
-n = Value at POR
1 = Bit is set
0 = Bit is cleared
bit 7
Unimplemented: Read as 0
bit 6
bit 5
bit 4
bit 3
bit 2
bit 1
bit 0
Preliminary
x = Bit is unknown
DS41639A-page 333
PIC16(L)F1454/5/9
REGISTER 26-9:
R/C-0
U-0
U-0
R/C-0
R/C-0
R/C-0
R/C-0
R/C-0
BTSEF
BTOEF
DFN8EF
CRC16EF
CRC5EF
PIDEF
bit 7
bit 0
Legend:
R = Readable bit
C = Clearable bit
-n = Value at POR
1 = Bit is set
0 = Bit is cleared
x = Bit is unknown
bit 7
bit 6-5
Unimplemented: Read as 0
bit 4
bit 3
bit 2
bit 1
bit 0
DS41639A-page 334
Preliminary
PIC16(L)F1454/5/9
REGISTER 26-10: UEIE: USB ERROR INTERRUPT ENABLE REGISTER
R/W-0
U-0
U-0
R/W-0
R/W-0
R/W-0
R/W-0
R/W-0
BTSEE
BTOEE
DFN8EE
CRC16EE
CRC5EE
PIDEE
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
-n = Value at POR
1 = Bit is set
0 = Bit is cleared
bit 7
bit 6-5
Unimplemented: Read as 0
bit 4
bit 3
bit 2
bit 1
bit 0
Preliminary
x = Bit is unknown
DS41639A-page 335
PIC16(L)F1454/5/9
TABLE 26-4:
Name
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Details on
Page:
INTCON
GIE
PEIE
TMR0IE
INTE
IOCIE
TMR0IF
INTF
IOCIF
96
100
PIR2
OSFIF
C2IF
C1IF
BCL1IF
USBIF
ACTIF
PIE2
OSFIE
C2IE
C1IE
BCL1IE
USBIE
ACTIE
98
UCON
PPBRST
SE0
PKTDIS
USBEN
RESUME
SUSPND
326
UCFG
UTEYE
Reserved
UPUEN
Reserved
FSEN
DIR
PPBI
328
ADDR2
ADDR1
ADDR0
312
USTAT
UADDR
ADDR6
ADDR5
ADDR4
ADDR3
ENDP<3:0>
327
PPB<1:0>
UFRML
FRM7
FRM6
FRM5
FRM4
FRM3
FRM2
FRM1
FRM0
312*
UFRMH
FRM10
FRM9
FRM8
312*
UIR
SOFIF
STALLIF
IDLEIF
TRNIF
ACTVIF
UERRIF
URSTIF
332
UIE
SOFIE
STALLIE
IDLEIE
TRNIE
ACTVIE
UERRIE
URSTIE
333
UEIR
BTSEF
BTOEF
DFN8EF
CRC16EF
CRC5EF
PIDEF
334
UEIE
BTSEE
BTOEE
DFN8EE
CRC16EE
CRC5EE
PIDEE
335
UEP0
EPHSHK
EPCONDIS EPOUTEN
EPINEN
EPSTALL
329
UEP1
EPHSHK
EPCONDIS EPOUTEN
EPINEN
EPSTALL
329
UEP2
EPHSHK
EPCONDIS EPOUTEN
EPINEN
EPSTALL
329
UEP3
EPHSHK
EPCONDIS EPOUTEN
EPINEN
EPSTALL
329
UEP4
EPHSHK
EPCONDIS EPOUTEN
EPINEN
EPSTALL
329
UEP5
EPHSHK
EPCONDIS EPOUTEN
EPINEN
EPSTALL
329
UEP6
EPHSHK
EPCONDIS EPOUTEN
EPINEN
EPSTALL
329
UEP7
EPHSHK
EPCONDIS EPOUTEN
EPINEN
EPSTALL
329
Legend:
*
Note 1:
= unimplemented, read as 0. Shaded cells are not used by the USB module.
Page provides register information.
This table includes only those hardware mapped SFRs located in Bank 15 of the data memory space. The Buffer
Descriptor registers, which are mapped into Bank 4 and are not true SFRs, are listed separately in Table 26-3.
DS41639A-page 336
Preliminary
PIC16(L)F1454/5/9
27.0
IN-CIRCUIT SERIAL
PROGRAMMING (ICSP)
27.3
FIGURE 27-1:
VDD
27.1
ICSPDAT
NC
2 4 6
ICSPCLK
1 3 5
Target
VSS
PC Board
Bottom Side
Pin Description
1 = VPP/MCLR
VPP/MCLR
2 = VDD Target
3 = VSS (ground)
4 = ICSPDAT
27.2
5 = ICSPCLK
6 = No Connect
Preliminary
DS41639A-page 337
PIC16(L)F1454/5/9
FIGURE 27-2:
1
2
3
4
5
6
2 = VDD Target
3 = VSS (ground)
4 = ICSPDAT
5 = ICSPCLK
6 = No Connect
FIGURE 27-3:
Device to be
Programmed
VDD
VDD
VDD
VPP
MCLR/VPP
VSS
VSS
Data
ICSPDAT
Clock
ICSPCLK
To Normal Connections
DS41639A-page 338
Preliminary
PIC16(L)F1454/5/9
28.0
28.1
Read-Modify-Write Operations
Byte Oriented
Bit Oriented
Literal and Control
The literal and control category contains the most varied instruction word format.
TABLE 28-1:
OPCODE FIELD
DESCRIPTIONS
Field
f
Description
mm
TABLE 28-2:
ABBREVIATION
DESCRIPTIONS
Field
PC
Program Counter
TO
Time-out bit
C
DC
Z
PD
Description
Preliminary
Carry bit
Digit carry bit
Zero bit
Power-down bit
DS41639A-page 339
PIC16(L)F1454/5/9
FIGURE 28-1:
d = 0 for destination W
d = 1 for destination f
f = 7-bit file register address
0
k (literal)
OPCODE
k (literal)
0
k (literal)
5 4
0
k (literal)
0
k (literal)
6
n
0
k (literal)
n = appropriate FSR
k = 6-bit immediate value
FSR Increment instructions
13
OPCODE
2 1
0
n m (mode)
n = appropriate FSR
m = 2-bit mode value
OPCODE only
13
0
OPCODE
DS41639A-page 340
Preliminary
PIC16(L)F1454/5/9
TABLE 28-3:
Mnemonic,
Operands
Description
Cycles
14-Bit Opcode
MSb
LSb
Status
Affected
Notes
f, d
f, d
f, d
f, d
f, d
f, d
f
f, d
f, d
f, d
f, d
f, d
f
f, d
f, d
f, d
f, d
f, d
f, d
Add W and f
Add with Carry W and f
AND W with f
Arithmetic Right Shift
Logical Left Shift
Logical Right Shift
Clear f
Clear W
Complement f
Decrement f
Increment f
Inclusive OR W with f
Move f
Move W to f
Rotate Left f through Carry
Rotate Right f through Carry
Subtract W from f
Subtract with Borrow W from f
Swap nibbles in f
Exclusive OR W with f
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
00
11
00
11
11
11
00
00
00
00
00
00
00
00
00
00
00
11
00
00
0111
1101
0101
0111
0101
0110
0001
0001
1001
0011
1010
0100
1000
0000
1101
1100
0010
1011
1110
0110
dfff
dfff
dfff
dfff
dfff
dfff
lfff
0000
dfff
dfff
dfff
dfff
dfff
1fff
dfff
dfff
dfff
dfff
dfff
dfff
ffff
ffff
ffff
ffff
ffff
ffff
ffff
00xx
ffff
ffff
ffff
ffff
ffff
ffff
ffff
ffff
ffff
ffff
ffff
ffff
C, DC, Z
C, DC, Z
Z
C, Z
C, Z
C, Z
Z
Z
Z
Z
Z
Z
Z
C
C
C, DC, Z
C, DC, Z
Z
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
f, d
f, d
Decrement f, Skip if 0
Increment f, Skip if 0
BCF
BSF
f, b
f, b
Bit Clear f
Bit Set f
1(2)
1(2)
00
00
1, 2
1, 2
2
2
01
01
1, 2
1, 2
11
11
11
00
11
11
11
11
1110
1001
1000
0000
0001
0000
1100
1010
01
01
f, b
f, b
ADDLW
ANDLW
IORLW
MOVLB
MOVLP
MOVLW
SUBLW
XORLW
k
k
k
k
k
k
k
k
1 (2)
1 (2)
LITERAL OPERATIONS
1
1
1
1
1
1
1
1
kkkk
kkkk
kkkk
001k
1kkk
kkkk
kkkk
kkkk
kkkk
kkkk
kkkk
kkkk
kkkk
kkkk
kkkk
kkkk
C, DC, Z
Z
Z
C, DC, Z
Z
Note 1: If the Program Counter (PC) is modified, or a conditional test is true, the instruction requires two cycles. The second cycle
is executed as a NOP.
2: If this instruction addresses an INDF register and the MSb of the corresponding FSR is set, this instruction will require one
additional instruction cycle.
Preliminary
DS41639A-page 341
PIC16(L)F1454/5/9
TABLE 28-3:
Mnemonic,
Operands
Description
Cycles
14-Bit Opcode
MSb
LSb
Status
Affected
Notes
CONTROL OPERATIONS
BRA
BRW
CALL
CALLW
GOTO
RETFIE
RETLW
RETURN
k
k
k
Relative Branch
Relative Branch with W
Call Subroutine
Call Subroutine with W
Go to address
Return from interrupt
Return with literal in W
Return from Subroutine
CLRWDT
NOP
OPTION
RESET
SLEEP
TRIS
ADDFSR
MOVIW
n, k
n mm
MOVWI
k[n]
n mm
2
2
2
2
2
2
2
2
11
00
10
00
10
00
11
00
001k
0000
0kkk
0000
1kkk
0000
0100
0000
kkkk
0000
kkkk
0000
kkkk
0000
kkkk
0000
kkkk
1011
kkkk
1010
kkkk
1001
kkkk
1000
00
00
00
00
00
00
0000
0000
0000
0000
0000
0000
0110
0000
0110
0000
0110
0110
0100 TO, PD
0000
0010
0001
0011 TO, PD
0fff
INHERENT OPERATIONS
1
1
1
1
1
1
C-COMPILER OPTIMIZED
1
1
11
00
1
1
11
00
2, 3
2
2, 3
2
11 1111 1nkk
k[n]
1
Note 1: If the Program Counter (PC) is modified, or a conditional test is true, the instruction requires two cycles. The second cycle
is executed as a NOP.
2: If this instruction addresses an INDF register and the MSb of the corresponding FSR is set, this instruction will require
one additional instruction cycle.
3: See Table in the MOVIW and MOVWI instruction descriptions.
DS41639A-page 342
Preliminary
PIC16(L)F1454/5/9
28.2
Instruction Descriptions
ADDFSR
ANDLW
Syntax:
Syntax:
[ label ] ANDLW
Operands:
-32 k 31
n [ 0, 1]
Operands:
0 k 255
Operation:
FSR(n) + k FSR(n)
Status Affected:
None
Description:
Operation:
Status Affected:
Description:
ANDWF
AND W with f
FSRn is limited to the range 0000h FFFFh. Moving beyond these bounds
will cause the FSR to wrap around.
ADDLW
Syntax:
[ label ] ADDLW
Operands:
0 k 255
Operation:
(W) + k (W)
Status Affected:
C, DC, Z
Description:
ADDWF
Add W and f
Syntax:
[ label ] ANDWF
Operands:
0 f 127
d 0,1
f,d
Operation:
Status Affected:
Description:
ASRF
Syntax:
[ label ] ADDWF
Syntax:
[ label ] ASRF
Operands:
0 f 127
d 0,1
Operands:
0 f 127
d [0,1]
Operation:
Operation:
(f<7>) dest<7>
(f<7:1>) dest<6:0>,
(f<0>) C,
f,d
Status Affected:
C, DC, Z
Description:
ADDWFC
Syntax:
[ label ] ADDWFC
Operands:
0 f 127
d [0,1]
Status Affected:
C, Z
Description:
f {,d}
Operation:
Status Affected:
C, DC, Z
Description:
Add W, the Carry flag and data memory location f. If d is 0, the result is
placed in W. If d is 1, the result is
placed in data memory location f.
f {,d}
Preliminary
DS41639A-page 343
PIC16(L)F1454/5/9
BCF
Bit Clear f
Syntax:
[ label ] BCF
BTFSC
f,b
Syntax:
Operands:
0 f 127
0b7
Operands:
Operation:
0 (f<b>)
Operation:
skip if (f<b>) = 0
Status Affected:
None
Status Affected:
None
Description:
Description:
BRA
Relative Branch
BTFSS
Syntax:
Syntax:
Operands:
Operands:
0 f 127
0b<7
Operation:
skip if (f<b>) = 1
Operation:
(PC) + 1 + k PC
Status Affected:
None
Status Affected:
None
Description:
Description:
BRW
Syntax:
[ label ] BRW
Operands:
None
Operation:
(PC) + (W) PC
Status Affected:
None
Description:
BSF
Bit Set f
Syntax:
[ label ] BSF
Operands:
0 f 127
0b7
Operation:
1 (f<b>)
Status Affected:
None
Description:
DS41639A-page 344
f,b
Preliminary
PIC16(L)F1454/5/9
CALL
Call Subroutine
CLRWDT
Syntax:
[ label ] CALL k
Syntax:
[ label ] CLRWDT
Operands:
0 k 2047
Operands:
None
Operation:
(PC)+ 1 TOS,
k PC<10:0>,
(PCLATH<4:3>) PC<12:11>
Operation:
Status Affected:
None
00h WDT
0 WDT prescaler,
1 TO
1 PD
Description:
Status Affected:
TO, PD
Description:
CLRWDT instruction resets the Watchdog Timer. It also resets the prescaler
of the WDT.
Status bits TO and PD are set.
CALLW
COMF
Complement f
Syntax:
[ label ] CALLW
Syntax:
[ label ] COMF
Operands:
None
Operands:
Operation:
(PC) +1 TOS,
(W) PC<7:0>,
(PCLATH<6:0>) PC<14:8>
0 f 127
d [0,1]
Operation:
(f) (destination)
Status Affected:
Description:
DECF
Decrement f
Syntax:
Status Affected:
None
Description:
CLRF
Clear f
Syntax:
[ label ] CLRF
f,d
Operands:
0 f 127
Operands:
Operation:
00h (f)
1Z
0 f 127
d [0,1]
Operation:
(f) - 1 (destination)
Status Affected:
Status Affected:
Description:
Description:
CLRW
Clear W
Syntax:
[ label ] CLRW
Operands:
None
Operation:
00h (W)
1Z
Status Affected:
Description:
Preliminary
DS41639A-page 345
PIC16(L)F1454/5/9
DECFSZ
Decrement f, Skip if 0
INCFSZ
Increment f, Skip if 0
Syntax:
Syntax:
[ label ]
Operands:
0 f 127
d [0,1]
Operands:
0 f 127
d [0,1]
Operation:
(f) - 1 (destination);
skip if result = 0
Operation:
(f) + 1 (destination),
skip if result = 0
Status Affected:
None
Status Affected:
None
Description:
Description:
GOTO
Unconditional Branch
IORLW
Syntax:
[ label ]
Syntax:
[ label ]
GOTO k
INCFSZ f,d
IORLW k
Operands:
0 k 2047
Operands:
0 k 255
Operation:
k PC<10:0>
PCLATH<4:3> PC<12:11>
Operation:
Status Affected:
Status Affected:
None
Description:
Description:
INCF
Increment f
IORWF
Inclusive OR W with f
Syntax:
[ label ]
Operands:
0 f 127
d [0,1]
Syntax:
[ label ]
Operands:
0 f 127
d [0,1]
Operation:
(f) + 1 (destination)
Operation:
Status Affected:
Status Affected:
Description:
Description:
DS41639A-page 346
INCF f,d
Preliminary
IORWF
f,d
PIC16(L)F1454/5/9
LSLF
MOVF
f {,d}
Move f
Syntax:
[ label ] LSLF
Syntax:
[ label ]
Operands:
0 f 127
d [0,1]
Operands:
0 f 127
d [0,1]
Operation:
(f<7>) C
(f<6:0>) dest<7:1>
0 dest<0>
Operation:
(f) (dest)
Status Affected:
C, Z
Description:
register f
Status Affected:
Description:
Words:
Cycles:
Example:
Syntax:
[ label ] LSRF
Operands:
0 f 127
d [0,1]
Operation:
0 dest<7>
(f<7:1>) dest<6:0>,
(f<0>) C,
Status Affected:
C, Z
Description:
f {,d}
register f
MOVF
FSR, 0
After Instruction
W = value in FSR register
Z = 1
LSRF
MOVF f,d
Preliminary
DS41639A-page 347
PIC16(L)F1454/5/9
MOVIW
Move INDFn to W
Syntax:
MOVLP
Operands:
n [0,1]
mm [00,01, 10, 11]
-32 k 31
Operation:
INDFn W
Effective address is determined by
FSR + 1 (preincrement)
FSR - 1 (predecrement)
FSR + k (relative offset)
After the Move, the FSR value will be
either:
FSR + 1 (all increments)
FSR - 1 (all decrements)
Unchanged
Status Affected:
Syntax:
[ label ] MOVLP k
Operands:
0 k 127
Operation:
k PCLATH
Status Affected:
None
Description:
MOVLW
Move literal to W
Syntax:
[ label ]
0 k 255
Operation:
k (W)
Status Affected:
None
Description:
Words:
1
1
Mode
Syntax
mm
Cycles:
Preincrement
++FSRn
00
Example:
--FSRn
01
Postincrement
FSRn++
10
Postdecrement
FSRn--
11
Description:
Syntax:
[ label ] MOVLB k
Operands:
0 k 15
Operation:
k BSR
Status Affected:
None
Description:
DS41639A-page 348
0x5A
MOVWF
Move W to f
Syntax:
[ label ]
MOVWF
Operands:
0 f 127
Operation:
(W) (f)
0x5A
Status Affected:
None
Description:
Words:
Cycles:
Example:
MOVLW
After Instruction
W =
MOVLB
MOVLW k
Operands:
Predecrement
Preliminary
MOVWF
OPTION_REG
Before Instruction
OPTION_REG =
W
=
After Instruction
OPTION_REG =
W
=
0xFF
0x4F
0x4F
0x4F
PIC16(L)F1454/5/9
MOVWI
Move W to INDFn
Syntax:
Operands:
Operation:
Status Affected:
n [0,1]
mm [00,01, 10, 11]
-32 k 31
W INDFn
Effective address is determined by
FSR + 1 (preincrement)
FSR - 1 (predecrement)
FSR + k (relative offset)
After the Move, the FSR value will be
either:
FSR + 1 (all increments)
FSR - 1 (all decrements)
Unchanged
None
Mode
Syntax
mm
Preincrement
++FSRn
00
Predecrement
--FSRn
01
Postincrement
FSRn++
10
Postdecrement
FSRn--
11
Description:
NOP
No Operation
Syntax:
[ label ]
Operands:
None
Operation:
No operation
Status Affected:
None
Description:
No operation.
Words:
Cycles:
Example:
NOP
NOP
OPTION
Syntax:
[ label ] OPTION
Operands:
None
Operation:
(W) OPTION_REG
Status Affected:
None
Description:
RESET
Software Reset
Syntax:
[ label ] RESET
Operands:
None
Operation:
Status Affected:
None
Description:
Preliminary
DS41639A-page 349
PIC16(L)F1454/5/9
RETFIE
RETURN
Syntax:
[ label ]
Syntax:
[ label ]
None
RETFIE
RETURN
Operands:
None
Operands:
Operation:
TOS PC,
1 GIE
Operation:
TOS PC
Status Affected:
None
Status Affected:
None
Description:
Description:
Words:
Cycles:
Example:
RETFIE
After Interrupt
PC =
GIE =
TOS
1
RETLW
Syntax:
[ label ]
Operands:
0 k 255
Operation:
k (W);
TOS PC
Status Affected:
None
Description:
Words:
Cycles:
Example:
TABLE
RETLW k
Syntax:
[ label ]
Operands:
0 f 127
d [ 0, 1]
Operation:
Status Affected:
Description:
RLF
C
CALL TABLE;W contains table
;offset value
ADDWF PC ;W = offset
RETLW k1 ;Begin table
RETLW k2 ;
Before Instruction
W =
After Instruction
W =
DS41639A-page 350
RLF
Words:
Cycles:
Example:
RLF
f,d
Register f
REG1,0
Before Instruction
REG1
C
After Instruction
REG1
W
C
=
=
1110 0110
0
=
=
=
1110 0110
1100 1100
1
0x07
value of k8
Preliminary
PIC16(L)F1454/5/9
SUBLW
Syntax:
[ label ]
RRF
Syntax:
[ label ]
Operands:
0 f 127
d [0,1]
Operands:
0 k 255
Operation:
k - (W) W)
Operation:
Status Affected:
C, DC, Z
Status Affected:
Description:
Description:
RRF f,d
Register f
SUBLW k
C=0
Wk
C=1
Wk
DC = 0
W<3:0> k<3:0>
DC = 1
W<3:0> k<3:0>
SLEEP
SUBWF
Subtract W from f
Syntax:
[ label ]
Syntax:
[ label ]
Operands:
0 f 127
d [0,1]
SLEEP
Operands:
None
Operation:
00h WDT,
0 WDT prescaler,
1 TO,
0 PD
Status Affected:
TO, PD
Description:
SUBWF f,d
Operation:
Status Affected:
C, DC, Z
Description:
C=0
Wf
C=1
Wf
DC = 0
W<3:0> f<3:0>
DC = 1
W<3:0> f<3:0>
SUBWFB
Syntax:
SUBWFB
Operands:
0 f 127
d [0,1]
Operation:
f {,d}
Status Affected:
C, DC, Z
Description:
Preliminary
DS41639A-page 351
PIC16(L)F1454/5/9
SWAPF
Swap Nibbles in f
XORLW
Syntax:
[ label ]
Syntax:
[ label ]
Operands:
0 f 127
d [0,1]
Operation:
SWAPF f,d
(f<3:0>) (destination<7:4>),
(f<7:4>) (destination<3:0>)
XORLW k
Operands:
0 k 255
Operation:
(W) .XOR. k W)
Status Affected:
Description:
Status Affected:
None
Description:
TRIS
XORWF
Exclusive OR W with f
Syntax:
[ label ] TRIS f
Syntax:
[ label ]
Operands:
0 f 127
d [0,1]
Operands:
5f7
Operation:
Status Affected:
None
Description:
DS41639A-page 352
XORWF
f,d
Operation:
Status Affected:
Description:
Preliminary
PIC16(L)F1454/5/9
29.0
ELECTRICAL SPECIFICATIONS
Power dissipation is calculated as follows: PDIS = VDD x {IDD IOH} + {(VDD VOH) x IOH} + (VOl x
IOL).
NOTICE: Stresses above those listed under Absolute Maximum Ratings may cause permanent damage to the
device. This is a stress rating only and functional operation of the device at those or any other conditions above those
indicated in the operation listings of this specification is not implied. Exposure above maximum rating conditions for
extended periods may affect device reliability.
Preliminary
DS41639A-page 353
PIC16(L)F1454/5/9
PIC16F1454/5/9 VOLTAGE FREQUENCY GRAPH, -40C TA +125C
FIGURE 29-1:
VDD (V)
5.5
2.7
2.3
10
20
40
48
Frequency (MHz)
Note 1: The shaded region indicates the permissible combinations of voltage and frequency.
2: Refer to Table 29-1 for each Oscillator modes supported frequencies.
VDD (V)
FIGURE 29-2:
3.6
2.7
1.8
0
10
20
40
48
Frequency (MHz)
Note 1: The shaded region indicates the permissible combinations of voltage and frequency.
2: Refer to Table 29-1 for each Oscillator modes supported frequencies.
DS41639A-page 354
Preliminary
PIC16(L)F1454/5/9
29.1
PIC16LF1454/5/9
PIC16F1454/5/9
Param.
No.
D001
Sym.
VDD
Characteristic
VDR
VPOR*
VPORR*
Units
PIC16LF1454/5/9
1.8
2.5
3.6
3.6
V
V
FOSC 20 MHz
FOSC 48 MHz
PIC16F1454/5/9
2.3
2.5
5.5
5.5
V
V
FOSC 20 MHz
FOSC 48 MHz
PIC16LF1454/5/9
1.5
PIC16F1454/5/9
1.7
PIC16LF1454/5/9
1.6
PIC16F1454/5/9
1.7
V
V
0.8
PIC16F1454/5/9
1.65
1
1
1
1
1
1
D003C* TCVFVR
-130
ppm/C
D003D* VFVR/
VIN
0.270
%/V
D004*
0.05
V/ms
D002B
D003
VADFVR
SVDD
Conditions
D002A
D002B
Max.
D002*
D002A
Typ
D001
D002*
Min.
Note
Preliminary
DS41639A-page 355
PIC16(L)F1454/5/9
FIGURE 29-3:
VDD
VPOR
VPORR
VSS
NPOR
POR REARM
VSS
TVLOW(2)
Note 1:
2:
3:
DS41639A-page 356
TPOR(3)
Preliminary
PIC16(L)F1454/5/9
29.2
PIC16LF1454/5/9
PIC16F1454/5/9
Param
No.
Device
Characteristics
Conditions
Min.
Typ
Max.
Units
1.8
3.0
16
2.3
16
3.0
19
5.0
40
1.8
80
3.0
110
2.3
130
3.0
160
5.0
120
1.8
220
3.0
230
2.3
300
3.0
350
5.0
30
1.8
50
3.0
75
2.3
100
3.0
VDD
Note
D011
D011
D012
D012
D013
D013
D014
D014
D015
D015
115
5.0
100
1.8
180
3.0
225
2.3
300
3.0
350
5.0
2.3
1.8
4.0
3.0
23
2.3
46
3.0
145
5.0
FOSC = 1 MHz
EC Oscillator mode, Medium-power mode
FOSC = 1 MHz
EC Oscillator mode
Medium-power mode
FOSC = 4 MHz
EC Oscillator mode,
Medium-power mode
FOSC = 4 MHz
EC Oscillator mode
Medium-power mode
FOSC = 31 kHz
LFINTOSC mode
FOSC = 31 kHz
LFINTOSC mode
Preliminary
DS41639A-page 357
PIC16(L)F1454/5/9
29.2
PIC16LF1454/5/9
PIC16F1454/5/9
Param
No.
Device
Characteristics
Conditions
Min.
Typ
Max.
Units
220
1.8
280
3.0
340
2.3
410
3.0
535
5.0
380
1.8
560
3.0
720
2.3
920
3.0
1017
5.0
520
1.8
810
3.0
1000
2.3
1300
3.0
1600
5.0
D019A
750
3.0
FOSC = 20 MHz
ECH mode
D019A
1400
3.0
1600
5.0
FOSC = 20 MHz
ECH mode
D019B
1.8
3.0
11
2.3
15
3.0
18
5.0
15
1.8
20
3.0
35
2.3
45
3.0
D016
D016
D017*
D017*
D018
D018
D019B
D019C
D019C
D020
D020
VDD
55
5.0
150
1.8
280
3.0
230
2.3
310
3.0
370
5.0
Note
FOSC = 500 kHz HFINTOSC mode
FOSC = 500 kHz HFINTOSC mode
FOSC = 8 MHz
HFINTOSC mode
FOSC = 8 MHz
HFINTOSC mode
FOSC = 16 MHz
HFINTOSC mode
FOSC = 16 MHz
HFINTOSC mode
DS41639A-page 358
Preliminary
PIC16(L)F1454/5/9
29.2
PIC16LF1454/5/9
PIC16F1454/5/9
Param
No.
Device
Characteristics
Min.
Typ
Max.
Units
Conditions
VDD
Note
D021
1000
3.0
D021
1350
3.0
1700
5.0
Preliminary
DS41639A-page 359
PIC16(L)F1454/5/9
29.3
PIC16LF1454/5/9
PIC16F1454/5/9
Param
No.
Device Characteristics
Power-down Current
D022
D022
D022A
D023
D023
D023A
D023A
Min.
Typ
Max.
+85C
Max.
+125C
Units
0.025
0.035
0.20
0.25
Conditions
VDD
Note
1.8
3.0
2.3
3.0
0.30
5.0
10
2.3
11
3.0
12
5.0
0.29
1.8
0.39
3.0
10.5
2.3
11.3
3.0
12.5
5.0
14
1.8
23
3.0
23
2.3
30
3.0
5.0
(IPD)(2)
34
D024
3.0
D024
15
3.0
17
5.0
D24A
0.1
3.0
D24A
11
3.0
12
5.0
Note 1:
2:
3:
DS41639A-page 360
Preliminary
PIC16(L)F1454/5/9
29.3
PIC16LF1454/5/9
PIC16F1454/5/9
Param
No.
Device Characteristics
D025
D025
D026
D026
D026A*
D026A*
D027
D027
Note 1:
2:
3:
Conditions
Min.
Typ
Max.
+85C
Max.
+125C
Units
0.6
1.8
1.8
3.0
11
2.3
13
3.0
19
5.0
.025
1.8
.035
3.0
10
2.3
11
3.0
VDD
12
5.0
250
1.8
250
3.0
280
2.3
280
3.0
280
5.0
1.8
3.0
17
2.3
18
3.0
19
5.0
Note
SOSC Current (Note 1)
SOSC Current (Note 1)
Preliminary
DS41639A-page 361
PIC16(L)F1454/5/9
29.4
DC Characteristics: PIC16(L)F1454/5/9-I/E
DC CHARACTERISTICS
Param
No.
Sym.
VIL
Characteristic
Typ
Max.
Units
Conditions
D030
0.8
0.15 VDD
0.2 VDD
with SMBus
0.8
3.0 VDD
0.2 VDD
2.0
0.25 VDD +
0.8
D030A
D031
D032
MCLR
VIH
D040
D040A
D041
D042
MCLR
IIL
0.8 VDD
2.1
VDD
3.0 VDD
0.8 VDD
V
nA
D060
I/O ports
125
1000
nA
D061
MCLR(2)
50
200
nA
25
25
100
140
200
300
0.6
VDD - 0.7
50
pF
IPUR
D070*
VOL
D080
VOH
D090
DS41639A-page 362
Preliminary
PIC16(L)F1454/5/9
29.5
DC CHARACTERISTICS
Param
No.
Sym.
Characteristic
Min.
Typ
Max.
Units
Conditions
Program Memory
Programming Specifications
D110
VIHH
8.0
9.0
D111
IDDP
10
mA
D112
VBE
2.7
VDDMAX
D113
VPEW
VDDMIN
VDDMAX
D114
1.0
mA
D115
5.0
mA
D121
EP
Cell Endurance
10K
E/W
(Note 2)
D122
VPRW
VDDMIN
VDDMAX
D123
TIW
2.5
ms
D124
TRETD
Characteristic Retention
40
Year
Provided no other
specifications are violated
D125
EHEFC
100K
E/W
Data in Typ column is at 3.0V, 25C unless otherwise stated. These parameters are for design guidance
only and are not tested.
Note 1: Self-write and Block Erase.
2: Required only if single-supply programming is disabled.
Preliminary
DS41639A-page 363
PIC16(L)F1454/5/9
29.6
Sym
Characteristic
Min
Typ
Max
Units
Conditions
D313
VUSB
USB Voltage
3.0
3.6
D314
IIL
D315
0.8
D316
2.0
D318
VDIFS
0.2
D319
VCM
0.8
2.5
D320
ZOUT
28
44
D321
VOL
0.0
0.3
D322
VOH
2.8
3.6
Note 1: The D+ and D- signal lines have been built-in impedance matching resistors. No external resistors,
capacitors or magnetic components are necessary on the D+/D- signal paths between the
PIC16(L)F1454/5/9 family device and USB cable.
DS41639A-page 364
Preliminary
PIC16(L)F1454/5/9
29.7
Thermal Considerations
TH02
Sym.
Characteristic
Typ.
Units
JA
70
C/W
95.3
C/W
100
C/W
45.7
C/W
62.2
C/W
77.7
C/W
87.3
C/W
43.0
C/W
32
C/W
31
C/W
24.4
C/W
6.3
C/W
27.5
C/W
23.1
C/W
31.1
C/W
5.3
C/W
150
PD = PINTERNAL + PI/O
JC
TH03
TJMAX
TH04
PD
TH05
Conditions
TH06
PI/O
TH07
PDER
Derated Power
Note 1: IDD is current to run the chip alone without driving any load on the output pins.
2: TA = Ambient Temperature
3: TJ = Junction Temperature
Preliminary
DS41639A-page 365
PIC16(L)F1454/5/9
29.8
FIGURE 29-4:
Time
osc
rd
rw
sc
ss
t0
t1
wr
CLKIN
RD
RD or WR
SCKx
SS
T0CKI
T1CKI
WR
P
R
V
Z
Period
Rise
Valid
High-impedance
LOAD CONDITIONS
Load Condition
Pin
CL
VSS
DS41639A-page 366
Preliminary
PIC16(L)F1454/5/9
29.9
AC Characteristics: PIC16(L)F1454/5/9-I/E
FIGURE 29-5:
CLOCK TIMING
Q4
Q1
Q2
Q3
Q4
Q1
CLKIN
OS12
OS02
OS11
OS03
CLKOUT
(CLKOUT Mode)
Note
1:
TABLE 29-1:
Sym.
FOSC
Characteristic
External CLKIN Frequency(1)
Min.
Typ
Max.
Units
Conditions
DC
0.5
MHz
DC
MHz
DC
20
MHz
OS02
TOSC
31.25
ns
EC mode
OS03
TCY
125
DC
ns
TCY = FOSC/4
TABLE 29-2:
OSCILLATOR PARAMETERS
Sym.
HFOSC
OS08A HFTOL
Characteristic
Min.
Typ
Max.
Units
16.0
MHz
Frequency Tolerance
+25C, 16 MHz
0C TA +85C, 16 MHz
OS09
LFOSC
31
kHz
OS10*
TIOSC ST
HFINTOSC
Wake-up from Sleep Start-up Time
OS11*
TUNELOCK HFINTOSC
Self-tune Lock Time
<5
mS
Conditions
0C TA +85C
-40C TA +125C
NOTE 2
Preliminary
DS41639A-page 367
PIC16(L)F1454/5/9
FIGURE 29-6:
Cycle
Write
Fetch
Read
Execute
Q4
Q1
Q2
Q3
FOSC
OS12
OS11
OS20
OS21
CLKOUT
OS19
OS18
OS16
OS13
OS17
I/O pin
(Input)
OS14
OS15
I/O pin
(Output)
New Value
Old Value
OS18, OS19
TABLE 29-3:
OS11
Sym.
TosH2ckL
Characteristic
Min.
Typ
Max.
Units
Conditions
70
ns
VDD = 3.3-5.0V
(1)
72
ns
VDD = 3.3-5.0V
20
ns
TOSC + 200 ns
50
50
70*
ns
ns
ns
20
ns
25
25
15
40
28
15
32
72
55
30
ns
OS12
OS13
TckL2ioV
OS14
OS15
OS16
TioV2ckH
TosH2ioV
TosH2ioI
OS17
TioV2osH
OS18* TioR
OS19* TioF
OS20* Tinp
OS21* Tioc
DS41639A-page 368
Preliminary
ns
VDD = 3.3-5.0V
VDD = 3.3-5.0V
VDD = 2.0V
VDD = 5.0V
VDD = 2.0V
VDD = 5.0V
ns
ns
PIC16(L)F1454/5/9
FIGURE 29-7:
VDD
MCLR
30
Internal
POR
33
PWRT
Time-out
Internal Reset(1)
Watchdog Timer
Reset(1)
31
34
34
I/O pins
FIGURE 29-8:
VDD
VBOR and VHYST
VBOR
37
Reset
33(1)
(due to BOR)
Preliminary
DS41639A-page 369
PIC16(L)F1454/5/9
TABLE 29-4:
Sym.
Characteristic
Min.
Typ
Max.
Units
Conditions
2
5
s
s
10
16
27
ms
VDD = 3.3V-5V,
1:16 Prescaler used
30
TMCL
31
33*
TPWRT
40
65
140
ms
34*
TIOZ
2.0
35
VBOR
2.55
1.80
2.70
1.90
2.85
2.11
V
V
36*
VHYST
25
50
mV
-40C to +85C
37*
VDD VBOR
1.8
2.1
2.5
LPBOR = 1
38*
VLPOR
Low-Power Brown-out
BORV = 0
BORV = 1
FIGURE 29-9:
T0CKI
40
41
42
T1CKI
45
46
47
49
TMR0 or
TMR1
DS41639A-page 370
Preliminary
PIC16(L)F1454/5/9
TABLE 29-5:
Sym.
TT0H
Characteristic
T0CKI High Pulse Width
Min.
No Prescaler
TT0L
No Prescaler
TT0P
T0CKI Period
45*
TT1H
ns
ns
0.5 TCY + 20
ns
10
ns
Greater of:
20 or TCY + 40
N
ns
0.5 TCY + 20
ns
15
ns
Asynchronous
46*
TT1L
T1CKI Low
Time
Units
10
With Prescaler
42*
Max.
0.5 TCY + 20
With Prescaler
41*
Typ
30
ns
Synchronous, No Prescaler
0.5 TCY + 20
ns
15
ns
Asynchronous
30
ns
Greater of:
30 or TCY + 40
N
ns
47*
TT1P
49*
60
ns
2 TOSC
7 TOSC
Conditions
N = prescale value
(2, 4, ..., 256)
N = prescale value
(1, 2, 4, 8)
Timers in Sync
mode
TABLE 29-6:
Characteristic
Min.
Typ
Max.
Units
Conditions
AD01
NR
Resolution
10
AD02
EIL
Integral Error
1.7
AD03
EDL
Differential Error
AD04
2.5
AD05
EGN
2.0
AD06
1.8
VDD
AD07
VAIN
Full-Scale Range
VSS
VREF
AD08
ZAIN
Recommended Impedance of
Analog Voltage Source
10
Note 1:
2:
3:
4:
Gain Error
bit
LSb VREF = 3.0V
LSb No missing codes
VREF = 3.0V
Preliminary
DS41639A-page 371
PIC16(L)F1454/5/9
TABLE 29-7:
Sym.
Characteristic
AD130* TAD
AD131
TCNV
AD132* TACQ
Min.
Typ
Max.
Units
Conditions
1.0
9.0
TOSC-based
1.0
1.6
6.0
11
TAD
Acquisition Time
5.0
FIGURE 29-10:
BSF ADCON0, GO
AD134
1 TCY
(TOSC/2(1))
AD131
Q4
AD130
A/D CLK
9
A/D Data
OLD_DATA
ADRES
0
NEW_DATA
1 TCY
ADIF
GO
Sample
DONE
AD132
Sampling Stopped
Note 1: If the A/D clock source is selected as FRC, a time of TCY is added before the A/D clock starts. This allows the
SLEEP instruction to be executed.
DS41639A-page 372
Preliminary
PIC16(L)F1454/5/9
FIGURE 29-11:
BSF ADCON0, GO
AD134
(TOSC/2 + TCY(1))
1 TCY
AD131
Q4
AD130
A/D CLK
9
A/D Data
OLD_DATA
ADRES
0
NEW_DATA
ADIF
1 TCY
GO
DONE
Sample
AD132
Sampling Stopped
Note 1: If the A/D clock source is selected as FRC, a time of TCY is added before the A/D clock starts. This allows the
SLEEP instruction to be executed.
Preliminary
DS41639A-page 373
PIC16(L)F1454/5/9
TABLE 29-8:
COMPARATOR SPECIFICATIONS
Operating Conditions: 1.8V < VDD < 5.5V, -40C < TA < +125C (unless otherwise stated).
Param
No.
Sym.
Characteristics
CM01
VIOFF
CM02
VICM
Min.
Typ.
Max.
Units
Comments
7.5
60
mV
VDD
CM04A
400
800
ns
High-Power mode
(Note 1)
CM04B
200
400
ns
High-Power mode
(Note 1)
1200
ns
Low-Power mode
(Note 1)
550
ns
Low-Power mode
(Note 1)
10
65
mV
CM04C
TRESP
CM04D
CM05
TMC2OV
CM06
*
Note 1:
2:
Note 2
TABLE 29-9:
Operating Conditions: 1.8V < VDD < 5.5V, -40C < TA < +125C (unless otherwise stated).
Param
No.
Sym.
Characteristics
Min.
Typ.
Max.
Units
DAC01*
CLSB
Step Size
VDD/32
DAC02*
CACC
Absolute Accuracy
1/2
LSb
DAC03*
CR
5K
DAC04*
CST
Settling Time(1)
10
*
Note 1:
Comments
DS41639A-page 374
Preliminary
PIC16(L)F1454/5/9
FIGURE 29-12:
CK
US121
US121
DT
US122
US120
Note:
Symbol
Characteristic
Min.
Max.
Units
3.0-5.5V
80
ns
1.8-5.5V
100
ns
US121 TCKRF
3.0-5.5V
45
ns
1.8-5.5V
50
ns
3.0-5.5V
45
ns
1.8-5.5V
50
ns
US122 TDTRF
FIGURE 29-13:
Conditions
US125
DT
US126
Note: Refer to Figure 29-4 for load conditions.
Symbol
Characteristic
Preliminary
Min.
Max.
Units
10
ns
15
ns
Conditions
DS41639A-page 375
PIC16(L)F1454/5/9
FIGURE 29-14:
SS
SP70
SCK
(CKP = 0)
SP71
SP72
SP78
SP79
SP79
SP78
SCK
(CKP = 1)
SP80
bit 6 - - - - - -1
MSb
SDO
LSb
SP75, SP76
SDI
MSb In
bit 6 - - - -1
LSb In
SP74
SP73
FIGURE 29-15:
SS
SP81
SCK
(CKP = 0)
SP71
SP72
SP79
SP73
SCK
(CKP = 1)
SP80
SDO
MSb
SP78
bit 6 - - - - - -1
LSb
SP75, SP76
SDI
MSb In
bit 6 - - - -1
LSb In
SP74
DS41639A-page 376
Preliminary
PIC16(L)F1454/5/9
FIGURE 29-16:
SS
SP70
SCK
(CKP = 0)
SP83
SP71
SP72
SP78
SP79
SP79
SP78
SCK
(CKP = 1)
SP80
MSb
SDO
LSb
bit 6 - - - - - -1
SP77
SP75, SP76
SDI
MSb In
bit 6 - - - -1
LSb In
SP74
SP73
FIGURE 29-17:
SS
SCK
(CKP = 0)
SP71
SP72
SCK
(CKP = 1)
SP80
MSb
SDO
bit 6 - - - - - -1
LSb
SP77
SP75, SP76
SDI
MSb In
bit 6 - - - -1
LSb In
SP74
Preliminary
DS41639A-page 377
PIC16(L)F1454/5/9
TABLE 29-12: SPI MODE REQUIREMENTS
Param
No.
Symbol
Characteristic
Min.
Typ
TCY
ns
SP71* TSCH
TCY + 20
ns
SP72* TSCL
TCY + 20
ns
100
ns
100
ns
3.0-5.5V
10
25
ns
1.8-5.5V
25
50
ns
10
25
ns
SP75* TDOR
SP76* TDOF
SP77* TSSH2DOZ
10
50
ns
SP78* TSCR
3.0-5.5V
10
25
ns
1.8-5.5V
25
50
ns
SP79* TSCF
10
25
ns
3.0-5.5V
50
ns
1.8-5.5V
145
ns
Tcy
ns
50
ns
1.5TCY + 40
ns
DS41639A-page 378
Preliminary
PIC16(L)F1454/5/9
FIGURE 29-18:
SCL
SP93
SP91
SP90
SP92
SDA
Stop
Condition
Start
Condition
Symbol
SP90*
TSU:STA
SP91*
THD:STA
SP92*
TSU:STO
SP93
Characteristic
Typ
Max. Units
Start condition
4700
Setup time
600
Start condition
4000
Hold time
600
Stop condition
4700
Setup time
600
4000
600
Min.
Conditions
ns
ns
ns
ns
FIGURE 29-19:
SCL
SP100
SP90
SP102
SP101
SP106
SP107
SP91
SDA
In
SP92
SP110
SP109
SP109
SDA
Out
Preliminary
DS41639A-page 379
PIC16(L)F1454/5/9
TABLE 29-14: I2C BUS DATA REQUIREMENTS
Param.
No.
Symbol
SP100* THIGH
Characteristic
Min.
Max.
Units
4.0
0.6
1.5TCY
4.7
1.3
SSP module
SP101* TLOW
1.5TCY
1000
ns
20 + 0.1CB
300
ns
250
ns
20 + 0.1CB
250
ns
SSP module
SP102* TR
SP103* TF
SP106* THD:DAT
SP107* TSU:DAT
SP109* TAA
SP110*
SP111
*
Note 1:
2:
TBUF
CB
ns
0.9
Conditions
250
ns
100
ns
3500
ns
ns
4.7
1.3
400
pF
CB is specified to be from
10-400 pF
CB is specified to be from
10-400 pF
(Note 2)
(Note 1)
DS41639A-page 380
Preliminary
PIC16(L)F1454/5/9
NOTES:
Preliminary
DS41639A-page 381
PIC16(L)F1454/5/9
DS41639A-page 382
Preliminary
PIC16(L)F1454/5/9
30.0
DC AND AC
CHARACTERISTICS GRAPHS
AND CHARTS
Preliminary
DS41639A-page 383
PIC16(L)F1454/5/9
NOTES:
DS41639A-page 384
Preliminary
PIC16(L)F1454/5/9
31.0
DEVELOPMENT SUPPORT
31.1
Preliminary
DS41639A-page 385
PIC16(L)F1454/5/9
31.2
31.3
MPASM Assembler
31.4
31.5
31.6
DS41639A-page 386
Preliminary
PIC16(L)F1454/5/9
31.7
31.9
31.8
MPLAB ICD 3 In-Circuit Debugger System is Microchip's most cost effective high-speed hardware
debugger/programmer for Microchip Flash Digital Signal Controller (DSC) and microcontroller (MCU)
devices. It debugs and programs PIC Flash microcontrollers and dsPIC DSCs with the powerful, yet easyto-use graphical user interface of MPLAB Integrated
Development Environment (IDE).
The MPLAB ICD 3 In-Circuit Debugger probe is connected to the design engineer's PC using a high-speed
USB 2.0 interface and is connected to the target with a
connector compatible with the MPLAB ICD 2 or MPLAB
REAL ICE systems (RJ-11). MPLAB ICD 3 supports all
MPLAB ICD 2 headers.
Preliminary
DS41639A-page 387
PIC16(L)F1454/5/9
31.11 PICkit 2 Development
Programmer/Debugger and
PICkit 2 Debug Express
31.13 Demonstration/Development
Boards, Evaluation Kits, and
Starter Kits
DS41639A-page 388
Preliminary
PIC16(L)F1454/5/9
32.0
PACKAGING INFORMATION
32.1
Example
PIC16F1454
-E/P e3
1220123
Example
PIC16F1455
-E/SL e3
1220123
Legend: XX...X
Y
YY
WW
NNN
e3
*
Note:
Customer-specific information
Year code (last digit of calendar year)
Year code (last 2 digits of calendar year)
Week code (week of January 1 is week 01)
Alphanumeric traceability code
Pb-free JEDEC designator for Matte Tin (Sn)
This package is Pb-free. The Pb-free JEDEC designator ( e3 )
can be found on the outer packaging for this package.
In the event the full Microchip part number cannot be marked on one line, it will
be carried over to the next line, thus limiting the number of available
characters for customer-specific information.
Standard PICmicro device marking consists of Microchip part number, year code, week code and
traceability code. For PICmicro device marking beyond this, certain price adders apply. Please check
with your Microchip Sales Office. For QTP devices, any special marking adders are included in QTP
price.
Preliminary
DS41639A-page 389
PIC16(L)F1454/5/9
Example
XXXXXXXX
YYWW
NNN
F1454EST
1220
123
Example
PIN 1
PIN 1
Example
PIC16F1459
-E/P e3
1220123
XXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXX
YYWWNNN
DS41639A-page 390
PIC16
F1455
E/ML e3
220123
Preliminary
PIC16(L)F1454/5/9
20-Lead SOIC (7.50 mm)
Example
PIC16F1459
-E/SO e3
1220123
Example
PIC16F1459
-E/SS e3
1220123
Example
PIN 1
PIN 1
Preliminary
PIC16
F1459
E/ML e3
220123
DS41639A-page 391
PIC16(L)F1454/5/9
32.2
Package Details
3
%&
%! %4" ) ' %
4$%
%"%
%%255)))&
&54
NOTE 1
E1
D
E
A2
L
A1
b1
b
eB
6%
&
9&%
7!&(
$
7+8-
7
7:
;
%
%
%
<
<
""4
4
0
,
0
1 %
%
0
<
<
!" %
!" ="%
,
,0
""4="%
-
0
>
: 9%
,0
0
0
%
%
0
,
0
9" 4
>
0
(
0
?
>
1
<
<
6 9"="%
9
) 9"="%
:
)*
1+
,
!"#$%! & '(!%&! %(
%")%%%"
*$%+ % %
, &
"-"
%!"&
"$
% !
"$
% !
%#". "
&
"%
-/0
1+21 &
%#%!
))%
!%%
) +01
DS41639A-page 392
Preliminary
PIC16(L)F1454/5/9
Note:
For the most current package drawings, please see the Microchip Packaging Specification located at
http://www.microchip.com/packaging
Preliminary
DS41639A-page 393
PIC16(L)F1454/5/9
Note:
For the most current package drawings, please see the Microchip Packaging Specification located at
http://www.microchip.com/packaging
DS41639A-page 394
Preliminary
PIC16(L)F1454/5/9
Note:
For the most current package drawings, please see the Microchip Packaging Specification located at
http://www.microchip.com/packaging
Preliminary
DS41639A-page 395
PIC16(L)F1454/5/9
Note:
For the most current package drawings, please see the Microchip Packaging Specification located at
http://www.microchip.com/packaging
DS41639A-page 396
Preliminary
PIC16(L)F1454/5/9
Note:
For the most current package drawings, please see the Microchip Packaging Specification located at
http://www.microchip.com/packaging
Preliminary
DS41639A-page 397
PIC16(L)F1454/5/9
!
" #
$
%& ' (()* "#
3
%&
%! %4" ) ' %
4$%
%"%
%%255)))&
&54
D2
D
EXPOSED
PAD
e
E2
E
2
TOP VIEW
N
NOTE 1
BOTTOM VIEW
A3
A
A1
6%
&
9&%
7!&(
$
99-
-
7
7:
;
?
%
: 8%
>
%"
$$
0
+
%%
4
,
: ="%
-#
""="%
-
: 9%
-#
""9%
?01+
-3
1+
0
?0
>
1+
0
?0
+
%%="%
0
,
,0
+
%%9%
,
0
+
%%%
-#
""
V
<
!"#$%! & '(!%&! %(
%")%%%"
4 ) !%"
, &
"%
-/0
1+2 1 &
%#%!
))%
!%%
-32 $ &
'! !)%
!%%
'$
$
&%
!
>
<
) +1
DS41639A-page 398
Preliminary
PIC16(L)F1454/5/9
Note:
For the most current package drawings, please see the Microchip Packaging Specification located at
http://www.microchip.com/packaging
Preliminary
DS41639A-page 399
PIC16(L)F1454/5/9
+
3
%&
%! %4" ) ' %
4$%
%"%
%%255)))&
&54
E1
NOTE 1
3
D
E
A2
A1
b1
b
eB
e
6%
&
9&%
7!&(
$
7+8-
7
7:
;
%
%
%
<
<
""4
4
0
,
0
1 %
%
0
<
<
!" %
!" ="%
,
,
,0
""4="%
-
0
>
: 9%
>
,
?
%
%
0
,
0
9" 4
>
0
(
0
?
>
1
<
<
6 9"="%
9
) 9"="%
:
)*
1+
,
!"#$%! & '(!%&! %(
%")%%%"
*$%+ % %
, &
"-"
%!"&
"$
% !
"$
% !
%#". "
&
"%
-/0
1+2 1 &
%#%!
))%
!%%
) +1
DS41639A-page 400
Preliminary
PIC16(L)F1454/5/9
Note:
For the most current package drawings, please see the Microchip Packaging Specification located at
http://www.microchip.com/packaging
Preliminary
DS41639A-page 401
PIC16(L)F1454/5/9
Note:
For the most current package drawings, please see the Microchip Packaging Specification located at
http://www.microchip.com/packaging
DS41639A-page 402
Preliminary
PIC16(L)F1454/5/9
+
,-.% , /
,, 0) ,,/
3
%&
%! %4" ) ' %
4$%
%"%
%%255)))&
&54
D
N
E
E1
NOTE 1
1 2
e
b
c
A2
A1
L1
6%
&
9&%
7!&(
$
L
99-
-
7
7:
;
%
: 8%
<
?01+
<
""4
4
?0
0
>0
%"
$$
0
<
<
: ="%
>
>
""4="%
-
0
0,
0?
: 9%
?
0
%9%
00
0
0
% %
9
0-3
9" 4
<
%
W
W
0
>W
9"="%
<
,>
!"#$%! & '(!%&! %(
%")%%%"
&
"-"
%!"&
"$
% !
"$
% !
%#"&& "
, &
"%
-/0
1+2 1 &
%#%!
))%
!%%
-32 $ &
'! !)%
!%%
'$
$
&%
!
) +1
Preliminary
DS41639A-page 403
PIC16(L)F1454/5/9
Note:
For the most current package drawings, please see the Microchip Packaging Specification located at
http://www.microchip.com/packaging
DS41639A-page 404
Preliminary
PIC16(L)F1454/5/9
+
" #
$
%& ' (()* "#
3
%&
%! %4" ) ' %
4$%
%"%
%%255)))&
&54
D2
EXPOSED
PAD
e
E2
2
E
b
1
K
N
N
NOTE 1
TOP VIEW
BOTTOM VIEW
A
A1
A3
6%
&
9&%
7!&(
$
99-
-
7
7:
;
%
: 8%
>
%"
$$
0
+
%%
4
,
: ="%
-#
""="%
-
: 9%
-#
""9%
01+
-3
1+
?
>
1+
?
>
+
%%="%
>
0
,
+
%%9%
,
0
+
%%%
-#
""
<
<
!"#$%! & '(!%&! %(
%")%%%"
4 ) !%"
, &
"%
-/0
1+2 1 &
%#%!
))%
!%%
-32 $ &
'! !)%
!%%
'$
$
&%
!
) +?1
Preliminary
DS41639A-page 405
PIC16(L)F1454/5/9
3
%&
%! %4" ) ' %
4$%
%"%
%%255)))&
&54
DS41639A-page 406
Preliminary
PIC16(L)F1454/5/9
APPENDIX A:
DATA SHEET
REVISION HISTORY
Revision A (06/2012)
Initial release.
Preliminary
DS41639A-page 407
PIC16(L)F1454/5/9
NOTES:
DS41639A-page 408
Preliminary
PIC16(L)F1454/5/9
INDEX
A
A/D
Specifications.................................................... 371, 372
Absolute Maximum Ratings .............................................. 353
AC Characteristics
Industrial and Extended ............................................ 367
Load Conditions ........................................................ 366
ACKSTAT ......................................................................... 238
ACKSTAT Status Flag ...................................................... 238
ADC .................................................................................. 153
Acquisition Requirements ......................................... 165
Associated registers.................................................. 167
Block Diagram........................................................... 154
Calculating Acquisition Time..................................... 165
Channel Selection..................................................... 155
Configuration............................................................. 155
Configuring Interrupt ................................................. 159
Conversion Clock...................................................... 155
Conversion Procedure .............................................. 159
Internal Sampling Switch (RSS) Impedance.............. 165
Interrupts................................................................... 157
Operation .................................................................. 158
Operation During Sleep ............................................ 158
Port Configuration ..................................................... 155
Reference Voltage (VREF)......................................... 155
Source Impedance.................................................... 165
Starting an A/D Conversion ...................................... 157
ADCON0 Register....................................................... 38, 160
ADCON1 Register....................................................... 38, 161
ADCON2 Register............................................................. 162
ADDFSR ........................................................................... 343
ADDWFC .......................................................................... 343
ADRESH Register............................................................... 38
ADRESH Register (ADFM = 0) ......................................... 163
ADRESH Register (ADFM = 1) ......................................... 164
ADRESL Register (ADFM = 0).......................................... 163
ADRESL Register (ADFM = 1).......................................... 164
Alternate Pin Function....................................................... 130
Analog-to-Digital Converter. See ADC
ANSELA Register ............................................................. 133
ANSELB Register ............................................................. 137
ANSELC Register ............................................................. 141
APFCON Register............................................................. 130
Assembler
MPASM Assembler................................................... 386
Automatic Context Saving................................................... 95
B
Bank 10 ............................................................................... 41
Bank 11 ............................................................................... 41
Bank 12 ............................................................................... 41
Bank 13 ............................................................................... 41
Bank 14-28.......................................................................... 41
Bank 2 ................................................................................. 39
Bank 3 ................................................................................. 39
Bank 30 ............................................................................... 42
Bank 31 ............................................................................... 43
Bank 4 ................................................................................. 40
Bank 5 ................................................................................. 40
Bank 6 ................................................................................. 40
Bank 7 ................................................................................. 40
Bank 8 ................................................................................. 40
Bank 9 ................................................................................. 40
C
C Compilers
MPLAB C18.............................................................. 386
CALL................................................................................. 345
CALLW ............................................................................. 345
CLKRCON Register............................................................ 88
Clock Accuracy with Asynchronous Operation ................. 266
Clock Sources
External Modes........................................................... 59
EC ...................................................................... 59
HS ...................................................................... 59
LP ....................................................................... 59
OST .................................................................... 60
RC ...................................................................... 62
XT ....................................................................... 59
Internal Modes............................................................ 62
HFINTOSC ......................................................... 62
Internal Oscillator Clock Switch Timing .............. 64
LFINTOSC.......................................................... 63
Clock Switching ............................................................ 66, 67
CMOUT Register .............................................................. 180
CMxCON0 Register .......................................................... 179
CMxCON1 Register .......................................................... 180
Preliminary
DS41639A-page 409
PIC16(L)F1454/5/9
Code Examples
A/D Conversion ......................................................... 159
Initializing PORTA............................................. 129, 131
Writing to Flash Program Memory ............................ 121
Comparator
Associated Registers ................................................ 181
Operation .................................................................. 173
Comparator Module .......................................................... 173
Cx Output State Versus Input Conditions ................. 175
Comparator Specifications ................................................ 374
Comparators
C2OUT as T1 Gate ................................................... 189
Complementary Waveform Generator (CWG) .......... 293, 294
CONFIG1 Register.............................................................. 52
CONFIG2 Register.............................................................. 54
Core Function Register ....................................................... 37
CPU Clock Divider .............................................................. 66
Customer Change Notification Service ............................. 415
Customer Notification Service........................................... 415
Customer Support ............................................................. 415
CWG
Auto-shutdown Control ............................................. 300
Clock Source............................................................. 296
Output Control........................................................... 296
Selectable Input Sources .......................................... 296
CWGxCON0 Register ....................................................... 303
CWGxCON1 Register ....................................................... 304
CWGxCON2 Register ....................................................... 305
CWGxDBF Register .......................................................... 306
CWGxDBR Register.......................................................... 306
D
DACCON0 (Digital-to-Analog Converter
Control 0) Register .................................................... 172
DACCON1 (Digital-to-Analog Converter
Control 1) Register .................................................... 172
Data Memory....................................................................... 26
DC and AC Characteristics ............................................... 383
DC Characteristics
Extended and Industrial ............................................ 362
Industrial and Extended ............................................ 355
Development Support ....................................................... 385
Device Configuration........................................................... 51
Code Protection .......................................................... 55
Configuration Word ..................................................... 51
Device ID and Revision ID .......................................... 56
User ID ........................................................................ 55
Device ID Register .............................................................. 56
Device Overview ......................................................... 13, 107
Digital-to-Analog Converter (DAC).................................... 169
Associated Registers ................................................ 172
Effects of a Reset...................................................... 170
Specifications ............................................................ 374
E
Effects of Reset
PWM mode ............................................................... 289
Electrical Specifications .................................................... 353
Enhanced Mid-Range CPU................................................. 21
Enhanced Universal Synchronous Asynchronous
Receiver Transmitter (EUSART)............................... 257
Equations
Estimating USB Transceiver Current
Consumption..................................................... 322
Errata .................................................................................. 11
DS41639A-page 410
F
Fail-Safe Clock Monitor ...................................................... 71
Fail-Safe Condition Clearing....................................... 71
Fail-Safe Detection ..................................................... 71
Fail-Safe Operation..................................................... 71
Reset or Wake-up from Sleep .................................... 71
Firmware Instructions ....................................................... 339
Fixed Voltage Reference (FVR)........................................ 149
Associated Registers ................................................ 150
Flash Program Memory .................................................... 112
Associated Registers ................................................ 128
Configuration Word w/ Flash
Program Memory.............................................. 128
Erasing ..................................................................... 116
Modifying .................................................................. 122
Write Verify ............................................................... 124
Writing ...................................................................... 118
FSR Register ...................................................................... 37
FVRCON (Fixed Voltage Reference Control) Register..... 150
I
I2C Mode (MSSP)
Acknowledge Sequence Timing ............................... 242
Bus Collision
During a Repeated Start Condition................... 246
During a Stop Condition ................................... 247
Effects of a Reset ..................................................... 243
I2C Clock Rate w/BRG.............................................. 249
Master Mode
Operation.......................................................... 234
Reception ......................................................... 240
Preliminary
PIC16(L)F1454/5/9
Start Condition Timing .............................. 236, 237
Transmission .................................................... 238
Multi-Master Communication, Bus Collision
and Arbitration .................................................. 243
Multi-Master Mode .................................................... 243
Read/Write Bit Information (R/W Bit) ........................ 219
Slave Mode
Transmission .................................................... 224
Sleep Operation ........................................................ 243
Stop Condition Timing............................................... 242
INDF Register ..................................................................... 37
Indirect Addressing ............................................................. 47
Instruction Format ............................................................. 340
Instruction Set ................................................................... 339
ADDLW ..................................................................... 343
ADDWF..................................................................... 343
ADDWFC .................................................................. 343
ANDLW ..................................................................... 343
ANDWF..................................................................... 343
BRA........................................................................... 344
CALL ......................................................................... 345
CALLW...................................................................... 345
LSLF ......................................................................... 347
LSRF......................................................................... 347
MOVF........................................................................ 347
MOVIW ..................................................................... 348
MOVLB ..................................................................... 348
MOVWI ..................................................................... 349
OPTION .................................................................... 349
RESET ...................................................................... 349
SUBWFB................................................................... 351
TRIS.......................................................................... 352
BCF........................................................................... 344
BSF ........................................................................... 344
BTFSC ...................................................................... 344
BTFSS ...................................................................... 344
CALL ......................................................................... 345
CLRF......................................................................... 345
CLRW ....................................................................... 345
CLRWDT................................................................... 345
COMF ....................................................................... 345
DECF ........................................................................ 345
DECFSZ.................................................................... 346
GOTO ....................................................................... 346
INCF.......................................................................... 346
INCFSZ ..................................................................... 346
IORLW ...................................................................... 346
IORWF ...................................................................... 346
MOVLW .................................................................... 348
MOVWF .................................................................... 348
NOP .......................................................................... 349
RETFIE ..................................................................... 350
RETLW ..................................................................... 350
RETURN ................................................................... 350
RLF ........................................................................... 350
RRF........................................................................... 351
SLEEP ...................................................................... 351
SUBLW ..................................................................... 351
SUBWF ..................................................................... 351
SWAPF ..................................................................... 352
XORLW..................................................................... 352
XORWF..................................................................... 352
INTCON Register ................................................................ 96
L
LATA Register .......................................................... 133, 141
LATB Register .................................................................. 137
Load Conditions................................................................ 366
LSLF ................................................................................. 347
LSRF ................................................................................ 347
M
Master Synchronous Serial Port. See MSSP
MCLR ................................................................................. 82
Internal........................................................................ 82
Memory Organization ......................................................... 23
Data ............................................................................ 26
Program...................................................................... 23
Microchip Internet Web Site.............................................. 415
MOVIW ............................................................................. 348
MOVLB ............................................................................. 348
MOVWI ............................................................................. 349
MPLAB ASM30 Assembler, Linker, Librarian ................... 386
MPLAB Integrated Development
Environment Software .............................................. 385
MPLAB PM3 Device Programmer .................................... 388
MPLAB REAL ICE In-Circuit Emulator System ................ 387
MPLINK Object Linker/MPLIB Object Librarian ................ 386
MSSP ............................................................................... 203
SPI Mode.................................................................. 206
SSPBUF Register..................................................... 209
SSPSR Register ....................................................... 209
MSSPx
I2C Mode .................................................................. 214
I2C Mode Operation.................................................. 216
O
OPCODE Field Descriptions............................................. 339
OPTION ............................................................................ 349
OPTION_REG Register.................................................... 185
OSCCON Register.............................................................. 75
Oscillator
Associated Registers.................................................. 78
Associated registers ................................................. 307
Oscillator Module ........................................................ 57, 309
ECH ............................................................................ 57
ECL............................................................................. 57
ECM............................................................................ 57
HS............................................................................... 57
Preliminary
DS41639A-page 411
PIC16(L)F1454/5/9
INTOSC ...................................................................... 57
LP................................................................................ 57
RC ............................................................................... 57
XT ............................................................................... 57
Oscillator Parameters........................................................ 367
Oscillator Specifications .................................................... 367
Oscillator Start-up Timer (OST)
Specifications ............................................................ 370
Oscillator Switching
Fail-Safe Clock Monitor............................................... 71
Two-Speed Clock Start-up .......................................... 69
OSCSTAT Register............................................................. 76
OSCTUNE Register ............................................................ 77
P
Packaging ......................................................................... 389
Marking ..................................................................... 389
PDIP Details.............................................................. 392
PCL and PCLATH ............................................................... 21
PCL Register....................................................................... 37
PCLATH Register................................................................ 37
PCON Register ............................................................. 38, 85
PIE1 Register ................................................................ 38, 97
PIE2 Register ................................................................ 38, 98
Pinout Descriptions
PIC16(L)F1454 ........................................................... 15
PIC16(L)F1455 ........................................................... 17
PIC16(L)F1459 ........................................................... 19
PIR1 Register................................................................ 38, 99
PIR2 Register.............................................................. 38, 100
PMADR Registers ............................................................. 112
PMADRH Registers .......................................................... 112
PMADRL Register............................................................. 126
PMADRL Registers ........................................................... 112
PMCON1 Register .................................................... 112, 127
PMCON2 Register .................................................... 112, 128
PMDATH Register............................................................. 125
PMDATL Register ............................................................. 125
PMDRH Register............................................................... 126
PORTA.............................................................................. 131
Associated Registers ................................................ 134
LATA Register............................................................. 39
PORTA Register ......................................................... 38
Specifications ............................................................ 368
PORTA Register ............................................................... 132
PORTB.............................................................................. 135
Associated Registers ................................................ 138
LATB Register............................................................. 39
PORTB Register ......................................................... 38
PORTB Register ............................................................... 136
PORTC
Associated Registers ................................................ 141
LATC Register ............................................................ 39
Pin Descriptions and Diagrams................................. 139
PORTC Register ......................................................... 38
PORTC Register ............................................................... 140
Power-Down Mode (Sleep) ............................................... 103
Associated Registers ................................................ 106
Power-on Reset .................................................................. 80
Power-up Time-out Sequence ............................................ 82
Power-up Timer (PWRT)..................................................... 80
Specifications ............................................................ 370
PR2 Register....................................................................... 38
Program Memory ................................................................ 23
Map and Stack (PIC16(L)F1509 ................................. 24
Programming, Device Instructions .................................... 339
DS41639A-page 412
R
RCREG............................................................................. 264
RCREG Register ................................................................ 39
RCSTA Register ......................................................... 39, 268
Reader Response............................................................. 416
Read-Modify-Write Operations ......................................... 339
Reference Clock ................................................................. 87
Associated Registers .................................................. 89
Registers
ADCON0 (ADC Control 0) ........................................ 160
ADCON1 (ADC Control 1) ........................................ 161
ADCON2 (ADC Control 2) ........................................ 162
ADRESH (ADC Result High) with ADFM = 0) .......... 163
ADRESH (ADC Result High) with ADFM = 1) .......... 164
ADRESL (ADC Result Low) with ADFM = 0)............ 163
ADRESL (ADC Result Low) with ADFM = 1)............ 164
ANSELA (PORTA Analog Select)............................. 133
ANSELB (PORTB Analog Select)............................. 137
ANSELC (PORTC Analog Select) ............................ 141
APFCON (Alternate Pin Function Control) ............... 130
BAUDCON (Baud Rate Control)............................... 269
BDnSTAT (Buffer Descriptor n Status,
CPU Mode)............................................... 314, 330
BDnSTAT (Buffer Descriptor n Status,
SIE Mode)................................................. 315, 331
BORCON Brown-out Reset Control) .......................... 81
CLKRCON (Reference Clock Control)........................ 88
CMOUT (Comparator Output) .................................. 180
CMxCON0 (Cx Control) ............................................ 179
CMxCON1 (Cx Control 1) ......................................... 180
Configuration Word 1.................................................. 52
Configuration Word 2.................................................. 54
Core Function, Summary............................................ 37
CWGxCON0 (CWG Control 0) ................................. 303
CWGxCON1 (CWG Control 1) ................................. 304
CWGxCON2 (CWG Control 1) ................................. 305
CWGxDBF (CWGx Dead Band Falling Count)......... 306
CWGxDBR (CWGx Dead Band Rising Count) ......... 306
DACCON0 ................................................................ 172
DACCON1 ................................................................ 172
Device ID .................................................................... 56
FVRCON................................................................... 150
INTCON (Interrupt Control)......................................... 96
IOCAF (Interrupt-on-Change PORTA Flag).............. 146
IOCAN (Interrupt-on-Change PORTA
Negative Edge)................................................. 145
IOCAP (Interrupt-on-Change PORTA
Positive Edge) .................................................. 145
Preliminary
PIC16(L)F1454/5/9
IOCBF (Interrupt-on-Change PORTB Flag).............. 147
IOCBN (Interrupt-on-Change PORTB
Negative Edge) ................................................. 147
IOCBP (Interrupt-on-Change PORTB
Positive Edge)................................................... 146
LATA (Data Latch PORTA)....................................... 133
LATB (Data Latch PORTB)....................................... 137
LATC (Data Latch PORTC) ...................................... 141
OPTION_REG (OPTION) ......................................... 185
OSCCON (Oscillator Control) ..................................... 75
OSCSTAT (Oscillator Status) ..................................... 76
OSCTUNE (Oscillator Tuning) .................................... 77
PCON (Power Control Register) ................................. 85
PCON (Power Control) ............................................... 85
PIE1 (Peripheral Interrupt Enable 1)........................... 97
PIE2 (Peripheral Interrupt Enable 2)........................... 98
PIR1 (Peripheral Interrupt Register 1) ........................ 99
PIR2 (Peripheral Interrupt Request 2) ...................... 100
PMADRL (Program Memory Address)...................... 126
PMCON1 (Program Memory Control 1).................... 127
PMCON2 (Program Memory Control 2).................... 128
PMDATH (Program Memory Data) ........................... 125
PMDATL (Program Memory Data)............................ 125
PMDRH (Program Memory Address) ....................... 126
PORTA...................................................................... 132
PORTB...................................................................... 136
PORTC ..................................................................... 140
PWMxCON (PWM Control)....................................... 291
PWMxDCH (PWM Control)....................................... 292
PWMxDCL (PWM Control) ....................................... 292
RCREG ..................................................................... 275
RCSTA (Receive Status and Control)....................... 268
SPBRGH................................................................... 270
SPBRGL ................................................................... 270
Special Function, Summary ........................................ 38
SSPADD (MSSP Address and Baud Rate,
I2C Mode) ......................................................... 255
SSPCON1 (MSSP Control 1).................................... 252
SSPCON2 (SSP Control 2)....................................... 253
SSPCON3 (SSP Control 3)....................................... 254
SSPMSK (SSP Mask)............................................... 255
SSPSTAT (SSP Status)............................................ 250
STATUS...................................................................... 27
T1CON (Timer1 Control)........................................... 195
T1GCON (Timer1 Gate Control) ............................... 196
T2CON...................................................................... 201
TRISA (Tri-State PORTA)......................................... 132
TRISB (Tri-State PORTB)......................................... 136
TRISC (Tri-State PORTC) ........................................ 140
TXSTA (Transmit Status and Control) ...................... 267
UCFG (USB Configuration)............................... 310, 327
UCON (USB Control) ........................................ 310, 326
UEIE (USB Error Interrupt Enable) ........................... 335
UEIE (USB Interrupt Enable) .................................... 319
UEIR (USB Error Interrupt Status) .................... 319, 334
UEPN (USB Endpoint Control) ................................. 312
UEPn (USB Endpoint n Control) ............................... 329
UIE (USB Interrupt Enable)............................... 319, 333
UIR (USB Interrupt Status) ............................... 319, 332
USTAT (USB Status) ........................................ 312, 328
VREGCON (Voltage Regulator Control) ................... 106
WDTCON (Watchdog Timer Control) ....................... 110
WPUA (Weak Pull-up PORTA) ................................. 134
WPUB (Weak Pull-up PORTB) ................................. 138
RESET .............................................................................. 349
Reset .................................................................................. 79
Reset Instruction................................................................. 82
Resets ................................................................................ 79
Associated Registers.................................................. 86
Revision History................................................................ 407
S
Software Simulator (MPLAB SIM) .................................... 387
SPBRG Register................................................................. 39
SPBRGH Register ............................................................ 270
SPBRGL Register............................................................. 270
Special Function Registers (SFRs)..................................... 38
SPI Mode (MSSP)
SPI Clock.................................................................. 209
SPI Mode (MSSPx)
Associated Registers................................................ 213
SSPADD Register............................................................. 255
SSPCON1 Register .......................................................... 252
SSPCON2 Register .......................................................... 253
SSPCON3 Register .......................................................... 254
SSPMSK Register ............................................................ 255
SSPOV ............................................................................. 240
SSPOV Status Flag .......................................................... 240
SSPSTAT Register ........................................................... 250
R/W Bit ..................................................................... 219
ST
Block Diagram ............................................................ 73
Stack................................................................................... 45
Accessing ................................................................... 45
Reset .......................................................................... 47
Stack Overflow/Underflow .................................................. 82
STATUS Register ............................................................... 27
SUBWFB .......................................................................... 351
T
T1CON Register ......................................................... 38, 195
T1GCON Register ............................................................ 196
T2CON (Timer2) Register................................................. 201
T2CON Register ................................................................. 38
Temperature Indicator
Associated Registers................................................ 152
Temperature Indicator Module.......................................... 151
Thermal Considerations.................................................... 365
Timer0 .............................................................................. 183
Associated Registers................................................ 185
Operation.................................................................. 183
Specifications ........................................................... 371
Timer1 .............................................................................. 187
Associated registers ................................................. 197
Asynchronous Counter Mode ................................... 189
Reading and Writing ......................................... 189
Clock Source Selection ............................................ 188
Interrupt .................................................................... 191
Operation.................................................................. 188
Operation During Sleep ............................................ 191
Oscillator................................................................... 189
Prescaler .................................................................. 189
Specifications ........................................................... 371
Timer1 Gate
Selecting Source .............................................. 189
TMR1H Register....................................................... 187
TMR1L Register ....................................................... 187
Timer2 .............................................................................. 199
Associated registers ................................................. 202
Preliminary
DS41639A-page 413
PIC16(L)F1454/5/9
Timers
Timer1
T1CON.............................................................. 195
T1GCON ........................................................... 196
Timer2
T2CON.............................................................. 201
Timing Diagrams
A/D Conversion ......................................................... 372
A/D Conversion (Sleep Mode) .................................. 373
Acknowledge Sequence ........................................... 242
Asynchronous Reception .......................................... 264
Asynchronous Transmission ..................................... 260
Asynchronous Transmission (Back to Back) ............ 260
Auto Wake-up Bit (WUE) During
Normal Operation.............................................. 277
Auto Wake-up Bit (WUE) During Sleep .................... 277
Automatic Baud Rate Calibration .............................. 275
Baud Rate Generator with Clock Arbitration ............. 235
BRG Reset Due to SDA Arbitration
During Start Condition....................................... 245
Brown-out Reset (BOR) ............................................ 369
Brown-out Reset Situations ........................................ 81
Bus Collision During a Repeated
Start Condition (Case 1) ................................... 246
Bus Collision During a Repeated
Start Condition (Case 2) ................................... 246
Bus Collision During a Start Condition (SCL = 0) ..... 245
Bus Collision During a Stop Condition (Case 1) ....... 247
Bus Collision During a Stop Condition (Case 2) ....... 247
Bus Collision During Start Condition (SDA only) ...... 244
Bus Collision for Transmit and Acknowledge............ 243
CLKOUT and I/O....................................................... 368
Clock Synchronization .............................................. 232
Clock Timing ............................................................. 367
Comparator Output ................................................... 173
Fail-Safe Clock Monitor (FSCM) ................................. 72
First Start Bit Timing ................................................. 236
I2C Bus Data ............................................................. 379
I2C Bus Start/Stop Bits.............................................. 379
I2C Master Mode (7 or 10-Bit Transmission) ............ 239
I2C Master Mode (7-Bit Reception) ........................... 241
I2C Stop Condition Receive or Transmit Mode ......... 242
INT Pin Interrupt.......................................................... 94
Internal Oscillator Switch Timing................................. 65
Repeat Start Condition.............................................. 237
Reset Start-up Sequence............................................ 83
Reset, WDT, OST and Power-up Timer ................... 369
Send Break Character Sequence ............................. 278
SPI Master Mode (CKE = 1, SMP = 1) ..................... 376
SPI Mode (Master Mode) .......................................... 209
SPI Slave Mode (CKE = 0) ....................................... 377
SPI Slave Mode (CKE = 1) ....................................... 377
Synchronous Reception (Master Mode, SREN) ....... 282
Synchronous Transmission....................................... 280
Synchronous Transmission (Through TXEN) ........... 280
Timer0 and Timer1 External Clock ........................... 370
Timer1 Incrementing Edge........................................ 191
Two Speed Start-up .................................................... 70
USART Synchronous Receive (Master/Slave) ......... 375
USART Synchronous Transmission (Master/Slave) . 375
Wake-up from Interrupt ............................................. 104
Timing Parameter Symbology........................................... 366
Timing Requirements
I2C Bus Data ............................................................. 380
I2C Bus Start/Stop Bits ............................................. 379
DS41639A-page 414
U
Universal Serial Bus
Associated Registers ................................................ 336
BD Address Validation.............................................. 315
BD Byte Count .......................................................... 315
Buffer Descriptor Table (BDT) .................................. 313
Buffer Descriptors
Assignment in Different Buffering Modes ......... 316
Example............................................................ 314
Memory Map..................................................... 316
Register Summary............................................ 317
Buffer Descriptors (BDn)........................................... 313
Interrupt-on-change .................................................. 323
Interrupts .................................................................. 318
and USB Transactions...................................... 318
Oscillator................................................................... 323
Ping-Pong Buffering ................................................. 315
Power Modes............................................................ 320
RAM.......................................................................... 313
Memory Map..................................................... 313
Status and Control .................................................... 310
Universal Serial Bus (USB)............................................... 309
USART
Synchronous Master Mode
Requirements, Synchronous Receive .............. 375
Requirements, Synchronous Transmission...... 375
Timing Diagram, Synchronous Receive ........... 375
Timing Diagram, Synchronous Transmission... 375
USB .................................................................................. 309
USB Operation.................................................................... 66
V
VREF. SEE ADC Reference Voltage
VREGCON Register ......................................................... 106
W
Wake-up on Break ............................................................ 276
Wake-up Using Interrupts ................................................. 104
Watchdog Timer (WDT)...................................................... 82
Associated Registers ................................................ 111
Modes ....................................................................... 108
Specifications ........................................................... 370
WCOL ....................................................... 235, 238, 240, 242
WCOL Status Flag.................................... 235, 238, 240, 242
WDTCON Register ........................................................... 110
WPUA Register................................................................. 134
WPUB Register................................................................. 138
Write Protection .................................................................. 55
WWW Address ................................................................. 415
WWW, On-Line Support ..................................................... 11
Preliminary
PIC16(L)F1454/5/9
THE MICROCHIP WEB SITE
CUSTOMER SUPPORT
Distributor or Representative
Local Sales Office
Field Application Engineer (FAE)
Technical Support
Customers
should
contact
their
distributor,
representative or field application engineer (FAE) for
support. Local sales offices are also available to help
customers. A listing of sales offices and locations is
included in the back of this document.
Technical support is available through the web site
at: http://microchip.com/support
Preliminary
DS41639A-page 415
PIC16(L)F1454/5/9
READER RESPONSE
It is our intention to provide you with the best documentation possible to ensure successful use of your Microchip
product. If you wish to provide your comments on organization, clarity, subject matter, and ways in which our
documentation can better serve you, please FAX your comments to the Technical Publications Manager at
(480) 792-4150.
Please list the following information, and use this outline to provide us with your comments about this document.
TO:
RE:
Reader Response
From: Name
Company
Address
City / State / ZIP / Country
Telephone: (_______) _________ - _________
Application (optional):
Would you like a reply?
Device: PIC16(L)F1454/5/9
Questions:
1. What are the best features of this document?
2. How does this document meet your hardware and software development needs?
3. Do you find the organization of this document easy to follow? If not, why?
4. What additions to the document do you think would enhance the structure and subject?
5. What deletions from the document could be made without affecting the overall usefulness?
DS41639A-page 416
Preliminary
PIC16(L)F1454/5/9
PRODUCT IDENTIFICATION SYSTEM
To order or obtain information, e.g., on pricing or delivery, refer to the factory or the listed sales office.
[X](1)
PART NO.
Device
/XX
XXX
Package
Pattern
Examples:
a)
b)
Device:
PIC16F1454, PIC16LF1454,
PIC16F1455, PIC16LF1455,
PIC16F1459, PIC16LF1459
c)
Blank
T
Temperature
Range:
I
E
= -40C to +85C
= -40C to +125C
Package:(2)
ML
P
SS
ST
SO
SL
Pattern:
=
=
=
=
=
=
(Industrial)
(Extended)
QFN 4x4
Plastic DIP
SSOP
TSSOP
SOIC 20-Lead
SOIC 14-Lead
PIC16F1454T - E/SL
Tape and Reel,
Industrial temperature,
SOIC package
PIC16F1459 - I/P
Industrial temperature
PDIP package
PIC16F1459 - E/ML
Extended temperature,
QFN package
Note
Preliminary
1:
2:
DS41639A-page 417
ASIA/PACIFIC
ASIA/PACIFIC
EUROPE
Corporate Office
2355 West Chandler Blvd.
Chandler, AZ 85224-6199
Tel: 480-792-7200
Fax: 480-792-7277
Technical Support:
http://www.microchip.com/
support
Web Address:
www.microchip.com
India - Bangalore
Tel: 91-80-3090-4444
Fax: 91-80-3090-4123
India - New Delhi
Tel: 91-11-4160-8631
Fax: 91-11-4160-8632
Austria - Wels
Tel: 43-7242-2244-39
Fax: 43-7242-2244-393
Denmark - Copenhagen
Tel: 45-4450-2828
Fax: 45-4485-2829
India - Pune
Tel: 91-20-2566-1512
Fax: 91-20-2566-1513
France - Paris
Tel: 33-1-69-53-63-20
Fax: 33-1-69-30-90-79
Japan - Osaka
Tel: 81-66-152-7160
Fax: 81-66-152-9310
Germany - Munich
Tel: 49-89-627-144-0
Fax: 49-89-627-144-44
Atlanta
Duluth, GA
Tel: 678-957-9614
Fax: 678-957-1455
Boston
Westborough, MA
Tel: 774-760-0087
Fax: 774-760-0088
Chicago
Itasca, IL
Tel: 630-285-0071
Fax: 630-285-0075
Cleveland
Independence, OH
Tel: 216-447-0464
Fax: 216-447-0643
Dallas
Addison, TX
Tel: 972-818-7423
Fax: 972-818-2924
Detroit
Farmington Hills, MI
Tel: 248-538-2250
Fax: 248-538-2260
Indianapolis
Noblesville, IN
Tel: 317-773-8323
Fax: 317-773-5453
Los Angeles
Mission Viejo, CA
Tel: 949-462-9523
Fax: 949-462-9608
Santa Clara
Santa Clara, CA
Tel: 408-961-6444
Fax: 408-961-6445
Toronto
Mississauga, Ontario,
Canada
Tel: 905-673-0699
Fax: 905-673-6509
Australia - Sydney
Tel: 61-2-9868-6733
Fax: 61-2-9868-6755
China - Beijing
Tel: 86-10-8569-7000
Fax: 86-10-8528-2104
Japan - Yokohama
Tel: 81-45-471- 6166
Fax: 81-45-471-6122
China - Chengdu
Tel: 86-28-8665-5511
Fax: 86-28-8665-7889
Korea - Daegu
Tel: 82-53-744-4301
Fax: 82-53-744-4302
China - Chongqing
Tel: 86-23-8980-9588
Fax: 86-23-8980-9500
China - Hangzhou
Tel: 86-571-2819-3187
Fax: 86-571-2819-3189
Korea - Seoul
Tel: 82-2-554-7200
Fax: 82-2-558-5932 or
82-2-558-5934
China - Nanjing
Tel: 86-25-8473-2460
Fax: 86-25-8473-2470
Malaysia - Penang
Tel: 60-4-227-8870
Fax: 60-4-227-4068
China - Qingdao
Tel: 86-532-8502-7355
Fax: 86-532-8502-7205
Philippines - Manila
Tel: 63-2-634-9065
Fax: 63-2-634-9069
China - Shanghai
Tel: 86-21-5407-5533
Fax: 86-21-5407-5066
Singapore
Tel: 65-6334-8870
Fax: 65-6334-8850
China - Shenyang
Tel: 86-24-2334-2829
Fax: 86-24-2334-2393
China - Shenzhen
Tel: 86-755-8203-2660
Fax: 86-755-8203-1760
Taiwan - Kaohsiung
Tel: 886-7-536-4818
Fax: 886-7-330-9305
China - Wuhan
Tel: 86-27-5980-5300
Fax: 86-27-5980-5118
Taiwan - Taipei
Tel: 886-2-2500-6610
Fax: 886-2-2508-0102
China - Xian
Tel: 86-29-8833-7252
Fax: 86-29-8833-7256
Thailand - Bangkok
Tel: 66-2-694-1351
Fax: 66-2-694-1350
Netherlands - Drunen
Tel: 31-416-690399
Fax: 31-416-690340
Spain - Madrid
Tel: 34-91-708-08-90
Fax: 34-91-708-08-91
UK - Wokingham
Tel: 44-118-921-5869
Fax: 44-118-921-5820
China - Xiamen
Tel: 86-592-2388138
Fax: 86-592-2388130
China - Zhuhai
Tel: 86-756-3210040
Fax: 86-756-3210049
DS41639A-page 418
Italy - Milan
Tel: 39-0331-742611
Fax: 39-0331-466781
11/29/11
Preliminary