DS20005281A-page 4 2014 Microchip Technology Inc.
Page 5
TABLE 2:28-PIN SUMMARY
MCP19114/5
I/O
ANSEL
A/D
Timers
28-Pin QFN
MSSP
Interrupt
Pull-up
BasicAdditional
GPA01YAN0——IOCY—Analog/Digital Debug Output
GPA12YAN1——IOCY—Sync Signal In/Out
GPA23YAN2T0CKI—IOC
Y——
(2)
INT
GPA35YAN3——IOCY——
GPA58N———IOC
(4)
(5)
Y
MCLRTest Enable Input
GPA67N———IOCY—Dual Capture/Single
Compare1 Input
GPA76N——SCLIOCN——
GPB010N——SDAIOCN——
GPB126YAN4——IOCY—V
REF2
(3)
GPB44YAN5——IOCYICSPDAT—
GPB527YAN6——IOCYICSPCLK—
GPB628YAN7——IOCY——
GPB79Y———IOCY—Single Compare2 Input
DESATP/
I
SOUT
12N——————DESATP input or I
Output
(6)
SOUT
DESATN11N——————DESAT Negative Input
I
SP
13N————Y—Current Sense Amplifier
Non-Inverting Input
I
SN
14N——————Current Sense Amplifier
Inverting Input
A
P
I
P
GND
GND
15N——————Primary Input Current Sense
16N—————A
17N—————P
GND
GND
Small Signal Ground
Large Signal Ground
SDRV18N——————Secondary LS Gate Drive
Output
PDRV19N——————Primary LS Gate Drive Output
V
DR
V
DD
V
V
I
FB
I
COMP
IN
S
20N—————V
21N—————V
22N—————V
DR
DD
IN
Gate Drive Supply Voltage
VDD Output
Input Supply Voltage
23N——————Output Voltage Sense
24N——————Error Amplifier Feedback input
25N——————Error Amplifier Output
Note 1: The Analog/Digital Debug Output is selected through the control of the ABECON register.
2: Selected when functioning as master or slave by proper configuration of the MSC<1:0> bits in the
MODECON register.
3: VREF2 output selected when configured as master by proper configuration of the MSC<1:0> bits in the
MODECON register.
4: The IOC is disabled when MCLR
5: Weak pull-up always enabled when MCLR
6: When RFB of MODECON<6> =0 Internal feedback resistor is enabled allow with DESAT
RFB=1, I
SOUT
is enabled.
is enabled.
is enabled, otherwise the pull-up is under user control.
6.0Configuring the MCP19114/5 ..................................................................................................................................................... 37
17.0 Flash Program Memory Control ............................................................................................................................................... 103
23.0 Timer1 Module with Gate Control ............................................................................................................................................. 137
27.0 PWM Control Logic .................................................................................................................................................................. 151
28.0 Master Synchronous Serial Port (MSSP) Module .................................................................................................................... 153
29.0 Instruction Set Summary .......................................................................................................................................................... 195
30.0 In-Circuit Serial Programming™ (ICSP™) ............................................................................................................................... 205
31.0 Development Support............................................................................................................................................................... 207
Index .................................................................................................................................................................................................. 219
The Microchip Web Site..................................................................................................................................................................... 225
Customer Change Notification Service .............................................................................................................................................. 225
Customer Support .............................................................................................................................................................................. 225
DS20005281A-page 6 2014 Microchip Technology Inc.
Page 7
MCP19114/5
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 docerrors@microchip.com. We welcome your feedback.
Most Current Data Sheet
To obtain the most up-to-date version of this data sheet, please register at our Worldwide Web site at:
http://www.microchip.com
You can determine the version of a data sheet by examining its literature number found on the bottom outside corner of any page.
The last character of the literature number is the version number, (e.g., DS30000000A is version A of document DS30000000).
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:
• Microchip’s 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.
Customer Notification System
Register on our web site at www.microchip.com to receive the most current information on all of our products.
DS20005281A-page 8 2014 Microchip Technology Inc.
Page 9
MCP19114/5
1.0DEVICE OVERVIEW
The MCP19114/5 are highly integrated, mixed signal
low-side synchronous controllers that operate from
4.5V to 42V. The family features an analog PWM
controller with an integrated microcontroller core used
for LED lighting systems, battery chargers and other
low-side switch PWM applications. The devices feature
an analog internal PWM controller similar to the
MCP1631, and a standard PIC
to the PIC12F617.
Complete customization of device operating
parameters, start-up or shutdown profiles, protection
levels and fault handling procedures are accomplished
by setting digital registers using Microchip’s MPLAB
Integrated Development Environment software and
one of Microchip’s many in-circuit debugger and device
programmers.
The MCP19114/5 mixed signal low-side synchronous
controllers feature integrated programmable input
UVLO/OVLO, programmable output overvoltage (OV),
two low-side gate drive outputs with independent
programmable dead time, programmable leading edge
blanking (four steps), programmable 6-bit slope
compensation and an integrated internal
programmable oscillator for fixed-frequency
applications. An integrated 8-bit reference voltage
) is used for setting output voltage or current. An
(V
REF
internal comparator supports quasi-resonant
applications. Additional Capture and Compare
modules are integrated for additional control, including
enhanced dimming capability. The MCP19114/5
devices contain two internal LDOs. A 5V LDO is used
to power the internal processor and provide 5V
externally. This 5V external output can be used to
supply the gate drive. An analog filter between the V
output and the VDR input is recommended when
implementing a 5V gate drive supplied from V
4.7 µF capacitors are recommended with one placed
as close as possible to V
possible to V
, separated by a 10 isolation resistor.
DR
DO NOT exceed 10 µF on the V
is required to implement higher gate drive voltages. By
utilizing Microchip’s TC1240A voltage doubler supplied
from V
to provide VDR, a 10V gate drive can be
DD
achieved. A 4V LDO is used to power the internal
analog circuitry. The two low-side drivers can be used
to operate the power converter in bidirectional mode,
enabling the “shaping” of LED dimming current in LED
applications or developing bidirectional power
converters for battery-powered applications.
The MCP19114 is packaged in a 24-lead 4 mm x 4 mm
QFN. The MCP19115 is packaged in a 28-lead
5 mm x 5 mm QFN.
®
microcontroller similar
DD
and one as close as
DD
. An external supply
DD
®
X
DD
. Two
The ability for system designers to configure
application-specific features allows the MCP19114/5 to
be offered in smaller packages than currently available
in integrated devices today. The General Purpose
Input/Output (GPIO) of the MCP19114/5 can be
configured to offer a status output, a device enable, to
control an external switch, a switching frequency
synchronization output or input or even a device status
or "heartbeat" indicator. This flexibility allows the
MCP19114/5 packages and complete solutions to be
smaller, thereby saving size and cost of the system
printed circuit boards.
With integrated features like output current adjust and
dynamic output voltage positioning, the MCP19114/5
family has the best in class performance and highest
integration level currently available.
Power trains supported by this architecture include but
are not limited to boost, flyback, quasi-resonant
flyback, SEPIC, Ćuk, etc. Two low-side gate drivers are
capable of sinking and sourcing 1A at 10V V
. With a
DR
5V gate drive, the driver is capable of 0.5A sink and
source. The user has the option to allow the V
UVLO
IN
to shut down the drivers by setting the UVLOEN bit.
When this bit is not set, the device drivers will ride
through the UVLO condition and continue to operate
until VDR reaches the gate drive UVLO value. This
value is selectable at 2.7V or 5.4V and is always
enabled. An internal reset for the microcontroller core
is set to 2.0V. An internal comparator module is used to
sense the desaturation of the flyback transformer to
synchronize switching for quasi-resonant applications.
The operating input voltage for normal device operation
ranges from 4.5V to 42V with an absolute maximum of
44V. The maximum transient voltage is 48V for 500 ms.
DS20005281A-page 12 2014 Microchip Technology Inc.
Page 13
MCP19114/5
2.0PIN DESCRIPTION
The 24-lead MCP19114 and 28-lead MCP19115
devices feature pins that have multiple functions
associated with each pin. Tab le 2 -1 provides a
description of the different functions. Refer to
Section 2.1 “Detailed Pin Functional Description”
for more detailed information.
TABLE 2-1:MCP19114/5 PINOUT DESCRIPTION
NameFunction
Input
Type
GPA0/AN0/TEST_OUTGPA0TTLCMOS General-purpose I/O
AN0AN—A/D Channel 0 input
TEST_OUT——Internal analog/digital signal multiplexer output
GPA1/AN1/CLKPINGPA1TTLCMOS General-purpose I/O
AN1AN—A/D Channel 1 input
CLKPINSTCMOS Switching frequency clock input or output
GPA2/AN2/T0CKI/INTGPA2STCMOS General-purpose I/O
AN2AN—A/D Channel 2 input
T0CKIST—Timer0 clock input
INTST—External interrupt
GPA3/AN3GPA3TTLCMOS General-purpose I/O
AN3AN—A/D Channel 3 input
GPA5/MCLR
GPA5TTL—General-purpose input only
MCLR
GPA6/CCD/ICSPDATGPA6STCMOS General-purpose I/O
ICSPDATSTCMOS Serial Programming Data I/O
CCDSTCMOS Single Compare output. Dual Capture input
GPA7/SCL/ICSPCLKGPA7STODGeneral-purpose open drain I/O
SCLI
ICSPCLKST—Serial Programming Clock
GPB0/SDAGPB0TTLODGeneral-purpose I/O
SDAI
GPB1/AN4/VREF2GPB1TTLCMOS General-purpose I/O
AN4AN—A/D Channel 4 input
VREF2—ANVREF2 DAC Output
GPB4/AN5/ICSPDAT
(MCP19115 Only)
GPB4TTLCMOS General-purpose I/O
AN5AN—A/D Channel 5 input
ICSPDATSTCMOS Primary Serial Programming Data I/O
GPB5/AN6/ICSPCLK
(MCP19115 Only)
GPB5TTLCMOS General-purpose I/O
AN6AN—A/D Channel 6 input
ISCPCLKST—Primary Serial Programming Clock
Legend:AN = Analog input or output CMOS = CMOS compatible input or outputOD = Open Drain
TTL = TTL compatible input ST = Schmitt Trigger input with CMOS levels I
Note 1:The Analog/Digital Debug Output is selected through the control of the ABECON register.
2:Selected when functioning as master or slave by proper configuration of the MSC<1:0> bits in the MODECON register.
3:VREF2 output selected when configured as master by proper configuration of the MSC<1:0> bits in the MODECON
CCDSTCMOS Single Compare output. Dual Capture input.
V
IN
V
DD
V
DR
A
GND
P
GND
Input
Type
PDRVPDRV——Primary Low-Side MOSFET gate drive
SDRVSDRV——Secondary Low-Side MOSFET gate drive
I
P
I
SN
I
SP
V
S
I
FB
I
COMP
DESATP/I
DESAT
Legend:AN = Analog input or output CMOS = CMOS compatible input or outputOD = Open Drain
SOUT
N
TTL = TTL compatible input ST = Schmitt Trigger input with CMOS levels I
I
P
I
SN
I
SP
V
S
I
FB
I
COMP
DESATP/I
DESAT
SOUT
N
Note 1:The Analog/Digital Debug Output is selected through the control of the ABECON register.
2:Selected when functioning as master or slave by proper configuration of the MSC<1:0> bits in the MODECON register.
3:VREF2 output selected when configured as master by proper configuration of the MSC<1:0> bits in the MODECON
register.
Output
Type
Description
——Device input supply voltage
——Internal +5V LDO output pin
——Gate drive supply voltage
——Small signal quiet ground
——Large signal power ground
——Primary input current sense
——Secondary current sense amplifier negative input
——Secondary current sense amplifier positive input
——Sense voltage compared to overvoltage DAC
——Error amplifier feedback input
——Error amplifier output
——DESATP: DESAT detect comparator positive input
: Secondary current sense amplifier output
I
SOUT
——DESATN: DESAT detect comparator negative
input
2
C = Schmitt Trigger input with I2C
DS20005281A-page 14 2014 Microchip Technology Inc.
Page 15
MCP19114/5
2.1Detailed Pin Functional
Description
2.1.1GPA0 PIN
GPA0 is a general-purpose TTL input or CMOS output
pin whose data direction is controlled in TRISGPA. An
internal weak pull-up and interrupt-on-change are also
available.
AN0 is an input to the A/D. To configure this pin to be
read by the A/D on channel 0, bits TRISA0 and ANSA0
must be set.
The ABECON register can be configured to set this pin
to the TEST_OUT function. It is a buffered output of the
internal analog or digital signal multiplexers. Analog
signals present on this pin are controlled by the
ADCON0 register. Digital signals present on this pin
are controlled by the ABECON register.
2.1.2GPA1 PIN
GPA1 is a general-purpose TTL input or CMOS output
pin whose data direction is controlled in TRISGPA. An
internal weak pull-up and interrupt-on-change are also
available.
AN1 is an input to the A/D. To configure this pin to be
read by the A/D on channel 1, bits TRISA1 and ANSA1
must be set.
When the MCP19114/5 are configured as a MASTER
or SLAVE, this pin is configured to be the switching
frequency synchronization input or output (CLKPIN).
2.1.3GPA2 PIN
GPA2 is a general-purpose ST input or CMOS output
pin whose data direction is controlled in TRISGPA. An
internal weak pull-up and interrupt-on-change are also
available.
AN2 is an input to the A/D. To configure this pin to be
read by the A/D on channel 2, bits TRISA2 and ANSA2
must be set.
When bit T0CS is set in the OPTION_REG register, the
T0CKI function is enabled. Refer to Section 22.0
“Timer0 Module” for more information.
GPA2 can also be configured as an external interrupt
by setting the INTE bit. Refer to Section 14.2
“GPA2/INT Interrupt” for more information.
2.1.5GPA5 PIN
GPA5 is a general-purpose TTL input only pin. An
internal weak pull-up and interrupt-on-change are also
available.
For programming purposes, this pin is to be connected
to the MCLR
Section 30.0 “In-Circuit Serial Programming™
(ICSP™)” for more information.
This pin is MCLR
CONFIG register.
pin of the serial programmer. Refer to
when the MCLRE bit is set in the
2.1.6GPA6 PIN
GPA6 is a general-purpose CMOS output ST input pin
whose data direction is controlled in TRISGPA.
ICSPDAT is a serial programming data I/O function.
This can be used in conjunction with ICSPCLK to serial
program the device.
GPA6 is part of the CCD Module. For more information,
refer to Section 26.0 “Dual Capture/Compare (CCD)
Module”.
2.1.7GPA7 PIN
GPA7 is a true open drain general-purpose pin whose
data direction is controlled in TRISGPA. There is no
internal connection between this pin and device VDD.
This pin does not have a weak pull-up, but interrupt-on-change is available.
This pin is the primary ICSPCLK input. For MCP19115,
this pin is ALT1_ICSPCLK. This can be used in
conjunction with ICSPDAT to serial program the
device.
When the MCP19114/5 is configured for I
communication, Section 28.2 “I
GPA7 functions as the I
be configured as an input to allow proper operation.
2
2
C Mode Overview ”,
C clock (SCL). This pin must
2
C
2.1.4GPA3 PIN
GPA3 is a general-purpose TTL input or CMOS output
pin whose data direction is controlled in TRISGPA. An
internal weak pull-up and interrupt-on-change are also
available.
AN3 is an input to the A/D. To configure this pin to be
read by the A/D on channel 3, bits TRISA3 and ANSA3
must be set.
GPB0 is a true open drain general-purpose pin whose
data direction is controlled in TRISGPB. There is no
internal connection between this pin and device V
This pin does not have a weak pull-up, but
interrupt-on-change is available. When the
MCP19114/5 are configured for I
Section 28.2 “I
2
as the I
an input to allow proper operation.
2
C Mode Overvi ew”, GPB0 functions
C clock (SDA). This pin must be configured as
2
C communication,
DD
2.1.9GPB1 PIN
GPB1 is a general-purpose TTL input or CMOS output
pin whose data direction is controlled in TRISGPB. An
internal weak pull-up and interrupt-on-change are also
available.
AN4 is an input to the A/D. To configure this pin to be
read by the A/D on channel 4, bits TRISB1 and ANSB1
must be set.
When the MCP19114/5 are configured as a MASTER,
this pin is configured to be the V
DAC output.
REF2
2.1.10GPB4 PIN (MCP19115 ONLY)
GPB4 is a general-purpose TTL input or CMOS output
pin whose data direction is controlled in TRISGPB. An
internal weak pull-up and interrupt-on-change are also
available.
AN5 is an input to the A/D. To configure this pin to be
read by the A/D on channel 5, bits TRISB4 and ANSB4
must be set.
ICSPDAT is the primary serial programming data I/O
function. This is used in conjunction with ICSPCLK to
serial program the device.
2.1.11GPB5 PIN (MCP19115 ONLY)
GPB5 is a general-purpose TTL input or CMOS output
pin whose data direction is controlled in TRISGPB. An
internal weak pull-up and interrupt-on-change are also
available.
AN6 is an input to the A/D. To configure this pin to be
read by the A/D on channel 6, bits TRISB5 and ANSB5
must be set.
ICSPCLK is the primary serial programming clock
function. This is used in conjunction with ICSPDAT to
serial program the device.
2.1.12GPB6 PIN (MCP19115 ONLY)
GPB6 is a general-purpose TTL input or CMOS output
pin whose data direction is controlled in TRISGPB. An
internal weak pull-up and interrupt-on-change are also
available.
AN7 is an input to the A/D. To configure this pin to be
read by the A/D on channel 7, bits TRISB6 and ANSB6
must be set.
2.1.13GPB7 PIN (MCP19115 ONLY)
GPB7 is a general-purpose TTL input or CMOS output
pin whose data direction is controlled in TRISGPB. An
.
internal weak pull-up and interrupt-on-change are also
available.
GPB7 is part of the CCD Module. For more information,
refer to Section 26.0 “Dual Capture/Compare (CCD)
Module”.
2.1.14DESATN PIN
Internal comparator inverting input. Used during
quasi-resonant operation for desaturation detection.
2.1.15DESATP/I
When using the internal comparator for desaturation
detection during quasi-resonant operation, this pin
connects to the comparator’s non-inverting input. The
output of the remote sense current sense amplifier gets
configured to utilize the 5 k internal feedback resistor.
When not utilizing the internal comparator and not
configured to use the 5 k internal feedback resistor,
the current sense amplifier gets connected to this pin
SOUT
.
and is I
SOUT
PIN
2.1.16ISP PIN
The non-inverting input to internal current sense
amplifier, typically used to differentially remote sense
secondary current. This pin can be internally pulled-up
by setting the <ISPUEN> bit in the PE1 register.
to V
DD
2.1.17ISN PIN
The inverting input to internal current sense amplifier,
typically used to differentially remote sense secondary
current.
2.1.18IP PIN
Primary input current sense for current mode control
and peak current limit. For voltage mode control, this
pin can be connected to an artificial ramp.
2.1.19A
A
is the small signal ground connection pin. This
GND
pin should be connected to the exposed pad on the
bottom of the package.
2.1.20P
Connect all large signal level ground returns to P
These large-signal level ground traces should have a
small loop area and minimal length to prevent coupling
of switching noise to sensitive traces.
GND
GND
PIN
PIN
GND
.
DS20005281A-page 16 2014 Microchip Technology Inc.
Page 17
2.1.21SDRV PIN
The gate of the low-side secondary MOSFET is
connected to SDRV. The PCB trace connecting SDRV
to the gate must be of minimal length and appropriate
width to handle the high peak drive current and fast
voltage transitions.
2.1.22PDRV PIN
The gate of the low-side primary MOSFET is
connected to PDRV. The PCB tracing connecting
PDRV to the gate must be of minimal length and
appropriate width to handle the high-peak drive
currents and fast voltage transitions.
2.1.23VDR PIN
The supply for the low-side drivers is connected to this
pin and has an absolute maximum rating of +13.5V.
This pin can be connected by an RC filter to the V
pin.
DD
2.1.24VDD PIN
The output of the internal +5.0V regulator is connected
to this pin. It is recommended that a 1.0 µF bypass
capacitor be connected between this pin and the GND
pin of the device. The bypass capacitor should be
physically placed close to the device.
MCP19114/5
2.1.25VIN PIN
Input power connection pin of the device. It is
recommended that capacitance be placed between this
pin and the GND pin of the device.
2.1.26VS PIN
Analog input connected to the non-inverting input of the
overvoltage comparator. Typically used as output
voltage overvoltage protection. The inverting input of
the overvoltage comparator is controlled by the OV
REF DAC.
DS20005281A-page 18 2014 Microchip Technology Inc.
Page 19
3.0FUNCTIONAL DESCRIPTION
MCP19114/5
3.1Linear Regulators
The operating input voltage for the MCP19114/5
ranges from 4.5V to 42V. There are two internal Low
Dropout (LDO) voltage regulators. A 5V LDO is used to
power the internal processor and provide a 5V output
for external usage. A second LDO (V
regulator and is used to power the remaining analog
internal circuitry. Using an LDO to power the
MCP19114/5, the input voltage is monitored using a
resistor divider. The MCP19114/5 also incorporate
brown-out protection. Refer to Section 13.3
“Brown-out Reset (BOR)” for details. The PIC core
will reset at 2.0V V
DD
.
AVD D
) is a 4V
3.2Output Drive Circuitry
The MCP19114/5 integrate two low-side drivers used
to drive the external low-side N-Channel power
MOSFETs for synchronous applications, such as
synchronous flyback and synchronous Ćuk converters.
Both converter types can be configured for
non-synchronous control by replacing the synchronous
FET with a diode. The flyback is also capable of
quasi-resonant operation. The MCP19114/5 can also
be configured as a Boost or SEPIC switch-mode power
supply (SMPS). In Boost mode, non-synchronous
fixed-frequency or non-synchronous quasi-resonant
control can be utilized. This device can also be used as
a SEPIC SMPS in fixed-frequency non-synchronous
mode. The low-side drive is capable of switching the
MOSFET at high frequency in typical SMPS
applications. The gate drive (V
5V to 10V. The drive strength is capable of up to 1A
sink/source with 10V gate drive and down to 0.5A
sink/source with 5V gate drive. A programmable delay
is used to set the gate turn-on dead time. This prevents
overlap and shoot-through currents that can decrease
the converter efficiency. Each driver shall have its own
EN input controlled by the microcontroller core.
) can be supplied from
DR
3.3Current Sense
The output current is differentially sensed by the
MCP19114/5. In low-current applications, this helps
maintain high system efficiency by minimizing power
dissipation in current sense resistors. Differential
current sensing also minimizes external ground shift
errors. The internal differential amplifier has a precision
gain of 10V/V.
3.4Peak Current Mode
The MCP19114/5 is a peak current mode controlled
device with the current sensing element in series with
the primary side MOSFET. Programmable Leading
Edge Blanking can be implemented to blank current
spikes resulting from turn on. The blank time is
controlled from the ICLEBCON register.
Primary Input Current Offset Adjust is also available via
user programmability, thus limiting peak primary input
current. This offset adjustment is controlled by the
ICOACON register.
3.5Magnetic Desaturation Detection
An internal comparator module is used to detect power
train magnetic desaturation for quasi-resonant
applications. The comparator output is used as a signal
to synchronize the start of the next switching cycle.
This operation differs from the traditional
fixed-frequency application. The DESAT comparator
output can be enabled and routed into the PWM
circuitry or disabled for fixed-frequency applications.
During Quasi-Resonant (QR) operation, the DESAT
comparator output is enabled and combined with a pair
of one-shot timers and a flip-flop to sustain PWM
operation. Timer2 (TMR2) must be initialized and set to
run at a frequency lower than the minimum QR
operating frequency. When the CDSWDE bit is set in
the DESATCON register, TMR2 serves as a watchdog.
An example of the order of events for a Flyback SMPS
in synchronous QR operation is as follows:
The primary gate drive (PDRV) goes high. The output
of the DESAT comparator is high. The primary current
increases until I
and causes PWM comparator output to go low. The
PDRV goes low and the secondary gate drive (SDRV)
goes high (after programmed dead time). This triggers
the first one-shot to send a 200 ns pulse that resets the
flip-flop and TMR2 (WDM_RESET). The 200 ns
one-shot pulse design is implemented to mask out any
spurious transitions at the DESAT comparator output
caused by switching noise. The SDRV stays high until
the secondary winding completely runs out of energy,
at which time the output capacitance begins to source
current back through the winding and secondary
MOSFET. The DESAT comparator detects this and its
output goes low. This sets the flip-flop and triggers the
second one-shot to send a 33 ns pulse to the control
logic, causing the SDRV to go low and the PDRV to go
high (after programmed dead time). The cycle then
repeats. If, for any reason, the reset one-shot does not
fire, the WDM_RESET signal stays low and TMR2 is
allowed to run until the PWM signal kicks off a new
cycle.
The desaturation comparator module is controlled by
the DESATCON register.
To control the output current during start-up, the
MCP19114/5 have the capability to monotonically
increase system current, at the user’s discretion. This
is accomplished through the control of the reference
voltage DAC (V
user control via software.
). The entire start-up profile is under
REF
3.7Driver Control Circuitry
The internal driver control circuitry of the MCP19114/5
is comprised of an error amplifier (EA), a high-speed
comparator and a latch similar to the MCP1631.
The error amplifier generates the control voltage used
by the high-speed PWM comparator. There is an
internally generated reference voltage, V
difference or error between this internal reference
voltage and the actual feedback voltage is the control
voltage. Some applications will implement parked
times where the gate drives are not active. For
example, when changing between LED strings and
after voltage repositioning, the user can disable the
gate drives and park the error amplifier output low.
During the time when the EA is parked, its output will be
clamped low (1 * BG) such that it is in a known state
when reactivated. Before the output switches are
re-enabled, it may be necessary to re-enable the EA
some time prior to enabling the output drivers. This
prior-EA enable time will allow the EA to slew towards
the intended target and prevent the secondary switch
from turning on for an extensive period of time,
unintentionally discharging the output capacitance and
pulling the output voltage down. External
compensation is used to stabilize the control system.
Since the MCP19114/5 are peak current mode
controlled, the comparator compares the primary peak
current waveform (I
flowing in the primary side with the error amplifier
control output voltage. This error amplifier control
output voltage also has user-programmable slope
compensation subtracted from it. In fixed-frequency
applications, the slope compensation signal is
generated to be greater than 1/2 the down slope of the
inductor current waveform and is controlled by the
SLPCRCON register. Offset adjust ability is also
available to set the peak current limit of the primary
switch for overcurrent protection. The range of the
slope compensation ramp is specified. When the
current sense signal reaches the level of the control
voltage minus slope compensation, the on cycle is
terminated and the external switch is latched off until
the beginning of the next cycle which begins at the next
clock cycle.
To improve current regulation at low levels, a pedestal
voltage (VZC) set to the BG (1.23V) is implemented.
This virtual ground serves as the reference for the error
amplifier (A1), slope compensation, current sense
amplifier (A2) and the I
) that is based upon the current
P
offset adjustment.
P
REF
. The
An S-R latch (Set-Rest-Flip-Flop) is used to prevent the
PWM circuitry from turning the external switch on until
the beginning of the next clock cycle.
3.8Fixed PWM Frequency
The switching frequency of the MCP19114/5 while not
controlled by the DESAT comparator output is
generated by using a single edge of the 8 MHz internal
clock. The user sets the MCP19114/5 switching
frequency by configuring the PR2 register. The
maximum allowable PDRV duty cycle is adjustable and
is controlled by the PWMRL register. The
programmable range of the switching frequency will be
31.25 kHz to 2 MHz. The available switching frequency
below 2 MHz is defined as F
a whole number between 4 N 256. Refer to
Section 25.0 “Enhanced PWM Module” for details.
3.9V
This reference is used to generate the voltage
connected to the non-inverting input of the error
amplifier. The entire analog control loop is raised to a
virtual ground pedestal equal to the Band Gap voltage
(1.23V).
REF
= 8 MHz/N, where N is
SW
3.10OV REF
This reference is used to set the output overvoltage set
point. It is compared to the V
typically proportional to the output voltage based on a
resistor divider. OV protection, when enabled, can be
set to a value for the protection of system circuitry or it
can be used to “ripple” regulate the converter output
voltage for repositioning purposes. For details, refer to
Register 6-4.
input pin, which is
S
3.11Independent Gate Drive with
Programmable Delay
Two independent low-side gate drives are integrated
for synchronous applications. Programmable delay has
been implemented to improve efficiency and prevent
shoot-through currents. Each gate drive has an
independent enable input controlled by the PE1
register and programmable dead time controlled by the
DEADCON register.
DS20005281A-page 20 2014 Microchip Technology Inc.
Page 21
3.12Temperature Management
3.12.1THERMAL SHUTDOWN
To protect the MCP19114/5 from overtemperature
conditions, a 150°C junction temperature thermal
shutdown has been implemented. When the junction
temperature reaches this limit, the device disables the
output drivers. In Shutdown mode, both PDRV and
SDRV outputs are disabled and the overtemperature
flag (OTIF) is set in the PIR2 register. When the
junction temperature is reduced by 20°C to 130°C, the
MCP19114/5 can resume normal output drive
switching.
3.12.2TEMPERATURE REPORTING
The MCP19114/5 have a second on-chip temperature
monitoring circuit that can be read by the ADC through
the analog test MUX. Refer to Section 20.0 “In ternal
PDRV ..................................................................................................................................(GND - 0.3V) to (V
SDRV ....................................................................... ..........................................................(GND - 0.3V) to (V
V
DD
V
DR
Voltage on MCLR
Maximum voltage: any other pin .................................. ...................................................+(V
(operating) .................................................................................................................................................-0.3V to +44V
with respect to GND.................... ...............................................................................-0.3V to +13.5V
- 0.3V) to (VDD+0.3V)
GND
Maximum output current sunk by any single I/O pin .... ..........................................................................................25 mA
Maximum output current sourced by any single I/O pin ..........................................................................................25 mA
Maximum current sunk by all GPIO.............................. ..........................................................................................90 mA
Maximum current sourced by all GPIO ........................ ..........................................................................................35 mA
Storage Temperature.................................................... ..........................................................................-65°C to +150°C
Maximum Junction Temperature .................................. ........................................................................................+150°C
Operating Junction Temperature.................................. ..........................................................................-40°C to +125°C
ESD protection on all pins (HBM)................................. ......................................................................................... 2.0 kV
ESD protection on all pins (MM)................................... ........................................................................................... 200V
† Notice: Stresses above those listed under “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
operational listings of this specification is not implied. Exposure to maximum rating conditions for extended periods
may affect device reliability.
4.2Electrical Characteristics
Electrical Specifications: Unless otherwise noted, V
apply over the T
range of -40°C to +125°C
A
ParametersSym.Min.Typ.Max.UnitsConditions
Input
Input VoltageV
Input Quiescent
IN
I
Q
4.5—42V
—510mANot Switching, +V
Current
Shutdown Current
Linear Regulator V
Internal Circuitry
DD
I
SHDN
V
DD
—30150µAV
4.755.05.5VV
Bias Voltage
Maximum External
V
Output Current
DD
Line RegulationV
Load RegulationV
Output Short Circuit
(V
DD-OUT
I
DD_OUT
DD-OUT
DD-OUT
V
DD-OUT
I
DD_SC
/
* VIN)
/
35——mAV
-0.10.0020.1%/V(V
-0.650.1+0.65%I
—50—mAV
Current
Note 1:Refer to Section 15.0 “Power-Down Mode (Sleep)”.
2:Ensured by design, not production tested.
3:V
is the voltage present at the VDD pin.
DD
4:Dropout voltage is defined as the input-to-output voltage differential at which the output voltage drops 2%
below its nominal value measured at a 1V differential between V
5:The V
LDO will limit the total source current to a maximum of 35 mA. Individually each pin can source a
DD
maximum of 15 mA.
= 12V, FSW=150kHz, T
IN
A
and VDD.
IN
=+25°C, Boldface specifications
=5V
SEN
= 12V
IN
Note 1
= 6.0V to 42V
IN
= 6.0V to 42V,
IN
Note 3
+1.0V) VIN 20V
DD
Note 3
DD_OUT
= 1 mA to 20 mA
Note 3
=(VDD+1.0V)
IN
Note 3
DS20005281A-page 22 2014 Microchip Technology Inc.
Page 23
MCP19114/5
4.2Electrical Characteristics (Continued)
Electrical Specifications: Unless otherwise noted, V
apply over the T
range of -40°C to +125°C
A
ParametersSym.Min.Typ.Max.UnitsConditions
Dropout VoltageVIN-V
Power Supply
PSRR
DD
LDO
—0.30.5VI
—60—dBf 1000 Hz,
Rejection Ratio
Linear Regulator V
Internal Analog
AVDD
V
AVD D
—4.0—V
Supply Voltage
Band Gap VoltageBG—1.23—VTrimmed at 1.0% tolerance
Band Gap
BG
TOL
-2.5—+2.5%
To le r a nc e
Input UVLO Voltage
UVLO RangeUVLO
UVLO
ON
Trip
UVLO
ON
TOL
4.0—20VV
-14—14%V
To le r a nc e
UVLO HysteresisUVLO
HYS
—4—%Hysteresis is based upon
Resolutionnbits—6—BitsLogarithmic Steps
UVLO Comparator
Input-to-Output
TD—5—µs100 ns rise time to 1V
Delay
Input OVLO Voltage
OVLO RangeOVLO
OVLO
ON
Trip
OVLO
ON
TOL
8.8—44VV
-14—14%V
To le r a nc e
OVLO HysteresisOVLO
HYS
—5—%Hysteresis is based upon the
Resolutionnbits—6—BitsLogarithmic Steps
OVLO Comparator
Input-to-Output
TD—5—µs100 ns rise time to 1V
Delay
Note 1:Refer to Section 15.0 “Power-Down Mode (Sleep)”.
2:Ensured by design, not production tested.
3:V
is the voltage present at the VDD pin.
DD
4:Dropout voltage is defined as the input-to-output voltage differential at which the output voltage drops 2%
below its nominal value measured at a 1V differential between V
5:The V
LDO will limit the total source current to a maximum of 35 mA. Individually each pin can source a
Standard Operat ing Conditi ons (unle ss othe rwis e stated)
Operating temperature-40°C T
Param.
No.
AD01N
Sym.CharacteristicMin.Typ.
Resolution——10 bitsbit
R
AD02EILIntegral Error——1LSbAVDD= 4.0V
AD03E
AD04E
AD07E
AD07V
AD08Z
Differential Error——1LSbNo missing codes to 10 bits
DL
Offset Error—+1.5+2.0LSbAVDD=4.0V
OFF
Gain Error——1LSbAVDD=4.0V
GN
Full-Scale RangeA
AIN
Recommended Impedance
AIN
of Analog Voltage Source
* These parameters are characterized but not tested.
† Data in ‘Typ.’ column is at V
for design guidance only and are not tested.
Note 1:Total Absolute Error includes integral, differential, offset and gain errors.
2:The A/D conversion result never decreases with an increase in the input voltage and has no missing
codes.
3:When ADC is off, it will not consume any current other than leakage current. The power-down current
specification includes any such leakage from the ADC module.
+125°C
A
†
Max.UnitsConditions
=4.0V
AV
DD
GND
—AVDDV
—— 10k
=12V (AVDD= 4V), 25°C unless otherwise stated. These parameters are
IN
TABLE 5-7:MCP19114/5 A/D CONVERSION REQUIREMENTS
Standard Operat ing Conditi ons (unle ss othe rwis e stated)
Operating temperature-40°C T
Param.
AD130* T
Sym.CharacteristicMin.Typ.
No.
A/D Clock Period1.6—9.0µsT
AD
A/D Internal RC
Oscillator Period
AD131 T
CNV
Conversion Time
(not including
Acquisition Time)
AD132* T
AD133* T
ACQ
AMP
Acquisition Time—11.5—µs
Amplifier Settling
Time
AD134T
Q4 to A/D Clock Start—T
GO
* These parameters are characterized but not tested.
† Data in ‘Typ.’ column is at VIN=12V (VDD=AVDD= 5V), 25°C unless otherwise stated. These parameters
are for design guidance only and are not tested.
Note 1: ADRESH and ADRESL registers may be read on the following T
Note 1: If the A/D clock source is selected as RC, a time of T
CY
is added before the A/D clock starts. This
allows the SLEEP instruction to be executed.
FIGURE 5-8:A/D CONVERSION TIMING
DS20005281A-page 36 2014 Microchip Technology Inc.
Page 37
MCP19114/5
6.0CONFIGURING THE
MCP19114/5
The MCP19114/5 are analog controllers with a digital
peripheral. This means that device configuration is
handled through register settings instead of adding
external components. There are several internal
configurable comparator modules used to interface
analog circuits to digital processing that are very similar
to a standard comparator module found in many PIC
processors today (i.e. PIC16F1824/1828). The
following sections detail how to set the analog control
registers for all the configurable parameters.
6.1Input Undervoltage and
Overvoltage Lockout
(UVLO and OVLO)
VINCON is the comparator control register for both the
VINUVLO and VINOVLO registers. It contains the
enable bits, the polarity edge detection bits and the
status output bits for both protection circuits. The
interrupt flags <UVLOIF> and <OVLOIF> in the PIR2
register are independent of the enable <UVLOEN> and
<OVLOEN> bits in the VINCON register. The
<UVLOOUT> undervoltage lockout status output bit in
the VINCON register indicates if an UVLO event has
occurred. The <OVLOOUT> overvoltage lockout status
output bit in the VINCON register indicates if an OVLO
event has occurred.
The VINUVLO register contains the digital value that
sets the input undervoltage lockout. UVLO has a range
of 4V to 20V. When the input voltage on the V
the MCP19114/5 is below this programmed level and
the <UVLOEN> bit in the VINCON register is set, both
PDRV and SDRV gate drivers are disabled. This bit is
automatically cleared when the MCP19114/5 V
voltage rises above this programmed level.
The VINOVLO register contains the digital value that
sets the input overvoltage lockout. OVLO has a range
of 8.8V to 44V. When the input voltage on the V
the MCP19114/5 is above this programmed level and
the <OVLOEN> bit in the VINCON register is set, both
PDRV and SDRV gate drivers are disabled. This bit is
automatically cleared when the MCP19114/5 V
voltage drops below this programmed level. Refer to
Figure 27-1.
Note:The UVLOIF and OVLOIF interrupt flag
bits are set when an interrupt condition
occurs, regardless of the state of its
corresponding enable bit or the Global
Enable bit (GIE) in the INTCON register.
pin to
IN
pin to
IN
IN
IN
REGISTER 6-1:VINCON: UVLO AND OVLO COMPARATOR CONTROL REGISTER
1 = UVLO event has occurred
0 = No UVLO event has occurred
bit 5UVLOINTP: UVLO Comparator Interrupt on Positive Going Edge Enable bit
1 = The UVLOIF interrupt flag will be set upon a positive going edge of the UVLO
0 = No UVLOIF interrupt flag will be set upon a positive going edge of the UVLO
bit 4UVLOINTN: UVLO Comparator Interrupt on Negative Going Edge Enable bit
1 = The UVLOIF interrupt flag will be set upon a negative going edge of the UVLO
0 = No UVLOIF interrupt flag will be set upon a negative going edge of the UVLO
bit 2OVLOOUT: Overvoltage Lockout Status Output bit
1 = OVLO event has occurred
0 = No OVLO event has occurred
bit 1OVLOINTP: OVLO Comparator Interrupt on Positive Going Edge Enable bit
1 = The OVLOIF interrupt flag will be set upon a positive going edge of the OVLO
0 = No OVLOIF interrupt flag will be set upon a positive going edge of the OVLO
bit 0OVLOINTN: OVLO Comparator Interrupt on Negative Going Edge Enable bit
1 = The OVLOIF interrupt flag will be set upon a negative going edge of the OVLO
0 = No OVLOIF interrupt flag will be set upon a negative going edge of the OVLO
R = Readable bitW = Writable bitU = Unimplemented bit, read as ‘0’
u = Bit is unchangedx = Bit is unknown-n = Value at POR
‘1’ = Bit is set‘0’ = Bit is cleared
bit 7-6Unimplemented: Read as ‘0’
bit 5-0OVLO<5:0>: Overvoltage Lockout Configuration bits
OVLO(V) = 7.4847 * (1.0286
to 63
N
) where N = the decimal value written to the VINOVLO Register from 0
DS20005281A-page 38 2014 Microchip Technology Inc.
Page 39
MCP19114/5
6.2Output Overvoltage Protection
The MCP19114/5 feature output overvoltage
protection. This feature also utilizes a comparator
module similar to the standard PIC comparator module.
This is used to prevent the power system from being
damaged when the load is disconnected. The
OVREFCON register contains the digital value that
sets the analog DAC voltage at the inverting input of the
comparator. By comparing the divided down power
train output voltage connected to the non-inverting
input (V
voltage, the user will know when an overvoltage event
has occurred and can automatically take action.
) of the comparator with the OVREF reference
S
The OVCON register contains the interrupt flag polarity
and OV enable bits along with the output status bit just
as VINCON does for the input voltage UVLO and
OVLO. When <OVEN> bit in the OVCON register is set
and an overvoltage occurs, the control logic will
automatically set the secondary gate drive output
(SDRV) high and set the primary gate drive output
(PDRV) low.
Note:The OVIF interrupt flag bit is set when an
interrupt condition occurs, regardless of
the state of its corresponding enable bit or
the Global Enable bit (GIE) in the INTCON
register.
REGISTER 6-4:OVCON: OUTPUT OVERVOLTAGE COMPARATOR CONTROL REGISTER
U-0U-0U-0U-0R/W-0R-0R/W-0R/W-0
————OVENOVOUTOVINTPOVINTN
bit 7bit 0
Legend:
R = Readable bitW = Writable bitU = Unimplemented bit, read as ‘0’
u = Bit is unchangedx = Bit is unknown-n = Value at POR
‘1’ = Bit is set‘0’ = Bit is cleared
bit 7-4Unimplemented: Read as ‘0’
bit 3OVEN: OV Comparator output enable bit
1 = OV Comparator output is enabled
0 = OV Comparator output is Not enabled
bit 2OVOUT: Output Overvoltage Status Output bit
1 = Output Overvoltage has occurred
0 = No Output Overvoltage has occurred
bit 1OVINTP: OV Comparator Interrupt on Positive Going Edge Enable bit
1 = The OVIF interrupt flag will be set upon a positive going edge of the OV
0 = No OVIF interrupt flag will be set upon a positive going edge of the OV
bit 0OVINTN: OV Comparator Interrupt on Negative Going Edge Enable bit
1 = The OVIF interrupt flag will be set upon a negative going edge of the OV
0 = No OVIF interrupt flag will be set upon a negative going edge of the OV
REGISTER 6-5:OVREFCON: OUTPUT OVERVOLTAGE DE TECT LEVEL REGISTER
R/W-xR/W-xR/W-xR/W-xR/W-xR/W-xR/W-xR/W-x
OOV7OOV6OOV5OOV4OOV3OOV2OOV1OOV0
bit 7bit 0
Legend:
R = Readable bitW = Writable bitU = Unimplemented bit, read as ‘0’
u = Bit is unchangedx = Bit is unknown-n = Value at POR
‘1’ = Bit is set‘0’ = Bit is cleared
bit 7-0OOV<7:0>: Output Overvoltage Detect Level Configuration bits
Note 1: In this example, the LSb weight of OVREFTARGET is set to 1/(2
10
) volt. Users can choose their own
resolution depending on their accuracy requirement. The digital value of 2.0 V is determined as follows:
TRUNC(2.0 x 2
10
) = 2048 (0x0800 hex).
The A/D converter Calibration Word 8 can be used to
improve OVREF accuracy. An ADC measurement tar-
An example of OVREF-calibration firmware is as fol-
lows:
get (target in Example 6-1) is obtained by adding the
analog mux buffer offset (BUOFFSET) to the desired
OVREF voltage (OVREFTARGET) and multiplying the
result by the ADC gain (GADC). OVREF is adjusted
until the ADC reading equals or exceeds the target.
EXAMPLE 6-1:EXAMPLE OVREF CORRECTION ROUTINE
DS20005281A-page 40 2014 Microchip Technology Inc.
Page 41
MCP19114/5
6.3Desaturation Detection for
Quasi-Resonant Operation
The MCP19114/5 have been designed with a built-in
desaturation detection comparator module custom
made for quasi-resonant topologies. This is especially
useful for LED-type applications. Through the use of
the MCP19114/5, both synchronous and asynchronous
quasi-resonant topologies can be implemented. The
DESAT comparator module has the same features as
the UVLO/OVLO and OV comparator modules, except
that it includes some additional programmable
parameters.
The DESATCON register holds the setup control bits
for this module. Common control bits are the polarity
edge trigger for the interrupt flag
<CDSINTP><CDSINTN>, comparator output polarity
control <CDSPOL>, output enable <CDSOE> and
output status <CDSOUT> bit. As with the other
comparator modules, the CDSIF is independent of the
CDSOE enable bit. On the front end connected to the
DESAT comparator non-inverting input, there is a
two-channel MUX that connects either to the DESAT
pin or to the fixed internally generated band gap
voltage. Additionally, the input offset voltage of the
DESAT comparator is factory-trimmed to within ±1 mV
typically. These factory-trimmed values are stored in
the CALWD2 register at address 2081h. Firmware
must read these values into the DSTCAL register
(196h). If more offset is desired, the user can adjust the
values written to the DSTCAL per their implementation.
REGISTER 6-6:DESATCON: DESATURATION COMPARATOR CONTROL REGISTER
Primary input current offset adjust provides the ability
to add offset to the primary input current signal, thus
setting a peak primary current limit. This offset adjust is
controlled using the four bits in the ICOACON register.
REGISTER 6-7:ICOACON: INPUT CURRENT OFFSET ADJUST CONTROL REGISTER
U-0U-0U-0U-0R/W-xR/W-xR/W-xR/W-x
————ICOAC3ICOAC2ICOAC1ICOAC0
bit 7bit 0
Legend:
R = Readable bitW = Writable bitU = Unimplemented bit, read as ‘0’
u = Bit is unchangedx = Bit is unknown-n = Value at POR
‘1’ = Bit is set‘0’ = Bit is cleared
bit 7-4Unimplemented: Read as ‘0’
bit 3-0ICOAC<3:0>: Input current offset adjustment Configuration bits
DS20005281A-page 42 2014 Microchip Technology Inc.
Page 43
MCP19114/5
6.5Leading Edge Blanking
The adjustable Leading Edge Blanking (LEB) is used to
blank primary current spikes resulting from primary
switch turn-on. Implementing adjustable LEB allows
the system to ignore turn-on noise to best suit the
application without primary current sense distortion
from RC filtering. There are four settings available for
LEB, including zero. These settings are controlled via
two bits in the ICLEBCON register.
REGISTER 6-8:ICLEBCON: INPUT CURRENT LEADING EDGE BLANKING CONTROL
REGISTER
U-0U-0U-0U-0U-0U-0R/W-xR/W-x
——————ICLEBC1ICLEBC0
bit 7bit 0
Legend:
R = Readable bitW = Writable bitU = Unimplemented bit, read as ‘0’
u = Bit is unchangedx = Bit is unknown-n = Value at POR
‘1’ = Bit is set‘0’ = Bit is cleared
bit 7-2Unimplemented: Read as ‘0’
bit 1-0ICLEBC<1:0>: Input current Leading Edge Blanking Configuration bits
A negative voltage slope is added to the output of the
error amplifier. This is done to prevent subharmonic
instability when:
1. the operating duty cycle is greater than 50%
2. wide changes in the duty cycle occur
The amount of negative slope added to the error
amplifier output is controlled by slope compensation
slew rate control bits.
The slope compensation is enabled by clearing the
SLPBY bit in the SLPCRCON register.
REGISTER 6-9:SLPCRCON: SLOPE COMPENSATION RAMP CONTROL REGISTER
U-0R/W-0R/W-xR/W-xR/W-xR/W-xR/W-xR/W-x
—SLPBYSLPS5SLPS4SLPS3SLPS2SLPS1SLPS0
bit 7bit 0
Legend:
R = Readable bitW = Writable bitU = Unimplemented bit, read as ‘0’
u = Bit is unchangedx = Bit is unknown-n = Value at POR
‘1’ = Bit is set‘0’ = Bit is cleared
bit 7Unimplemented: Read as ‘0’
bit 6SLPBY: Slope Compensation Bypass Control bit
1 = Slope compensation is Bypassed
0 = Slope compensation is not Bypassed
bit 5-0SLPS<5:0>: Slope Compensation Slew Rate Control bits
SLPS (mV/µs) = 4.1505 mV/µs * e
0.739*(dec)
DS20005281A-page 44 2014 Microchip Technology Inc.
Page 45
MCP19114/5
PDT
SDT
PDRV
SDRV
6.7MOSFET Driver Programmable
Dead Time
FIGURE 6-1:MOSFET DRIVER DEAD
TIME
The turn-on dead time of both PDRV and SDRV
low-side drive signals can be configured independently
to allow different MOSFETs and circuit board layouts to
be used to construct an optimized system (refer to
Figure 6-1).
Clearing the PDRVBY and SDRVBY bits in the PE1
register enables the PDRV and SDRV low-side dead
timers respectively. The amount of dead time added is
controlled in the DEADCON register.
REGISTER 6-10:DEADCON: DRIVER DEAD TIME CONTROL REGISTER
//Assumes that calibration word A2CAL has been read into variable A2COMP
unsigned int VREF1_TEMP = VREFCON*A2COMP; // A2 Gain compensate for VREFCON
VREF1_TEMP >>= 7;
VREF1_TEMP &= 0x00FF;
VREFCON = VREF1_TEMP;
6.8Output Regulation Reference
Voltage Configuration
The VREFCON register controls the error amplifier
reference voltage. This reference is used to set the
current or voltage regulation set point. VREFCON
holds the digital value used by an 8-bit linear DAC
setting the analog equivalent that gets summed with
the pedestal voltage (VZC) at the non-inverting node of
the error amplifier. VZC is equal to the band gap
voltage (1.23V). The output of the current sense
amplifier A2 is also raised on the pedestal voltage
effectively canceling its effect on the input. The
pedestal is implemented throughout the analog control
loop to improve accuracy at low levels. The VREF DAC
can be adjusted in 255 steps of 4.8 mV/step.
REGISTER 6-11:VREFCON: CURRENT/VOLTAGE REGULATION SET POINT CONTROL
REGISTER
R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0
VREF7VREF6VREF5VREF4VREF3VREF2VREF1VREF0
bit 7bit 0
Legend:
R = Readable bitW = Writable bitU = Unimplemented bit, read as ‘0’
u = Bit is unchangedx = Bit is unknown-n = Value at POR
‘1’ = Bit is set‘0’ = Bit is cleared
bit 7-0VREF<7:0>: Voltage Controlling Current Regulation Set point bits
VREF(V) = V
To ensure the best regulation accuracy while
implementing the Current Sense Amplifier (A2), the
initial gain error must be considered. An 8-bit
factory-stored calibration value A2CAL<7:0> has been
stored in CALWD10 at 208Bh. This value can be used
to compensate for A2 gain error by adjusting the V
command.
* (VREF(dec)/255)
BG
REF
To get the final commanded value, the CALWD10 value
gets multiplied by the original V
using the V
Rotating the 16 bit result right produces the final compensated command in the least significant byte. The
most significant byte is unused.
An example of the firmware is as follows:
expression resulting in a 16-bit word.
REF
EXAMPLE 6-2:EX AMP LE A2 GAIN CORRECTION
decimal command
REF
DS20005281A-page 46 2014 Microchip Technology Inc.
Page 47
MCP19114/5
// Assumes that the calibration word ADCCAL has been read into variable ADCC
extern volatile unsigned int ADRES @ 0x01C;
#define VREF2TARGET (unsigned int) 0x02CC// VREF2 Target = 0.7 V
unsigned long tmp = (unsigned long)ADCC*VREF2TARGET;// ADC Reference
unsigned int target = (unsigned int)(tmp >> 15) - 3;// Subtract ADC typical offset error 3
unsigned int adc;
VREF2CON = 0x00;// Clear VREF2CON
ADCON = 0x71;// Enable ADC and set channel to GPB1/VREF2
do {// Adjust VREF2CON
VREF2CON++;
NOP(); NOP();
adc = 0;
for (unsigned char i = 4; i > 0; i--) {
Note 1: In this example, the LSb weight of VREF2TARGET is set to 1/(2
10
) Volt. Users can choose their own resolution depending on
their accuracy requirement. The digital value of 0.7V is determined as follows: TRUNC(0.7 x 2
10
) = 716 (0x02CC hex).
(1)
6.9V
Voltage Reference
REF2
The VREF2CON register controls a second reference
DAC that can be used externally. For example, it can be
sent off chip and used to set the current regulation set
point for a MCP1631 Pulse Width Modulator. The
MCP19114/5 must be configured in Master Mode with
connect V
is not accessible. VREFCON2 holds the digital value
used to set the VREF2 DAC. Since this reference is
intended to go off chip, there is no pedestal offset
associated with it and it is referenced to GND. It is an
8-bit linear DAC and has a range from 0V to 1.23V (BG)
equating to 255 steps at 4.8 mV/step.
to GPB1. In Stand-alone mode, V
REF2
REF2
bits MSC<0:1> = 01 in the MODECON register to
REGISTER 6-12:VREF2CON: V
VOLTAGE SET POINT REGISTER
REF2
R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0
VREF27VREF26VREF25VREF24VREF23VREF22VREF21VREF20
bit 7bit 0
Legend:
R = Readable bitW = Writable bitU = Unimplemented bit, read as ‘0’
u = Bit is unchangedx = Bit is unknown-n = Value at POR
‘1’ = Bit is set‘0’ = Bit is cleared
bit 7-0VR EF2<7:0>: Voltage Controlling Current Regulation Set point bits
V
The A/D converter Calibration Word 8 can be used to
improve V
accuracy. An ADC measurement target
REF2
= VBG* (VREF2(dec)/255)
REF2(V)
An example of V
-correction firmware is as follows:
REF2
(target in Example 6-3) is obtained by multiplying the
desired V_{REF2} voltage (VREF2TARGET) by the
ADC gain (ADCC). V
The MCP19114/5 have various analog peripherals.
These peripherals can be configured to allow
customizable operation. Refer to Register 6-13 for
more information.
6.10.1MOSFET GATE DRIVER ENABLES
The MCP19114/5 can enable and/or disable the
MOSFET gate driver outputs for the primary drive
(PDRV) and the secondary drive (SDRV)
independently. Setting the <PDRVEN> bit in the PE1
register enables the primary drive. Setting the
<SDRVEN> bit in the PE1 register enables the
secondary drive. Refer to Register 6-13 for details.
6.10.2MOSFET DRIVER DEAD TIME
As described in Section 6.7 “MOSFET Driver
Programmable Dead T ime”, the MOSFET drive dead
time can be adjusted. The dead time can be set
independently for each driver from 16 ns to 256 ns in
increments of 16 ns using the DEADCON register.
Dead time can also be disabled for each driver
independently by setting the bypass bits <PDRVBY>
and <SDRVBY> in the PE1 register.
6.10.3SECONDARY CURRENT POSITIVE
SENSE PULL-UP
A high-impedance pull-up on the ISP pin can be
configured by setting the <ISPUEN> bit in the PE1
register. When set, the I
V
. Refer to Register 6-13 for details.
DD
pin is internally pulled-up to
SP
6.10.4PWM STEERING
The MCP19114/5 have additional control circuitry to
allow open-loop repositioning of the output. The
PWMSTR_PEN bit enables a primary-only PWM signal
of fixed frequency and duty cycle to reposition the
output voltage up. The PWMSTR_SEN bit enables a
secondary-only PWM signal of fixed frequency and
duty cycle to reposition the output voltage down. When
repositioning output voltage down, the output
overvoltage protection must be active along with
PWMSTR_SEN for the PWM to pulse the SDRV.
Frequency and duty cycle are controlled through TMR2
registers PR2 and TMR1L. PWMSTPR_PEN and
PWMSTR_SEN should never be active at the same
time, therefore the PWMSTPR_PEN is the dominant
bit. For quasi-resonant operation during open-loop
repositioning, the DESAT comparator output should be
disabled with the <CDSOE> bit in the DEADCON
register.
REGISTER 6-13:PE1: ANALOG PERIPHERAL ENABLE1 CONTROL REGISTER
R/W-0R/W-0R/W-0R/W-0U-0R/W-0R/W-0R/W-0
PDRVENSDRVENPDRVBYSDRVBY
bit 7bit 0
Legend:
R = Readable bitW = Writable bitU = Unimplemented bit, read as ‘0’
u = Bit is unchangedx = Bit is unknown-n = Value at POR
‘1’ = Bit is set‘0’ = Bit is cleared
bit 7PDRVEN: PDRV Gate Drive Enable bit
1 = ENABLED
0 = DISABLED
bit 6SDRVEN: SDRV Gate Drive Enable bit
1 = ENABLED
0 = DISABLED
bit 5PDRVBY: PDRV Dead Time Bypass bit
1 = PDRV dead time is bypassed
0 = PDRV dead time is not bypassed
bit 4SDRVBY: SDRV Dead Time Bypass bit
1 = SDRV dead time is bypassed
0 = SDRV dead time is not bypassed.
bit 3Unimplemented: Read as ‘0’
bit 2ISPUEN: I
1 = I
SP
0 = I
SP
Weak Pull-Up Enable bit
SP
weak pull-up is enabled
weak pull-up is disabled
—ISPUENPWMSTR_PEN PWMSTR_SEN
DS20005281A-page 48 2014 Microchip Technology Inc.
Page 49
MCP19114/5
REGISTER 6-13:PE1: ANALOG PERIPHERAL ENABLE1 CONTROL REGISTER (CONTINUED)
bit 1PWMSTR_PEN: PDRV PWM Steering bit
1 = Enables open-loop PWM control to the PDRV
0 = Disables open-loop PWM control to the PDRV
bit 0PWMSTR_SEN: SDRV PWM Steering bit
1 = Enables open-loop PWM control to the SDRV
0 = Disables open-loop PWM control to the SDRV
bit
6.11Analog Blocks Enable Control
Various analog circuit blocks can be enabled or
disabled, as shown in the ABECON register. The
ABECON register also contains bits controlling analog
and digital test signals. These signals can be
configured to GPA0. Setting the <DIGOEN> bit enables
the digital test signals to be connected to GPA0.
<DSEL2:0> selects the digital channels. Setting
<ANAOEN> enables the analog test signals to be
connected to GPA0. If <ANAOEN> and <DIGOEN>
both get set, the DIGOEN bit takes priority. When
ANAOEN is not set, the analog test signals are
connected to the internal ADC. The analog test channel
selections are controlled through the ADCON0 register.
The MOSFET gate drivers have internal undervoltage
protection that is controlled by the <DRUVSEL> bit in
the ABECON register. Since the gate drive supply is
provided externally through the V
capable of driving logic level FETs or higher 10V (13.5V
maximum) FETs. <DRUVSEL> defaults to clear,
therefore selecting a gate drive UVLO of 2.7V. Setting
<DRUVSEL> selects the higher 5.4V gate drive UVLO.
Refer to Section 4.2 “Electrical Characteristics” for
additional electrical specifications.
pin, the drivers are
DR
6.11.2ERROR AMPLIFIER DISABLE
The error amplifier can be disabled such that its output
is parked to a known state. The <EADIS> bit defaults to
zero and the error amp is enabled during normal
operation. In case the user wants to disable the error
amplifier, setting the EADIS bit parks the error amplifier
output to just below the low clamp voltage. Under
normal operation, the error amplifier output runs
between 2 * BG (upper clamp value) and 1 * BG –
150 mV (lower clamp value). The analog feedback
circuitry utilizes an offset pedestal (1 * BG) to improve
accuracy at low levels.
REGISTER 6-14:ABECON: ANALOG BLOCK ENABLE CONTROL REGISTER
R/W-0R/W-0R/W-0R/W-0R/W-0U-0R/W-0R/W-0
DIGOENDSEL2DSEL1DSEL0DRUVSEL
bit 7bit 0
Legend:
R = Readable bitW = Writable bitU = Unimplemented bit, read as ‘0’
u = Bit is unchangedx = Bit is unknown-n = Value at POR
‘1’ = Bit is set‘0’ = Bit is cleared
bit 7DIGOEN: DIG Test MUX to GPA0 connection control
1 = DIG Test MUX output is connected to external pin GPA0
0 = DIG Test MUX output is not connected to external pin GPA0
REGISTER 6-14:ABECON: ANALOG BLOCK ENABLE CONTROL REGISTER (CONTINUED)
bit 6-4DSEL<2:0>
000 = QRS (Output of DESAT comparator)
001 = PWM_L (PWM output after monostable)
010 = PWM (Oscillator output from the micro-controller)
011 = TMR2EQ (When TMR2 equals PR2)
100 = OV (Overvoltage comparator output)
101 = SWFRQ (Switching Frequency Output)
110 = SDRV_ON_ONESHOT (200 nS one-shot signal to reset WDM logic)
111 = Unimplemented
bit 3DRUVSEL: Selects gate drive undervoltage lockout level
1 = Gate Drive UVLO set to 5.4V
0 = Gate Drive UVLO set to 2.7V
bit 2Unimplemented: Read as ‘0’
bit 1EADIS: Error Amplifier Disable bit
1 = Disables the error amplifier (Output parked low, clamped to 1 * BG)
0 = Enables the error amplifier (Normal operation)
bit 0ANAOEN: Analog MUX Output Control bit
1 = Analog MUX output is connected to external pin GPA0
0 = Analog MUX output is not connected to external pin GPA0
DS20005281A-page 50 2014 Microchip Technology Inc.
Page 51
MCP19114/5
6.12Mode and RFB MUX Control
The MODECON register controls the Master/Slave
configuration and the internal resistor feedback MUX
for the current sense amplifier while in quasi-resonant
mode.
In Master/Slave mode, it allows the V
Master MCP19115 device to be buffered and
connected to a GPIO pin. This output signal can be
connected to a Slave PWM driver (MCP1631) at the
input to regulate current via the Slave PWM
V
REF
Controller. In Stand-alone mode, the V
buffer is not connected to a separate GPIO Pin.
The RFB MUX selects the output of A2 current sense
amplifier to be connected to the internal 5 k feedback
resistor (quasi-resonant) or to the I
SOUT
REGISTER 6-15:MODECON: MASTER/SLAVE AND RFB MUX CONTROL REGISTER
R/W-0R/W-0R/W-0U-0U-0U-0U-0U-0
MSC1MSC0RFB
bit 7bit 0
REF2
REF2
pin.
signal of the
unity gain
—————
Legend:
R = Readable bitW = Writable bitU = Unimplemented bit, read as ‘0’
u = Bit is unchangedx = Bit is unknown-n = Value at POR
‘1’ = Bit is set‘0’ = Bit is cleared
bit 7-6MSC<1:0>: Master/Slave Configuration bits
00 = Device set as stand-alone unit
01 = Device set as MASTER
10 = Device set as SLAVE
11 = RESERVED
bit 5RFB<5>: Current Sense Amplifier (A2) output resistor feedback MUX Configuration bit
DS20005281A-page 52 2014 Microchip Technology Inc.
Page 53
MCP19114/5
5.3
5.4
5.5
5.6
5.7
5.8
5.9
6.0
6.1
-40 -25 -10 5 20 35 50 65 80 95 110 125
VIN= 32V
VIN= 6V
Non-Switching
10
15
20
25
30
35
-40 -25 -10 5 20 35 50 65 80 95 110 125
Sleep Current (µA)
VIN= 32V
VIN= 25V
VIN= 12V
VIN= 6V
5.04
5.05
5.06
5.07
5.08
5.09
5.10
6 8 10 12 14 16 18 20 22 24 26 28 30 32
DD
-40°C
+125°C
+25°C
IDD= 1 mA
5.03
5.04
5.05
5.06
5.07
5.08
5.09
5.10
024681012141618202224262830
V
DD
Voltage (V)
-40°C
+25°C
+125°C
0.0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
024681012141618202224262830
DD
-40°C
+25°C
+125°C
0.10
0.15
0.20
0.25
0.30
0.35
0.40
-40 -25 -10 5 20 35 50 65 80 95 110 125
DD
7.0TYPICAL PERFORMANCE CURVES
Note:The graphs and tables provided following this note are a statistical summary based on a limited number of
samples and are provided for informational purposes only. The performance characteristics listed herein
are not tested or guaranteed. In some graphs or tables, the data presented may be outside the specified
operating range (e.g., outside specified power supply range) and therefore, outside the warranted range.
DS20005281A-page 56 2014 Microchip Technology Inc.
Page 57
MCP19114/5
8.0SYSTEM BENCH TESTING
Control of the signals present at the output of the unity
gain analog buffer is found in the ADCON0 register.
To allow for easier system design and bench testing,
the MCP19114/5 feature a multiplexer used to output
various internal analog signals. These signals can be
measured on the GPA0 pin through a unity gain buffer.
The configuration control of the GPA0 pin is found in
the ABECON register.
.
REGISTER 8-1:ADCON0: ANALOG-TO-DIGITAL CONTROL REGISTER
U-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0
—CHS4CHS3CHS2CHS1CHS0GO/DONEADON
bit 7bit 0
Legend:
R = Readable bitW = Writable bitU = Unimplemented bit, read as ‘0’
u = Bit is unchangedx = Bit is unknown-n = Value at POR
‘1’ = Bit is set‘0’ = Bit is cleared
bit 7Unimplemented: Read as ‘0’
bit 6-2CHS<4:0>: Analog Channel Select bits
00000 = V
00001 = V
00010 = OV_REF (reference for overvoltage comparator)
00011 = V
00100 = V
00101 = EA_SC (error amplifier after slope compensation output)
00110 = A2 (secondary current sense amplifier output at R
00111 = PEDESTAL (Pedestal Voltage)
01000 =RESERVED
01001 =RESERVED
01010 = IP_ADJ (IP after Pedestal and Offset Adjust (at PWM Comparator))
01011 = IP_OFF_REF (IP Offset Reference)
01100 = V
01101 = TEMP_SNS (analog voltage representing internal temperature)
01110 = DLL_VCON (Delay Locked Loop Voltage Reference - control voltage for dead time)
01111 = SLPCMP_REF (slope compensation reference)
10000 = Unimplemented
10001 = Unimplemented
10010 = Unimplemented
10011 = Unimplemented
10100 = Unimplemented
10101 = Unimplemented
10110 = Unimplemented
10111 = Unimplemented
11000 = GPA0/AN0 (i.e. ADDR1)
11001 = GPA1/AN1 (i.e. ADDR0)
11010 = GPA2/AN2 (i.e. Temperature Sensor Input)
11011 = GPA3/AN3 (i.e. BIN)
11100 = GPB1/AN4
11101 = GPB4/AN5 (MCP19115 Only)
11110 = GPB5/AN6 (MCP19115 Only)
11111 = GPB6/AN7 (MCP19115 Only)
bit 1GO/DONE
1 = A/D conversion cycle in progress. Setting this bit starts an A/D conversion cycle.
0 = A/D conversion completed/not in progress
bit 0ADON: A/D Conversion Status bit
1 = A/D converter module is operating
0 = A/D converter is shut off and consumes no operating current
/n analog voltage measurement (VIN/15.5328)
IN
+ VZC (DAC reference voltage + VZC pedestal setting current regulation level)
REF
(band gap reference)
BGR
(voltage proportional to V
S
/n (VDR/n analog driver voltage measurement = 0.229V/V * VDR)
DR
: A/D Conversion Status bit
This bit is automatically cleared by hardware when the A/D conversion has completed.
DS20005281A-page 58 2014 Microchip Technology Inc.
Page 59
9.0DEVICE CALIBRATION
Read-only memory locations 2080h through 208Fh
contain factory calibration data. Refer to Section 1 7.0
“Flash Program Memory Control” for information on
how to read from these memory locations.
9.1Calibration Word 1
The DCSRFB<6:0> bits set the offset calibration for the
current sense differential amplifier (A2) when
configured using the internal feedback resistor. A
calibration range of ±30 mV is provided with 20h and
00h being midscale (no offset). The MSB is polarity
only. Firmware must read these values and write them
into the DCSCAL register to implement offset
calibration.
Calibration Word 2 is at memory location 2081h. It
contains the calibration bits for the desaturation
comparator current measurement input offset.
Firmware must read these values and write them into
the DSTCAL register to implement the factory offset
calibration. The factory offset calibration will minimize
offset voltage. The desaturation comparator is one of
the few examples where the user may want to
implement their own offset voltage values. Writing user
defined values to the DSTCAL register provides this
flexibility. This register also contains the trim bits
needed to trim the internal 5k feedback resistor to
within 2% using the <RFBT5:0> bits. Firmware must
read these values and write them into the RFBTCAL
register to implement the factory-trimmed feedback
resistor value.
REGISTER 9-2:CALWD2: CALIBRATION WORD 2 REGISTER
U-0R/P-1R/P-1R/P-1R/P-1R/P-1
—DST4DST3DST2DST1DST0
bit 13bit 8
U-0U-0R/P-1R/P-1R/P-1R/P-1R/P-1R/P-1
——RFBT5RFBT4RFBT3RFBT2RFBT1RFBT0
bit 7bit 0
Legend:
R = Readable bitP = Programmable bitU = Unused bit, read as ‘0’
-n = Value at POR‘1’ = Bit is set‘0’ = Bit is clearedx = Bit is unknown
bit 13Unused: Read as ‘0’
bit 12-8DST<4:0>: Desaturation Comparator Current Measure Offset calibration bits
bit 7-6Unused: Read as ‘0’
bit 5-0RFBT<5:0>: Internal Feedback Resistor Trim bits
DS20005281A-page 60 2014 Microchip Technology Inc.
Page 61
MCP19114/5
9.3Calibration Word 3
The VRO<5:0> bits at memory location 2082h calibrate
the offset of the buffer amplifier of the output voltage
regulation reference set point (V
read these values and write them to the VROCAL
register for proper calibration.
The BGR<3:0> bits at memory location 2082h calibrate
the band gap reference. Firmware must read these
values and write them to the BGRCAL register for
proper calibration.
REGISTER 9-3:CALWD3: CALIBRATION WORD 3 REGISTER
U-0U-0U-0U-0R/P-1R/P-1R/P-1R/P-1
————BGR3BGR2BGR1BGR0
bit 7bit 0
). Firmware must
REF
R/P-1R/P-1R/P-1R/P-1R/P-1R/P-1
VRO5VRO4VRO3VRO2VRO1VRO0
bit 13bit 8
Legend:
R = Readable bitP = Programmable bitU = Unused bit, read as ‘0’
-n = Value at POR‘1’ = Bit is set‘0’ = Bit is clearedx = Bit is unknown
bit 13-8VRO<5:0>: Reference voltage (V
bit 7-4Unused: Read as ‘0’
bit 3-0BGR<3:0>: Band Gap Reference calibration bits
) offset calibration bits
REF
9.4Calibration Word 4
The TTA<3:0> bits at memory location 2083h contain
the calibration bits for the factory-set overtemperature
threshold. Firmware must read these values and write
them into the TTACAL register for proper calibration.
REGISTER 9-4:CALWD4: CALIBRATION WORD 4 REGISTER
U-0U-0U-0U-0U-0U-0
——————
bit 13bit 8
U-0U-0U-0U-0R/P-1R/P-1R/P-1R/P-1
————T TA3TTA2TTA1TTA0
bit 7bit 0
Legend:
R = Readable bitP = Programmable bitU = Unused bit, read as ‘0’
-n = Value at POR‘1’ = Bit is set‘0’ = Bit is clearedx = Bit is unknown
bit 13-4Unused: Read as ‘0’
bit 3-0TTACAL<3:0>: Overtemperature threshold calibration bits
The TANA<9:0> bits at memory location 2084h contain
the ADC reading from the internal temperature sensor
when the silicon temperature is at 30°C. The
temperature coefficient of the internal temperature
sensor is 16 mV/°C.
REGISTER 9-5:CALWD5: CALIBRATION WORD 5 REGISTER
U-0U-0U-0U-0R/P-1R/P-1
————TANA9TANA8
bit 13bit 8
R/P-1R/P-1R/P-1R/P-1R/P-1R/P-1R/P-1R/P-1
TANA7TANA6TANA5TANA4TANA3TANA2TANA1TANA0
bit 7bit 0
Legend:
R = Readable bitP = Programmable bitU = Unused bit, read as ‘0’
-n = Value at POR‘1’ = Bit is set‘0’ = Bit is clearedx = Bit is unknown
bit 13-8Unused: Read as ‘0’
bit 7-0TANA<9:0>: ADC reading of internal silicon temperature at 30°C calibration bits
9.6Calibration Word 6
The FCAL<6:0> bits at memory location 2085h set the
internal oscillator calibration. Firmware must read
these values and write them to the OSCCAL register
for proper calibration.
REGISTER 9-6:CALWD6: CALIBRATION WORD 6 REGISTER
U-0U-0U-0U-0U-0U-0
——————
bit 13bit 8
U-0R/P-1R/P-1R/P-1R/P-1R/P-1R/P-1R/P-1
—FCAL6FCAL5FCAL4FCAL3FCAL2FCAL1FCAL0
bit 7bit 0
Legend:
R = Readable bitP = Programmable bitU = Unused bit, read as ‘0’
-n = Value at POR‘1’ = Bit is set‘0’ = Bit is clearedx = Bit is unknown
bit 13-7Unused: Read as ‘0’
bit 6-0FCAL<6:0>: Internal oscillator calibration bits
DS20005281A-page 62 2014 Microchip Technology Inc.
Page 63
9.7Calibration Word 7
The DCS<6:0> bits at memory location 2086h store the
factory-set offset calibration for the current sense
differential amplifier (A2) when configured using I
A configuration range of +/-30 mV is provided with 20h
and 00h being midscale (no offset). The MSB is polarity
only. Firmware must read this value into the DCSCAL
register to implement offset calibration. If using the
internal feedback resistor, refer to Register 9-1.
REGISTER 9-7:CALWD7: CALIBRATION WORD 7 REGISTER
U-0U-0U-0U-0U-0U-0
——————
bit 13bit 8
SOUT
.
MCP19114/5
U-0
—DCS6DCS5DCS4DCS3DCS2DCS1DCS0
bit 7bit 0
Legend:
R = Readable bitP = Programmable bitU = Unimplemented bit, read as ‘0’
-n = Value at POR‘1’ = Bit is set‘0’ = Bit is clearedx = Bit is unknown
bit 13-7Unimplemented: Read as ‘0’
bit 6-0DCS<6:0>: Differential Current Sense Amplifier Calibration bits when used with I
The ADCCAL<13:0> bits at memory location 2089h
contain the calibration bits for the A/D converter.
Calibration Word 8 (ADCCAL <13:0>) contains the
factory measurement of the full scale ADC Reference.
The value represents the number of A/D converter
counts per volt. ADCC<4:0> bits represent the fraction
of an A/D converter count, which can provide additional
precision when oversampling the ADC for enhanced
resolution. This calibration word can be used to
calibrate signals read by the Analog-to-Digital
Converter.
REGISTER 9-8:CALWD8: CALIBRATION WORD 8 REGISTER
R/P-1R/P-1R/P-1R/P-1R/P-1R/P-1
ADCC13ADCC12ADCC11ADCC10ADCC9ADCC8
bit 13bit 8
U-0R/P-1R/P-1R/P-1R/P-1R/P-1R/P-1R/P-1
ADCC7ADCC6ADCC5ADCC4ADCC3ADCC2ADCC1ADCC0
bit 7bit 0
Legend:
R = Readable bitP = Programmable bitU = Unimplemented bit, read as ‘0’
-n = Value at POR‘1’ = Bit is set‘0’ = Bit is clearedx = Bit is unknown
bit 13-5ADCC<13:5>: Whole number of A/D converter count
111111111 = 511
•
•
•
000000000 = 0
bit 4-0ADCC<4:0>: Fraction number of A/D converter count
11111 = 0.96875
•
•
•
00001 = 0.03125
00000 = 0.00000
DS20005281A-page 64 2014 Microchip Technology Inc.
Page 65
MCP19114/5
9.9Calibration Word 9
Calibration Word 9 is at memory location 208Ah. The
value stored at this memory location represents the
offset voltage (in units of mV) of the analog test buffer.
This is an 8-bit, 2's complement word that can be used
to compensate any signal sent through the Analog test
multiplexer. See section 8.0 for test signal details.
REGISTER 9-9:CALWD9: CALIBRATION WORD 9 REGISTER
U-0U-0U-0U-0U-0U-0
——————
bit 13bit 8
R/P-1R/P-1R/P-1R/P-1R/P-1R/P-1R/P-1R/P-1
BUFF7BUFF6BUFF5BUFF4BUFF3BUFF2BUFF1BUFF0
bit 7bit 0
Legend:
R = Readable bitP = Programmable bitU = Unimplemented bit, read as ‘0’
-n = Value at POR‘1’ = Bit is set‘0’ = Bit is clearedx = Bit is unknown
bit 13-8Unimplemented: Read as ‘0’
bit 7-0BUFF<7:0>: Analog Buffer Offset calibration bits
11111111 = Mid scale (-1 mV)
•
•
•
10000000 = Largest negative offset (-128 mV)
01111111 = Largest positive offset (127 mV)
The A2CAL<7:0> bits at memory location 208Bh
contain the calibration bits for Current Sense Amplifier
(A2) Gain Error. For best regulation accuracy using this
amplifier, firmware can read this value and use it to
adjust the VREF command. Section 6.8 “Output
Regulation Reference Voltage Configuration” for
details.
REGISTER 9-10:CALWD10: CALIBRATION WORD 10 REGISTER
U-0U-0U-0U-0U-0U-0
——————
bit 13bit 8
R/P-1R/P-1R/P-1R/P-1R/P-1R/P-1R/P-1R/P-1
A2CAL7A2CAL6A2CAL5A2CAL4A2CAL3A2CAL2A2CAL1A2CAL0
bit 7bit 0
Legend:
R = Readable bitP = Programmable bitU = Unimplemented bit, read as ‘0’
-n = Value at POR‘1’ = Bit is set‘0’ = Bit is clearedx = Bit is unknown
bit 13-8Unimplemented: Read as ‘0’
bit 7-0A2CAL<7:0>: Current Sense Amplifier (A2) Gain Error Calibration bits
DS20005281A-page 66 2014 Microchip Technology Inc.
Page 67
MCP19114/5
PC<12:0>
13
0000h
0004h
0005h
0FFFh
1FFFh
Stack Level 1
Stack Level 8
Reset Vector
Interrupt Vector
On-Chip Program
Memory
CALL, RETURN
RETFIE, RETLW
1000h
2000h
2005h
2006h
2007h
200Ah
207Fh
20FFh
2003h
2004h
Note 1: Not code protected.
Shadows 000-FFFh
2008h
2080h
200Bh
208Fh
2090h
2100h
3FFFh
User IDs
(1)
ICD Instruction
(1)
Manufacturing Codes
(1)
Device ID (hardcoded)
(1)
Config Word
(1)
Reserved
Reserved for
Manufacturing & Test
(1)
Calibration Words
(1)
Unimplemented
Shadows 2000-20FFh
10.0MEMORY ORGANIZATION
There are two types of memory in the MCP19114/5:
• Program Memory
• Data Memory
10.1Program Memory Organization
The MCP19114/5 have a 13-bit program counter
capable of addressing an 8000 x 14 program memory
space. Only the first 4000 x 14 (0000h-0FFFh) is
physically implemented. Addressing a location above
this boundary will cause a wrap-around within the first
4000 x 14 space. The Reset vector is at 0000h and the
interrupt vector is at 0004h (refer to Figure 10-1). The
width of the program memory bus (instruction word) is
14 bits. Since all instructions are a single word, the
MCP19114/5 have space for 4000 instructions.
;select data
RETLW DATA0;Index0 data
RETLW DATA1;Index1 data
RETLW DATA2
RETLW DATA3
my_function
;… LOTS OF CODE…
MOVLWDATA_INDEX
call constants
;… THE CONSTANT IS IN W
10.1.1READING PROGRAM MEMORY
AS DATA
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 a
Files Select Register (FSR) to point to the program
memory.
10.1.1.1RETLW Instruction
The RETLW instruction can be used to provide access
to the tables of constants. The recommended way to
create such tables is shown in Example 10-1.
EXAMPLE 10-1:RETLW INSTRUCTION
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.
10.2Data Memory Organization
The data memory (refer to Figure 10-1) is partitioned
into four banks, which contain the General Purpose
Registers (GPR) and the Special Function Registers
(SFR). The Special Function Registers are located in
the first 32 locations of each bank. Register locations
20h-7Fh in Bank 0, A0h-EFh in Bank 1 and 120h-16Fh
in Bank 2 are General Purpose Registers,
implemented as static RAM. All other RAM is
unimplemented and returns ‘0’ when read. The
RP<1:0> bits in the STATUS register are the bank
select bits.
EXAMPLE 10-2:BANK SE LECT
RP1RP0
00 -> Bank 0 is selected
01 -> Bank 1 is selected
10 -> Bank 2 is selected
11 -> Bank 3 is selected
To move values from one register to another register,
the value must pass through the W register. This
means that for all register-to-register moves, two
instruction cycles are required.
The entire data memory can be accessed either
directly or indirectly. Direct addressing may require the
use of the RP<1:0> bits. Indirect addressing requires
the use of the FSR. Indirect addressing uses the
Indirect Register Pointer (IRP) bit in the STATUS
register for access to the Bank0/Bank1 or the
Bank2/Bank3 areas of data memory.
10.2.1GENERAL PURPOSE REGISTER
FILE
The register file is organized as 64 x 8 in the
MCP19114/5. Each register is accessed, either directly
or indirectly, through the FSR (refer to Section 10.5
“Indirect Addressing, INDF and FSR Registers”).
DS20005281A-page 68 2014 Microchip Technology Inc.
Page 69
MCP19114/5
10.2.2CORE REGISTERS
The core registers contain the registers that directly
affect the basic operation. The core registers can be
addressed from any bank. These registers are listed
below in Tab le 1 0- 1. For detailed information, refer to
Table 10-2.
TABLE 10-1: CORE REGISTERS
AddressesBANKx
x00h, x80h, x100h, or x180h
x02h, x82h, x102h, or x182h
x03h, x83h, x103h, or x183h
x04h, x84h, x104h, or x184h
x0Ah, x8Ah, x10Ah, or x18Ah
x0Bh, x8Bh, x10Bh, or x18Bh
INDF
PCL
STATUS
FSR
PCLATH
INTCON
10.2.2.1STATUS Register
The STATUS register contains:
• the arithmetic status of the ALU
• the Reset status
• the bank select bits for data memory (RAM)
The STATUS register can be the destination for any
instruction, like any other register. If the STATUS
register is the destination for an instruction that affects
the Z, DC or C bits, the write to these three bits is
disabled. These bits are set or cleared according to the
device logic. Furthermore, the TO
writable. Therefore, the result of an instruction with the
STATUS register as destination may be different than
intended.
For example, CLRF STATUS will clear the upper three
bits and set the Z bit. This leaves the STATUS register
as ‘000u u1uu’ (where u = unchanged).
It is recommended, therefore, that only BCF, BSF,SWAPF and MOVWF instructions are used to alter the
STATUS register, because these instructions do not
affect any Status bits.
Note 1: The C and DC bits operate as Borrow
and Digit Borrow out bits, respectively, in
subtraction.
and PD bits are not
REGISTER 10-1:STATUS: STATUS REGISTER
R/W-0R/W-0R/W-0R-1R-1R/W-xR/W-xR/W-x
IRPRP1RP0TO
bit 7bit 0
Legend:
R = Readable bitW = Writable bitU = Unimplemented bit, read as ‘0’
-n = Value at PORx = Bit is unknown‘0’ = Bit is cleared
‘1’ = Bit is set
bit 7IRP: Register Bank Select bit (used for Indirect addressing)
1 = Bank 2 & 3 (100h - 1FFh)
0 = Bank 0 & 1 (00h - FFh)
bit 6-5RP<1:0>: Register Bank Select bits (used for Direct addressing)
Note 1: For Borrow, the polarity is reversed. A subtraction is executed by adding the two’s complement of the
second operand. For rotate (RRF, RLF) instructions, this bit is loaded with either the high-order or
low-order bit in the source register.
: Power-down bit
1 = After power-up or by the CLRWDT instruction
0 = By execution of the SLEEP instruction
1 = The result of an arithmetic or logic operation is zero
0 = The result of an arithmetic or logic operation is not zero
(1)
(ADDWF, ADDLW, SUBLW, SUBWF instructions)
1 = A carry-out from the 4th low-order bit of the result occurred
0 = No carry-out from the 4
(1)
1 = A carry-out from the Most Significant bit of the result occurred
0 = No carry-out from the Most Significant bit of the result occurred
th
low-order bit of the result
(ADDWF, ADDLW, SUBLW, SUBWF instructions)
(1)
10.2.3SPECIAL FUNCTION REGISTERS
The Special Function Registers are registers used by
the CPU and peripheral functions for controlling the
desired operation of the device (refer to Figure 10-2).
These registers are static RAM.
The special registers can be classified into two sets:
core and peripheral. The Special Function Registers
associated with the microcontroller core are described
in this section. Those related to the operation of the
peripheral features are described in the associated
section for that peripheral feature.
DS20005281A-page 70 2014 Microchip Technology Inc.
DS20005281A-page 72 2014 Microchip Technology Inc.
MCP19114/5
TABLE 10-2:MCP19114/5 SPECIAL REGISTERS SUMMARY BANK 0
AdrNameBit 7Bit 6Bit 5Bit 4Bit 3Bit 2 Bit 1Bit 0Value on POR ResetValue on all other resets
Bank 0
00hINDFAddressing this location uses contents of FSR to address data memory (not a physical register)xxxx xxxxxxxx xxxx
01hTMR0Timer0 Module’s Registerxxxx xxxxuuuu uuuu
02hPCLProgram Counter's (PC) Least Significant byte0000 00000000 0000
03hSTATUSIRPRP1RP0TO
04hFSRIndirect data memory address pointerxxxx xxxxuuuu uuuu
05hPORTGPAGPA7GPA6GPA5
06hPORTGPBGPB7GPB6GPB5GPB4
07hPIR1
08hPIR2CDSIF
09hPCON
0AhPCLATH
0BhINTCONGIE PEIET0IEINTEIOCET0IFINTFIOCF
0Ch TMR1LHolding register for the Least Significant byte of the 16-bit TMR1xxxx xxxxuuuu uuuu
0DhTMR1HHolding register for the Most Significant byte of the 16-bit TMR1xxxx xxxx
1BhOSCTUNE
1ChADRESLLeast significant 8 bits of the A/D resultxxxx xxxxuuuu uuuu
1Dh ADRESHMost significant 2 bits of the A/D result 0000 00xx0000 00uu
Legend: — = Unimplemented locations read as ‘0’, u = unchanged, x = unknown, q = value depends on condition, shaded = unimplemented
Note 1: Other (non power-up) resets include MCLR Reset and Watchdog Timer Reset during normal operation.
2: MCLR and WDT reset does not affect the previous value data latch. The IOCF bit will be cleared upon reset but will be set again if the mismatch exists.
Legend:— = Unimplemented locations read as ‘0’, u = unchanged, x = unknown, q = value depends on condition, shaded = unimplemented
Note 1:Other (non power-up) resets include MCLR
—Unimplemented——
2:MCLR
and WDT reset does not affect the previous value data latch. The IOCF bit will be cleared upon reset but will be set again if the mismatch exists.
116h SSPSTATSMPCKED/A
117h SSPADD2ADD2<7:0>0000 00000000 0000
118h SSPMSK2MSK2<7:0>1111 11111111 1111
119 h —Unimplemented——
11A h —Unimplemented——
11B h —Unimplemented——
11C h —Unimplemented——
11D h —Unimplemented——
11E h —Unimplemented——
11F h —Unimplemented——
——WPUA5—WPUA3WPUA2WPUA1WPUA0--1- 1111--u- uuuu
—————001- ----001- ----
———Write buffer for upper 5 bits of program counter---0 0000---0 0000
Legend:— = Unimplemented locations read as ‘0’, u = unchanged, x = unknown, q = value depends on condition, shaded = unimplemented
Note 1:Other (non power-up) resets include MCLR
2:MCLR
3:Only accessible when DBGEN
(3)
(3)
(3)
(3)
and WDT reset does not affect the previous value data latch. The IOCF bit will be cleared upon reset but will be set again if the mismatch exists.
1 = Increment on high-to-low transition on T0CKI pin
0 = Increment on low-to-high transition on T0CKI pin
1 = Prescaler is assigned to WDT
0 = Prescaler is assigned to the Timer0 module
(1)
Note 1: Individual WPUx bit must also be enabled.
DS20005281A-page 76 2014 Microchip Technology Inc.
Page 77
MCP19114/5
PC
128 70
5
PCLATH<4:0>
PCLATH
Instruction with
ALU Result
GOTO, CALL
OPCODE <10:0>
8
PC
12 11 100
11
PCLATH<4:3>
PCHPCL
87
2
PCLATH
PCHPCL
Destination
10.4PCL and PCLATH
The Program Counter (PC) is 13-bits wide. The low byte
comes from the PCL register, which is a readable and
writable register. The high byte (PC<12:8>) is not directly
readable or writable and comes from PCLATH. On any
Reset, the PC is cleared. Figure 10-3 shows the two
situations for loading the PC: the upper example shows
how the PC is loaded on a write to PCL (PCLATH <4:0>
PCH), while the lower example in Figure 10-3 shows
how the PC is loaded during a CALL or GOTO instruction
(PCLATH<4:3> PCH).
FIGURE 10-3:PROGRAM COUNTER
(PC) LOADING IN
DIFFERENT SITUATIONS
10.4.3COMPUTED FUNCTION CALLS
A computed function CALL allows programs to maintain
tables of functions and provide another way to execute
state machines or look-up tables. When performing a
table read using a computed function CALL, care
should be exercised if the table location crosses a PCL
memory boundary (each 256-byte block).
If using the CALL instruction, the PCH<2:0> and PCL
registers are loaded with the operand of the CALL
instruction. PCH<6:3> is loaded with PCLATH<6:3>.
10.4.4STACK
The MCP19114/5 have an 8-level x 13-bit wide
hardware stack (refer to Figure 10-1). The stack space
is not part of either program or data space and the
Stack Pointer is not readable or writable. The PC is
PUSHed onto the stack when CALL instruction is
executed or an interrupt causes a branch. The stack is
POPed in the event of a RETURN, RETLW or a RETFIE
instruction execution. PCLATH is not affected by a
PUSH or POP operation.
The stack operates as a circular buffer. This means that
after the stack has been PUSHed eight times, the 9
push overwrites the value that was stored from the first
push. The tenth push overwrites the second push (and
so on).
th
10.4.1MODIFYING PCL REGISTER
Executing any instruction with the PCL register as the
destination simultaneously causes the Program
Counter PC<12:8> bits (PCH) to be replaced by the
contents of the PCLATH register. This allows the entire
contents of the program counter to be changed by
writing the desired upper 5 bits to the PCLATH register.
When the lower 8 bits are written to the PCL register, all
13 bits of the program counter will change to the values
contained in the PCLATH register and those being
written to the PCL register.
10.4.2COMPUTED GOTO
A computed GOTO is accomplished by adding an offset
to the program counter (ADDWF PCL). Care should be
exercised when jumping into a look-up table or
program branch table (computed GOTO) by modifying
the PCL register. Assuming that PCLATH is set to the
table start address, if the table length is greater than
255 instructions or if the lower 8 bits of the memory
address roll over from 0xFFh to 0X00h in the middle of
the table, then PCLATH must be incremented for each
address rollover that occurs between the table
beginning and the table location within the table.
For more information, refer to Application Note AN556,
Note 1: There are no Status bits to indicate Stack
Overflow or Stack Underflow conditions.
2: There are no instructions/mnemonics
called PUSH or POP. These are actions
that occur from the execution of the
CALL, RETURN, RETLW and RETFIE
instructions or the vectoring to an
interrupt address.
10.5Indirect Addressing, INDF and
FSR Registers
The INDF register is not a physical register. Addressing
the INDF register will cause indirect addressing.
Indirect addressing is possible by using the INDF
register. Any instruction using the INDF register
actually accesses data pointed to by the File Select
Register (FSR). Reading INDF itself indirectly will
produce 00h. Writing to the INDF register directly
results in a no operation (although Status bits may be
affected). An effective 9-bit address is obtained by
concatenating the 8-bit FSR and the IRP bit in the
STATUS register, as shown in Figure 10-4.
A simple program to clear RAM location 40h-7Fh using
indirect addressing is shown in Example 10-3.
Page 78
MCP19114/5
MOVLW0x40;initialize pointer
MOVWFFSR;to RAM
NEXTCLRFINDF;clear INDF register
INCFFSR;inc pointer
BTFSSFSR,7;all done?
GOTONEXT;no clear next
CONTINUE;yes continue
Data
Memory
Indirect AddressingDirect Addressing
Bank SelectLocation Select
RP1 RP06
0
From Opcode
IRPFile Select Register
7
0
Bank Select
Location Select
00011011
180h
1FFh
00h
7Fh
Bank 0Bank 1Bank 2Bank 3
For memory map detail, refer to Figure 10-2.
EXAMPLE 10-3:INDIR ECT ADDRESSI NG
FIGURE 10-4:DIRECT/INDIRECT ADDRESSING
DS20005281A-page 78 2014 Microchip Technology Inc.
Page 79
MCP19114/5
11.0DEVICE CONFIGURATION
Device Configuration consists of Configuration Word,
Code Protection and Device ID.
Note:The DBGEN bit in Configuration Word is
managed automatically by device
development tools, including debuggers
and programmers. For normal device
11.1Configuration Word
There are several Configuration Word bits that allow
operation, this bit should be maintained as
a '1'. Debug is available only on the
MCP19115.
different timers to be enabled and memory protection
options. These are implemented as Configuration
Word at 2007h
.
REGISTER 11-1:CONFIG: CONFIGURATION WORD
R/P-1U-1R/P-1R/P-1U-1R/P-1
DBGEN
bit 13bit 8
U-1R/P-1R/P-1R/P-1R/P-1U-1U-1U-1
—CPMCLREPWRTEWDTE———
bit 7bit 0
Legend:
R = Readable bitW = Writable bitU = Unimplemented bit, read as ‘0’
-n = Value at POR‘1’ = Bit is set‘0’ = Bit is clearedx = Bit is unknown
bit 12Unimplemented: Read as ‘0’
bit 11-10WRT<1:0>: Flash Program Memory Self Write Enable bit
11 = Write protection off
10 = 000h to 3FFh write protected, 400h to FFFh may be modified by PMCON1 control
01 = 000h to 7FFh write protected, 800h to FFFh may be modified by PMCON1 control
00 = 000h to FFFh write protected, entire program memory is write protected.
bit 9Unimplemented: Read as ‘0’
bit 8BOREN: Brown-out Reset Enable bit
1 = BOR disabled during Sleep and Enabled during operation
0 = BOR disabled
bit 7Unimplemented: Read as ‘0’
bit 6CP
bit 5MCLRE: MCLR
bit 4
bit 3WDTE: Watchdog Timer Enable bit
bit 2-0Unimplemented: Read as ‘0’
: Code Protection
1 = Program memory is not code protected
0 = Program memory is external read and write protected
Pin Function Select
1 =MCLR
0 =MCLR
PWRTE
1 = PWRT disabled
0 = PWRT enabled
1 = WDT enabled
0 = WDT disabled
pin is MCLR function and weak internal pull-up is enabled
pin is alternate function, MCLR function is internally disabled
: Power-up Timer Enable bit
(1)
Note 1: Bit is reserved and not controlled by user.
Code protection allows the device to be protected from
unauthorized access. Internal access to the program
memory is unaffected by any code protection setting.
11.2.1PROGRAM MEMORY PROTECTION
The entire program memory space is protected from
external reads and writes by the CP
Configuration Word. When CP
writes of program memory are inhibited and a read will
return all ‘0’s. The CPU can continue to read program
memory, regardless of the protection bit settings.
Writing the program memory is dependent upon the
write protection setting. Refer to Section 11.3 “Write
Protection” for more information.
= 0, external reads and
11.3Write Protection
Write protection allows the device to be protected from
unintended self-writes. Applications, such as boot
loader software, can be protected while allowing other
regions of the program memory to be modified.
The WRT<1:0> bits in the Configuration Word define
the size of the program memory block that is protected.
bit in the
11.4ID Locations
Four memory locations (2000h – 2003h) are
designated as ID locations where the user can store
checksum or other code identification numbers. These
locations are not accessible during normal execution
but are readable and writable during Program/Verify
mode. Only the Least Significant 7 bits of the ID
locations are reported when using MPLAB Integrated
Development Environment (IDE).
DS20005281A-page 80 2014 Microchip Technology Inc.
Page 81
MCP19114/5
12.0OSCILLATOR MODES
The MCP19114/5 have one oscillator configuration
which is an 8 MHz internal oscillator.
12.1Internal Oscillator (INTOSC)
The Internal Oscillator module provides a system
clock source of 8 MHz. The frequency of the internal
oscillator can be trimmed with a calibration value in the
OSCTUNE register.
12.2Oscillator Calibration
The 8 MHz internal oscillator is factory-calibrated. The
factory calibration values reside in the read-only
CALWD6 register. These values must be read from the
CALWD6 register and stored in the OSCCAL register.
Refer to Section 17.0 “Flash Program Memory
Control” for the procedure on reading the program
memory.
Note:The FCAL<6:0> bits in the CALWD6
register must be written into the OSCCAL
register to calibrate the internal oscillator.
12.3Frequency Tuning in User Mode
In addition to the factory calibration, the base
frequency can be tuned in the user's application. This
frequency tuning capability allows the user to deviate
from the factory-calibrated frequency. The user can
tune the frequency by writing to the OSCTUNE
register (refer to Register 12-1).
REGISTER 12-1:OSCTUNE: OSCILLATOR TUNING REGISTER
U-0 U-0U-0R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
———TUN4TUN3TUN2TUN1TUN0
bit 7bit 0
Legend:
R = Readable bitW = Writable bitU = Unimplemented bit, read as ‘0’
-n = Value at POR‘1’ = Bit is set‘0’ = Bit is clearedx = Bit is unknown
bit 7-5Unimplemented: Read as ‘0’
bit 4-0TUN<4:0>: Frequency Tuning bits
01111 = Maximum frequency
01110 =
•
•
•
00001 =
00000 = Center frequency. Oscillator Module is running at the calibrated frequency.
11111 =
12.3.1OSCILLATOR DELAY UPON
POWER-UP, WAKE-UP AND BASE
FREQUENCY CHANGE
In applications where the OSCTUNE register is used to
shift the frequency of the internal oscillator, the
application should not expect the frequency of the
internal oscillator to stabilize immediately. In this case,
the frequency may shift gradually toward the new
value. The time for this frequency shift is less than eight
cycles of the base frequency.
On power-up, the device is held in reset by the
power-up time if the power-up timer is enabled.
Following a wake-up from Sleep mode or POR, an
internal delay of ~10 µs is invoked to allow the memory
bias to stabilize before program execution can begin.
TABLE 12-1:SUMMARY OF REGISTERS ASSOCIATED WITH CLOCK SOURCES
NameBit 7Bit 6Bit 5Bit 4Bit 3Bit 2Bit 1Bit 0
Register
on Page
OSCTUNE
Legend: — = unimplemented locations, read as ‘0’. Shaded cells are not used by clock sources.
———TUN4TUN3TUN2TUN1TUN081
TABLE 12-2:SUMMARY OF CONFIGURATION WORD ASSOCIATED WITH CLOCK SOURCES
Legend: — = unimplemented locations, read as ‘0’. Shaded cells are not used by clock sources.
13:8
7:0
————————
—FCAL6FCAL5FCAL4FCAL3FCAL2FCAL1FCAL0
Register
on Page
62
DS20005281A-page 82 2014 Microchip Technology Inc.
Page 83
MCP19114/5
WDT
Module
VDDRise
Detect
Brown-out
Reset
Sleep
BOREN
MCLR/TEST_EN
pin
V
DD
External
Reset
S
RQ
On-Chip
RC OSC
11-bit Ripple Counter
PWRT
Enable PWRT
Chip_Reset
Power-on Reset
Time-out
Reset
Brown-out
Reset
13.0RESETS
Some registers are not affected in any Reset condition;
their status is unknown on POR and unchanged in any
The reset logic is used to place the MCP19114/5 into a
known state. The source of the reset can be
determined by using the device status bits.
There are multiple ways to reset these devices:
• Power-on Reset (POR)
• Overtemperature Reset (OT)
•MCLR
Reset
•WDT Reset
• Brown-out Reset (BOR)
To a llo w V
to stabilize, an optional power-up timer
DD
can be enabled to extend the Reset time after a POR
event.
other Reset. Most other registers are reset to a “Reset
state” on:
• Power-on Reset
•MCLR
•MCLR
Reset
Reset during Sleep
• WDT Reset
• Brown-out Reset
WDT (Watchdog Timer) wake-up does not cause
register resets in the same manner as a WDT Reset,
since wake-up is viewed as the resumption of normal
operation. TO
and PD bits are set or cleared differently
in different Reset situations, as indicated in Tab le 1 3- 1.
The software can use these bits to determine the
nature of the Reset. Refer to Tab le 1 3- 2 for a full
description of Reset states of all registers.
A simplified block diagram of the On-Chip Reset Circuit
is shown in Figure 13-1.
The MCLR
Reset path has a noise filter to detect and
ignore small pulses. Refer to Section 5.0 “Digital
Electrical Characteristics” for pulse-width
specifications.
FIGURE 13-1:SIMPLIFIED BLOCK DIAGRAM OF ON-CHIP RESET CIRCUIT
The on-chip POR circuit holds the chip in Reset until
has reached a high enough level for proper
V
DD
operation. To take advantage of the POR, simply
connect the MCLR pin through a resistor to VDD. This
will eliminate external RC components usually needed
to create Power-on Reset.
Note:The POR circuit does not produce an
internal Reset when V
re-enable the POR, V
(A
) for a minimum of 100 µs.
GND
When the device starts normal operation (exits the
Reset condition), device operating parameters (i.e.,
voltage, frequency, temperature, etc.) must be met to
ensure proper operation. If these conditions are not
met, the device must be held in Reset until the operating conditions are met.
declines. To
DD
must reach V
DD
SS
13.2MCLR
MCP19114/5 have a noise filter in the MCLR Reset
path. The filter will detect and ignore small pulses.
It should be noted that a WDT Reset does not drive
pin low.
MCLR
Voltages applied to the MCLR
specification can result in both MCLR
excessive current beyond the device specification
during the ESD event. For this reason, Microchip
recommends that the MCLR
directly to V
. The use of a Resistor-Capacitor (RC)
DD
network, as shown in Figure 13-2, is suggested.
An internal MCLR option is enabled by clearing the
MCLRE bit in the CONFIG register. When MCLRE = 0,
the Reset signal to the chip is generated internally.
When MCLRE = 1, the MCLR
Reset input. In this mode, the MCLR
pull-up to V
DD
.
FIGURE 13-2:RECOMMENDED MCLR
CIRCUIT
pin that exceed its
Resets and
pin no longer be tied
pin becomes an external
pin has a weak
DS20005281A-page 84 2014 Microchip Technology Inc.
Page 85
MCP19114/5
V
DD
Internal
Reset
V
DD
V
DD
Internal
Reset
Internal
Reset
V
BOR
V
BOR
V
BOR
64 ms
(1)
64 ms
(1)
64 ms
(1)
<64ms
Note 1: 64 ms delay only if PWRTE bit is programmed to ‘0’.
13.3Brown-out Reset (BOR)
The BOREN bit <8> in the CONFIG register enables or
disables the BOR mode, as defined in the CONFIG
register. A brown-out occurs when V
V
for greater than 100 µs minimum. On any Reset
BOR
(Power-on, Brown-out, Watchdog Timer, etc.), the chip
will remain in Reset until V
rises above V
DD
to Figure 13-3). If enabled, the Power-up Timer will be
invoked by the Reset and will keep the chip in Reset an
additional 64 ms.
FIGURE 13-3:BROWN-OUT SITUATIONS
falls below
DD
BOR
(refer
Note:The Power-up Timer is enabled by the
PWRTE
drops below V
bit in the CONFIG register. If V
while the Power-up
BOR
DD
Timer is running, the chip will go back into
a Brown-out Reset and the Power-up
Timer will be re-initialized. Once the V
rises above V
The Power-up Timer provides a fixed 64 ms (nominal)
time-out on power-up only, from POR Reset. The
Power-up Timer operates from an internal RC
oscillator. The chip is kept in Reset as long as PWRT is
active. The PWRT delay allows the V
acceptable level. A bit (P
register can disable (if set) or enable (if cleared or
programmed) the Power-up Timer.
The Power-up Timer delay will vary from chip to chip
due to:
variation
•V
DD
• Temperature variation
• Process variation
Note:Voltage spikes below V
pin, inducing currents greater than 80 mA,
may cause latch-up. Thus, a series
resistor of 50-100 should be used when
applying a “low” level to the MCLR
rather than pulling this pin directly to V
The Power-up Timer optionally delays device execution
after a POR event. This timer is typically used to allow
VDD to stabilize before allowing the device to start
running.
The Power-up Timer is controlled by the PWRTE
the CONFIG register.
WRTE) in the CONFIG
to rise to an
DD
at the MCLR
SS
pin,
SS
bit in
13.5Watchdog Timer (WDT) Reset
The Watchdog Timer generates a Reset if the firmware
does not issue a CLRWDT instruction within the time-out
period. The TO
changed to indicate the WDT Reset. Refer to
Section 16.0 “Watchdog Timer (WDT)” for more
information.
and PD bits in the STATUS register are
13.6Start-up Sequence
Upon the release of a POR, the following must occur
before the device begins executing:
• Power-up Timer runs to completion (if enabled)
• Oscillator start-up timer runs to completion
•MCLR
The total time-out will vary based on PWRTE
For example, with PWRTE bit erased (PWRT disabled),
there will be no time-out at all. Figures 13-4, 13-5
and 13-6 depict time-out sequences.
.
Since the time-outs occur from the POR pulse, if MCLR
is kept low long enough, the time-outs will expire. Then,
bringing MCLR
(refer to Figure 13-5). This is useful for testing purposes
or to synchronize more than one MCP19114/5 device
operating in parallel.
13.6.1POWER CONTROL (PCON)
The Power Control (PCON) register (address 8Eh) has
two Status bits to indicate what type of Reset occurred
last.
must be released (if enabled)
bit status.
high will begin execution immediately
REGISTER
FIGURE 13-4:TIME-OUT SEQUENCE ON POWER-UP (DELAYED MCLR): CASE 1
DS20005281A-page 86 2014 Microchip Technology Inc.
Page 87
MCP19114/5
V
DD
MCLR
Internal POR
PWRT Time-out
OST Time-out
Internal Reset
T
PWRT
T
IOSCST
V
DD
MCLR
Internal POR
PWRT Time-out
OST Time-out
Internal Reset
T
PWRT
T
IOSCST
FIGURE 13-5:TIME-OUT SEQUENCE ON POWER-UP (DELAYED MCLR): CASE 2
FIGURE 13-6:TIME-OUT SEQUENCE ON POWER-UP (MCLR
13.7Determining the Cause of a Reset
Upon any Reset, multiple bits in the STATUS and
PCON register are updated to indicate the cause of the
Reset. Tables 13-3 and 13-4 show the Reset
conditions of these registers.
MCLR Reset during normal operation0000h000u uuuu---- --uu
MCLR
Reset during Sleep0000h0001 0uuu---- --uu
WDT Reset0000h0000 uuuu---- --uu
WDT Wake-up from SleepPC + 1uuu0 0uuu---- --uu
Interrupt Wake-up from SleepPC + 1
Legend: u = unchanged, x = unknown, - = unimplemented bit, reads as ‘0’.
Note 1: When the wake-up is due to an interrupt and Global Enable bit (GIE) is set, the return address is pushed
on the stack and PC is loaded with the interrupt vector (0004h) after execution of PC + 1.
2: If a Status bit is not implemented, that bit will be read as ‘0’.
Program
Counter
(1)
STATUS
Register
uuu1 0uuu---- --uu
PCON
Register
DS20005281A-page 88 2014 Microchip Technology Inc.
Page 89
MCP19114/5
13.8Power Control (PCON) Register
The Power Control (PCON) register contains flag bits
to differentiate between a:
• Power-on Reset (POR
• Brown-out Reset (BOR)
The PCON register bits are shown in Register 13-1.
REGISTER 13-1:PCON: POWER CONTROL REGISTER
U-0U-0U-0U-0U-0R/W-0R/W-0U-0
—————PORBOR
bit 7bit 0
Legend:
R = Readable bitW = Writable bitU = Unimplemented bit, read as ‘0’
-n = Value at POR‘1’ = Bit is set‘0’ = Bit is clearedx = Bit is unknown
bit 7-2Unimplemented: Read as '0'
bit 1POR
1 = No Power-on Reset occurred
0 = A Power-on Reset occurred (must be set in software after a Power-on Reset occurs)
bit 0Unimplemented: Read as '0'
)
: Power-on Reset Status bit
TABLE 13-5:SUMMARY OF REGISTERS ASSOCIATED WITH RESETS
Register
NameBit 7Bit 6Bit 5Bit 4Bit 3Bit 2Bit 1Bit 0
PCON
STATUSIPRRP1RP0TO
Legend: — = unimplemented bit, read 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.
DS20005281A-page 90 2014 Microchip Technology Inc.
Page 91
MCP19114/5
14.0INTERRUPTS
The MCP19114/5 have multiple sources of interrupt:
• External Interrupt (INT pin)
• Interrupt-On-Change (IOC) Interrupts
• Timer0 Overflow Interrupt
• Timer1 Overflow Interrupt
• Timer2 Match Interrupt
• ADC Interrupt
• System Input Undervoltage Error
• System Input Overvoltage Error
• SSP
•BCL
• Desaturation Detection
• Gate Drive UVLO
• Capture/Compare 1
• Capture/Compare 2
• Overtemperature
The Interrupt Control (INTCON) register and the
Peripheral Interrupt Request (PIRx) registers record
individual interrupt requests in flag bits. The INTCON
register also has individual and global interrupt enable
bits.
The Global Interrupt Enable bit, GIE, in the INTCON
register, enables (if set) all unmasked interrupts, or
disables (if cleared) all interrupts. Individual interrupts
can be disabled through their corresponding enable
bits in the INTCON register and PIEx registers. GIE is
cleared on Reset.
When an interrupt is serviced, the following actions
occur automatically:
• The GIE is cleared to disable any further interrupt
• The return address is pushed onto the stack
• The PC is loaded with 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 interrupt’s
operation, refer to its peripheral chapter.
14.1Interrupt Latency
For external interrupt events, such as the INT pin or
PORTGPx change interrupt, the interrupt latency will
be three or four instruction cycles. The exact latency
depends upon when the interrupt event occurs (refer to
Figure 14-2). The latency is the same for one- or
two-cycle instructions.
14.2GPA2/INT Interrupt
The external interrupt on the GPA2/INT pin is
edge-triggered, either on the rising edge, if the INTEDG
bit in the OPTION_REG register is set, or the falling
edge, if the INTEDG bit is clear. When a valid edge
appears on the GPA2/INT pin, the INTF bit in the
INTCON register is set. This interrupt can be disabled
by clearing the INTE control bit in the INTCON register.
The INTF bit must be cleared by software in the
Interrupt Service Routine before re-enabling this
interrupt. The GPA2/INT interrupt can wake up the
processor from Sleep, if the INTE bit was set prior to
going into Sleep. Refer to Section 15.0 “Power-Down
Mode (Sleep)” for details on Sleep and Section 15.1
“Wake-up from Sleep” for timing of wake-up from
Sleep through GPA2/INT interrupt.
Note:The ANSEL register must be initialized to
configure an analog channel as a digital
input. Pins configured as analog inputs
will read ‘0’ and cannot generate an
interrupt.
Note 1: Individual interrupt flag bits are set,
regardless of the status of their
corresponding mask bit or the GIE bit.
2: When an instruction that clears the GIE
bit is executed, any interrupts that were
pending for execution in the next cycle
are ignored. The interrupts which were
ignored are still pending to be serviced
when the GIE bit is set again.
Latency is the same whether Inst (PC) is a single-cycle or a two-cycle instruction.
3: CLKOUT is available only in INTOSC and RC Oscillator modes.
4: For minimum width of INT pulse, refer to AC specifications in
Section 5.0 “Digital Electrical Characteristics”.
5: INTF is enabled to be set any time during the Q4-Q1 cycles.
CLKOUT
(3)
(4)
(1)
(5)
(1)
Interrupt Latency
(2)
FIGURE 14-1:INTERRUPT LOGIC
FIGURE 14-2:INT PIN INTERRUPT TIMING
DS20005281A-page 92 2014 Microchip Technology Inc.
Page 93
MCP19114/5
14.3Interrupt Control Registers
14.3.1INTCON REGISTER
The INTCON register is a readable and writable
register, that contains the various enable and flag bits
for the TMR0 register overflow, interrupt-on-change
and external INT pin interrupts.
Note:Interrupt flag bits are set when an interrupt
condition occurs, regardless of the state of
its corresponding enable bit or the Global
Enable bit, GIE, in the INTCON register.
The user’s software should ensure the
appropriate interrupt flag bits are clear
prior to enabling an interrupt.
REGISTER 14-1:INTCON: INTERRUPT CONTROL REGISTER
R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-x
GIEPEIET0IEINTEIOCET0IFINTFIOCF
bit 7bit 0
Legend:
R = Readable bitW = Writable bitU = Unimplemented bit, read as ‘0’
-n = Value at POR‘1’ = Bit is set‘0’ = Bit is clearedx = Bit is unknown
bit 7GIE: Global Interrupt Enable bit
1 = Enables all unmasked interrupts
0 = Disables all interrupts
bit 6PEIE: Peripheral Interrupt Enable bit
1 = Enables all unmasked peripheral interrupts
0 = Disables all peripheral interrupts
bit 5T0IE: TMR0 Overflow Interrupt Enable bit
1 = Enables the TMR0 interrupt
0 = Disables the TMR0 interrupt
bit 4INTE: INT External Interrupt Enable bit
1 = Enables the INT external interrupt
0 = Disables the INT external interrupt
bit 3IOCE: Interrupt-on-Change Enable bit
1 = Enables the interrupt-on-change
0 = Disables the interrupt-on-change
bit 2T0IF: TMR0 Overflow Interrupt Flag bit
1 = TMR0 register has overflowed (must be cleared in software)
0 = TMR0 register did not overflow
bit 1INTF: External Interrupt Flag bit
1 = The external interrupt occurred (must be cleared in software)
0 = The external interrupt did not occur
bit 0IOCF: Interrupt-on-Change Interrupt Flag bit
1 = When at least one of the interrupt-on-change pins changed state
0 = None of the interrupt-on-change pins have changed state
(1)
(2)
Note 1: IOCx registers must also be enabled.
2: T0IF bit is set when TMR0 rolls over. TMR0 is unchanged on Reset and should be initialized before
The PIR1 register contains the Peripheral Interrupt
Flag bits, as shown in Register 14-4.
Note 1: Interrupt flag bits are set when an
interrupt condition occurs, regardless of
the state of its corresponding enable bit
or the Global Enable bit, GIE, in the
INTCON register. The user’s software
should ensure the appropriate interrupt
flag bits are clear prior to enabling an
interrupt.
REGISTER 14-4:PIR1: PERIPHERAL INTERRUPT FLAG REGISTER 1
U-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0
—ADIFBCLIFSSPIFCC2IFCC1IFTMR2IFTMR1IF
bit 7bit 0
Legend:
R = Readable bitW = Writable bitU = Unimplemented bit, read as ‘0’
-n = Value at POR‘1’ = Bit is set‘0’ = Bit is clearedx = Bit is unknown
bit 7Unimplemented: Read as ‘0’
bit 6ADIF: ADC Interrupt Flag bit
1 = ADC conversion complete
0 = ADC conversion has not completed or has not been started
bit 5BCLIF: MSSP Bus Collision Interrupt Flag bit
1 = Interrupt is pending
0 = Interrupt is not pending
bit 4SSPIF: Synchronous Serial Port (MSSP) Interrupt Flag bit
1 = Interrupt is pending
0 = Interrupt is not pending
bit 3CC2IF: Capture2/Compare2 Interrupt Flag bit
1 = Capture or Compare has occurred
0 = Capture or Compare has not occurred
bit 2CC1IF: Capture1/Compare1 Interrupt Flag bit
1 = Capture or Compare has occurred
0 = Capture or Compare has not occurred
bit 1TMR2IF: Timer2 to PR2 Match Interrupt Flag
1 = Timer2 to PR2 match occurred (must be cleared in software)
0 = Timer2 to PR2 match did not occur
bit 0TMR1IF: Timer1 Interrupt Flag
1 = Timer1 rolled over (must be cleared in software)
0 = Timer1 has not rolled over
DS20005281A-page 96 2014 Microchip Technology Inc.
Page 97
MCP19114/5
14.3.1.4PIR2 Register
The PIR2 register contains the Peripheral Interrupt
Flag bits, as shown in Register 14-3.
Note 1: Interrupt flag bits are set when an
interrupt condition occurs, regardless of
the state of its corresponding enable bit
or the Global Enable bit, GIE, in the
INTCON register. The user’s software
should ensure the appropriate interrupt
flag bits are clear prior to enabling an
interrupt.
REGISTER 14-5:PIR2: PERIPHERAL INTERRUPT FLAG REGISTER 2
R/W-0U-0U-0R/W-0R/W-0R/W-0R/W-0R/W-0
CDSIF——OTIFOVIFDRUVIFOVLOIFUVLOIF
bit 7bit 0
Legend:
R = Readable bitW = Writable bitU = Unimplemented bit, read as ‘0’
-n = Value at POR‘1’ = Bit is set‘0’ = Bit is clearedx = Bit is unknown
bit 7CDSIF: DESAT Detect Interrupt Flag bit
1 = Normal Operation (CDSPOL = 0, CDSINTP = 0, CDSINTN = 1)
0 = Desaturation Detection has occurred
bit 6-5Unimplemented: Read as ‘0’
bit 4OTIF: Overtemperature Interrupt Flag bit
1 = Overtemperature event has occurred
0 = Overtemperature event has not occurred
bit 3OVIF: Overvoltage Interrupt Flag bit
1 =V
0 =V
bit 2DRUVIF: Gate Drive Undervoltage Lockout Interrupt Flag bit
1 = Gate Drive Undervoltage Lockout has occurred
0 = Gate Drive Undervoltage Lockout has not occurred
bit 1OVLOIF: V
1 =VIN has exceeded the level defined by OVLO_DAC
0 =V
MOVWFW_TEMP;Copy W to TEMP register
SWAPFSTATUS,W;Swap status to be saved into W
;Swaps are used because they do not affect the status bits
MOVWFSTATUS_TEMP;Save status to bank zero STATUS_TEMP register
:
:(ISR);Insert user code here
:
SWAPFSTATUS_TEMP,W;Swap STATUS_TEMP register into W
;(sets bank to original state)
MOVWFSTATUS;Move W into STATUS register
SWAPFW_TEMP,F;Swap W_TEMP
SWAPFW_TEMP,W;Swap W_TEMP into W
TABLE 14-1:SUMMARY OF REGISTERS ASSOCIATED WITH INTERRUPTS
NameBit 7Bit 6Bit 5Bit 4Bit 3Bit 2Bit 1Bit 0
INTCONGIE PEIET0IEINTEIOCET0IFINTFIOCF93
OPTION_REGRAPUINTEDGT0CST0SEPSAPS2PS1PS076
PIE1—ADIEBCLIESSPIECC2IECC1IETMR2IETMR1IE94
PIE2CDSIE——OTIEOVIEDRUVIEOVLOIEUVLOIE95
PIR1
PIR2CDSIF——OTIFOVIFDRUVIFOVLOIFUVLOIF97
Legend: — = unimplemented locations, read as ‘0’. Shaded cells are not used by Interrupts.
—ADIFBCLIFSSPIF——TMR2IFTMR1IF96
14.4Context Saving During Interrupts
During an interrupt, only the return PC value is saved
on the stack. Typically, users may wish to save key
registers during an interrupt (e.g., W and STATUS
registers). This must be implemented in software.
Temporary holding registers W_TEMP and
STATUS_TEMP should be placed in the last 16 bytes
of GPR (refer to Figure 10-3). These 16 locations are
common to all banks and do not require banking. This
makes context save and restore operations simpler.
The code shown in Example 14-1 can be used to:
• Store the W register
• Store the STATUS register
• Execute the ISR code
• Restore the Status (and Bank Select Bit) register
• Restore the W register
Register
on Page
Note:The MCP19114/5 do not require saving
the PCLATH. However, if computed
GOTOs are used in both the ISR and the
main code, the PCLATH must be saved
and restored in the ISR.
EXAMPLE 14-1: SAVING STATUS AND W REGISTERS IN RAM
DS20005281A-page 98 2014 Microchip Technology Inc.
Page 99
MCP19114/5
15.0POW ER-DOWN MODE (SLEEP)
The Power-Down mode is entered by executing a
SLEEP instruction.
Upon entering Sleep mode, the following conditions
exist:
1. WDT will be cleared but keeps running, if
enabled for operation during Sleep.
2.PD
3.TO bit in the STATUS register is set.
4.CPU clock is disabled.
5. The ADC is inoperable due to the absence of the
6. I/O ports maintain the status they had before
7.Resets other than WDT are not affected by
8.Analog Circuit power (AV
Refer to individual chapters for more details on
peripheral operation during Sleep.
To minimize current consumption, the following
conditions should be considered:
• I/O pins should not be floating.
• External circuitry sinking current from I/O pins.
• Internal circuitry sourcing current from I/O pins.
• Current draw from pins with internal weak
• Modules using Timer1 oscillator.
I/O pins that are high-impedance inputs should be
pulled to V
currents caused by floating inputs.
The SLEEP instruction removes power from the analog
circuitry. AV
Sleep mode and to maintain a shutdown current of
50 µA typical. The 5V LDO (V
2.5V – 3V in Sleep mode. The enable state of the
analog circuitry does not change with the execution of
the SLEEP instruction.
bit in the STATUS register is cleared.
4V LDO power (AVDD).
SLEEP was executed (driving high, low or
high-impedance).
Sleep mode.
) is removed during
Sleep mode.
pull-ups.
or GND externally to avoid switching
DD
is shut down to minimize current draw in
DD
DD
) voltage drops to
DD
15.1Wake-up from Sleep
The device can wake up from Sleep through one of the
following events:
1. External Reset input on MCLR
2.POR Reset
3. Watchdog Timer, if enabled
4. Any external interrupt
5. Interrupts by peripherals capable of running
during Sleep (see individual peripheral for more
information)
The first two events will cause a device reset. The last
three events are considered a continuation of program
execution. To determine whether a device reset or
wake-up event occurred, refer to Section 13.7
“Determining the Cause of a Reset”.
The following peripheral interrupts can wake the device
from Sleep:
1. Interrupt-on-change
2. External Interrupt from INT pin
When the SLEEP instruction is being executed, the next
instruction (PC + 1) is prefetched. For the device to
wake up through an interrupt event, the corresponding
interrupt enable bit must be enabled. Wake-up will
occur regardless of the state of the GIE bit. If the GIE
bit is disabled, the device continues execution at the
instruction after the SLEEP instruction. If the GIE bit is
enabled, the device executes the instruction after the
SLEEP instruction and will then call the Interrupt
Service Routine. In cases where the execution of the
instruction following SLEEP is not desirable, the user
should have an NOP after the SLEEP instruction.
The WDT is cleared when the device wakes up from
Sleep, regardless of the source of wake-up.
Note 1:GIE = 1 assumed. In this case after wake-up, the processor calls the ISR at 0004h. If GIE = 0, execution will continue in-line.
Interrupt Latency
(1)
15.1.1WAKE-UP USING INTERRUPTS
When global interrupts are disabled (GIE cleared) and
any interrupt source has both its interrupt enable bit
and interrupt flag bit set, one of the following will occur:
• If the interrupt occurs before the execution of a
SLEEP instruction
- SLEEP instruction will execute as an NOP
- WDT and WDT prescaler will not be cleared
bit in the STATUS register will not be set
-TO
-PD
bit in the STATUS register will not be
cleared
• If the interrupt occurs during or after the
execution of a SLEEP instruction
- SLEEP instruction will be completely
executed
- Device will immediately wake up from Sleep
- WDT and WDT prescaler will be cleared
-TO
bit in the STATUS register will be set
-PD bit in the STATUS register will be cleared
Even if the flag bits were checked before executing a
SLEEP instruction, it may be possible for flag bits to
become set before the SLEEP instruction completes. To
determine whether a SLEEP instruction executed, test
bit. If the PD bit is set, the SLEEP instruction
the PD
was executed as an NOP.
FIGURE 15-1:WAKE-UP FROM SLEEP THROUGH INTERRUPT
TABLE 15-1:SUMMARY OF REGISTERS ASSOCIATED WITH POWER-DOWN MODE
NameBit 7Bit 6Bit 5Bit 4Bit 3Bit 2Bit 1Bit 0
INTCONGIEPEIET0IEINTEIOCET0IFINTFIOCF93
IOCAIOCA7IOCA6IOCA5
IOCBIOCB7IOCB6IOCB5IOCB4
—IOCA3IOCA2IOCA1IOCA0120
——IOCB1IOCB0 120
PIE1—ADIEBCLIESSPIECC2IECC1IETMR2IETMR1IE94
PIE2CDSIE——OTIEOVIEDRUVIEOVLOIEUVLOIE95
PIR1
—ADIFBCLIFSSPIFCC2IFCC1IFTMR2IFTMR1IF96
PIR2CDSIF——OTIFOVIFDRUVIFOVLOIFUVLOIF97
STATUS
IRPRP1RP0TOPDZDCC 69
Legend: — = unimplemented, read as ‘0’. Shaded cells are not used in Power-down mode.
DS20005281A-page 100 2014 Microchip Technology Inc.
Register on
Page
Loading...
+ hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.