PIC12F752/HV752
8-Pin Flash-Based, 8-Bit CMOS Microcontrollers
High-Performance RISC CPU
Peripheral Features
• Only 35 Instructions to Learn:
- All single-cycle instructions except branches
• Operating Speed:
- DC – 20 MHz clock input
- DC – 200 ns instruction cycle
• 1024 x 14 On-chip Flash Program Memory
• Self Read/Write Program Memory
• 64 x 8 General Purpose Registers (SRAM)
• Interrupt Capability
• 8-Level Deep Hardware Stack
• Direct, Indirect and Relative Addressing modes
• Five I/O Pins and One Input-only Pin
• High Current Source/Sink:
- 50 mA I/O, (2 pins)
- 25 mA I/O, (3 pins)
• Two High-Speed Analog Comparator modules:
- 40 ns response time
- Fixed Voltage Reference (FVR)
- Programmable on-chip voltage reference via
integrated 5-bit DAC
- Internal/external inputs and outputs
(selectable)
- Built-in Hysteresis (software selectable)
• A/D Converter:
- 10-bit resolution
- Four external channels
- Two internal reference voltage channels
• Dual Range Digital-to-Analog Converter (DAC):
- 5-bit resolution
- Full Range or Limited Range output
- 4 mV steps @ 2.0V (Limited Range)
- 65 mV steps @ 2.0V (Full Range)
• Fixed Voltage Reference (FVR), 1.2V reference
• Capture, Compare, PWM (CCP) module:
- 16-bit Capture, max. resolution = 12.5 ns
- Compare, max. resolution = 200 ns
- 10-bit PWM, max. frequency = 20 kHz
• Timer0: 8-Bit Timer/Counter with 8-Bit Prescaler
• Enhanced Timer1:
- 16-bit Timer/Counter with Prescaler
- External Timer1 Gate (count enable)
- Four Selectable Clock sources
• Timer2: 8-Bit Timer/Counter with Prescaler:
- 8-bit Period Register and Postscaler
• Hardware Limit Timer (HLT):
- 8-bit Timer with Prescaler
- 8-bit period register and postscaler
- Asynchronous H/W Reset sources
• Complementary Output Generator (COG):
- Complementary Waveforms from selectable
sources
- Two I/O (50 mA) for direct MOSFET drive
- Rising and/or Falling edge dead-band control
- Phase control, Blanking control
- Auto-shutdown
Microcontroller Features
• Precision Internal Oscillator:
- Factory calibrated to ±1%, typical
- Software selectable frequency:
8 MHz, 4 MHz, 1 MHz or 31 kHz
- Software tunable
• Power-Saving Sleep mode
• Voltage Range (PIC12F752):
- 2.0V to 5.5V
• Shunt Voltage Regulator (PIC12HV752)
- 2.0V to user defined
- 5-volt regulation
- 1 mA to 50 mA shunt range
• Multiplexed Master Clear with Pull-up/Input Pin
• Interrupt-on-Change Pins
• Individually Programmable Weak Pull-ups
• Power-on Reset (POR)
• Power-up Timer (PWRT)
• Brown-out Reset (BOR)
• Watchdog Timer (WDT) with Internal Oscillator for
Reliable Operation
• Industrial and Extended Temperature Range
• High Endurance Flash:
- 100,000 write Flash endurance
- Flash retention: >40 years
• Programmable Code Protection
• In-Circuit Debug (ICD) via Two Pins
• In-Circuit Serial Programming™ (ICSP™) via Two
Pins
eXtreme Low-Power (XLP) Features
• Sleep Current:
- 50 nA @ 2.0V, typical
• Operating Current:
- 11 µA @ 32 kHz, 2.0V, typical
- 260 µA @ 4 MHz, 2.0V, typical
• Watchdog Timer Current:
• VIH
0 = Port pin is < VIL
Note 1:
Writes to any PORTx register are written to the corresponding LATx register. Reads from any PORTx register, return
the value present on that PORTx I/O pins.
REGISTER 5-3:
TRISA: PORTA TRI-STATE REGISTER
U-0
U-0
R/W-1/1
R/W-1/1
R-1/1
R/W-1/1
R/W-1/1
R/W-1/1
—
—
TRISA5
TRISA4
TRISA3(1)
TRISA2
TRISA1
TRISA0
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
U = Unimplemented bit, read as ‘0’
u = Bit is unchanged
x = Bit is unknown
-n/n = Value at POR and BOR/Value at all other Resets
‘1’ = Bit is set
‘0’ = Bit is cleared
bit 7-6
Unimplemented: Read as ‘0’
bit 5-0
TRISA: PORTA Tri-State Control bits(1)
1 = PORTA pin configured as an input (tri-stated)
0 = PORTA pin configured as an output
Note 1:
TRISA3 always reads ‘1’.
REGISTER 5-4:
LATA: PORTA DATA LATCH REGISTER
U-0
U-0
R/W-x/u
R/W-x/u
U-0
R/W-x/u
R/W-x/u
R/W-x/u
—
—
LATA5
LATA4
—
LATA2
LATA1
LATA0
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
U = Unimplemented bit, read as ‘0’
u = Bit is unchanged
x = Bit is unknown
-n/n = Value at POR and BOR/Value at all other Resets
‘1’ = Bit is set
‘0’ = Bit is cleared
bit 7-6
Unimplemented: Read as ‘0’
bit 5-4
LATA: PORTA Output Latch Value bits(1)
bit 3
Unimplemented: Read as ‘0’
bit 2-0
LATA: PORTA Output Latch Value bits(1)
Note 1:
Writes to any PORTx register are written to the corresponding LATx register. Reads from any PORTx register, return
the value present on that PORTx I/O pins.
DS40001576D-page 40
2011-2015 Microchip Technology Inc.
PIC12F752/HV752
5.5
Additional Pin Functions
Every PORTA pin on the PIC12F752 has an
interrupt-on-change option and a weak pull-up option.
The next three sections describe these functions.
5.5.1
ANSELA REGISTER
The ANSELA register (Register 5-8) is used to
configure the Input mode of an I/O pin to analog.
Setting the appropriate ANSELA bit high will cause all
digital reads on the pin to be read as ‘0’ and allow
analog functions on the pin to operate correctly.
The state of the ANSELA bits has no effect on digital
output functions. A pin with TRIS clear and ANSEL set
will still operate as a digital output, but the Input mode
will be analog. This can cause unexpected behavior
when executing read-modify-write instructions on the
affected port.
Note:
The ANSELA bits default to the Analog
mode after Reset. To use any pins as
digital general purpose or peripheral
inputs, the corresponding ANSEL bits
must be initialized to ‘0’ by user software.
REGISTER 5-5:
ANSELA: PORTA ANALOG SELECT REGISTER
U-0
U-0
R/W-1
R/W-1
U-0
R/W-1
R/W-1
R/W-1
—
—
ANSA5
ANSA4
—
ANSA2
ANSA1
ANSA0
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
U = Unimplemented bit, read as ‘0’
-n = Value at POR
‘1’ = Bit is set
‘0’ = Bit is cleared
x = Bit is unknown
bit 7-6
Unimplemented: Read as ‘0’
bit 5-4
ANSA: Analog Select Between Analog or Digital Function on Pin RA bits
1 = Analog input. Pin is assigned as analog input(1).
0 = Digital I/O. Pin is assigned to port or special function.
bit 3
Unimplemented: Read as ‘0’
bit 2-0
ANSA:Analog Select Between Analog or Digital Function on Pin RA bits
1 = Analog input. Pin is assigned as analog input.(1)
0 = Digital I/O. Pin is assigned to port or special function.
Note 1:
Setting a pin to an analog input automatically disables the digital input circuitry, weak pull-ups, and
interrupt-on-change if available. The corresponding TRIS bit must be set to Input mode in order to allow
external control of the voltage on the pin.
2011-2015 Microchip Technology Inc.
DS40001576D-page 41
PIC12F752/HV752
5.5.2
WEAK PULL-UPS
Each of the PORTA pins, except RA3, has an
individually configurable internal weak pull-up. Control
bits WPUx enable or disable each pull-up. Refer to
Register 5-9. Each weak pull-up is automatically turned
off when the port pin is configured as an output. The
REGISTER 5-6:
pull-ups are disabled on a Power-on Reset by the
RAPU bit of the OPTION_REG register). A weak
pull-up is automatically enabled for RA3 when
configured as MCLR and disabled when RA3 is an I/O.
There is no software control of the MCLR pull-up.
WPUA: WEAK PULL-UP PORTA REGISTER (1,2)
U-0
U-0
R/W-1
R/W-1
R/W-1
R/W-1
R/W-1
R/W-1
—
—
WPU5
WPU4
WPU3(3)
WPU2
WPU1
WPU0
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
U = Unimplemented bit, read as ‘0’
-n = Value at POR
‘1’ = Bit is set
‘0’ = Bit is cleared
bit 7-6
Unimplemented: Read as ‘0’
bit 5-0
WPU: Weak Pull-up Control bits
1 = Pull-up enabled
0 = Pull-up disabled
Note 1:
2:
3:
5.5.3
x = Bit is unknown
Global RAPU must be enabled for individual pull-ups to be enabled.
The weak pull-up device is automatically disabled if the pin is in Output mode (TRISA = 0).
The RA3 pull-up is enabled when configured as MCLR in the Configuration Word, otherwise it is disabled
as an input and reads as ‘0’.
SLEW RATE CONTROL
Two of the PORTA pins (RA0 and RA2) are equipped
with high current driver circuitry. The SLRCONA register
provides reduced slew rate control to mitigate possible
EMI radiation from these pins.
REGISTER 5-7:
SLRCONA: SLEW RATE CONTROL REGISTER
U-0
U-0
U-0
U-0
U-0
R/W-0
U-0
R/W-0
—
—
—
—
—
SLRA2
—
SLRA0
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
U = Unimplemented bit, read as ‘0’
-n = Value at POR
‘1’ = Bit is set
‘0’ = Bit is cleared
bit 7-3
Unimplemented: Read as ‘0’
bit 2
SLRA2: Slew Rate Control bit
1 = Pin voltage slews at limited rate
0 = Pin voltage slews at maximum rate
bit 1
Unimplemented: Read as ‘0’
bit 0
SLRA0: Slew Rate Control bit
1 = Pin voltage slews at limited rate
0 = Pin voltage slews at maximum rate
DS40001576D-page 42
x = Bit is unknown
2011-2015 Microchip Technology Inc.
PIC12F752/HV752
5.5.4
INTERRUPT-ON-CHANGE
All pins on all ports can be configured to operate as
Interrupt-on-Change (IOC) pins. An interrupt can be
generated by detecting a signal that has either a rising
edge or a falling edge. Any individual pin or combination
of pins can be configured to generate an interrupt. The
interrupt-on-change module has the following features:
•
•
•
•
5.5.4.5
Operation in Sleep
The interrupt-on-change interrupt will wake the device
from Sleep mode, if the IOCIE bit is set.
If an edge is detected while in Sleep mode, the affected
IOCAF register will be updated prior to the first
instruction executed out of Sleep.
Interrupt-on-Change Enable (Master Switch)
Individual Pin Configuration
Rising and Falling Edge Detection
Individual Pin Interrupt Flags
Figure 14-1 is a block diagram of the IOC module.
5.5.4.1
Enabling the Module
To allow individual pins to generate an interrupt, the
IOCIE bit of the INTCON register must be set. If the
IOCIE bit is disabled, the edge detection on the pin will
still occur, but an interrupt will not be generated.
5.5.4.2
Individual Pin Configuration
For each pin, a rising edge detector and a falling edge
detector are present. To enable a pin to detect a rising
edge, the associated bit of the IOCAP register is set. To
enable a pin to detect a falling edge, the associated bit
of the IOCAN register is set.
A pin can be configured to detect rising and falling
edges simultaneously by setting the associated bits in
both of the IOCAP and IOCAN registers.
5.5.4.3
Interrupt Flags
The bits located in the IOCAF registers are status flags
that correspond to the interrupt-on-change pins of each
port. If an expected edge is detected on an appropriately
enabled pin, then the status flag for that pin will be set,
and an interrupt will be generated if the IOCIE bit is set.
The IOCIF bit of the INTCON register reflects the status
of all IOCAF bits.
5.5.4.4
Clearing Interrupt Flags
The individual status flags (IOCAF register bits) can be
cleared by resetting them to zero. If another edge is
detected during this clearing operation, the associated
status flag will be set at the end of the sequence,
regardless of the value actually being written.
In order to ensure that no detected edge is lost while
clearing flags, only AND operations masking out known
changed bits should be performed. The following
sequence is an example of what should be performed.
EXAMPLE 5-2:
MOVLW
XORWF
ANDWF
CLEARING INTERRUPT
FLAGS
(PORTA EXAMPLE)
0xff
IOCAF, W
IOCAF, F
2011-2015 Microchip Technology Inc.
DS40001576D-page 43
PIC12F752/HV752
FIGURE 5-2:
INTERRUPT-ON-CHANGE BLOCK DIAGRAM
IOCBNx
D
Q4Q1
Q
CK
Edge
Detect
R
RBx
IOCBPx
D
Data Bus =
0 or 1
Q
Write IOCBFx
CK
D
S
Q
To Data Bus
IOCBFx
CK
IOCIE
R
Q2
From all other
IOCBFx individual
Pin Detectors
Q1
Q2
Q3
Q4
Q4Q1
DS40001576D-page 44
Q1
Q1
Q2
Q2
Q3
Q4
Q4Q1
IOC Interrupt
to CPU Core
Q3
Q4
Q4
Q4Q1
Q4Q1
2011-2015 Microchip Technology Inc.
PIC12F752/HV752
REGISTER 5-8:
IOCAP: INTERRUPT-ON-CHANGE POSITIVE EDGE REGISTER
U-0
U-0
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
—
—
IOCAP5
IOCAP4
IOCAP3
IOCAP2
IOCAP1
IOCAP0
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
U = Unimplemented bit, read as ‘0’
u = Bit is unchanged
x = Bit is unknown
-n/n = Value at POR and BOR/Value at all other Resets
‘1’ = Bit is set
‘0’ = Bit is cleared
bit 7-6
Unimplemented: Read as ‘0’
bit 5-0
IOCAP: Interrupt-on-Change Positive Edge Enable bits
1 = Interrupt-on-Change enabled on the pin for a positive going edge. Associated Status bit and interrupt flag will
be set upon detecting an edge.
0 = Interrupt-on-Change disabled for the associated pin.
REGISTER 5-9:
IOCAN: INTERRUPT-ON-CHANGE NEGATIVE EDGE REGISTER
U-0
U-0
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
—
—
IOCAN5
IOCAN4
IOCAN3
IOCAN2
IOCAN1
IOCAN0
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
U = Unimplemented bit, read as ‘0’
u = Bit is unchanged
x = Bit is unknown
-n/n = Value at POR and BOR/Value at all other Resets
‘1’ = Bit is set
‘0’ = Bit is cleared
bit 7-6
Unimplemented: Read as ‘0’
bit 5-0
IOCAN: Interrupt-on-Change Negative Edge Enable bits
1 = Interrupt-on-Change enabled on the pin for a negative going edge. Associated Status bit and interrupt flag will
be set upon detecting an edge.
0 = Interrupt-on-Change disabled for the associated pin.
REGISTER 5-10:
IOCAF: INTERRUPT-ON-CHANGE FLAG REGISTER
U-0
U-0
R/W/HS-0/0
R/W/HS-0/0
R/W/HS-0/0
R/W/HS-0/0
R/W/HS-0/0
R/W/HS-0/0
—
—
IOCAF5
IOCAF4
IOCAF3
IOCAF2
IOCAF1
IOCAF0
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
U = Unimplemented bit, read as ‘0’
-n/n = Value at POR and BOR/Value at all other Resets
‘1’ = Bit is set
‘0’ = Bit is cleared
HS - Bit is set in hardware
bit 7-6
Unimplemented: Read as ‘0’
bit 5-0
IOCAF: Interrupt-on-Change Flag bits
1 = An enabled change was detected on the associated pin.
Set when IOCAPx = 1 and a rising edge was detected on RBx, or when IOCANx = 1 and a falling edge was
detected on RAx.
0 = No change was detected, or the user cleared the detected change.
2011-2015 Microchip Technology Inc.
DS40001576D-page 45
PIC12F752/HV752
TABLE 5-2:
Name
SUMMARY OF REGISTERS ASSOCIATED WITH PORTA
Bit 7
Bit 6
ADCON0
ADFM
VCFG
ADCON1
—
ANSELA
—
APFCON
Bit 5
Bit 4
Bit 2
CHS
ADCS
—
Bit 3
ANSA5
ANSA4
Bit 1
Bit 0
Register
on Page
GO/DONE
ADON
94
—
—
—
—
94
—
ANSA2
ANSA1
ANSA0
41
—
—
—
T1GSEL
—
COG1FSEL
COG1O1SEL
COG1O0SEL
38
CM1CON0
C1ON
C1OUT
C1OE
C1POL
C1ZLF
C1SP
C1HYS
C1SYNC
113
CM2CON0
C2ON
C2OUT
C2OE
C2POL
C2ZLF
C2SP
C2HYS
C2SYNC
113
CM1CON1
C1INTP
C1INTN
C1PCH
—
—
—
C1NCH0
114
CM2CON1
C2NTP
C2INTN
C2PCH
—
—
—
C2NCH0
114
DACCON0
DACEN
DACRNG
DACOE
—
—
DACPSS0
—
—
105
IOCAF
—
—
IOCAF5
IOCAF4
IOCAF3
IOCAF2
IOCAF1
IOCAF0
45
IOCAN
—
—
IOCAN5
IOCAN4
IOCAN3
IOCAN2
IOCAN1
IOCAN0
45
IOCAP
—
—
IOCAP5
IOCAP4
IOCAP3
IOCAP2
IOCAP1
IOCAP0
45
LATA
—
—
LATA5
LATA4
—
LATA2
LATA1
LATA0
RAPU
INTEDG
T0CS
T0SE
PSA
PORTA
—
—
RA5
RA4
RA3
RA2
RA1
RA0
40
SLRCONA
—
—
—
—
—
SLRA2
—
SLRA0
42
TRISA
—
—
TRISA5
TRISA4
TRISA3(1)
TRISA2
TRISA1
TRISA0
40
OPTION_REG
Legend:
Note 1:
PS
40
14
x = unknown, u = unchanged, – = unimplemented locations read as ‘0’. Shaded cells are not used by PORTA.
TRISA3 always reads ‘1’.
DS40001576D-page 46
2011-2015 Microchip Technology Inc.
PIC12F752/HV752
6.0
TIMER0 MODULE
6.1
Timer0 Operation
The Timer0 module is an 8-bit timer/counter with the
following features:
When used as a timer, the Timer0 module can be used
as either an 8-bit timer or an 8-bit counter.
•
•
•
•
•
6.1.1
8-Bit Timer/Counter Register (TMR0)
8-Bit Prescaler (shared with Watchdog Timer)
Programmable Internal or External Clock Source
Programmable External Clock Edge Selection
Interrupt-on-Overflow
8-BIT TIMER MODE
When used as a timer, the Timer0 module will
increment every instruction cycle (without prescaler).
Timer mode is selected by clearing the T0CS bit of the
OPTION register to ‘0’.
Figure 6-1 is a block diagram of the Timer0 module.
When TMR0 is written, the increment is inhibited for
two instruction cycles immediately following the write.
Note:
6.1.2
The value written to the TMR0 register
can be adjusted, in order to account for
the two instruction-cycle delay when
TMR0 is written.
8-BIT COUNTER MODE
When used as a counter, the Timer0 module will
increment on every rising or falling edge of the T0CKI
pin. The incrementing edge is determined by the T0SE
bit of the OPTION_REG register. Counter mode is
selected by setting the T0CS bit of the OPTION register
to ‘1’.
FIGURE 6-1:
TIMER0 WITH SHARED PRESCALE BLOCK DIAGRAM
FOSC/4
Data Bus
0
8
1
1
Sync
2 TCY
Shared Prescale
T0CKI
pin
TMR0
0
0
T0CS
T0SE
Set Flag bit T0IF
on Overflow
PSA
8-bit
Prescaler
1
PSA
8
PS
Watchdog
Timer
LFINTOSC
WDT
Time-out
2
(Figure 4-1)
1
0
PSA
PSA
WDTE
Note
1:
2:
T0SE, T0CS, PSA, PS are bits in the OPTION_REG register.
WDTE bit is in the Configuration Word register.
2011-2015 Microchip Technology Inc.
DS40001576D-page 47
PIC12F752/HV752
6.1.3
SOFTWARE PROGRAMMABLE
PRESCALER
A single software programmable prescaler is available
for use with either Timer0 or the Watchdog Timer
(WDT), but not both simultaneously. The prescaler
assignment is controlled by the PSA bit of the OPTION
register. To assign the prescaler to Timer0, the PSA bit
must be cleared to a ‘0’.
There are eight prescaler options for the Timer0
module ranging from 1:2 to 1:256. The prescale values
are selectable via the PS bits of the OPTION
register. In order to have a 1:1 prescaler value for the
Timer0 module, the prescaler must be assigned to the
WDT module.
The prescaler is not readable or writable. When
assigned to the Timer0 module, all instructions writing to
the TMR0 register will clear the prescaler.
When the prescaler is assigned to WDT (PSA = 1) a
CLRWDT instruction will clear the prescaler along with
the WDT.
6.1.3.1
Switching Prescaler Between
Timer0 and WDT Modules
As a result of having the prescaler assigned to either
Timer0 or the WDT, it is possible to generate an
unintended device Reset when switching prescaler
values. When changing the prescaler assignment from
Timer0 to the WDT module, the instruction sequence
shown in Example 6-1, must be executed.
EXAMPLE 6-1:
BANKSEL TMR0
CLRWDT
CLRF
TMR0
CHANGING PRESCALER
(TIMER0 WDT)
;
;Clear WDT
;Clear TMR0 and
;prescaler
BANKSEL OPTION_REG
;
BSF
OPTION_REG,PSA ;Select WDT
CLRWDT
;
;
MOVLW
b’11111000’
;Mask prescaler
ANDWF
OPTION_REG,W
;bits
IORLW
b’00000101’
;Set WDT prescaler
MOVWF
OPTION_REG
;to 1:32
DS40001576D-page 48
When changing the prescaler assignment from the
WDT to the Timer0 module, the following instruction
sequence must be executed (see Example 6-2).
EXAMPLE 6-2:
CHANGING PRESCALER
(WDT TIMER0)
CLRWDT
;Clear WDT and
;prescaler
BANKSEL OPTION_REG
;
MOVLW
b’11110000’ ;Mask TMR0 select and
ANDWF
OPTION_REG,W ;prescaler bits
IORLW
b’00000011’ ;Set prescale to 1:16
MOVWF
OPTION_REG
;
6.1.4
TIMER0 INTERRUPT
Timer0 will generate an interrupt when the TMR0
register overflows from FFh to 00h. The T0IF interrupt
flag bit of the INTCON register is set every time the
TMR0 register overflows, regardless of whether or not
the Timer0 interrupt is enabled. The T0IF bit must be
cleared in software. The Timer0 interrupt enable is the
T0IE bit of the INTCON register.
Note:
6.1.5
The Timer0 interrupt cannot wake the
processor from Sleep, since the timer is
frozen during Sleep.
USING TIMER0 WITH AN
EXTERNAL CLOCK
When Timer0 is in Counter mode, the synchronization
of the T0CKI input and the Timer0 register is
accomplished by sampling the prescaler output on the
Q2 and Q4 cycles of the internal phase clocks.
Therefore, the high and low periods of the external
clock source must meet the timing requirements as
shown in Section 20.0 “Electrical Specifications”.
2011-2015 Microchip Technology Inc.
PIC12F752/HV752
6.2
Option and Timer0 Control Register
REGISTER 6-1:
OPTION_REG: OPTION REGISTER
R/W-1
R/W-1
R/W-1
R/W-1
R/W-1
RAPU
INTEDG
T0CS
T0SE
PSA
R/W-1
R/W-1
R/W-1
PS
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
U = Unimplemented bit, read as ‘0’
-n = Value at POR
‘1’ = Bit is set
‘0’ = Bit is cleared
x = Bit is unknown
bit 7
RAPU: PORTA Pull-up Enable bit
1 = PORTA pull-ups are disabled
0 = PORTA pull-ups are enabled by individual PORT latch values in WPU register
bit 6
INTEDG: Interrupt Edge Select bit
1 = Interrupt on rising edge of INT pin
0 = Interrupt on falling edge of INT pin
bit 5
T0CS: TMR0 Clock Source Select bit
1 = Transition on T0CKI pin
0 = Internal instruction cycle clock (FOSC/4)
bit 4
T0SE: TMR0 Source Edge Select bit
1 = Increment on high-to-low transition on T0CKI pin
0 = Increment on low-to-high transition on T0CKI pin
bit 3
PSA: Prescaler Assignment bit
1 = Prescaler is assigned to the WDT
0 = Prescaler is assigned to the Timer0 module
bit 2-0
PS: Prescaler Rate Select bits
Bit Value TMR0 Rate WDT Rate
000
001
010
011
100
101
110
111
TABLE 6-1:
Name
OPTION_REG
Legend:
Note 1:
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
T0IF
INTF
IOCIF
Holding Register for the 8-bit Timer0 Register
INTCON
TRISA
1:1
1:2
1:4
1:8
1 : 16
1 : 32
1 : 64
1 : 128
SUMMARY OF REGISTERS ASSOCIATED WITH TIMER0
Bit 7
TMR0
1:2
1:4
1:8
1 : 16
1 : 32
1 : 64
1 : 128
1 : 256
Register on
Page
47*
GIE
PEIE
T0IE
INTE
IOCIE
RAPU
INTEDG
T0CS
T0SE
PSA
—
—
TRISA5
TRISA4
TRISA3(1)
PS
TRISA2
TRISA1
15
14
TRISA0
40
— Unimplemented locations, read as ‘0’, u = unchanged, x = unknown. Shaded cells are not used by the Timer0
module.
* Page provides register information.
TRISA3 always reads ‘1’.
2011-2015 Microchip Technology Inc.
DS40001576D-page 49
PIC12F752/HV752
7.0
TIMER1 MODULE WITH GATE
CONTROL
• Wake-up on Overflow (External Clock,
Asynchronous mode only)
• Time Base for the Capture/Compare Function
• Special Event Trigger (with CCP)
• Selectable Gate Source Polarity
• Gate Toggle mode
• Gate Single-Pulse mode
• Gate Value Status
• Gate Event Interrupt
The Timer1 module is a 16-bit timer/counter with the
following features:
• 16-Bit Timer/Counter Register Pair
(TMR1H:TMR1L)
• Selectable Internal or External Clock Sources
• 2-Bit Prescaler
• Synchronous or Asynchronous Operation
• Multiple Timer1 Gate (Count Enable) Sources
• Interrupt-on-Overflow
FIGURE 7-1:
Figure 7-1 is a block diagram of the Timer1 module.
TIMER1 BLOCK DIAGRAM
T1GSS
T1GSPM
00
T1G
From Timer0
Overflow
01
SYNCC1OUT
10
0
T1G_IN
T1GVAL
0
SYNCC2OUT
D
Q
CK
R
Q
Single Pulse
Acq. Control
1
1
Q1
11
Data Bus
Q
RD
T1GCON
EN
Interrupt
T1GGO/DONE
det
T1GPOL
TMR1ON
T1GTM
TMR1GIF
TMR1GE
TMR1ON
TMR1(2)
Set flag bit
TMR1IF on
Overflow
D
TMR1H
CCP Special Event Trigger
EN
T1CLK
TMR1L
R
Q
0
TMR1CS1
T1SYNC
Synchronized
clock input
D
1
TMR1CS
Temperature Sense
Oscillator
11
(1)
Synchronize(3)
Prescaler
1, 2, 4, 8
det
10
T1CKI
2
T1CKPS
FOSC
Internal
Clock
01
FOSC/4
Internal
Clock
00
FOSC/2
Internal
Clock
Sleep input
Note 1: ST buffer is high speed type when using T1CKI.
2: Timer1 register increments on rising edge.
3: Synchronize does not operate while in Sleep.
DS40001576D-page 50
2011-2015 Microchip Technology Inc.
PIC12F752/HV752
7.1
Timer1 Operation
7.2
Clock Source Selection
The Timer1 module is a 16-bit incrementing counter
which is accessed through the TMR1H:TMR1L register
pair. Writes to TMR1H or TMR1L directly update the
counter.
The TMR1CS bits of the T1CON register are used
to select the clock source for Timer1. Table 7-2 displays
the clock source selections.
When used with an internal clock source, the module is
a timer and increments on every instruction cycle.
When used with an external clock source, the module
can be used as either a timer or counter and
increments on every selected edge of the external
source.
TABLE 7-2:
Timer1 is enabled by configuring the TMR1ON and
TMR1GE bits in the T1CON and T1GCON registers,
respectively. Table 7-1 displays the Timer1 enable
selections.
TABLE 7-1:
TIMER1 ENABLE
SELECTIONS
TMR1ON
TMR1GE
0
0
Timer1
Operation
Off
0
1
Off
1
0
Always On
1
1
Count Enabled
TMR1CS
CLOCK SOURCE
SELECTIONS
Clock Source
11
Temperature Sense Oscillator
10
External Clocking on T1CKI Pin
01
System Clock (FOSC)
00
Instruction Clock (FOSC/4)
7.2.1
INTERNAL CLOCK SOURCE
When the internal clock source is selected, the
TMR1H:TMR1L register pair will increment on multiples
of FOSC or FOSC/4 as determined by the Timer1
prescaler.
7.2.2
EXTERNAL CLOCK SOURCE
When the external clock source is selected, the Timer1
module may work as a timer or a counter. When enabled
to count, Timer1 is incremented on the rising edge of the
external clock input T1CKI.
Note:
In Counter mode, a falling edge must be
registered by the counter prior to the first
incrementing rising edge (see Figure 7-2)
after any one or more of the following
conditions:
• Timer1 enabled after POR Reset
• Write to TMR1H or TMR1L
• Timer1 is disabled
• Timer1 is disabled (TMR1ON = 0)
when T1CKI is high; then Timer1 is
enabled (TMR1ON=1) when T1CKI is
low.
7.2.3
TEMPERATURE SENSE
OSCILLATOR
When the Temperature Sense Oscillator source is
selected, the TMR1H:TMR1L register pair will increment
on multiples of the Temperature Sense Oscillator as
determined by the Timer1 prescaler. The Temperature
Sense Oscillator operates at 16 kHz typical.
2011-2015 Microchip Technology Inc.
DS40001576D-page 51
PIC12F752/HV752
7.3
Timer1 Prescaler
7.5
Timer1 Gate
Timer1 has four prescaler options allowing 1, 2, 4 or 8
divisions of the clock input. The T1CKPS bits of the
T1CON register control the prescale counter. The
prescale counter is not directly readable or writable;
however, the prescaler counter is cleared upon a write to
TMR1H or TMR1L.
Timer1 can be configured to count freely or the count
can be enabled and disabled using Timer1 gate
circuitry. This is also referred to as Timer1 gate count
enable.
7.4
7.5.1
Timer1 Operation in
Asynchronous Counter Mode
If control bit T1SYNC of the T1CON register is set, the
external clock input is not synchronized. The timer
increments asynchronously to the internal phase
clocks. If external clock source is selected, then the
timer will continue to run during Sleep and can
generate an interrupt on overflow, which will wake-up
the processor. However, special precautions in
software are needed to read/write the timer (see
Section 7.4.1 “Reading and Writing Timer1 in
Asynchronous Counter Mode”).
Note:
7.4.1
When switching from synchronous to
asynchronous operation, it is possible to
skip an increment. When switching from
asynchronous to synchronous operation,
it is possible to produce an additional
increment.
Timer1 gate can also be driven by multiple selectable
sources.
TIMER1 GATE COUNT ENABLE
The Timer1 gate is enabled by setting the TMR1GE bit
of the T1GCON register. The polarity of the Timer1 gate
is configured using the T1GPOL bit of the T1GCON
register.
When Timer1 Gate (T1G) input is active, Timer1 will
increment on the rising edge of the Timer1 clock
source. When Timer1 gate input is inactive, no
incrementing will occur and Timer1 will hold the current
count. See Figure 7-3 for timing details.
TABLE 7-3:
TIMER1 GATE ENABLE
SELECTIONS
T1CLK
T1GPOL
T1G
Timer1 Operation
0
0
Counts
0
1
Holds Count
1
0
Holds Count
1
1
Counts
READING AND WRITING TIMER1 IN
ASYNCHRONOUS COUNTER
MODE
Reading TMR1H or TMR1L while the timer is running
from an external asynchronous clock will ensure a valid
read, which is taken care of in hardware. However, the
user should keep in mind that reading the 16-bit timer
in two 8-bit values poses certain problems, since the
timer may overflow between the reads.
For writes, it is recommended that the user simply stop
the timer and write the desired values. A write
contention may occur by writing to the timer registers,
while the register is incrementing. This may produce an
unpredictable value in the TMR1H:TMR1L register pair.
DS40001576D-page 52
2011-2015 Microchip Technology Inc.
PIC12F752/HV752
7.5.2
TIMER1 GATE SOURCE
SELECTION
The Timer1 gate source can be selected from one of
four different sources. Source selection is controlled by
the T1GSS bits of the T1GCON register. The polarity
for each available source is also selectable. Polarity
selection is controlled by the T1GPOL bit of the
T1GCON register.
TABLE 7-4:
T1GSS
TIMER1 GATE SOURCES
Timer1 Gate Source
11
SYNCC2OUT
10
SYNCC1OUT
01
Overflow of Timer0
(TMR0 increments from FFh to 00h)
00
Timer1 Gate Pin
7.5.2.1
T1G Pin Gate Operation
The T1G pin is one source for Timer1 gate control. It
can be used to supply an external source to the Timer1
gate circuitry.
7.5.2.2
Timer0 Overflow Gate Operation
When Timer0 increments from FFh to 00h, a
low-to-high pulse will automatically be generated and
internally supplied to the Timer1 gate circuitry.
7.5.2.3
C1OUT/C2OUT Gate Operation
The outputs from the Comparator C1 and C2 modules
can be used as gate sources for the Timer1 module.
7.5.3
TIMER1 GATE TOGGLE MODE
When Timer1 Gate Toggle mode is enabled, it is
possible to measure the full-cycle length of a Timer1
gate signal, as opposed to the duration of a single level
pulse.
The Timer1 gate source is routed through a flip-flop that
changes state on every incrementing edge of the
signal. See Figure 7-4 for timing details.
7.5.4
TIMER1 GATE SINGLE-PULSE
MODE
When Timer1 Gate Single-Pulse mode is enabled, it is
possible to capture a single pulse gate event. Timer1
Gate Single-Pulse mode is first enabled by setting the
T1GSPM bit in the T1GCON register. Next, the
T1GGO/DONE bit in the T1GCON register must be set.
The Timer1 will be fully enabled on the next
incrementing edge. On the next trailing edge of the
pulse, the T1GGO/DONE bit will automatically be
cleared. No other gate events will be allowed to
increment Timer1 until the T1GGO/DONE bit is once
again set in software.
Clearing the T1GSPM bit of the T1GCON register will
also clear the T1GGO/DONE bit. See Figure 7-5 for
timing details.
Enabling the Toggle mode and the Single-Pulse mode
simultaneously will permit both sections to work
together. This allows the cycle times on the Timer1 gate
source to be measured. See Figure 7-6 for timing
details.
7.5.5
TIMER1 GATE VALUE STATUS
When Timer1 gate value status is utilized, it is possible
to read the most current level of the gate control value.
The value is stored in the T1GVAL bit in the T1GCON
register. The T1GVAL bit is valid even when the Timer1
gate is not enabled (TMR1GE bit is cleared).
7.5.6
TIMER1 GATE EVENT INTERRUPT
When Timer1 gate event interrupt is enabled, it is
possible to generate an interrupt upon the completion
of a gate event. When the falling edge of T1GVAL
occurs, the TMR1GIF flag bit in the PIR1 register will be
set. If the TMR1GIE bit in the PIE1 register is set, then
an interrupt will be recognized.
The TMR1GIF flag bit operates even when the Timer1
gate is not enabled (TMR1GE bit is cleared).
Timer1 Gate Toggle mode is enabled by setting the
T1GTM bit of the T1GCON register. When the T1GTM
bit is cleared, the flip-flop is cleared and held clear. This
is necessary in order to control which edge is
measured.
Note:
Enabling Toggle mode at the same time
as changing the gate polarity may result in
indeterminate operation.
2011-2015 Microchip Technology Inc.
DS40001576D-page 53
PIC12F752/HV752
7.6
Timer1 Interrupt
The Timer1 register pair (TMR1H:TMR1L) increments
to FFFFh and rolls over to 0000h. When Timer1 rolls
over, the Timer1 interrupt flag bit of the PIR1 register is
set. To enable the Interrupt-on-Rollover, you must set
these bits:
•
•
•
•
TMR1ON bit of the T1CON register
TMR1IE bit of the PIE1 register
PEIE bit of the INTCON register
GIE bit of the INTCON register
The interrupt is cleared by clearing the TMR1IF bit in
the Interrupt Service Routine.
The TMR1H:TMR1L register pair and the
TMR1IF bit should be cleared before
enabling interrupts.
Note:
7.7
Timer1 Operation During Sleep
Timer1 can only operate during Sleep when setup in
Asynchronous Counter mode. In this mode, the clock
source can be used to increment the counter. To set up
the timer to wake the device:
•
•
•
•
•
TMR1ON bit of the T1CON register must be set
TMR1IE bit of the PIE1 register must be set
PEIE bit of the INTCON register must be set
T1SYNC bit of the T1CON register must be set
TMR1CS bits of the T1CON register must be
configured
• TMR1GE bit of the T1GCON register must be
configured
The device will wake-up on an overflow and execute
the next instructions. If the GIE bit of the INTCON
register is set, the device will call the Interrupt Service
Routine (0004h).
FIGURE 7-2:
7.8
CCP Capture/Compare Time Base
The CCP module uses the TMR1H:TMR1L register
pair as the time base when operating in Capture or
Compare mode.
In Capture mode, the value in the TMR1H:TMR1L
register pair is copied into the CCPR1H:CCPR1L
register pair on a configured event.
In Compare mode, an event is triggered when the value
CCPR1H:CCPR1L register pair matches the value in
the TMR1H:TMR1L register pair. This event can be a
Special Event Trigger.
For more information, see Section 10.0 “Capture/
Compare/PWM Modules”.
7.9
CCP Special Event Trigger
When the CCP is configured to trigger a special event,
the trigger will clear the TMR1H:TMR1L register pair.
This special event does not cause a Timer1 interrupt.
The CCP module may still be configured to generate a
CCP interrupt.
In this mode of operation, the CCPR1H:CCPR1L
register pair becomes the period register for Timer1.
Timer1 should be synchronized to the FOSC/4 to utilize
the Special Event Trigger. Asynchronous operation of
Timer1 can cause a Special Event Trigger to be
missed.
In the event that a write to TMR1H or TMR1L coincides
with a Special Event Trigger from the CCP, the write will
take precedence.
For more information, see Section 12.2.5 “Special
Event Trigger”.
TIMER1 INCREMENTING EDGE
T1CKI
T1CKI
TMR1 enabled
Note 1:
2:
Arrows indicate counter increments.
In Counter mode, a falling edge must be registered by the counter prior to the first incrementing rising edge of the clock.
DS40001576D-page 54
2011-2015 Microchip Technology Inc.
PIC12F752/HV752
FIGURE 7-3:
TIMER1 GATE COUNT ENABLE MODE
TMR1GE
T1GPOL
T1G_IN
T1CKI
T1GVAL
TIMER1
N
FIGURE 7-4:
N+1
N+2
N+3
N+4
TIMER1 GATE TOGGLE MODE
TMR1GE
T1GPOL
T1GTM
T1G_IN
T1CKI
T1GVAL
TIMER1
N
2011-2015 Microchip Technology Inc.
N+1 N+2 N+3
N+4
N+5 N+6 N+7
N+8
DS40001576D-page 55
PIC12F752/HV752
FIGURE 7-5:
TIMER1 GATE SINGLE-PULSE MODE
TMR1GE
T1GPOL
T1GSPM
T1GGO/
Cleared by hardware on
falling edge of T1GVAL
Set by software
DONE
Counting enabled on
rising edge of T1G
T1G_IN
T1CKI
T1GVAL
TIMER1
TMR1GIF
DS40001576D-page 56
N
Cleared by software
N+1
N+2
Set by hardware on
falling edge of T1GVAL
Cleared by
software
2011-2015 Microchip Technology Inc.
PIC12F752/HV752
FIGURE 7-6:
TIMER1 GATE SINGLE-PULSE AND TOGGLE COMBINED MODE
TMR1GE
T1GPOL
T1GSPM
T1GTM
T1GGO/
Cleared by hardware on
falling edge of T1GVAL
Set by software
DONE
Counting enabled on
rising edge of T1G
T1G_IN
T1CKI
T1GVAL
TIMER1
TMR1GIF
N
Cleared by software
2011-2015 Microchip Technology Inc.
N+1
N+2
N+3
Set by hardware on
falling edge of T1GVAL
N+4
Cleared by
software
DS40001576D-page 57
PIC12F752/HV752
7.10
Timer1 Control Registers
REGISTER 7-1:
R/W-0
T1CON: TIMER1 CONTROL REGISTER
R/W-0
TMR1CS
R/W-0
R/W-0
T1CKPS
R/W-0
R/W-0
U-0
R/W-0
Reserved
T1SYNC
—
TMR1ON
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
U = Unimplemented bit, read as ‘0’
-n = Value at POR
‘1’ = Bit is set
‘0’ = Bit is cleared
x = Bit is unknown
bit 7-6
TMR1CS: Timer1 Clock Source Select bits
11 = Temperature Sense Oscillator
10 = External clock from T1CKI pin (on the rising edge)
01 = Timer1 clock source is system clock (FOSC)
00 = Timer1 clock source is instruction clock (FOSC/4)
bit 5-4
T1CKPS: Timer1 Input Clock Prescale Select bits
11 = 1:8 Prescale value
10 = 1:4 Prescale value
01 = 1:2 Prescale value
00 = 1:1 Prescale value
bit 3
Reserved: Do not use.
bit 2
T1SYNC: Timer1 External Clock Input Synchronization Control bit
TMR1CS = 1X
1 = Do not synchronize external clock input
0 = Synchronize external clock input with system clock (FOSC)
TMR1CS = 0X
This bit is ignored. Timer1 uses the internal clock when TMR1CS = 1X.
bit 1
Unimplemented: Read as ‘0’
bit 0
TMR1ON: Timer1 On bit
1 = Enables Timer1
0 = Stops Timer1
Clears Timer1 gate flip-flop
DS40001576D-page 58
2011-2015 Microchip Technology Inc.
PIC12F752/HV752
REGISTER 7-2:
T1GCON: TIMER1 GATE CONTROL REGISTER
R/W-0
R/W-0
R/W-0
R/W-0
R/W-0
R-x
TMR1GE
T1GPOL
T1GTM
T1GSPM
T1GGO/
DONE
T1GVAL
R/W-0
R/W-0
T1GSS
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
U = Unimplemented bit, read as ‘0’
-n = Value at POR
‘1’ = Bit is set
‘0’ = Bit is cleared
x = Bit is unknown
bit 7
TMR1GE: Timer1 Gate Enable bit
If TMR1ON = 0:
This bit is ignored
If TMR1ON = 1:
1 = Timer1 counting is controlled by the Timer1 gate function
0 = Timer1 counts regardless of Timer1 gate function
bit 6
T1GPOL: Timer1 Gate Polarity bit
1 = Timer1 gate is active-high (Timer1 counts when gate is high)
0 = Timer1 gate is active-low (Timer1 counts when gate is low)
bit 5
T1GTM: Timer1 Gate Toggle mode bit
1 = Timer1 Gate Toggle mode is enabled.
0 = Timer1 Gate Toggle mode is disabled and toggle flip-flop is cleared
Timer1 gate flip-flop toggles on every rising edge.
bit 4
T1GSPM: Timer1 Gate Single Pulse mode bit
1 = Timer1 Gate Single-Pulse mode is enabled and is controlling Timer1 gate
0 = Timer1 Gate Single-Pulse mode is disabled
bit 3
T1GGO/DONE: Timer1 Gate Single-Pulse Acquisition Status bit
1 = Timer1 gate single-pulse acquisition is ready, waiting for an edge
0 = Timer1 gate single-pulse acquisition has completed or has not been started
This bit is automatically cleared when T1GSPM is cleared.
bit 2
T1GVAL: Timer1 Gate Current State bit
Indicates the current state of the Timer1 gate that could be provided to TMR1H:TMR1L.
Unaffected by Timer1 Gate Enable (TMR1GE).
bit 1-0
T1GSS: Timer1 Gate Source Select bits
11 = SYNCC2OUT
10 = SYNCC1OUT
01 = Timer0 overflow output
00 = Timer1 gate pin
2011-2015 Microchip Technology Inc.
DS40001576D-page 59
PIC12F752/HV752
TABLE 7-5:
SUMMARY OF REGISTERS ASSOCIATED WITH TIMER1
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Register
on Page
ANSELA
—
—
ANSA5
ANSA4
—
ANSA2
ANSA1
ANSA0
41
APFCON
—
—
—
T1GSEL
—
COG1SEL
CCP1CON
—
—
GIE
PEIE
T0IE
INTE
IOCIE
T0IF
INTF
IOCIF
15
PIE1
TMR1GIE
ADIE
—
—
—
HLTMR1IE
TMR2IE
TMR1IE
16
PIR1
TMR1GIF
ADIF
—
—
—
HLTMR1IF
TMR2IF
TMR1IF
18
—
—
RA5
RA4
RA3
RA2
RA1
RA0
40
Name
INTCON
PORTA
DC1B
TMR1H
Holding Register for the Most Significant Byte of the 16-bit TMR1 Register
TMR1L
Holding Register for the Least Significant Byte of the 16-bit TMR1 Register
TRISA
—
T1CON
TMR1CS
T1GCON
Legend:
TMR1GE
—
T1GPOL
TRISA5
TRISA4
T1CKPS
T1GTM
T1GSPM
COG1O1SEL COG1O0SEL
38
CCP1M
73
50*
50*
TRISA3
TRISA2
TRISA1
TRISA0
40
Reserved
T1SYNC
—
TMR1ON
58
T1GGO/
DONE
T1GVAL
T1GSS
59
x = unknown, u = unchanged, - = unimplemented, read as ‘0’. Shaded cells are not used by the Timer1 module.
* Page provides register information.
DS40001576D-page 60
2011-2015 Microchip Technology Inc.
PIC12F752/HV752
8.0
TIMER2 MODULE
The Timer2 module is an 8-bit timer with the following
features:
•
•
•
•
•
8-Bit Timer Register (TMR2)
8-Bit Period Register (PR2)
Interrupt on TMR2 Match with PR2
Software Programmable Prescaler (1:1, 1:4, 1:16)
Software Programmable Postscaler (1:1 to 1:16)
See Figure 8-1 for a block diagram of Timer2.
8.1
Timer2 Operation
The clock input to the Timer2 module is the system
instruction clock (FOSC/4). The clock is fed into the
Timer2 prescaler, which has prescale options of 1:1,
1:4 or 1:16. The output of the prescaler is then used to
increment the TMR2 register.
The values of TMR2 and PR2 are constantly compared
to determine when they match. TMR2 will increment
from 00h until it matches the value in PR2. When a
match occurs, two things happen:
The match output of the Timer2/PR2 comparator is
then fed into the Timer2 postscaler. The postscaler has
postscale options of 1:1 to 1:16 inclusive. The output of
the Timer2 postscaler is used to set the TMR2IF
interrupt flag bit in the PIR1 register.
The TMR2 and PR2 registers are both fully readable
and writable. On any Reset, the TMR2 register is set to
00h and the PR2 register is set to FFh.
Timer2 is turned on by setting the TMR2ON bit in the
T2CON register to a ‘1’. Timer2 is turned off by clearing
the TMR2ON bit to a ‘0’.
The Timer2 prescaler is controlled by the T2CKPS bits
in the T2CON register. The Timer2 postscaler is
controlled by the TOUTPS bits in the T2CON register.
The prescaler and postscaler counters are cleared
when:
• A write to TMR2 occurs
• A write to T2CON occurs
• Any device Reset occurs (Power-on Reset, MCLR
Reset, Watchdog Timer Reset, or Brown-out
Reset)
FIGURE 8-1:
FOSC/4
TMR2 is not cleared when T2CON is
written.
Note:
• TMR2 is reset to 00h on the next increment cycle
• The Timer2 postscaler is incremented
TIMER2 BLOCK DIAGRAM
Prescaler
1:1, 1:4, 1:16
2
TMR2
Reset
Comparator
EQ
TMR2 Output
Postscaler
1:1 to 1:16
Sets Flag bit TMR2IF
T2CKPS
PR2
4
TOUTPS
2011-2015 Microchip Technology Inc.
DS40001576D-page 61
PIC12F752/HV752
8.2
Timer2 Control Registers
REGISTER 8-1:
T2CON: TIMER 2 CONTROL REGISTER
U-0
R/W-0
R/W-0
—
R/W-0
R/W-0
TOUTPS
R/W-0
R/W-0
TMR2ON
R/W-0
T2CKPS
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
U = Unimplemented bit, read as ‘0’
-n = Value at POR
‘1’ = Bit is set
‘0’ = Bit is cleared
bit 7
Unimplemented: Read as ‘0’
bit 6-3
TOUTPS: Timer2 Output Postscaler Select bits
0000 = 1:1 Postscaler
0001 = 1:2 Postscaler
0010 = 1:3 Postscaler
0011 = 1:4 Postscaler
0100 = 1:5 Postscaler
0101 = 1:6 Postscaler
0110 = 1:7 Postscaler
0111 = 1:8 Postscaler
1000 = 1:9 Postscaler
1001 = 1:10 Postscaler
1010 = 1:11 Postscaler
1011 = 1:12 Postscaler
1100 = 1:13 Postscaler
1101 = 1:14 Postscaler
1110 = 1:15 Postscaler
1111 = 1:16 Postscaler
bit 2
TMR2ON: Timer2 On bit
1 = Timer2 is on
0 = Timer2 is off
bit 1-0
T2CKPS: Timer2 Clock Prescale Select bits
00 = Prescaler is 1
01 = Prescaler is 4
1x = Prescaler is 16
TABLE 8-1:
x = Bit is unknown
SUMMARY OF REGISTERS ASSOCIATED WITH TIMER2
Name
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Register on
Page
INTCON
GIE
PEIE
T0IE
INTE
IOCIE
T0IF
INTF
IOCIF
15
PIE1
TMR1GIE
ADIE
—
—
—
HLTMR1IE
TMR2IE
TMR1IE
16
PIR1
TMR1GIF
ADIF
—
—
—
HLTMR1IF
TMR2IF
TMR1IF
PR2
Timer2 Module Period Register
TMR2
Holding Register for the 8-bit TMR2 Register
T2CON
Legend:
—
18
61*
TOUTPS
61*
TMR2ON
T2CKPS
62
x = unknown, u = unchanged, - = unimplemented read as ‘0’. Shaded cells are not used for Timer2 module.
* Page provides register information.
DS40001576D-page 62
2011-2015 Microchip Technology Inc.
PIC12F752/HV752
9.0
HARDWARE LIMIT TIMER (HLT)
MODULE
The HLT module incorporates the following features:
• 8-Bit Read-Write Timer Register (HLTMR1)
• 8-Bit Read-Write Period Register (HLTPR1)
• Software Programmable Prescaler
- 1:1
- 1:4
- 1:16
• Software Programmable Postscaler:
- 1:1 to 1:16, inclusive
• Interrupt on HLTMR1 Match with HLTPR1
• Eight Selectable Timer Reset Inputs (five
reserved)
• Reset on Rising and Falling Event
The Hardware Limit Timer (HLT) module is a version of
the Timer2-type modules. In addition to all the
Timer2-type features, the HLT can be reset on rising
and falling events from selected peripheral outputs.
The HLT primary purpose is to act as a timed hardware
limit to be used in conjunction with asynchronous
analog feedback applications. The external reset
source synchronizes the HLTMR1 to an analog
application.
In normal operation, the external reset source from the
analog application should occur before the HLTMR1
matches the HLTPR1. This resets HLTMR1 for the next
period and prevents the HLTimer1 Output from going
active.
Refer to Figure 9-1 for a block diagram of the HLT.
When the external reset source fails to generate a
signal within the expected time, allowing the HLTMR1 to
match the HLTPR1, then the HLTimer1 Output
becomes active.
FIGURE 9-1:
HLTMR1 BLOCK DIAGRAM
CCP1 out
C1OUT
C2OUT
COG1FLT
COG1OUT0
COG1OUT1
‘0’
‘0’
H1ERS
FOSC/4
H1ON
000
H1REREN
Detect
Detect
H1FEREN
111
3
Prescaler
1:1, 1:4, 1:16
2
Reset
HLTMR1
Comparator
HLTimer1 Output
(to COG module)
EQ
Postscaler
1:1 to 1:16
Sets Flag bit HLTMR1IF
H1CKPS
HLTPR1
4
H1OUTPS
2011-2015 Microchip Technology Inc.
DS40001576D-page 63
PIC12F752/HV752
9.1
HLT Operation
The clock input to the HLT module is the system
instruction clock (FOSC/4). HLTMR1 increments on
each rising clock edge.
A 4-bit counter/prescaler on the clock input provides the
following prescale options:
• Direct Input
• Divide-by-4
• Divide-by-16
The prescale options are selected by the prescaler
control bits, H1CKPS of the HLT1CON0 register.
The value of HLTMR1 is compared to that of the Period
register, HLTPR1, on each clock cycle. When the two
values match,then the comparator generates a match
signal as the HLTimer1 output. This signal also resets
the value of HLTMR1 to 00h on the next clock rising
edge and drives the output counter/postscaler (see
Section 9.2 “HLT Interrupt”).
The time from HLT reset to the HLT output pulse is
calculated as shown in Equation 9-1 below.
EQUATION 9-1:
HLT OUTPUT
HLT Time = HLTPR1 + 2 4 Fosc
Unexpected operation may occur for HLT periods less
than half the period of the expected external HLT Reset
input.
The HLTMR1 and HLTPR1 registers are both directly
readable and writable. The HLTMR1 register is cleared
on any device Reset, whereas the HLTPR1 register
initializes to FFh. Both the prescaler and postscaler
counters are cleared on any of the following events:
•
•
•
•
•
•
•
•
•
A Write to the HLTMR1 Register
A Write to the HLT1CON0 Register
Power-on Reset (POR)
Brown-out Reset (BOR)
MCLR Reset
Watchdog Timer (WDT) Reset
Stack Overflow Reset
Stack Underflow Reset
RESET Instruction.
Note:
HLTMR1 is not cleared when HLT1CON0 is
written.
9.2
HLT Interrupt
The HLT can also generate an optional device interrupt.
The HLTMR1 output signal (HLTMR1-to-HLTPR1
match) provides the input for the 4-bit counter/
postscaler. The overflow output of the postscaler sets
the HLTMR1IF bit of the PIR1 register. The interrupt is
enabled by setting the HLTMR1 Match Interrupt Enable
bit, HLTMR1IE of the PIE1 register.
A range of 16 postscale options (from 1:1 through 1:16
inclusive) can be selected with the postscaler control
bits, H1OUTPS, of the HLT1CON0 register.
9.3
Peripheral Resets
Resets driven from the selected peripheral output
prevents the HLTMR1 from matching the HLTPR1
register and generating an output. In this manner, the
HLT can be used as a hardware time limit to other
peripherals.
In this device, the primary purpose of the HLT is to limit
the COG PWM duty cycle. Normally, the COG
operation uses analog feedback to determine the PWM
duty cycle. The same feedback signal is used as an
HLT Reset input. The HLTPR1 register is set to occur
at the maximum allowed duty cycle. If the analog
feedback to the COG exceeds the maximum time, then
an HLTMR1-to-HLTPR1 match will occur and generate
the output needed to limit the COG drive output.
The HLTMR1 can be reset by one of several selectable
peripheral sources. Reset inputs include:
• CCP1 Output
• Comparator 1 Output
• Comparator 2 Output
The Reset input is selected with the H1ERS bits
of the HLT1CON1 register.
HLTMR1 Resets are synchronous with the HLT clock,
i.e. HLTMR1 is cleared on the rising edge of the HLT
clock after the enabled Reset event occurs.
The Reset can be enabled to occur on the rising and
falling input event. Rising and falling event enables are
selected with the respective H1REREN and H1FEREN
bits of the HLT1CON1 register. External Resets do not
cause an HLTMR1 output event.
9.4
HLTimer1 Output
The unscaled output of HLTMR1 is available only to the
COG module, where it is used as a selectable limit to
the maximum COG period.
9.5
HLT Operation During Sleep
The HLT cannot be operated while the processor is in
Sleep mode. The contents of the HLTMR1 register will
remain unchanged while the processor is in Sleep
mode.
DS40001576D-page 64
2011-2015 Microchip Technology Inc.
PIC12F752/HV752
9.6
HLT Control Registers
REGISTER 9-1:
U-0
HLT1CON0: HLT1 CONTROL REGISTER 0
R/W-0/0
R/W-0/0
—
R/W-0/0
H1OUTPS
R/W-0/0
R/W-0/0
R/W-0/0
H1ON
bit 7
R/W-0/0
H1CKPS
bit 0
Legend:
R = Readable bit
W = Writable bit
U = Unimplemented bit, read as ‘0’
u = Bit is unchanged
x = Bit is unknown
-n/n = Value at POR and BOR/Value at all other Resets
‘1’ = Bit is set
‘0’ = Bit is cleared
bit 7
Unimplemented: Read as ‘0’
bit 6-3
H1OUTPS: Hardware Limit Timer 1 Output Postscaler Select bits
0000 = 1:1 Postscaler
0001 = 1:2 Postscaler
0010 = 1:3 Postscaler
0011 = 1:4 Postscaler
0100 = 1:5 Postscaler
0101 = 1:6 Postscaler
0110 = 1:7 Postscaler
0111 = 1:8 Postscaler
1000 = 1:9 Postscaler
1001 = 1:10 Postscaler
1010 = 1:11 Postscaler
1011 = 1:12 Postscaler
1100 = 1:13 Postscaler
1101 = 1:14 Postscaler
1110 = 1:15 Postscaler
1111 = 1:16 Postscaler
bit 2
H1ON: Hardware Limit Timer 1 On bit
1 = Timer is on
0 = Timer is off
bit 1-0
H1CKPS: Hardware Limit Timer 1 Clock Prescale Select bits
00 = Prescaler is 1
01 = Prescaler is 4
1x = Prescaler is 16
2011-2015 Microchip Technology Inc.
DS40001576D-page 65
PIC12F752/HV752
REGISTER 9-2:
HLT1CON1: HLT1 CONTROL REGISTER 1
U-0
U-0
U-0
—
—
—
R/W-0/0
R/W-0/0
R/W-0/0
H1ERS
R/W-0/0
R/W-0/0
H1FEREN
H1REREN
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
U = Unimplemented bit, read as ‘0’
u = Bit is unchanged
x = Bit is unknown
-n/n = Value at POR and BOR/Value at all other Resets
‘1’ = Bit is set
‘0’ = Bit is cleared
bit 7-5
Unimplemented: Read as ‘0’
bit 4-2
H1ERS: Hardware Limit Timer 1 Peripheral Reset Select bits
000 = CCP1 Out
001 = C1OUT
010 = C2OUT
011 = COG1FLT
100 = COG1OUT0
101 = COG1OUT1
110 = Reserved - ‘0’ input
111 = Reserved - ‘0’ input
bit 1
H1FEREN: Hardware Limit Timer 1 Falling Edge Reset Enable bit
1 = HLTMR1 will reset on the first clock after a falling edge of selected Reset source
0 = Falling edges of selected source have no effect
bit 0
H1REREN: Hardware Limit Timer 1 Rising Edge Reset Enable bit
1 = HLTMR1 will reset on the first clock after a rising edge of selected Reset source
0 = Rising edges of selected source have no effect
TABLE 9-1:
Name
CCP1CON
SUMMARY OF REGISTERS ASSOCIATED WITH HLT
Bit 7
Bit 6
—
—
CM1CON0
C1ON
C1OUT
CM1CON1
C1INTP
C1INTN
CM2CON0
C2ON
C2OUT
CM2CON1
C2INTP
C2INTN
INTCON
PIE1
PIR1
Bit 5
Bit 4
Bit 3
DC1B
C1OE
C1POL
C1PCH
C2OE
C2POL
C2PCH
Register
on Page
73
C1SP
C1HYS
C1SYNC
113
—
—
—
C1NCH0
114
C2ZLF
C2SP
C2HYS
C2SYNC
113
—
—
—
C2NCH0
114
GIE
PEIE
T0IE
INTE
IOCIE
T0IF
INTF
IOCIF
15
TMR1GIE
ADIE
—
—
—
HLTMR1IE
TMR2IE
TMR1IE
16
TMR1GIF
ADIF
—
—
—
HLTMR1IF
TMR2IF
TMR1IF
HLTPR1
HLTMR1 Module Period Register
Legend:
Bit 0
C1ZLF
Holding Register for the 8-bit Hardware Limit Timer1 Register
HLT1CON1
Bit 1
CCP1M
HLTMR1
HLT1CON0
Bit 2
—
—
63*
H1OUTPS
—
—
18
63*
H1ON
H1ERS
H1CKPS
H1FEREN
H1REREN
65
66
— = unimplemented location, read as ‘0’. Shaded cells do not affect the HLT module operation.
* Page provides register information.
DS40001576D-page 66
2011-2015 Microchip Technology Inc.
PIC12F752/HV752
10.0
CAPTURE/COMPARE/PWM
MODULES
The Capture/Compare/PWM modules is a peripheral
which allows the user to time and control different
events, and to generate Pulse-Width Modulation
(PWM) signals. In Capture mode, the peripheral allows
the timing of the duration of an event. The Compare
mode allows the user to trigger an external event when
a predetermined amount of time has expired. The
PWM mode can generate Pulse-Width Modulated
signals of varying frequency and duty cycle.
10.1
Capture Mode
Capture mode makes use of the 16-bit Timer1
resource. When an event occurs on the CCP1 pin, the
16-bit CCPR1H:CCPR1L register pair captures and
stores the 16-bit value of the TMR1H:TMR1L register
pair, respectively. An event is defined as one of the
following and is configured by the CCP1M bits of
the CCP1CON register:
•
•
•
•
Every Falling Edge
Every Rising Edge
Every 4th Rising Edge
Every 16th Rising Edge
Figure 10-1 shows a simplified diagram of the Capture
operation.
CCP1 PIN CONFIGURATION
In Capture mode, the CCP1 pin should be configured
as an input by setting the associated TRIS control bit.
Note:
If the CCP1 pin is configured as an output,
a write to the port can cause a capture
condition.
FIGURE 10-1:
Prescaler
1, 4, 16
CAPTURE MODE
OPERATION BLOCK
DIAGRAM
TIMER1 MODE RESOURCE
Timer1 must be running in Timer mode or Synchronized
Counter mode for the CCP1 module to use the capture
feature. In Asynchronous Counter mode, the capture
operation may not work.
See Section 7.0 “Timer1 Module with Gate Control”
for more information on configuring Timer1.
10.1.3
SOFTWARE INTERRUPT MODE
When the Capture mode is changed, a false capture
interrupt may be generated. The user should keep the
CCP1IE interrupt enable bit of the PIE2 register clear to
avoid false interrupts. Additionally, the user should
clear the CCP1IF interrupt flag bit of the PIR2 register
following any change in Operating mode.
Note:
10.1.4
When a capture is made, the Interrupt Request Flag bit
CCP1IF of the PIR2 register is set. The interrupt flag
must be cleared in software. If another capture occurs
before the value in the CCPR1H, CCPR1L register pair
is read, the old captured value is overwritten by the new
captured value.
10.1.1
10.1.2
Clocking Timer1 from the system clock
(FOSC) should not be used in Capture
mode. In order for Capture mode to
recognize the trigger event on the CCP1
pin, Timer1 must be clocked from the
instruction clock (FOSC/4) or from an
external clock source.
CCP1 PRESCALER
There are four prescaler settings specified by the
CCP1M bits of the CCP1CON register.
Whenever the CCP1 module is turned off or the CCP1
module is not in Capture mode, the prescaler counter
is cleared. Any Reset will clear the prescaler counter.
Switching from one capture prescaler to another does not
clear the prescaler and may generate a false interrupt. To
avoid this unexpected operation, turn the module off by
clearing the CCP1CON register before changing the
prescaler. Example 10-1 demonstrates the code to
perform this function.
EXAMPLE 10-1:
CHANGING BETWEEN
CAPTURE PRESCALERS
BANKSEL CCP1CON
CLRF
MOVLW
MOVWF
;Set Bank bits to point
;to CCP1CON
CCP1CON
;Turn CCP1 module off
NEW_CAPT_PS ;Load the W reg with
;the new prescaler
;move value and CCP1 ON
CCP1CON
;Load CCP1CON with this
;value
Set Flag bit CCP1IF
(PIR2 register)
CCP1
pin
CCPR1H
and
Edge Detect
CCPR1L
Capture
Enable
TMR1H
TMR1L
CCP1M
System Clock (FOSC)
2011-2015 Microchip Technology Inc.
DS40001576D-page 67
PIC12F752/HV752
10.1.5
CAPTURE DURING SLEEP
Capture mode depends upon the Timer1 module for
proper operation. If the Timer1 clock input source is a
clock that is not disabled during Sleep, Timer1 will
continue to operate and Capture mode will operate
during Sleep to wake the device. The T1CKI is an
example of a clock source that will operate during
Sleep.
When the input source to Timer1 is disabled during
Sleep, such as the HFINTOSC, Timer1 will not
increment during Sleep. When the device wakes from
Sleep, Timer1 will continue from its previous state.
TABLE 10-1:
Name
CCP1CON
SUMMARY OF REGISTERS ASSOCIATED WITH CAPTURE
Bit 7
Bit 6
—
—
Bit 5
Bit 4
DC1B
CCPR1L
Capture/Compare/PWM Register x Low Byte (LSB)
CCPR1H
Capture/Compare/PWM Register x High Byte (MSB)
INTCON
PIE1
Bit 3
Bit 2
Bit 1
Bit 0
CCP1M
Register
on Page
73
67*
67*
GIE
PEIE
T0IE
INTE
IOCIE
T0IF
INTF
IOCIF
15
TMR1GIE
ADIE
—
—
—
HLTMR1IE
TMR2IE
TMR1IE
16
PIE2
—
—
C2IE
C1IE
—
COG1IE
—
CCP1IE
17
PIR1
TMR1GIF
ADIF
—
—
—
HLTMR1IF
TMR2IF
TMR1IF
18
PIR2
—
—
C2IF
C1IF
T1CON
TMR1CS
T1GCON
TMR1GE
T1GPOL
T1CKPS
T1GTM
T1GSPM
—
COG1IF
—
CCP1IF
19
Reserved
T1SYNC
—
TMR1ON
58
T1GGO/
DONE
T1GVAL
T1GSS
59
TMR1H
Holding Register for the Most Significant Byte of the 16-bit TMR1 Register
50*
TMR1L
Holding Register for the Least Significant Byte of the 16-bit TMR1 Register
50*
TRISA
—
—
TRISA5
TRISA4
TRISA3(1)
TRISA2
TRISA1
TRISA0
40
Legend: — = Unimplemented location, read as ‘0’. Shaded cells are not used by Capture mode.
* Page provides register information.
Note 1:
TRISA3 always reads ‘1’.
DS40001576D-page 68
2011-2015 Microchip Technology Inc.
PIC12F752/HV752
10.2
10.2.2
Compare Mode
Compare mode makes use of the 16-bit Timer1
resource. The 16-bit value of the CCPR1H:CCPR1L
register pair is constantly compared against the 16-bit
value of the TMR1H:TMR1L register pair. When a
match occurs, one of the following events can occur:
•
•
•
•
•
Toggle the CCP1 Output
Set the CCP1 Output
Clear the CCP1 Output
Generate a Special Event Trigger
Generate a Software Interrupt
In Compare mode, Timer1 must be running in either
Timer mode or Synchronized Counter mode. The
compare operation may not work in Asynchronous
Counter mode.
See Section 7.0 “Timer1 Module with Gate Control”
for more information on configuring Timer1.
Note:
The action on the pin is based on the value of the
CCP1M control bits of the CCP1CON register. At
the same time, the interrupt flag CCP1IF bit is set.
All Compare modes can generate an interrupt.
Figure 10-2 shows a simplified diagram of the
Compare operation.
FIGURE 10-2:
COMPARE MODE
OPERATION BLOCK
DIAGRAM
CCP1M
Mode Select
Set CCP1IF Interrupt Flag
(PIR2)
4
CCPR1H CCPR1L
CCP1
Pin
Q
S
R
Output
Logic
Match
TRIS
Output Enable
Comparator
TMR1H
TMR1L
Special Event Trigger
10.2.1
CCP1 PIN CONFIGURATION
The user must configure the CCP1 pin as an output by
clearing the associated TRIS bit.
Note:
Clearing the CCP1CON register will force
the CCP1 compare output latch to the
default low level. This is not the PORT I/O
data latch.
TIMER1 MODE RESOURCE
10.2.3
Clocking Timer1 from the system clock
(FOSC) should not be used in Compare
mode. In order for Compare mode to
recognize the trigger event on the CCP1
pin, Timer1 must be clocked from the
instruction clock (FOSC/4) or from an
external clock source.
SOFTWARE INTERRUPT MODE
When Generate Software Interrupt mode is chosen
(CCP1M = 1010), the CCP1 module does not
assert control of the CCP1 pin (see the CCP1CON
register).
10.2.4
SPECIAL EVENT TRIGGER
When Special Event Trigger mode is chosen
(CCP1M = 1011), the CCP1 module does the
following:
• It resets Timer1
• It starts an ADC conversion if ADC is enabled
The CCP1 module does not assert control of the CCP1
pin in this mode.
The Special Event Trigger output of the CCP1 occurs
immediately upon a match between the TMR1H,
TMR1L register pair and the CCPR1H, CCPR1L
register pair. The TMR1H, TMR1L register pair is not
reset until the next rising edge of the Timer1 clock. The
Special Event Trigger output starts an A/D conversion
(if the A/D module is enabled). This allows the
CCPR1H, CCPR1L register pair to effectively provide a
16-bit programmable period register for Timer1.
TABLE 10-2:
SPECIAL EVENT TRIGGER
Device
PIC12F752
PIC12HV752
CCP1
CCP1
Refer to Section 12.0 “Analog-to-Digital Converter
(ADC) Module” for more information.
Note 1: The Special Event Trigger from the CCP
module does not set interrupt flag bit
TMR1IF of the PIR1 register.
2: Removing the match condition by
changing the contents of the CCPR1H
and CCPR1L register pair, between the
clock edge that generates the Special
Event Trigger and the clock edge that
generates the Timer1 Reset, will
preclude the Reset from occurring.
2011-2015 Microchip Technology Inc.
DS40001576D-page 69
PIC12F752/HV752
10.2.5
COMPARE DURING SLEEP
The Compare mode is dependent upon the system
clock (FOSC) for proper operation. Since FOSC is shut
down during Sleep mode, the Compare mode will not
function properly during Sleep.
TABLE 10-3:
Name
CCP1CON
SUMMARY OF REGISTERS ASSOCIATED WITH COMPARE
Bit 7
Bit 6
—
—
Bit 5
Bit 4
Bit 3
DC1B
Capture/Compare/PWM Register 1 Low Byte (LSB)
CCPR1H
Capture/Compare/PWM Register 1 High Byte (MSB)
PIE1
Bit 1
Bit 0
CCP1M
CCPR1L
INTCON
Bit 2
Register
on Page
73
67*
67*
GIE
PEIE
T0IE
INTE
IOCIE
T0IF
INTF
IOCIF
15
TMR1GIE
ADIE
—
—
—
HLTMR1IE
TMR2IE
TMR1IE
16
PIE2
—
—
C2IE
C1IE
—
COG1IE
—
CCP1IE
17
PIR1
TMR1GIF
ADIF
—
—
—
HLTMR1IF
TMR2IF
TMR1IF
18
PIR2
—
—
C2IF
C1IF
T1CON
TMR1CS
T1GCON
TMR1GE
T1GPOL
T1CKPS
T1GTM
T1GSPM
—
COG1IF
—
CCP1IF
19
Reserved
T1SYNC
—
TMR1ON
58
T1GGO/DONE
T1GVAL
TMR1H
Holding Register for the Most Significant Byte of the 16-bit TMR1 Register
TMR1L
Holding Register for the Least Significant Byte of the 16-bit TMR1 Register
TRISA
—
—
TRISA5
TRISA4
TRISA3(1)
TRISA2
T1GSS
59
50*
50*
TRISA1
TRISA0
40
Legend: — = Unimplemented location, read as ‘0’. Shaded cells are not used by Compare mode.
* Page provides register information.
Note 1:
TRISA3 always reads ‘1’.
DS40001576D-page 70
2011-2015 Microchip Technology Inc.
PIC12F752/HV752
10.3
PWM Overview
Pulse-Width Modulation (PWM) is a scheme that
provides power to a load by switching quickly between
fully-on and fully-off states. The PWM signal resembles
a square wave where the high portion of the signal is
considered the on state and the low portion of the signal
is considered the off state. The high portion, also known
as the pulse width, can vary in time and is defined in
steps. A larger number of steps applied, which
lengthens the pulse width, also supplies more power to
the load. Lowering the number of steps applied, which
shortens the pulse width, supplies less power. The
PWM period is defined as the duration of one complete
cycle or the total amount of on and off time combined.
FIGURE 10-3:
CCP1 PWM OUTPUT
SIGNAL
Period
Pulse Width
TMR2 = PR2
TMR2 = CCPR1H:CCP1CON
TMR2 = 0
FIGURE 10-4:
SIMPLIFIED PWM BLOCK
DIAGRAM
PWM resolution defines the maximum number of steps
that can be present in a single PWM period. A higher
resolution allows for more precise control of the pulse
width time and in turn the power that is applied to the
load.
Duty Cycle Registers
The term duty cycle describes the proportion of the on
time to the off time and is expressed in percentages,
where 0% is fully off and 100% is fully on. A lower duty
cycle corresponds to less power applied and a higher
duty cycle corresponds to more power applied.
CCPR1H(2) (Slave)
CCP1CON
CCPR1L
CCP1
R
Comparator
TMR2
(1)
Q
S
Figure 10-3 shows a typical waveform of the PWM
signal.
TRIS
Comparator
10.3.1
STANDARD PWM OPERATION
The standard PWM mode generates a Pulse-Width
modulation (PWM) signal on the CCP1 pin with up to
ten bits of resolution. The period, duty cycle and
resolution are controlled by the following registers:
•
•
•
•
PR2 Registers
T2CON Registers
CCPR1L Registers
CCP1CON Registers
PR2
Note 1:
2:
Clear Timer,
toggle CCP1 pin and
latch duty cycle
The 8-bit timer TMR2 register is concatenated
with the 2-bit internal system clock (FOSC), or
two bits of the prescaler, to create the 10-bit
time base.
In PWM mode, CCPR1H is a read-only register.
Figure 10-4 shows a simplified block diagram of PWM
operation.
Note 1: The corresponding TRIS bit must be
cleared to enable the PWM output on the
CCP1 pin.
2: Clearing the CCP1CON register will
relinquish control of the CCP1 pin.
2011-2015 Microchip Technology Inc.
DS40001576D-page 71
PIC12F752/HV752
10.3.2
SETUP FOR PWM OPERATION
The following steps should be taken when configuring
the CCP1 module for standard PWM operation:
1.
2.
3.
4.
5.
6.
Disable the CCP1 pin output driver by setting
the associated TRIS bit
Load the PR2 register with the PWM period
value
Configure the CCP1 module for the PWM mode
by loading the CCP1CON register with the
appropriate values
Load the CCPR1L register and the DC1B
bits of the CCP1CON register, with the PWM
duty cycle value
Configure and start Timer2:
• Clear the TMR2IF interrupt flag bit of the
PIR1 register (see Note below)
• Configure the T2CKPS bits of the T2CON
register with the Timer prescale value
• Enable the Timer by setting the TMR2ON
bit of the T2CON register
Enable PWM output pin:
• Wait until the Timer overflows and the
TMR2IF bit of the PIR1 register is set. See
Note below
• Enable the CCP1 pin output driver by clearing the associated TRIS bit
Note:
10.3.3
In order to send a complete duty cycle and
period on the first PWM output, the above
steps must be included in the setup
sequence. If it is not critical to start with a
complete PWM signal on the first output,
then step 6 may be ignored.
PWM PERIOD
The PWM period is specified by the PR2 register of
Timer2. The PWM period can be calculated using the
formula of Equation 10-1.
EQUATION 10-1:
PWM PERIOD
10.3.4
PWM DUTY CYCLE
The PWM duty cycle is specified by writing a 10-bit
value to multiple registers: CCPR1L register and
DC1B bits of the CCP1CON register. The
CCPR1L contains the eight MSbs and the DC1B
bits of the CCP1CON register contain the two LSbs.
CCPR1L and DC1B bits of the CCP1CON
register can be written to at any time. The duty cycle
value is not latched into CCPR1H until after the period
completes (i.e. a match between PR2 and TMR2
registers occurs). While using the PWM, the CCPR1H
register is read-only.
Equation 10-2 is used to calculate the PWM pulse
width.
Equation 10-3 is used to calculate the PWM duty cycle
ratio.
EQUATION 10-2:
PULSE WIDTH
Pulse Width = CCPR1L:CCP1CON
T OSC (TMR2 Prescale Value)
EQUATION 10-3:
DUTY CYCLE RATIO
CCPRxL:CCPxCON
Duty Cycle Ratio = ----------------------------------------------------------------------4 PRx + 1
The CCPR1H register and a 2-bit internal latch are
used to double buffer the PWM duty cycle. This double
buffering is essential for glitchless PWM operation.
The 8-bit timer TMR2 register is concatenated with
either the 2-bit internal system clock (FOSC), or two bits
of the prescaler, to create the 10-bit time base. The
system clock is used if the Timer2 prescaler is set to 1:1.
When the 10-bit time base matches the CCPR1H and
2-bit latch, then the CCP1 pin is cleared (see
Figure 10-4).
PWM Period = PR2 + 1 4 T OSC
(TMR2 Prescale Value)
Note 1:
TOSC = 1/FOSC
When TMR2 is equal to PR2, the following three events
occur on the next increment cycle:
• TMR2 is cleared
• The CCP1 pin is set (exception: If the PWM duty
cycle = 0%, the pin will not be set)
• The PWM duty cycle is latched from CCPR1L into
CCPR1H
Note:
The Timer postscaler (see Section 8.1
“Timer2 Operation”) is not used in the
determination of the PWM frequency.
DS40001576D-page 72
2011-2015 Microchip Technology Inc.
PIC12F752/HV752
10.4
CCP Control Registers
REGISTER 10-1:
U-0
CCP1CON: CCP1 CONTROL REGISTER
U-0
—
R/W-0/0
R/W-0/0
R/W-0/0
DC1B
—
R/W-0/0
R/W-0/0
R/W-0/0
CCP1M
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
U = Unimplemented bit, read as ‘0’
u = Bit is unchanged
x = Bit is unknown
-n/n = Value at POR and BOR/Value at all other Reset
‘1’ = Bit is set
‘0’ = Bit is cleared
bit 7-6
Unimplemented: Read as ‘0’
bit 5-4
DC1B: PWM Duty Cycle Least Significant bits
Capture mode:
Unused
Compare mode:
Unused
PWM mode:
These bits are the two LSbs of the PWM duty cycle. The eight MSbs are found in CCPR1L.
bit 3-0
CCP1M: CCP1 Mode Select bits
0000 = Capture/Compare/PWM off (resets CCP1 module)
0001 = Reserved
0010 = Compare mode: toggle output on match
0011 = Reserved
0100 =
0101 =
0110 =
0111 =
Capture mode: every falling edge
Capture mode: every rising edge
Capture mode: every 4th rising edge
Capture mode: every 16th rising edge
1000 =
1001 =
1010 =
1011 =
Compare mode: initialize CCP1 pin low; set output on compare match (set CCP1IF)
Compare mode: initialize CCP1 pin high; clear output on compare match (set CCP1IF)
Compare mode: generate software interrupt only; CCP1 pin reverts to I/O state
Compare mode: Special Event Trigger (CCP1 resets Timer, sets CCP1IF bit, and starts A/D
conversion if A/D module is enabled)
11xx = PWM mode
2011-2015 Microchip Technology Inc.
DS40001576D-page 73
PIC12F752/HV752
11.0
COMPLEMENTARY OUTPUT
GENERATOR (COG) MODULE
The primary purpose of the Complementary Output
Generator (COG) is to convert a single output PWM
signal into a two output complementary PWM signal.
The COG can also convert two separate input events
into a single or complementary PWM output.
The COG PWM frequency and duty cycle are
determined by a rising event input and a falling event
input. The rising event and falling event may be the
same source. Sources may be synchronous or
asynchronous to the COG_clock.
The rate at which the rising event occurs determines
the PWM frequency. The time from the rising event
input to the falling event input determines the duty
cycle.
A selectable clock input is used to generate the phase
delay, blanking and dead-band times.
A simplified block diagram of the COG is shown in
Figure 11-1.
The COG module has the following features:
•
•
•
•
•
•
•
•
Selectable clock source
Selectable rising event source
Selectable falling event source
Selectable edge or level event sensitivity
Independent output enables
Independent output polarity selection
Phase delay
Dead-band control with independent rising and
falling event dead-band times
• Blanking control with independent rising and
falling event blanking times
• Auto-shutdown control with:
- Selectable shutdown sources
- Auto-restart enable
- Auto-shutdown pin override control
11.1
Fundamental Operation
The COG generates a two output complementary
PWM waveform from rising and falling event sources.
In the simplest configuration, the rising and falling
event sources are the same signal, which is a PWM
signal with the desired period and duty cycle. The COG
converts this single PWM input into a dual
complementary PWM output. The frequency and duty
cycle of the dual PWM output match those of the single
input PWM signal. The off-to-on transition of each
output can be delayed from the on-to-off transition of
the other output, thereby, creating a time immediately
after the PWM transition where neither output is driven.
This is referred to as dead time and is covered in
Section 11.5 “Dead-Band Control”.
A typical operating waveform, with dead band, generated
from a single CCP1 input is shown in Figure 11-2.
The COG can also generate a PWM waveform from a
periodic rising event and a separate falling event. In
this case, the falling event is usually derived from
analog feedback within the external PWM driver circuit.
In this configuration, high-power switching transients
may trigger a false falling event that needs to be
blanked out. The COG can be configured to blank
falling (and rising) event inputs for a period of time
immediately following the rising (and falling) event drive
output. This is referred to as input blanking and is
covered in Section 11.6 “Blanking Control”.
It may be necessary to guard against the possibility of
circuit faults. In this case, the active drive must be
terminated before the Fault condition causes damage.
This is referred to as auto-shutdown and is covered in
Section 11.8 “Auto-Shutdown Control”.
A feedback falling event arriving too late or not at all
can be terminated with auto-shutdown or by using one
of the event inputs that is logically or’d with the
hardware limit timer (HLT). See Section 9.0
“Hardware Limit Timer (HLT) Module” for more
information about the HLT.
The COG can be configured to operate in phase
delayed conjunction with another PWM. The active
drive cycle is delayed from the rising event by a phase
delay timer. Phase delay is covered in more detail in
Section 11.7 “Phase Delay”.
A typical operating waveform, with phase delay and
dead band, generated from a single CCP1 input is
shown in Figure 11-3.
DS40001576D-page 74
2011-2015 Microchip Technology Inc.
2011-2015 Microchip Technology Inc.
FIGURE 11-1:
SIMPLIFIED COG BLOCK DIAGRAM
HFINTOSC
10
Fosc/4
Fosc
01
00
COG_clock
GxCS
HLTimer1 or COGxFLT
HLTimer1 or CCP1
HLTimer1 or C2OUT
HLTimer1 or C1OUT
COGxFLT
CCP1
C2OUT
C1OUT
7
6
5
4
3
2
1
0
HLTimer1 or COGxFLT
HLTimer1 or CCP1
HLTimer1 or C2OUT
HLTimer1 or C1OUT
COGxFLT
CCP1
C2OUT
C1OUT
Phase
Delay
Rising event source
7
6
5
4
3
2
1
0
GxFS0
Write GxASDE High
Reset Dominates
1
COG1OUT0
0
GxPOL0
0
R Q
GxRSIM
GxOE1
GxDBF
Dead Band
Cnt/R
=
Falling event source
GxOUT1SS
1
Blanking
=
Cnt/R
0
GxBLKR
GxFSIM
Auto-shutdown source
S Q
GxARSEN
GxEN
Write GxASDE Low
R
Set Dominates
1
COG1OUT1
0
GxPOL1
S
D Q
GxASDE
DS40001576D-page 75
PIC12F752/HV752
COGxFLT
GxASDSFLT
C1OUT
GxASDSC1
C2OUT
GxASDSC2
HLTimer1 output
GxASDSHLT
1
Dead Band
Cnt/R
=
GxOE0
GxOUT0SS
S Q
Blanking
=
Cnt/R
GxBLKF
GxRS0
GxDBR
GxPH
PIC12F752/HV752
FIGURE 11-2:
TYPICAL COG OPERATION WITH CCP1
COG_clock
Source
CCP1
COGxOUT0
Rising Source Dead Band
Falling Source Dead Band
Falling Source Dead Band
COGxOUT1
FIGURE 11-3:
COG OPERATION WITH CCP1 AND PHASE DELAY
COG_clock
Source
CCP1
COGxOUT0
Rising Source Dead Band
Falling Source Dead Band
Phase Delay
Falling Source Dead
Band
COGxOUT1
11.2
Clock Sources
The COG_clock is used as the reference clock to the
various timers in the peripheral. Timers that use the
COG_clock include:
• Rising and falling dead-band time
• Rising and falling blanking time
• Rising event phase delay
Clock sources available for selection include:
• 8 MHz HFINTOSC
• Instruction clock (Fosc/4)
• System clock (Fosc)
The clock source is selected with the GxCS bits
of the COGxCON0 register (Register 11-1).
DS40001576D-page 76
11.3
Selectable Event Sources
The COG uses two independently selectable event
sources to generate the complementary waveform:
• Rising event source
• Falling event source
Level or edge sensitive modes are available for each
event input.
The rising event source is selected with the GxRS
bits and the mode is controlled with the GxRSIM bit.
The falling event source is selected with the GxFS
bits and the mode is controlled with the GxFSIM bit.
Selection and mode control bits for both sources are
located in the COGxCON1 register (Register 11-2).
2011-2015 Microchip Technology Inc.
PIC12F752/HV752
11.3.1
EDGE VS. LEVEL SENSING
Event input detection may be selected as level or edge
sensitive. In general, events that are driven from a
periodic source should be edge detected and events
that are derived from voltage thresholds at the target
circuit should be level sensitive. Consider the following
two examples:
1. The first example is an application in which the
period is determined by a 50% duty cycle clock and the
COG output duty cycle is determined by a voltage level
fed back through a comparator. If the clock input is level
sensitive, then duty cycles less than 50% will exhibit
erratic operation.
2. The second example is similar to the first except that
the duty cycle is close to 100%. The feedback
comparator high-to-low transition trips the COG drive
off but almost immediately the period source turns the
drive back on. If the off cycle is short enough then the
comparator input may not reach the low side of the
hysteresis band precluding an output change. The
comparator output stays low and without a high-to-low
transition to trigger the edge sense then the drive of the
COG output will be stuck in a constant drive-on
condition. See Figure 11-4
FIGURE 11-4:
Rising (CCP1)
EDGE VS LEVEL SENSE
Level Sensitive
11.3.2
RISING EVENT
The rising event starts the PWM output active duty
cycle period. The rising event is the low-to-high
transition of the selected rising event source. When the
phase delay and rising event dead-band time values
are zero, the COGxOUT0 output starts immediately.
Otherwise, the COGxOUT0 output is delayed. The
rising event causes all the following actions:
•
•
•
•
•
Start rising event phase delay counter (if enabled)
Clear COGxOUT1 after phase delay
Start falling event input blanking (if enabled)
Start dead-band counter (if enabled)
Set COGxOUT0 output after dead-band counter
expires
11.3.3
FALLING EVENT
The falling event terminates the PWM output active duty
cycle period. The falling event is the high-to-low
transition of the selected falling event source. When the
falling event dead-band time value is zero, the
COGxOUT1 output starts immediately. Otherwise, the
COGxOUT1 output is delayed. The falling event causes
all the following actions:
•
•
•
•
Clear COGxOUT0
Start rising event input blanking (if enabled)
Start falling event dead-band counter (if enabled)
Set COGxOUT1 output after dead-band counter
expires
Falling (C1OUT)
C1In-
hyst
COGOUT
Edge Sensitive
Rising (CCP1)
Falling (C1OUT)
C1In-
hyst
COGOUT
2011-2015 Microchip Technology Inc.
DS40001576D-page 77
PIC12F752/HV752
11.4
Output Control
Immediately after the COG module is enabled, the
complementary drive is configured with COGxOUT0
drive cleared and COGxOUT1 drive active.
11.4.1
OUTPUT ENABLES
Each COG output pin has individual output enable
controls. Output enables are selected with the GxOE0
and GxOE1 bits of the COGxCON0 register. When an
output enable control is cleared, the module asserts
no control over the pin. When an output enable is set,
the override value or active PWM waveform is applied
to the pin per the port priority selection.
The output pin enables are independent of the module
enable bit, GxEN. When GxEN is cleared, the
shutdown override levels are present on the COG
output pins for which the output enables are active.
11.4.2
POLARITY CONTROL
The polarity of each COG output can be selected
independently. When the output polarity bit is set, the
corresponding output is active low. Clearing the output
polarity bit configures the corresponding output as
active high. However, polarity does not affect the
override levels.
Output polarity is selected with the GxPOL0 and
GxPOL1 bits of the COGxCON0 register.
11.5
Dead-Band Control
The dead-band control provides for non-overlapping
PWM output signals to prevent shoot through current
in the external power switches.
The COG contains two 4-bit dead-band counters. One
dead-band counter is used for rising event dead-band
control. The other is used for falling event dead-band
control.
Dead band is timed by counting COG_clock periods
from zero up to the value in the dead-band count
register. Use Equation 11-1 to calculate dead-band
times.
11.5.1
RISING EVENT DEAD BAND
Rising event dead band delays the turn-on of
COGxOUT0 from when COGxOUT1 is turned off. The
rising event dead-band time starts when the rising
event output goes true.
The rising event output into the dead-band counter
may be delayed by the phase delay. When the phase
delay time is zero, the rising event output goes true
coincident with the unblanked rising input event. When
the phase delay time is not zero, the rising event
output goes true at the completion of the phase delay
time.
The rising event dead-band time is set by the value
contained in the GxDBR bits of the COGxDB
register. When the value is zero, rising event dead
band is disabled.
11.5.2
FALLING EVENT DEAD BAND
Falling event dead band delays the turn-on of
COGxOUT1 from when COGxOUT0 is turned off. The
falling event dead-band time starts when the falling
event output goes true. The falling event output goes
true coincident with the unblanked falling input event.
The falling event dead-band time is set by the value
contained in the GxDBF bits of the COGxDB
register. When the value is zero, falling event dead
band is disabled.
11.5.3
DEAD-BAND TIME UNCERTAINTY
When the rising and falling events that trigger the
dead-band counters come from asynchronous inputs,
it creates uncertainty in the dead-band time. The
maximum uncertainty is equal to one COG_clock
period. Refer to Equation 11-1 for more detail.
DS40001576D-page 78
2011-2015 Microchip Technology Inc.
PIC12F752/HV752
11.5.4
DEAD-BAND OVERLAP
There are two cases of dead-band overlap:
• Rising-to-falling
• Falling-to-rising
11.5.4.1
Rising-to-Falling Overlap
In this case, the falling event occurs while the rising
event dead-band counter is still counting. When this
happens, the COGxOUT0 drive is suppressed and the
dead band extends by the falling event dead-band
time. At the termination of the extended dead-band
time, the COGxOUT1 drive goes true.
11.5.4.2
Falling-to-Rising Overlap
In this case, the rising event occurs while the falling
event dead-band counter is still counting. When this
happens, the COGxOUT1 drive is suppressed and the
dead band extends by the rising event dead-band
time. At the termination of the extended dead-band
time, the COGxOUT0 drive goes true.
11.6
11.6.2
FALLING EVENT INPUT BLANKING
The rising event blanking counter inhibits the falling
input from triggering a falling event. The rising event
blanking time starts when the falling event output drive
goes false.
The rising event blanking time is set by the value
contained in the GxBLKR bits of the COGxBLK
register.
When the GxBLKR value is ‘0’, rising event
blanking is disabled and the blanking counter output is
true, thereby, allowing the event signal to pass straight
through to the event trigger circuit.
11.6.3
BLANKING TIME UNCERTAINTY
When the rising and falling events that trigger the
blanking counters are asynchronous to the
COG_clock, it creates uncertainty in the blanking time.
The maximum uncertainty is equal to one COG_clock
period. Refer to Equation 11-1 and Example 11-1 for
more detail.
Blanking Control
Input blanking is a function whereby the event inputs
can be masked or blanked for a short period of time.
This is to prevent electrical transients caused by the
turn-on/off of power components from generating a
false input event.
The COG contains two 4-bit blanking counters. The
counters are cross coupled with the events they are
blanking. The falling event blanking counter is used to
blank rising input events and the rising event blanking
counter is used to blank falling input events. Once
started, blanking extends for the time specified by the
corresponding blanking counter.
Blanking is timed by counting COG_clock periods from
zero up to the value in the blanking count register. Use
Equation 11-1 to calculate blanking times.
11.6.1
RISING EVENT INPUT BLANKING
The falling event blanking counter inhibits the rising
input from triggering a rising event. The falling event
blanking time starts when the rising event output drive
goes false.
The falling event blanking time is set by the value
contained in the GxBLKF bits of the COGxBLK
register. Blanking times are calculated using the
formula shown in Equation 11-1.
When the GxBLKF value is ‘0’, falling event
blanking is disabled and the blanking counter output is
true, thereby, allowing the event signal to pass straight
through to the event trigger circuit.
2011-2015 Microchip Technology Inc.
DS40001576D-page 79
PIC12F752/HV752
11.7
EXAMPLE 11-1:
Phase Delay
It is possible to delay the assertion of the rising event.
This is accomplished by placing a non-zero value in
COGxPH register. Refer to Register 11-6 and
Figure 11-3 for COG operation with CCP1 and phase
delay. The delay from the input rising event signal
switching to the actual assertion of the events is
calculated the same as the dead-band and blanking
delays. Please see Equation 11-1.
When the COGxPH value is ‘0’, phase delay is
disabled and the phase delay counter output is true,
thereby, allowing the event signal to pass straight
through to complementary output driver flop.
11.7.1
CUMULATIVE UNCERTAINTY
It is not possible to create more than one COG_clock of
uncertainty by successive stages. Consider that the
phase delay stage comes after the blanking stage, the
dead-band stage comes after either the blanking or
phase delay stages, and the blanking stage comes
after the dead-band stage. When the preceding stage
is enabled, the output of that stage is necessarily
synchronous with the COG_clock, which removes any
possibility of uncertainty in the succeeding stage.
EQUATION 11-1:
PHASE, DEAD-BAND,
AND BLANKING TIME
CALCULATION
T min = Count
TIMER UNCERTAINTY
Given:
Count = Ah = 10d
F COG_Clock = 8MHz
Therefore:
1
T uncertainty = -------------------------F COG_clock
1
= --------------- = 125ns
8MHz
Proof:
Count
T min = -------------------------F COG_clock
= 125ns 10d = 1.25s
Count + 1
T max = -------------------------F COG_clock
= 125ns 10d + 1
= 1.375s
Therefore:
T uncertainty = T max – T min
= 1.375s – 1.25s
= 125ns
F COG_clock
Count + 1
T max = -------------------------F COG_clock
T uncertainty = T max – T min
Also:
1
T uncertainty = -------------------------F COG_clock
Where:
T
Count
Phase Delay
GxPH
Rising Dead Band
GxDBR
Falling Dead Band
GxDBF
Rising Event Blanking
GxBLKR
Falling Event Blanking
GxBLKF
DS40001576D-page 80
2011-2015 Microchip Technology Inc.
PIC12F752/HV752
11.8
Auto-Shutdown Control
Auto-shutdown is a method to immediately override
the COG output levels with specific overrides that
allow for safe shutdown of the circuit.
The shutdown state can be either cleared
automatically or held until cleared by software.
11.8.1
SHUTDOWN
The shutdown state can be entered by either of the
following two mechanisms:
• Software generated
• External Input
11.8.1.1
Software Generated Shutdown
Setting the GxASDE bit of the COGxASD register will
force the COG into the shutdown state.
When auto-restart is disabled, the shutdown state will
persist as long as the GxASDE bit is set.
When auto-restart is enabled, the GxASDE bit will
clear automatically and resume operation on the next
rising event. See Figure 11-5.
11.8.1.2
External Shutdown Source
External shutdown inputs provide the fastest way to
safely suspend COG operation in the event of a fault
condition. When any of the selected shutdown inputs
goes true, the output drive latches are reset and the
COG outputs will immediately go to the selected
override levels without software delay.
Any combination of four input sources can be selected
to cause a shutdown condition. The four sources
include:
•
•
•
•
HLTimer1 output
C2OUT (low true)
C1OUT (low true)
COG1FLT pin (low true)
11.8.2
PIN OVERRIDE LEVELS
The levels driven to the output pins, while the
shutdown input is true, are controlled by the GxASDL0
and GxASDL1 bits of the COGxASD register
(Register 11-3). GxASDL0 controls the GxOUT0
override level and GxASDL1 controls the GxOUT1
override level. The control bit logic level corresponds
to the output logic drive level while in the shutdown
state.
Note:
11.8.3
The polarity control does not apply to the
override level.
AUTO-SHUTDOWN RESTART
After an auto-shutdown event has occurred, there are
two ways to have the module resume operation:
• Software controlled
• Auto-restart
The restart method is selected with the GxARSEN bit
of the COGxASD register. Waveforms of a software
controlled automatic restart are shown in Figure 11-5.
11.8.3.1
Software Controlled Restart
When the GxARSEN bit of the COGxASD register is
cleared, the COG must be restarted after an
auto-shutdown event by software.
The COG will resume operation on the first rising
event after the GxASDE bit is cleared. Clearing the
shutdown state requires all selected shutdown inputs
to be false, otherwise, the GxASDE bit will remain set.
11.8.3.2
Auto-Restart
When the GxARSEN bit of the COGxASD register is
set, then the COG will restart from the auto-shutdown
state automatically.
The GxASDE bit will clear automatically and the COG
will resume operation on the first rising event after all
selected shutdown inputs go false.
Shutdown inputs are selected independently with bits
of the COGxASD register (Register 11-3).
Note:
Shutdown inputs are level sensitive, not
edge sensitive. The shutdown state cannot
be cleared as long as the shutdown input
level persists, except by disabling
auto-shutdown,
2011-2015 Microchip Technology Inc.
DS40001576D-page 81
DS40001576D-page 82
Operating State
COGxOUT1
COGxOUT0
GxASDL1
GxASDL0
GxASDE
Shutdown input
NORMAL OUTPUT
NORMAL OUTPUT
Next rising event
3
SOFTWARE CONTROLLED RESTART
SHUTDOWN
Cleared in software
2
SHUTDOWN
Cleared in hardware
4
AUTO-RESTART
NORMAL OUTPUT
Next rising event
5
FIGURE 11-5:
GxARSEN
CCP1
1
PIC12F752/HV752
AUTO-SHUTDOWN WAVEFORM – CCP1 AS RISING AND FALLING EVENT INPUT
SOURCE
2011-2015 Microchip Technology Inc.
PIC12F752/HV752
11.9
Buffer Updates
Changes to the phase, dead band, and blanking count
registers need to occur simultaneously during COG
operation to avoid unintended operation that may
occur as a result of delays between each register
write. This is accomplished with the GxLD bit of the
COGxCON0 register and double buffering of the
phase, blanking, and dead-band count registers.
Before the COG module is enabled, writing the count
registers loads the count buffers without need of the
GxLD bit. However, when the COG is enabled, the
count buffers updates are suspended after writing the
count registers until after the GxLD bit is set. When the
GxLD bit is set, the phase, dead band and blanking
register values are transferred to the corresponding
buffers synchronous with COG operation. The GxLD
bit is cleared by hardware to indicate that the transfer
is complete.
11.10 Alternate Pin Selection
The COGxOUT0, COGxOUT1 and COGxFLT
functions can be directed to alternate pins with control
bits of the APFCON register. Refer to Register 5-1.
Note:
11.12 Configuring the COG
The following steps illustrate how to properly configure
the COG to ensure a synchronous start with the rising
event input:
1.
2.
3.
4.
5.
6.
7.
8.
The default COG outputs have high drive
strength capability, whereas the alternate
outputs do not.
11.11 Operation During Sleep
The COG continues to operate in Sleep provided that
the COG_clock, rising event and falling event sources
remain active.
9.
The HFINTSOC remains active during Sleep when the
COG is enabled and the HFINTOSC is selected as the
COG_clock source.
10.
11.
12.
13.
2011-2015 Microchip Technology Inc.
Configure the desired COGxFLT input,
COGxOUT0 and COGxOUT1 pins with the
corresponding bits in the APFCON register.
Clear all ANSELA register bits associated with
pins that are used for COG functions.
Ensure that the TRIS control bits corresponding
to COGxOUT0 and COGxOUT1 are set so that
both are configured as inputs. These will be set
as outputs later.
Clear the GxEN bit, if not already cleared.
Set desired dead-band times with the COGxDB
register.
Set desired blanking times with the COGxBLK
register.
Set desired phase delay with the COGxPH
register.
Setup the following controls in COGxASD
auto-shutdown register:
• Select desired shutdown sources.
• Select both output overrides to the desired
levels (this is necessary, even if not using
auto-shutdown because start-up will be from
a shutdown state).
• Set the GxASDE bit and clear the GxARSEN
bit.
Select the desired rising and falling event
sources and input modes with the COGxCON1
register.
Configure the following controls in COGxCON0
register:
• Select the desired clock source
• Select the desired output polarities
• Set the output enables of the outputs to be
used.
Set the GxEN bit.
Clear TRIS control bits corresponding to
COGxOUT0 and COGxOUT1 to be used
thereby configuring those pins as outputs.
If auto-restart is to be used, set the GxARSEN bit
and the GxASDE will be cleared automatically.
Otherwise, clear the GxASDE bit to start the
COG.
DS40001576D-page 83
PIC12F752/HV752
11.13 COG Control Registers
REGISTER 11-1:
COGxCON0: COG CONTROL REGISTER 0
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
GxEN
GxOE1
GxOE0
GxPOL1
GxPOL0
GxLD
R/W-0/0
bit 7
R/W-0/0
GxCS
bit 0
Legend:
R = Readable bit
W = Writable bit
U = Unimplemented bit, read as ‘0’
u = Bit is unchanged
x = Bit is unknown
-n/n = Value at POR and BOR/Value at all other Resets
‘1’ = Bit is set
‘0’ = Bit is cleared
q = Value depends on condition
bit 7
GxEN: COGx Enable bit
1 = Module is enabled
0 = Module is disabled
bit 6
GxOE1: COGxOUT1 Output Enable bit
1 = COGxOUT1 is available on associated I/O pin
0 = COGxOUT1 is not available on associated I/O pin
bit 5
GxOE0: COGxOUT0 Output Enable bit
1 = COGxOUT0 is available on associated I/O pin
0 = COGxOUT0 is not available on associated I/O pin
bit 4
GxPOL1: COGxOUT1 Output Polarity bit
1 = Output is inverted polarity
0 = Output is normal polarity
bit 3
GxPOL0: COGxOUT0 Output Polarity bit
1 = Output is inverted polarity
0 = Output is normal polarity
bit 2
GxLD: COGx Load Buffers bit
1 = Phase, blanking, and dead-band buffers to be loaded with register values on next input events
0 = Register to buffer transfer is complete
bit 1-0
GxCS: COGx Clock Source Select bits
11 = Reserved
10 = 8 MHz HFINTOSC clock
01 = Instruction clock (Fosc/4)
00 = System clock (Fosc)
DS40001576D-page 84
2011-2015 Microchip Technology Inc.
PIC12F752/HV752
REGISTER 11-2:
COGxCON1: COG CONTROL REGISTER 1
R/W-0/0
R/W-0/0
GxFSIM
GxRSIM
R/W-0/0
R/W-0/0
R/W-0/0
GxFS
R/W-0/0
R/W-0/0
R/W-0/0
GxRS
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
U = Unimplemented bit, read as ‘0’
u = Bit is unchanged
x = Bit is unknown
-n/n = Value at POR and BOR/Value at all other Resets
‘1’ = Bit is set
‘0’ = Bit is cleared
q = Value depends on condition
bit 7
GxFSIM: COGx Falling Source Input Mode bit
1 = Input is edge sensitive
0 = Input is level sensitive
bit 6
GxRSIM: COGx Rising Source Input Mode bit
1 = Input is edge sensitive
0 = Input is level sensitive
bit 5-3
GxFS: COGx Falling Source Select bits
111 = COGxFLT or HLTimer1
110 = CCP1 or HLTimer1
101 = C2OUT or HLTimer1
100 = C1OUT or HLTimer1
011 = COGxFLT
010 = CCP1
001 = C2OUT
000 = C1OUT
bit 2-0
GxRS: COGx Rising Source Select bits
111 = COGxFLT or HLTimer1
110 = CCP1 or HLTimer1
101 = C2OUT or HLTimer1
100 = C1OUT or HLTimer1
011 = COGxFLT
010 = CCP1
001 = C2OUT
000 = C1OUT
2011-2015 Microchip Technology Inc.
DS40001576D-page 85
PIC12F752/HV752
REGISTER 11-3:
COGxASD: COG AUTO-SHUTDOWN CONTROL REGISTER
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
GxASDE
GxARSEN
GxASDL1
GxASDL0
GxASDSHLT
GxASDSC2
GxASDSC1
GxASDSFLT
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
U = Unimplemented bit, read as ‘0’
u = Bit is unchanged
x = Bit is unknown
-n/n = Value at POR and BOR/Value at all other Resets
‘1’ = Bit is set
‘0’ = Bit is cleared
q = Value depends on condition
bit 7
GxASDE: Auto-Shutdown Event Status bit
1 = COG is in the shutdown state
0 = COG is not in the shutdown state
bit 6
GxARSEN: Auto-Restart Enable bit
1 = Auto-restart is enabled
0 = Auto-restart is disabled
bit 5
GxASDL1: COGxOUT1 Auto-shutdown Override Level bit
1 = A logic ‘1’ is placed on COGxOUT1 when a shutdown input is true
0 = A logic ‘0’ is placed on COGxOUT1 when a shutdown input is true
bit 4
GxASDL0: COGxOUT0 Auto-shutdown Override Level bit
1 = A logic ‘1’ is placed on COGxOUT0 when a shutdown input is true
0 = A logic ‘0’ is placed on COGxOUT0 when a shutdown input is true
bit 3
GxASDSHLT: COG Auto-shutdown Source Enable bit 3
1 = COG is shutdown when HLTMR equals HLTPR is low
0 = HLTimer1 pin has no effect on shutdown
bit 2
GxASDSC2: COG Auto-shutdown Source Enable bit 2
1 = COG is shutdown when C2OUT is low
0 = C2OUT pin has no effect on shutdown
bit 1
GxASDSC1: COG Auto-shutdown Source Enable bit 1
1 = COG is shutdown when C1OUT is low
0 = C1OUT pin has no effect on shutdown
bit 0
GxASDSFLT: COG Auto-shutdown Source Enable bit 0
1 = COG is shutdown when COGxFLT pin is low
0 = COGxFLT pin has no effect on shutdown
DS40001576D-page 86
2011-2015 Microchip Technology Inc.
PIC12F752/HV752
REGISTER 11-4:
R/W-x/u
COGxDB: COG DEAD-BAND COUNT REGISTER
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
GxDBR
R/W-x/u
R/W-x/u
GxDBF
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
U = Unimplemented bit, read as ‘0’
u = Bit is unchanged
x = Bit is unknown
-n/n = Value at POR and BOR/Value at all other Resets
‘1’ = Bit is set
‘0’ = Bit is cleared
q = Value depends on condition
bit 7-4
GxDBR: Rising Event Dead-band Count Value bits
Number of COG clock periods to delay primary output after rising event input
bit 3-0
GxDBF: Falling Event Dead-band Count Value bits
Number of COG clock periods to delay complementary output after falling event input
REGISTER 11-5:
R/W-x/u
COGxBLK: COG BLANKING COUNT REGISTER
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
GxBLKR
R/W-x/u
R/W-x/u
R/W-x/u
GxBLKF
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
U = Unimplemented bit, read as ‘0’
u = Bit is unchanged
x = Bit is unknown
-n/n = Value at POR and BOR/Value at all other Resets
‘1’ = Bit is set
‘0’ = Bit is cleared
q = Value depends on condition
bit 7-4
GxBLKR: Rising Event Blanking Count Value bits
Number of COGx clock periods to inhibit falling event input
bit 3-0
GxBLKF: Falling Event Blanking Count Value bits
Number of COGx clock periods to inhibit rising event input
REGISTER 11-6:
COGxPH: COG PHASE COUNT REGISTER
U-0
U-0
U-0
U-0
—
—
—
—
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
GxPH
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
U = Unimplemented bit, read as ‘0’
u = Bit is unchanged
x = Bit is unknown
-n/n = Value at POR and BOR/Value at all other Resets
‘1’ = Bit is set
‘0’ = Bit is cleared
q = Value depends on condition
bit 7-4
Unimplemented: Read as ‘0’
bit 3-0
GxPH: Rising Event Phase Delay Count Value bits
Number of COG clock periods to delay rising edge event
2011-2015 Microchip Technology Inc.
DS40001576D-page 87
PIC12F752/HV752
TABLE 11-1:
SUMMARY OF REGISTERS ASSOCIATED WITH COG
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Register
on Page
ANSELA
—
—
ANSA5
ANSA4
—
ANSA2
ANSA1
ANSA0
41
APFCON
—
—
—
T1GSEL
—
Name
COG1PH
—
—
—
—
COG1FSEL COG1O1SEL COG1O0SEL
38
G1PH
87
COG1BLK
G1BLKR
G1BLKF
87
COG1DB
G1DBR
G1DBF
87
COG1CON0
G1EN
COG1CON1 G1FSIM
COG1ASD
G1OE1
G1OE0
G1RSIM
G1POL1
G1POL0
G1LD
G1FS
G1CS1
G1CS0
G1RS
G1ASDE G1ARSEN G1ASDL1 G1ASDL0 G1ASDSHLT G1ASDSC2
84
85
G1ASDSC1
G1ASDSFLT
86
T0IF
INTF
IOCIF
15
GIE
PEIE
T0IE
INTE
IOCIE
LATA
—
—
LATA5
LATA4
—
LATA2
LATA1
LATA0
40
PIE2
—
—
C2IE
C1IE
—
COG1IE
—
CCP1IE
17
PIR2
—
—
C2IF
C1IF
—
COG1IF
—
CCP1IF
19
—
—
TRISA5
TRISA4
TRISA3
TRISA2
TRISA1
TRISA0
40
INTCON
TRISA
Legend:
Note 1:
2:
x = unknown, u = unchanged, – = unimplemented locations read as ‘0’. Shaded cells are not used by COG.
Other (non Power-up) Resets include MCLR Reset and Watchdog Timer Reset during normal operation.
See Configuration Word register (Register 17-1) for operation of all register bits.
DS40001576D-page 88
2011-2015 Microchip Technology Inc.
PIC12F752/HV752
12.0
ANALOG-TO-DIGITAL
CONVERTER (ADC) MODULE
The Analog-to-Digital Converter (ADC) allows
conversion of an analog input signal to a 10-bit binary
representation of that signal. This device uses analog
inputs, which are multiplexed into a single sample and
hold circuit. The output of the sample and hold is
connected to the input of the converter. The converter
generates a 10-bit binary result via successive
approximation and stores the conversion result into the
ADC result registers (ADRESL and ADRESH).
The ADC voltage reference is software selectable to
either VDD or a voltage applied to the external reference
pins.
The ADC can generate an interrupt upon completion of
a conversion. This interrupt can be used to wake-up the
device from Sleep.
Figure 12-1 shows the block diagram of the ADC.
Note:
The ADRESL and ADRESH registers are
read-only.
FIGURE 12-1:
ADC BLOCK DIAGRAM
VDD
VCFG = 0
VREF+
AN0
0000
AN1/VREF+
0001
AN2
0010
AN3
0011
VCFG = 1
A/D
10
GO/DONE
dac_ref
1110
fvr_ref
1111
ADFM
0 = Left Justify
1 = Right Justify
ADON
CHS
2011-2015 Microchip Technology Inc.
10
Vss
ADRESH
ADRESL
DS40001576D-page 89
PIC12F752/HV752
12.1
ADC Configuration
When configuring and using the ADC the following
functions must be considered:
•
•
•
•
•
•
Port configuration
Channel selection
ADC voltage reference selection
ADC conversion clock source
Interrupt control
Results formatting
12.1.1
PORT CONFIGURATION
The ADC can be used to convert both analog and digital
signals. When converting analog signals, the I/O pin
should be configured for analog by setting the associated
TRIS and ANSEL bits. See the corresponding port
section for more information.
Note:
12.1.2
Analog voltages on any pin that is defined
as a digital input may cause the input buffer to conduct excess current.
CHANNEL SELECTION
The CHS bits of the ADCON0 register determine which
channel is connected to the sample and hold circuit.
12.1.4
CONVERSION CLOCK
The source of the conversion clock is software
selectable via the ADCS bits of the ADCON1 register.
There are seven possible clock options:
•
•
•
•
•
•
•
FOSC/2
FOSC/4
FOSC/8
FOSC/16
FOSC/32
FOSC/64
FRC (dedicated internal oscillator)
The time to complete one bit conversion is defined as
TAD. One full 10-bit conversion requires 11 TAD periods
as shown in Figure 12-2.
For correct conversion, the appropriate TAD specification
must be met. See A/D conversion requirements in
Section 20.0 “Electrical Specifications” for more
information. Table 12-1 gives examples of appropriate
ADC clock selections.
Note:
Unless using the FRC, any changes in the
system clock frequency will change the
ADC clock frequency, which may
adversely affect the ADC result.
When changing channels, a delay is required before
starting the next conversion. Refer to Section 12.2
“ADC Operation” for more information.
12.1.3
ADC VOLTAGE REFERENCE
The VCFG bit of the ADCON0 register provides control
of the positive voltage reference. The positive voltage
reference can be either VDD or an external voltage
source. The negative voltage reference is always
connected to the ground reference.
DS40001576D-page 90
2011-2015 Microchip Technology Inc.
PIC12F752/HV752
TABLE 12-1:
ADC CLOCK PERIOD (TAD) VS. DEVICE OPERATING FREQUENCIES (VDD > 3.0V)
ADC Clock Period (TAD)
ADC Clock Source
Device Frequency (FOSC)
ADCS
FOSC/2
20 MHz
000
100 ns
(2)
(2)
8 MHz
4 MHz
250 ns
(2)
500 ns
500 ns
(2)
1.0 s
(2)
(2)
1 MHz
2.0 s
4.0 s
FOSC/4
100
200 ns
FOSC/8
001
400 ns(2)
1.0 s(2)
2.0 s
8.0 s(3)
FOSC/16
101
800 ns(2)
2.0 s
4.0 s
16.0 s(3)
FOSC/32
010
1.6 s
4.0 s
FOSC/64
110
3.2 s
8.0 s(3)
FRC
Legend:
Note 1:
2:
3:
4:
2-6 s
2-6 s
(1,4)
x11
8.0 s
32.0 s(3)
16.0 s(3)
64.0 s(3)
2-6 s
2-6 s(1,4)
(3)
(1,4)
(1,4)
Shaded cells are outside of recommended range.
The FRC source has a typical TAD time of 4 s for VDD > 3.0V.
These values violate the minimum required TAD time.
For faster conversion times, the selection of another clock source is recommended.
When the device frequency is greater than 1 MHz, the FRC clock source is only recommended if the
conversion will be performed during Sleep.
FIGURE 12-2:
ANALOG-TO-DIGITAL CONVERSION TAD CYCLES
TCY to TAD TAD1 TAD2 TAD3 TAD4 TAD5 TAD6 TAD7 TAD8 TAD9 TAD10 TAD11
b9
b8
b7
b6
b5
b4
b3
b2
b1
b0
Conversion Starts
Holding Capacitor is Disconnected from Analog Input (typically 100 ns)
Set GO/DONE bit
12.1.5
ADRESH and ADRESL registers are loaded,
GO bit is cleared,
ADIF bit is set,
Holding capacitor is connected to analog input
INTERRUPTS
The ADC module allows for the ability to generate an
interrupt upon completion of an Analog-to-Digital
conversion. The ADC interrupt flag is the ADIF bit in the
PIR1 register. The ADC interrupt enable is the ADIE bit
in the PIE1 register. The ADIF bit must be cleared in
software.
Note:
The ADIF bit is set at the completion of
every conversion, regardless of whether
or not the ADC interrupt is enabled.
This interrupt can be generated while the device is
operating or while in Sleep. If the device is in Sleep, the
interrupt will wake-up the device. Upon waking from
Sleep, the next instruction following the SLEEP
instruction is always executed. If the user is attempting
to wake-up from Sleep and resume in-line code
execution, the global interrupt must be disabled. If the
global interrupt is enabled, execution will switch to the
Interrupt Service Routine.
2011-2015 Microchip Technology Inc.
DS40001576D-page 91
PIC12F752/HV752
12.1.6
RESULT FORMATTING
The 10-bit A/D conversion result can be supplied in two
formats, left justified or right justified. The ADFM bit of
the ADCON0 register controls the output format.
Figure 12-4 shows the two output formats.
FIGURE 12-3:
10-BIT A/D CONVERSION RESULT FORMAT
ADRESH
(ADFM = 0)
ADRESL
MSB
LSB
bit 7
bit 0
bit 7
10-bit A/D Result
Unimplemented: Read as ‘0’
MSB
(ADFM = 1)
bit 7
LSB
bit 0
Unimplemented: Read as ‘0’
12.2
12.2.1
ADC Operation
STARTING A CONVERSION
To enable the ADC module, the ADON bit of the
ADCON0 register must be set to a ‘1’. Setting the GO/
DONE bit of the ADCON0 register to a ‘1’ will start the
Analog-to-Digital conversion.
Note:
12.2.2
The GO/DONE bit should not be set in the
same instruction that turns on the ADC.
Refer to Section 12.2.6 “A/D Conversion Procedure”.
COMPLETION OF A CONVERSION
When the conversion is complete, the ADC module will:
• Clear the GO/DONE bit
• Set the ADIF flag bit
• Update the ADRESH:ADRESL registers with new
conversion result
12.2.3
TERMINATING A CONVERSION
If a conversion must be terminated before completion,
the GO/DONE bit can be cleared in software. The
ADRESH:ADRESL registers will not be updated with
the partially complete Analog-to-Digital conversion
sample. Instead, the ADRESH:ADRESL register pair
will retain the value of the previous conversion.
Additionally, a 2 TAD delay is required before another
acquisition can be initiated. Following this delay, an
input acquisition is automatically started on the
selected channel.
Note:
bit 0
bit 7
bit 0
10-bit A/D Result
12.2.4
ADC OPERATION DURING SLEEP
The ADC module can operate during Sleep. This
requires the ADC clock source to be set to the FRC
option. When the FRC clock source is selected, the
ADC waits one additional instruction before starting the
conversion. This allows the SLEEP instruction to be
executed, which can reduce system noise during the
conversion. If the ADC interrupt is enabled, the device
will wake-up from Sleep when the conversion
completes. If the ADC interrupt is disabled, the ADC
module is turned off after the conversion completes,
although the ADON bit remains set.
When the ADC clock source is something other than
FRC, a SLEEP instruction causes the present
conversion to be aborted and the ADC module is
turned off, although the ADON bit remains set.
12.2.5
SPECIAL EVENT TRIGGER
The CCP Special Event Trigger allows periodic ADC
measurements without software intervention. When
this trigger occurs, the GO/DONE bit is set by hardware
and the Timer1 counter resets to zero.
Using the Special Event Trigger does not assure proper
ADC timing. It is the user’s responsibility to ensure that
the ADC timing requirements are met.
Section 10.0
“Capture/Compare/PWM
See
Modules” for more information.
A device Reset forces all registers to their
Reset state. Thus, the ADC module is
turned off and any pending conversion is
terminated.
DS40001576D-page 92
2011-2015 Microchip Technology Inc.
PIC12F752/HV752
12.2.6
A/D CONVERSION PROCEDURE
This is an example procedure for using the ADC to
perform an Analog-to-Digital conversion:
1.
2.
3.
4.
5.
6.
7.
8.
Configure Port:
• Disable pin output driver (See TRIS register)
• Configure pin as analog
Configure the ADC module:
• Select ADC conversion clock
• Configure voltage reference
• Select ADC input channel
• Select result format
• Turn on ADC module
Configure ADC interrupt (optional):
• Clear ADC interrupt flag
• Enable ADC interrupt
• Enable peripheral interrupt
• Enable global interrupt(1)
Wait the required acquisition time(2)
Start conversion by setting the GO/DONE bit
Wait for ADC conversion to complete by one of
the following:
• Polling the GO/DONE bit
• Waiting for the ADC interrupt (interrupts
enabled)
Read ADC Result
Clear the ADC interrupt flag (required if interrupt
is enabled)
EXAMPLE 12-1:
A/D CONVERSION
;This code block configures the ADC
;for polling, Vdd reference, Frc clock
;and RA0 input.
;
;Conversion start & polling for completion
; are included.
;
BANKSEL TRISA
;
BSF
TRISA,0
;Set RA0 to input
BANKSEL ADCON1
;
MOVLW
B’01110000’ ;ADC Frc clock,
IORWF
ADCON1
; and RA0 as analog
BANKSEL ADCON0
;
MOVLW
B’10000001’ ;Right justify,
MOVWF
ADCON0
;Vdd Vref, AN0, On
CALL
SampleTime ;Acquisiton delay
BSF
ADCON0,GO
;Start conversion
TEST AGAIN
BTFSC
ADCON0,GO
;Is conversion done?
GOTO
TEST AGAIN ;No, test again
BANKSEL ADRESH
;
MOVF
ADRESH,W
;Read upper 2 bits
MOVWF
RESULTHI
;Store in GPR space
BANKSEL ADRESL
;
MOVF
ADRESL,W
;Read lower 8 bits
MOVWF
RESULTLO
;Store in GPR space
Note 1: The global interrupt can be disabled if the
user is attempting to wake-up from Sleep
and resume in-line code execution.
2: See Section 12.4 “A/D Acquisition
Requirements”.
2011-2015 Microchip Technology Inc.
DS40001576D-page 93
PIC12F752/HV752
12.3
ADC Control Registers
REGISTER 12-1:
ADCON0: A/D CONTROL REGISTER 0
R/W-0
R/W-0
ADFM
VCFG
R/W-0
R/W-0
R/W-0
R/W-0
CHS
R/W-0
R/W-0
GO/DONE
ADON
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
U = Unimplemented bit, read as ‘0’
-n = Value at POR
‘1’ = Bit is set
‘0’ = Bit is cleared
x = Bit is unknown
bit 7
ADFM: A/D Conversion Result Format Select bit
1 = Right justified
0 = Left justified
bit 6
VCFG: Voltage Reference bit
1 = VREF pin
0 = VDD
bit 5-2
CHS: Analog Channel Select bits
0000 = Channel 00 (AN0)
0001 = Channel 01 (AN1)
0010 = Channel 02 (AN2)
0011 = Channel 03 (AN3)
0100 = Reserved. Do not use.
•
•
•
1101 = Reserved. Do not use.
1110 = Digital-to-Analog Converter (DAC output)
1111 = Fixed Voltage Reference (FVR)
bit 1
GO/DONE: A/D Conversion Status bit
1 = A/D conversion cycle in progress. Setting this bit starts an A/D conversion cycle.
This bit is automatically cleared by hardware when the A/D conversion has completed.
0 = A/D conversion completed/not in progress
bit 0
ADON: ADC Enable bit
1 = ADC is enabled
0 = ADC is disabled and consumes no operating current
DS40001576D-page 94
2011-2015 Microchip Technology Inc.
PIC12F752/HV752
REGISTER 12-2:
U-0
ADCON1: A/D CONTROL REGISTER 1
R/W-0/0
—
R/W-0/0
R/W-0/0
ADCS
U-0
U-0
U-0
U-0
—
—
—
—
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
U = Unimplemented bit, read as ‘0’
u = Bit is unchanged
x = Bit is unknown
-n/n = Value at POR and BOR/Value at all other Resets
‘1’ = Bit is set
‘0’ = Bit is cleared
bit 7
Unimplemented: Read as ‘0’
bit 6-4
ADCS: A/D Conversion Clock Select bits
000 = FOSC/2
001 = FOSC/8
010 = FOSC/32
011 = FRC (clock supplied from an internal oscillator with a divisor of 16)
100 = FOSC/4
101 = FOSC/16
110 = FOSC/64
bit 3-0
Unimplemented: Read as ‘0’
2011-2015 Microchip Technology Inc.
DS40001576D-page 95
PIC12F752/HV752
REGISTER 12-3:
ADRESH: ADC RESULT REGISTER HIGH (ADRESH) ADFM = 0 (READ-ONLY)
R-x
R-x
R-x
R-x
R-x
R-x
R-x
R-x
ADRES
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
U = Unimplemented bit, read as ‘0’
-n = Value at POR
‘1’ = Bit is set
‘0’ = Bit is cleared
bit 7-0
x = Bit is unknown
ADRES: ADC Result Register bits
Upper eight bits of 10-bit conversion result
REGISTER 12-4:
ADRESL: ADC RESULT REGISTER LOW (ADRESL) ADFM = 0 (READ-ONLY)
R-x
R-x
ADRES
U-0
U-0
U-0
U-0
U-0
U-0
—
—
—
—
—
—
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
U = Unimplemented bit, read as ‘0’
-n = Value at POR
‘1’ = Bit is set
‘0’ = Bit is cleared
bit 7-6
ADRES: ADC Result Register bits
Lower two bits of 10-bit conversion result
bit 5-0
Unimplemented: Read as ‘0’
REGISTER 12-5:
x = Bit is unknown
ADRESH: ADC RESULT REGISTER HIGH (ADRESH) ADFM = 1 (READ-ONLY)
U-0
U-0
U-0
U-0
U-0
U-0
—
—
—
—
—
—
R-x
R-x
ADRES
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
U = Unimplemented bit, read as ‘0’
-n = Value at POR
‘1’ = Bit is set
‘0’ = Bit is cleared
bit 7-2
Unimplemented: Read as ‘0’
bit 1-0
ADRES: ADC Result Register bits
Upper two bits of 10-bit conversion result
REGISTER 12-6:
R-x
x = Bit is unknown
ADRESL: ADC RESULT REGISTER LOW (ADRESL) ADFM = 1 (READ-ONLY)
R-x
R-x
R-x
R-x
R-x
R-x
R-x
ADRES
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
U = Unimplemented bit, read as ‘0’
-n = Value at POR
‘1’ = Bit is set
‘0’ = Bit is cleared
bit 7-0
x = Bit is unknown
ADRES: ADC Result Register bits
Lower eight bits of 10-bit conversion result
DS40001576D-page 96
2011-2015 Microchip Technology Inc.
PIC12F752/HV752
12.4
A/D Acquisition Requirements
For the ADC to meet its specified accuracy, the charge
holding capacitor (CHOLD) must be allowed to fully
charge to the input channel voltage level. The Analog
Input model is shown in Figure 12-4. The source
impedance (RS) and the internal sampling switch (RSS)
impedance directly affect the time required to charge the
capacitor CHOLD. The sampling switch (RSS) impedance
varies over the device voltage (VDD), see Figure 12-4.
The maximum recommended impedance for analog
sources is 10 k. As the source impedance is
decreased, the acquisition time may be decreased.
EQUATION 12-1:
After the analog input channel is selected (or changed),
an A/D acquisition must be done before the conversion
can be started. To calculate the minimum acquisition
time, Equation 12-1 may be used. This equation
assumes that 1/2 LSb error is used (1024 steps for the
ADC). The 1/2 LSb error is the maximum error allowed
for the ADC to meet its specified resolution.
ACQUISITION TIME EXAMPLE
Temperature = 50°C and external impedance of 10k 5.0V V DD
Assumptions:
T ACQ = Amplifier Settling Time + Hold Capacitor Charging Time + Temperature Coefficient
= T AMP + T C + T COFF
= 2µs + T C + Temperature - 25°C 0.05µs/°C
The value for TC can be approximated with the following equations:
1
V AP PLIE D 1 – ------------ = V CHOLD
2047
;[1] VCHOLD charged to within 1/2 lsb
–TC
----------
RC
V AP P LI ED 1 – e = V CHOLD
;[2] VCHOLD charge response to VAPPLIED
– Tc
---------
RC
1
V AP P LIED 1 – e = V A P PLIE D 1 – ------------
2047
;combining [1] and [2]
Solving for TC:
T C = – C HOLD R IC + R SS + R S ln(1/2047)
= – 10pF 1k + 7k + 10k ln(0.0004885)
= 1.37 µs
Therefore:
T ACQ = 2µs + 1.37µs + 50°C- 25°C 0.05µs/°C
= 4.67µs
Note 1: The reference voltage (VREF) has no effect on the equation, since it cancels itself out.
2: The charge holding capacitor (CHOLD) is not discharged after each conversion.
3: The maximum recommended impedance for analog sources is 10 k. This is required to meet the pin
leakage specification.
2011-2015 Microchip Technology Inc.
DS40001576D-page 97
PIC12F752/HV752
FIGURE 12-4:
ANALOG INPUT MODEL
VDD
ANx
Rs
Cpin
5 pF
VA
Vt = 0.6V
Vt = 0.6V
Ric 1k
Sampling
Switch
SS Rss
I leakage
± 500 nA
Chold = 10 pF
Vss/VREF-
Legend: Cpin
= Input Capacitance
Vt
= Threshold Voltage
I leakage = Leakage current at the pin due to
various junctions
Ric
= Interconnect Resistance
SS
= Sampling Switch
Chold
= Sample/Hold Capacitance
FIGURE 12-5:
6V
5V
VDD 4V
3V
2V
Rss
5 6 7 8 9 10 11
Sampling Switch
(k)
ADC TRANSFER FUNCTION
Full-Scale Range
3FFh
3FEh
ADC Output Code
3FDh
3FCh
1 LSB ideal
3FBh
Full-Scale
Transition
004h
003h
002h
001h
000h
Analog Input Voltage
1 LSB ideal
VSS/VREF-
DS40001576D-page 98
Zero-Scale
Transition
VDD/VREF+
2011-2015 Microchip Technology Inc.
PIC12F752/HV752
TABLE 12-2:
Name
SUMMARY OF ASSOCIATED ADC REGISTERS
Bit 7
Bit 6
ADCON0
ADFM
VCFG
ADCON1
—
ANSELA
—
Bit 5
—
ANSA5
A/D Result Register High Byte
ADRESL(2)
A/D Result Register Low Byte
INTCON
Bit 3
Bit 2
CHS
ADCS
ADRESH(2)
PORTA
Bit 4
ANSA4
Bit 1
Bit 0
Register on
Page
GO/DONE
ADON
94
—
—
—
—
94
—
ANSA2
ANSA1
ANSA0
41
96*
94*
—
—
RA5
RA4
RA3
RA2
RA1
RA0
40
GIE
PEIE
T0IE
INTE
IOCIE
T0IF
INTF
IOCIF
15
PIE1
TMR1GIE
ADIE
—
—
—
HLTMR1IE
TMR2IE
TMR1IE
16
PIR1
TMR1GIF
ADIF
—
—
—
HLTMR1IF
TMR2IF
TMR1IF
18
—
—
TRISA5
TRISA4
TRISA3(1)
TRISA2
TRISA1
TRISA0
40
TRISA
Legend:
Note 1:
2:
x = unknown, u = unchanged, — = unimplemented read as ‘0’. Shaded cells are not used for ADC module.
* Page provides register information.
TRISA3 always reads ‘1’.
Read-only register.
2011-2015 Microchip Technology Inc.
DS40001576D-page 99
PIC12F752/HV752
13.0
FIXED VOLTAGE REFERENCE
(FVR)
13.2
When the Fixed Voltage Reference module is enabled, it
requires time for the reference circuit to stabilize. Once
the circuit stabilizes and is ready for use, the FVRRDY bit
of the FVRCON register will be set. See Section 20.0
“Electrical Specifications” for the minimum delay
requirement.
The Fixed Voltage Reference (FVR) is a stable voltage
reference, independent of VDD, with 1.2V output level.
The output of the FVR can be configured to supply a
reference voltage to the following:
•
•
•
•
FVR Stabilization Period
ADC input channel
Comparator 1 positive input (C1VP)
Comparator 2 positive input (C2VP)
REFOUT pin
13.3
Operation During Sleep
On the PIC12F752, the FVR is enabled by setting the
FVREN bit of the FVRCON register. The FVR is always
enabled on the PIC12HV752 device.
When the device wakes up from Sleep through an
interrupt or a Watchdog Timer time-out, the contents of
the FVRCON register are not affected. To minimize
current consumption in Sleep mode, FVR the voltage
reference should be disabled.
13.1
13.4
Fixed Voltage Reference Output
The FVR output can be applied to the REFOUT pin by
setting the FVRBUFSS and FVRBUFEN bits of the
FVRCON register. The FVRBUFSS bit selects either
the FVR or DAC output reference to the REFOUT pin
buffer. The FVRBUFEN bit enables the output buffer to
the REFOUT pin.
Effects of a Reset
A device Reset clears the FVRCON register. As a result:
• The FVR module is disabled
• The FVR voltage output is disabled on the
REFOUT pin
Enabling the REFOUT pin automatically overrides any
digital input or output functions of the pin. Reading the
REFOUT pin when it has been configured for a
reference voltage output will always return a ‘0’.
FIGURE 13-1:
VOLTAGE REFERENCE BLOCK DIAGRAM
VDD
5V Shunt
Regulator
VREF+
DACPSS
PIC12HV752 only
DACR
DACRNG
DACEN
DAC
dac_ref
EN
To ADC, Comparators
C1 and C2.
Vss
dac_ref
0
fvr_ref
1
VDD
x1
FVRBUFSS
ref
fvr_ref
To ADC, Comparators
C1 and C2.
+
REFOUT
DACOUT
DACOE
FVRBUFEN
1.2V
12HV752
FVREN
rdy
EN
FVRRDY
VSS
DS40001576D-page 100
2011-2015 Microchip Technology Inc.
PIC12F752/HV752
13.5
FVR Control Registers
REGISTER 13-1:
FVRCON: FIXED VOLTAGE REFERENCE CONTROL REGISTER
R/W-0/0
R-q/q
R/W-0/0
FVREN
FVRRDY
R/W-0/0
FVRBUFEN FVRBUFSS
U-0
U-0
U-0
U-0
—
—
—
—
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
U = Unimplemented bit, read as ‘0’
u = Bit is unchanged
x = Bit is unknown
-n/n = Value at POR and BOR/Value at all other Resets
‘1’ = Bit is set
‘0’ = Bit is cleared
q = Value depends on condition
bit 7
FVREN: Fixed Voltage Reference Enable bit
0 = Fixed Voltage Reference is disabled
1 = Fixed Voltage Reference is enabled
bit 6
FVRRDY: Fixed Voltage Reference Ready Flag bit
0 = Fixed Voltage Reference output is not ready or not enabled bit
1 = Fixed Voltage Reference output is ready for use
bit 5
FVRBUFEN: Voltage Reference Output Pin Buffer Enable
0 = Output buffer is disabled
1 = Output buffer is enabled
bit 4
FVRBUFSS: Voltage Reference Pin Buffer Source Select bit
0 = Bandgap (1.2V) is the input to the output voltage buffer
1 = dac_out is the input to the output voltage buffer
bit 3-0
Unimplemented: Read as ‘0’
TABLE 13-1:
Name
FVRCON
Legend:
SUMMARY OF REGISTERS ASSOCIATED WITH FIXED VOLTAGE REFERENCE
Bit 7
Bit 6
FVREN
FVRRDY
Bit 5
Bit 4
FVRBUFEN FVRBUFSS
Bit 3
Bit 2
Bit 1
Bit 0
Register
on page
—
—
—
—
101
Shaded cells are not used with the Fixed Voltage Reference.
2011-2015 Microchip Technology Inc.
DS40001576D-page 101
PIC12F752/HV752
14.0
DIGITAL-TO-ANALOG
CONVERTER (DAC) MODULE
The 5-bit, dual range Digital-to-Analog Converter
(DAC) module supplies a variable voltage reference,
with 64 selectable output levels of which three levels
are duplicated. The output is ratiometric with respect to
the input source, VSRC+. See Figure 14-1 for a block
diagram of the DAC module.
The output of the DAC module provides a reference
voltage to the following:
•
•
•
•
Comparator positive input
ADC input channel
FVR input reference
DACOUT pin
The DAC is enabled by setting the DACEN bit of the
DACCON0 register.
The input of the DAC can be connected to two external
voltage connections:
• VDD pin
• VREF+ pin
FIGURE 14-1:
DIGITAL-TO-ANALOG CONVERTER BLOCK DIAGRAM
VREF+
1
VDD
0
VSRC+
R2(31)
DACPSS
11111
DACEN
R2(30)
11110
dac_ref
(to Comparator, FVR
FVR and ADC modules)
Full Range
R2(2)
00010
00001
00000
1
DACOUT
0
DACR
5
DACRNG
R1(31)
DACOE
11111
R2(1)
R1(30)
11110
R1(16)
10000
R1(15)
01111
Limited Range
R2(0)
R1(1)
00001
R1(0)
00000
Note: R2 = 16*R1
DS40001576D-page 102
2011-2015 Microchip Technology Inc.
PIC12F752/HV752
14.1
DAC Positive Voltage Source
14.3
The DACPSS bit of the DACCON0 register selects the
positive voltage source, VSRC+. The following voltage
sources are available:
The DAC output value is derived using a resistor ladder
with one end of the ladder tied to the positive voltage
reference and the other end tied to VSS. If the voltage of
the input source fluctuates, a similar fluctuation will
result in the DAC output value.
• VDD pin (default)
• VREF+ pin
The resistor values within the ladder can be found in
Section 20.0 “Electrical Specifications”.
DAC module can select the positive voltage source
using the DACPSS bit of the DACCON0 register. The
default source, DACPSS = 0, connects VDD to the
positive voltage source (VSRC+). VSRC+ can be
changed to the VREF+ pin by setting DACPSS = 1.
14.2
14.4
DAC Output Voltage
The DAC output voltage level of the DAC is determined
by the DACRNG and the DACR bits of the
DACCON0 and DACCON1 registers, respectively.
DAC Range Selection
Use Equation 14-1 to determine the value of the DAC
output voltage. Example 14-1 illustrates the calculations
of the minimum, maximum and increment size of the
DAC output voltage in Full Range mode. Example 14-2
illustrates the Limited Range mode of the DAC output
voltage values.
The DACRNG bit of the DACCON0 register selects
between full-range or limited-range DAC output
voltage.
Each range selects the output in 32 equal steps.
In Full-Range mode, the output is (31/32)*VSRC+. In
Limited-Range mode, the maximum VOUT is limited to
6% of VSRC+, (31/512) * VSRC+.
EQUATION 14-1:
Ratiometric Output Level
DAC OUTPUT VOLTAGE
DACR 4:0
V OUT = VSRC+ ------------------------------
n
2
Note:
The value of ‘n’ is determined by the DACRNG bit.
When: DACRNG = 0 (Limited Range mode); n = 9;
DACRNG = 1 (Full Range mode); n = 5.
EXAMPLE 14-1:
FULL RANGE MODE
VOUT = [VSRC+ * (DACR/25)]
Given: VSRC = VDD = 5V, DACRNG = 1
Minimum VOUT Calculation:
DACR = 0 0000b, (0d);
Maximum VOUT Calculation:
DACR = 1 1111b, (31d);
VOUT = [5V * (0/32)] = 0V;
VOUT = [5V * (31/32)] = 4.84V;
Step Increment Calculation:
DACR = 0 0001b, (1d);
VOUT = [5V * (1/32)] = 156 mV
Full Range Mode Operation:
0V VOUT 4.84V, with 32-step increments of 156 mV.
EXAMPLE 14-2:
LIMITED RANGE MODE
Given: VSRC = VDD = 5V, DACRNG = 0
Minimum VOUT Calculation:
DACR = 0 0000b, (0d);
VOUT = [VSRC+ * (DACR/29)]
Maximum VOUT Calculation:
DACR = 1 1111b, (31d);
VOUT = [5V * (0/512)] = 0V;
VOUT = [5V * (31/512)] = 303 mV;
Step Increment Calculation:
DACR = 0 0001b, (1d);
VOUT = [5V * (1/512)] = 9.8 mV
Limited Range Mode Operation:
0V VOUT 303 mV, with 32-step increments of 9.8 mV.
2011-2015 Microchip Technology Inc.
DS40001576D-page 103
PIC12F752/HV752
FIGURE 14-2:
VOLTAGE REFERENCE OUTPUT BUFFER EXAMPLE
PIC® MCU
DAC
Module
R
Voltage
Reference
Output
Impedance
14.5
+
–
DACOUT
DAC Voltage Reference Output
The DAC output (dac_ref) can be applied to the
DACOUT pin as an unbuffered signal by:
• Setting the DACOE bit of the DACCON0 register
• Clearing the FVRBUFSS bit of the FVRCON
register
• Clearing the FVRBUFEN bit of the FVRCON
register
Figure 14-3 shows a block diagram pin configuration
for the dac_ref and fvr_ref signals. This unbuffered
DACOUT pin has limited current drive capability. When
a higher drive current is required, an external buffer can
be used on the DACOUT pin. Figure 14-2 shows an
example of buffering technique.
14.6
Buffered DAC Output
Operation During Sleep
When the device wakes up from Sleep through an
interrupt or a Watchdog Timer time-out, the contents of
the DACCON0 register are not affected. To minimize
current consumption in Sleep mode, the voltage
reference should be disabled.
14.7
Effects of a Reset
A device Reset clears the DACCON0 and DACCON1
registers. As a result:
• The DAC module is disabled
• The DAC voltage output is disabled on the
DACOUT pin
The DAC output can also be configured to use an
internal buffer by:
• Setting the FVRBUFEN bit of the FVRCON
register changing the pin configuration to be the
REFOUT pin
Enabling the DACOUT pin automatically overrides any
digital input or output functions of the pin. Reading the
DACOUT pin when it has been configured for DAC
reference voltage output will always return a ‘0’.
FIGURE 14-3:
DAC/FVR OUTPUT PIN
dac_ref
0
fvr_ref
1
x1
REFOUT
DACOUT
FVRBUFSS
DACOE
FVRBUFEN
DS40001576D-page 104
2011-2015 Microchip Technology Inc.
PIC12F752/HV752
14.8
DAC Control Registers
REGISTER 14-1:
DACCON0: VOLTAGE REFERENCE CONTROL REGISTER 0
R/W-0/0
R/W-0/0
R/W-0/0
U-0
U-0
R/W-0/0
U-0
U-0
DACEN
DACRNG
DACOE
—
—
DACPSS
—
—
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
U = Unimplemented bit, read as ‘0’
u = Bit is unchanged
x = Bit is unknown
-n/n = Value at POR and BOR/Value at all other Resets
‘1’ = Bit is set
‘0’ = Bit is cleared
bit 7
DACEN: DAC Enable bit
1 = DAC is enabled
0 = DAC is disabled
bit 6
DACRNG: DAC Range Selection bit(1)
1 = DAC is operating in Full Range mode
0 = DAC is operating in Limited Range mode
bit 5
DACOE: DAC Voltage Output Enable bit
1 = DAC reference output is enabled to the DACOUT pin(2)
0 = DAC reference output is disabled
bit 4-3
Unimplemented: Read as ‘0’
bit 2
DACPSS: DAC Positive Source Select bits
0 = VDD
1 = VREF+ pin
bit 1-0
Unimplemented: Read as ‘0’
Note 1:
2:
Refer to Equation 14-1.
The DACOUT pin configuration requires additional control bits in the FVRCON register (see Figure 14-3).
REGISTER 14-2:
DACCON1: VOLTAGE REFERENCE CONTROL REGISTER 1
U-0
U-0
U-0
—
—
—
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
DACR
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
U = Unimplemented bit, read as ‘0’
u = Bit is unchanged
x = Bit is unknown
-n/n = Value at POR and BOR/Value at all other Resets
‘1’ = Bit is set
‘0’ = Bit is cleared
bit 7-5
Unimplemented: Read as ‘0’
bit 4-0
DACR: DAC Voltage Output Select bits
1 1111 = DAC Voltage Maximum Output
0 0000 = DAC Voltage Minimum Output
Note 1: Refer to Equation 14-1 to calculate the value of the DAC Voltage Output.
2011-2015 Microchip Technology Inc.
DS40001576D-page 105
PIC12F752/HV752
TABLE 14-1:
SUMMARY OF REGISTERS ASSOCIATED WITH THE DAC MODULE
Name
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Register
on page
DACCON0
DACEN
DACRNG
DACOE
—
—
DACPSS
—
—
105
DACCON1
—
—
—
FVREN
FVRRDY
—
—
FVRCON
Legend:
FVRBUFEN FVRBUFSS
DACR
—
—
105
101
— = unimplemented, read as ‘0’. Shaded cells are unused by the DAC module.
DS40001576D-page 106
2011-2015 Microchip Technology Inc.
PIC12F752/HV752
15.0
COMPARATOR MODULE
Comparators are used to interface analog circuits to a
digital circuit by comparing two analog voltages and
providing a digital indication of their relative magnitudes.
Comparators are very useful mixed signal building
blocks because they provide analog functionality
independent of program execution. The analog
comparator module includes the following features:
•
•
•
•
•
•
•
•
•
Independent comparator control
Programmable input selection
Comparator output is available internally/externally
Programmable output polarity
Interrupt-on-change
Wake-up from Sleep
Programmable Speed/Power optimization
PWM shutdown
Programmable and fixed voltage reference
15.1
Comparator Overview
FIGURE 15-1:
SINGLE COMPARATOR
VIN+
+
VIN-
–
Output
VINVIN+
Output
Note:
The black areas of the output of the
comparator represents the uncertainty
due to input offsets and response time.
A single comparator is shown in Figure 15-1 along with
the relationship between the analog input levels and
the digital output. When the analog voltage at VIN+ is
less than the analog voltage at VIN-, the output of the
comparator is a digital low level. When the analog
voltage at VIN+ is greater than the analog voltage at
VIN-, the output of the comparator is a digital high level.
2011-2015 Microchip Technology Inc.
DS40001576D-page 107
PIC12F752/HV752
FIGURE 15-2:
COMPARATOR MODULE SIMPLIFIED BLOCK DIAGRAM
CxNCH0
CxINTP
Interrupt
CxON(1)
det
Set CxIF
CXIN0-
0
CXIN1-
1
MUX
CxINTN
Interrupt
(2)
det
CXPOL
CxVN
0
Cx
CxVP
CXOUT
MCXOUT
Q
EN
Q1
CXZLF
CxHYS
dac_ref
1 MUX
2
fvr_ref
To Data Bus
1
+
0
CXIN+
ZLF
D
To COG Module
CxSP
(2)
CXSYNC
3
CxON
VSS
0
CXOE
TRIS bit
CXOUT
CXPCH
D
2
(from Timer1)
T1CLK
Note
1:
2:
Q
1
To Timer1
SYNCCXOUT
When CxON = 0, the comparator will produce a ‘0’ at the output.
When CxON = 0, all multiplexer inputs are disconnected.
DS40001576D-page 108
2011-2015 Microchip Technology Inc.
PIC12F752/HV752
15.2
Comparator Control
Each comparator has two control registers: CMxCON0
and CMxCON1.
The CMxCON0 registers (see Register 15-1) contain
Control and Status bits for the following:
•
•
•
•
•
•
•
Enable
Output selection
Output pin enable
Output polarity
Speed/Power selection
Hysteresis enable
Output synchronization
The CMxCON1 registers (see Register 15-2) contain
Control bits for the following:
• Interrupt edge polarity (rising and/or falling)
• Positive input channel selection
• Negative input channel selection
15.2.1
COMPARATOR OUTPUT
SELECTION
The output of the comparator can be monitored by
reading either the CxOUT bit of the CMxCON0 register
or the MCxOUT bit of the CMOUT register. In order to
make the output available for an external connection,
the following conditions must be true:
• CxOE bit of the CMxCON0 register must be set
• Corresponding TRIS bit must be cleared
• CxON bit of the CMxCON0 register must be set
Note 1: The CxOE bit of the CMxCON0 register
overrides the PORT data latch. Setting
the CxON bit of the CMxCON0 register
has no impact on the port override.
2: The internal output of the comparator is
latched with each instruction cycle.
Unless otherwise specified, external
outputs are not latched.
2011-2015 Microchip Technology Inc.
COMPARATOR OUTPUT POLARITY
Inverting the output of the comparator is functionally
equivalent to swapping the comparator inputs. The
polarity of the comparator output can be inverted by
setting the CxPOL bit of the CMxCON0 register.
Clearing the CxPOL bit results in a non-inverted output.
Table 15-1 shows the output state versus input
conditions, including polarity control.
TABLE 15-1:
COMPARATOR OUTPUT
STATE VS. INPUT
CONDITIONS
Input Condition
CxPOL
CxOUT
CxVN > CxVP
0
0
CxVN < CxVP
0
1
CxVN > CxVP
1
1
CxVN < CxVP
1
0
15.2.4
COMPARATOR ENABLE
Setting the CxON bit of the CMxCON0 register enables
the comparator for operation. Clearing the CxON bit
disables the comparator resulting in minimum current
consumption.
15.2.2
15.2.3
COMPARATOR SPEED/POWER
SELECTION
The trade-off between speed or power can be
optimized during program execution with the CxSP
control bit. The default state for this bit is ‘1’ which
selects the normal speed mode. Device power
consumption can be optimized at the cost of slower
comparator propagation delay by clearing the CxSP bit
to ‘0’.
15.3
Comparator Hysteresis
A selectable amount of separation voltage can be
added to the input pins of each comparator to provide a
hysteresis function to the overall operation. Hysteresis
is enabled by setting the CxHYS bit of the CMxCON0
register.
See Section 20.0 “Electrical Specifications” for more
information.
15.4
Timer1 Gate Operation
The output resulting from a comparator operation can
be used as a source for gate control of Timer1. See
Section 7.5 “Timer1 Gate” for more information. This
feature is useful for timing the duration or interval of an
analog event.
It is recommended that the comparator output be
synchronized to Timer1. This ensures that Timer1 does
not increment while a change in the comparator is
occurring.
DS40001576D-page 109
PIC12F752/HV752
15.4.1
COMPARATOR OUTPUT
SYNCHRONIZATION
15.6
Comparator Positive Input
Selection
The output from either comparator, C1 or C2, can be
synchronized with Timer1 by setting the CxSYNC bit of
the CMxCON0 register.
Configuring the CxPCH bits of the CMxCON1
register directs an internal voltage reference or an
analog pin to the non-inverting input of the comparator:
Once enabled, the comparator output is latched on the
falling edge of the Timer1 source clock. If a prescaler is
used with Timer1, the comparator output is latched after
the prescaling function. To prevent a race condition, the
comparator output is latched on the falling edge of the
Timer1 clock source and Timer1 increments on the
rising edge of its clock source. See the Comparator
Block Diagram (Figure 15-2) and the Timer1 Block
Diagram (Figure 7-1) for more information.
•
•
•
•
15.5
Comparator Interrupt
An interrupt can be generated upon a change in the
output value of the comparator for each comparator, a
rising edge detector and a Falling edge detector are
present.
When either edge detector is triggered and its associated enable bit is set (CxINTP and/or CxINTN bits of
the CMxCON1 register), the Corresponding Interrupt
Flag bit (CxIF bit of the PIR2 register) will be set.
To enable the interrupt, you must set the following bits:
• CxON, CxPOL and CxSP bits of the CMxCON0
register
• CxIE bit of the PIE2 register
• CxINTP bit of the CMxCON1 register (for a rising
edge detection)
• CxINTN bit of the CMxCON1 register (for a falling
edge detection)
• PEIE and GIE bits of the INTCON register
The associated interrupt flag bit, CxIF bit of the PIR2
register, must be cleared in software. If another edge is
detected while this flag is being cleared, the flag will still
be set at the end of the sequence.
Note:
Although a comparator is disabled, an
interrupt can be generated by changing
the output polarity with the CxPOL bit of
the CMxCON0 register, or by switching
the comparator on or off with the CxON bit
of the CMxCON0 register.
CxIN0+ analog pin
DAC Reference Voltage (dac_ref)
FVR Reference Voltage (fvr_ref)
VSS (Ground)
See Section 13.0 “Fixed Voltage Reference (FVR)”
for more information on the Fixed Voltage Reference
module.
See Section 14.0 “Digital-to-Analog Converter
(DAC) Module” for more information on the DAC input
signal.
Any time the comparator is disabled (CxON = 0), all
comparator inputs are disabled.
15.7
Comparator Negative Input
Selection
The CxNCH0 bit of the CMxCON0 register selects the
analog input pin to the comparator inverting input.
Note:
15.8
To use CxIN0+ and CxIN1x- pins as
analog input, the appropriate bits must be
set in the ANSEL register and the
corresponding TRIS bits must also be set
to disable the output drivers.
Comparator Response Time
The comparator output is indeterminate for a period of
time after the change of an input source or the selection
of a new reference voltage. This period is referred to as
the response time. The response time of the comparator
differs from the settling time of the voltage reference.
Therefore, both of these times must be considered when
determining the total response time to a comparator
input change. See the Comparator and Voltage Reference Specifications in Section 20.0 “Electrical Specifications” for more details.
15.9
Interaction with the COG Module
The comparator outputs can be brought to the COG
module in order to facilitate auto-shutdown. If autorestart is also enabled, the comparators can be
configured as a closed loop analog feedback to the
COG, thereby creating an analog controlled PWM.
DS40001576D-page 110
2011-2015 Microchip Technology Inc.
PIC12F752/HV752
15.10 Zero Latency Filter
In high-speed operation, and under proper circuit
conditions, it is possible for the comparator output to
oscillate. This oscillation can have adverse effects on
the hardware and software relying on this signal.
Therefore, a digital filter has been added to the
comparator output to suppress the comparator output
oscillation. Once the comparator output changes, the
output is prevented from reversing the change for a
nominal time of 20 ns. This allows the comparator
output to stabilize without affecting other dependent
devices. Refer to Figure 15-3.
FIGURE 15-3:
COMPARATOR ZERO LATENCY FILTER OPERATION
CxOUT From Comparator
CxOUT From ZLF
TZLF
Output waiting for TZLF to expire before an output change is allowed
TZLF has expired so output change of ZLF is immediate based on
comparator output change
2011-2015 Microchip Technology Inc.
DS40001576D-page 111
PIC12F752/HV752
15.11 Analog Input Connection
Considerations
A simplified circuit for an analog input is shown in
Figure 15-4. Since the analog input pins share their
connection with a digital input, they have reverse
biased ESD protection diodes to VDD and VSS. The
analog input, therefore, must be between VSS and VDD.
If the input voltage deviates from this range by more
than 0.6V in either direction, one of the diodes is
forward biased and a latch-up may occur.
A maximum source impedance of 10 k is recommended
for the analog sources. Also, any external component
connected to an analog input pin, such as a capacitor or
a Zener diode, should have very little leakage current to
minimize inaccuracies introduced.
Note 1: When reading a PORT register, all pins
configured as analog inputs will read as a
‘0’. Pins configured as digital inputs will
convert as an analog input, according to
the input specification.
2: Analog levels on any pin defined as a
digital input, may cause the input buffer to
consume more current than is specified.
FIGURE 15-4:
ANALOG INPUT MODEL
VDD
Rs < 10K
Analog
Input
pin
VT 0.6V
RIC
To Comparator
VA
CPIN
5 pF
VT 0.6V
ILEAKAGE(1)
Vss
Legend: CPIN
= Input Capacitance
ILEAKAGE = Leakage Current at the pin due to various junctions
= Interconnect Resistance
RIC
= Source Impedance
RS
VA
= Analog Voltage
= Threshold Voltage
VT
Note 1:
DS40001576D-page 112
See Section 20.0 “Electrical Specifications”
2011-2015 Microchip Technology Inc.
PIC12F752/HV752
15.12 Comparator Control Registers
REGISTER 15-1:
CMxCON0: COMPARATOR Cx CONTROL REGISTER 0
R/W-0/0
R-0/0
R/W-0/0
R/W-0/0
R/W-0/0
R/W-1/1
R/W-0/0
R/W-0/0
CxON
CxOUT
CxOE
CxPOL
CxZLF
CxSP
CxHYS
CxSYNC
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
U = Unimplemented bit, read as ‘0’
u = Bit is unchanged
x = Bit is unknown
-n/n = Value at POR and BOR/Value at all other Resets
‘1’ = Bit is set
‘0’ = Bit is cleared
bit 7
CxON: Comparator Enable bit
1 = Comparator is enabled
0 = Comparator is disabled and consumes no active power
bit 6
CxOUT: Comparator Output bit
If CxPOL = 1 (inverted polarity):
1 = CxVP < CxVN
0 = CxVP > CxVN
If CxPOL = 0 (non-inverted polarity):
1 = CxVP > CxVN
0 = CxVP < CxVN
bit 5
CxOE: Comparator Output Enable bit
1 = CxOUT is present on the CxOUT pin. Requires that the associated TRIS bit be cleared to actually
drive the pin. Not affected by CxON.
0 = CxOUT is internal only
bit 4
CxPOL: Comparator Output Polarity Select bit
1 = Comparator output is inverted
0 = Comparator output is not inverted
bit 3
CxZLF: Zero Latency Filter Enable bit
1 = Zero latency filter is enabled
0 = Zero latency filter is disabled
bit 2
CxSP: Comparator Speed/Power Select bit
1 = Comparator operates in normal power, higher speed mode
0 = Comparator operates in low-power, low-speed mode
bit 1
CxHYS: Comparator Hysteresis Enable bit
1 = Comparator hysteresis enabled
0 = Comparator hysteresis disabled
bit 0
CxSYNC: Comparator Output Synchronous Mode bit
1 = Comparator output to Timer1 and I/O pin is synchronous to changes on Timer1 clock source.
Output updated on the falling edge of Timer1 clock source.
0 = Comparator output to Timer1 and I/O pin is asynchronous.
2011-2015 Microchip Technology Inc.
DS40001576D-page 113
PIC12F752/HV752
REGISTER 15-2:
CMxCON1: COMPARATOR Cx CONTROL REGISTER 1
R/W-0/0
R/W-0/0
CxINTP
CxINTN
R/W-0/0
R/W-0/0
CxPCH
U-0
—
U-0
—
U-0
R/W-0/0
—
CxNCH0
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
U = Unimplemented bit, read as ‘0’
u = Bit is unchanged
x = Bit is unknown
-n/n = Value at POR and BOR/Value at all other Resets
‘1’ = Bit is set
‘0’ = Bit is cleared
bit 7
CxINTP: Comparator Interrupt on Positive Going Edge Enable bit
1 = The CxIF interrupt flag will be set upon a positive going edge of the CxOUT bit
0 = No interrupt flag will be set on a positive going edge of the CxOUT bit
bit 6
CxINTN: Comparator Interrupt on Negative Going Edge Enable bits
1 = The CxIF interrupt flag will be set upon a negative going edge of the CxOUT bit
0 = No interrupt flag will be set on a negative going edge of the CxOUT bit
bit 5-4
CxPCH: Comparator Positive Input Channel Select bits
00 = CxVP connects to CxIN+ pin
01 = CxVP connects to DAC Voltage Reference (dac_ref)
10 = CxVP connects to FVR Voltage Reference (fvr_ref)
11 = CxVP connects to VSS
bit 3-1
Unimplemented: Read as ‘0’
bit 0
CxNCH0: Comparator Negative Input Channel Select bits
0 = CxVN connects to CXIN0- pin
1 = CxVN connects to CXIN1- pin
REGISTER 15-3:
CMOUT: COMPARATOR OUTPUT REGISTER
U-0
U-0
U-0
U-0
U-0
U-0
R-0/0
R-0/0
—
—
—
—
—
—
MC2OUT
MC1OUT
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
U = Unimplemented bit, read as ‘0’
u = Bit is unchanged
x = Bit is unknown
-n/n = Value at POR and BOR/Value at all other Resets
‘1’ = Bit is set
‘0’ = Bit is cleared
bit 7-2
Unimplemented: Read as ‘0’
bit 1
MC2OUT: Mirror Copy of C2OUT bit
bit 0
MC1OUT: Mirror Copy of C1OUT bit
DS40001576D-page 114
2011-2015 Microchip Technology Inc.
PIC12F752/HV752
TABLE 15-2:
SUMMARY OF REGISTERS ASSOCIATED WITH COMPARATOR MODULE
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Register
on Page
CM1CON0
C1ON
C1OUT
C1OE
C1POL
C1ZLF
C1SP
C1HYS
C1SYNC
113
CM1CON1
C1INTP
C1INTN
CM2CON0
C2ON
C2OUT
CM2CON1
C2INTP
C2INTN
—
—
—
DACCON0
DACEN
DACRNG
DACOE
DACCON1
—
—
—
FVRCON
FVREN
FVRRDY
FVRBUFEN
FVRBUFSS
—
INTCON
Name
CMOUT
C1PCH
C2OE
—
—
—
C1NCH0
114
C2ZLF
C2SP
C2HYS
C2SYNC
113
—
—
—
C2NCH0
114
—
—
—
MCOUT2
MCOUT1
114
—
—
DACPSS0
—
—
C2POL
C2PCH
DACR
105
105
—
—
—
101
GIE
PEIE
T0IE
INTE
IOCIE
T0IF
INTF
IOCIF
15
PIE2
—
—
C2IE
C1IE
—
COG1IE
—
CCP1IE
17
PIR2
—
—
C2IF
C1IF
—
COG1IF
—
CCP1IF
19
TRISA2
TRISA1
TRISA0
40
ANSA2
ANSA1
ANSA0
41
TRISA
—
—
TRISA5
TRISA4
TRISA3(1)
ANSELA
—
—
ANSA5
ANSA4
—
Legend:
Note 1:
— = unimplemented location, read as ‘0’. Shaded cells are unused by the comparator module.
TRISA3 always reads ‘1’.
2011-2015 Microchip Technology Inc.
DS40001576D-page 115
PIC12F752/HV752
16.0
INSTRUCTION SET SUMMARY
The PIC12F752/HV752 instruction set is highly
orthogonal and is comprised of three basic categories:
• Byte-oriented operations
• Bit-oriented operations
• Literal and control operations
TABLE 16-1:
OPCODE FIELD
DESCRIPTIONS
Field
f
Description
Register file address (0x00 to 0x7F)
W
Working register (accumulator)
Each PIC16 instruction is a 14-bit word divided into an
opcode, which specifies the instruction type and one or
more operands, which further specify the operation of
the instruction. The formats for each of the categories
is presented in Figure 16-1, while the various opcode
fields are summarized in Table 16-1.
b
Bit address within an 8-bit file register
k
Literal field, constant data or label
x
Don’t care location (= 0 or 1).
The assembler will generate code with x = 0.
It is the recommended form of use for
compatibility with all Microchip software tools.
Table 16-2 lists the instructions recognized by the
MPASMTM assembler.
d
For byte-oriented instructions, ‘f’ represents a file
register designator and ‘d’ represents a destination
designator. The file register designator specifies which
file register is to be used by the instruction.
Destination select; d = 0: store result in W,
d = 1: store result in file register f.
Default is d = 1.
PC
The destination designator specifies where the result of
the operation is to be placed. If ‘d’ is zero, the result is
placed in the W register. If ‘d’ is one, the result is placed
in the file register specified in the instruction.
For bit-oriented instructions, ‘b’ represents a bit field
designator, which selects the bit affected by the
operation, while ‘f’ represents the address of the file in
which the bit is located.
For literal and control operations, ‘k’ represents an
8-bit or 11-bit constant, or literal value.
One instruction cycle consists of four oscillator periods;
for an oscillator frequency of 4 MHz, this gives a normal
instruction execution time of 1 s. All instructions are
executed within a single instruction cycle, unless a
conditional test is true, or the program counter is
changed as a result of an instruction. When this occurs,
the execution takes two instruction cycles, with the
second cycle executed as a NOP.
TO
C
DC
Z
Program Counter
Time-out bit
Carry bit
Digit carry bit
Zero bit
PD
Power-down bit
FIGURE 16-1:
GENERAL FORMAT FOR
INSTRUCTIONS
Byte-oriented file register operations
13
8 7 6
OPCODE
d
f (FILE #)
0
d = 0 for destination W
d = 1 for destination f
f = 7-bit file register address
Bit-oriented file register operations
13
10 9
7 6
OPCODE
b (BIT #)
f (FILE #)
0
b = 3-bit bit address
f = 7-bit file register address
All instruction examples use the format ‘0xhh’ to
represent a hexadecimal number, where ‘h’ signifies a
hexadecimal digit.
Literal and control operations
16.1
Read-Modify-Write Operations
Any instruction that specifies a file register as part of
the instruction performs a Read-Modify-Write (RMW)
operation. The register is read, the data is modified,
and the result is stored according to either the
instruction or the destination designator ‘d’. A read
operation is performed on a register even if the
instruction writes to that register.
For example, a CLRF PORTA instruction will read
PORTA, clear all the data bits, then write the result back
to PORTA. This example would have the unintended
consequence of clearing the condition that set the
IOCIF flag.
DS40001576D-page 116
General
13
8
7
OPCODE
0
k (literal)
k = 8-bit immediate value
CALL and GOTO instructions only
13
11
OPCODE
10
0
k (literal)
k = 11-bit immediate value
2011-2015 Microchip Technology Inc.
PIC12F752/HV752
TABLE 16-2:
PIC12F752/HV752 INSTRUCTION SET
14-Bit Opcode
Mnemonic,
Operands
Description
Cycles
MSb
LSb
Status
Affected
Notes
BYTE-ORIENTED FILE REGISTER OPERATIONS
ADDWF
ANDWF
CLRF
CLRW
COMF
DECF
DECFSZ
INCF
INCFSZ
IORWF
MOVF
MOVWF
NOP
RLF
RRF
SUBWF
SWAPF
XORWF
f, d
f, d
f
–
f, d
f, d
f, d
f, d
f, d
f, d
f, d
f
–
f, d
f, d
f, d
f, d
f, d
Add W and f
AND W with f
Clear f
Clear W
Complement f
Decrement f
Decrement f, Skip if 0
Increment f
Increment f, Skip if 0
Inclusive OR W with f
Move f
Move W to f
No Operation
Rotate Left f through Carry
Rotate Right f through Carry
Subtract W from f
Swap nibbles in f
Exclusive OR W with f
1
1
1
1
1
1
1(2)
1
1(2)
1
1
1
1
1
1
1
1
1
00
00
00
00
00
00
00
00
00
00
00
00
00
00
00
00
00
00
dfff
dfff
lfff
0xxx
dfff
dfff
dfff
dfff
dfff
dfff
dfff
lfff
0xx0
dfff
dfff
dfff
dfff
dfff
ffff
ffff
ffff
xxxx
ffff
ffff
ffff
ffff
ffff
ffff
ffff
ffff
0000
ffff
ffff
ffff
ffff
ffff
00bb
01bb
10bb
11bb
bfff
bfff
bfff
bfff
ffff
ffff
ffff
ffff
111x
1001
0kkk
0000
1kkk
1000
00xx
0000
01xx
0000
0000
110x
1010
kkkk
kkkk
kkkk
0110
kkkk
kkkk
kkkk
0000
kkkk
0000
0110
kkkk
kkkk
kkkk
kkkk
kkkk
0100
kkkk
kkkk
kkkk
1001
kkkk
1000
0011
kkkk
kkkk
0111
0101
0001
0001
1001
0011
1011
1010
1111
0100
1000
0000
0000
1101
1100
0010
1110
0110
C, DC, Z
Z
Z
Z
Z
Z
Z
Z
Z
C
C
C, DC, Z
Z
1, 2
1, 2
2
1, 2
1, 2
1, 2, 3
1, 2
1, 2, 3
1, 2
1, 2
1, 2
1, 2
1, 2
1, 2
1, 2
BIT-ORIENTED FILE REGISTER OPERATIONS
BCF
BSF
BTFSC
BTFSS
f, b
f, b
f, b
f, b
Bit Clear f
Bit Set f
Bit Test f, Skip if Clear
Bit Test f, Skip if Set
1
1
1 (2)
1 (2)
01
01
01
01
1, 2
1, 2
3
3
LITERAL AND CONTROL OPERATIONS
ADDLW
ANDLW
CALL
CLRWDT
GOTO
IORLW
MOVLW
RETFIE
RETLW
RETURN
SLEEP
SUBLW
XORLW
Note 1:
2:
3:
k
k
k
–
k
k
k
–
k
–
–
k
k
Add literal and W
AND literal with W
Call Subroutine
Clear Watchdog Timer
Go to address
Inclusive OR literal with W
Move literal to W
Return from interrupt
Return with literal in W
Return from Subroutine
Go into Standby mode
Subtract W from literal
Exclusive OR literal with W
1
1
2
1
2
1
1
2
2
2
1
1
1
11
11
10
00
10
11
11
00
11
00
00
11
11
C, DC, Z
Z
TO, PD
Z
TO, PD
C, DC, Z
Z
When an I/O register is modified as a function of itself (e.g., MOVF PORTA, 1), the value used will be that value present
on the pins themselves. For example, if the data latch is ‘1’ for a pin configured as input and is driven low by an external
device, the data will be written back with a ‘0’.
If this instruction is executed on the TMR0 register (and where applicable, d = 1), the prescaler will be cleared if
assigned to the Timer0 module.
If the Program Counter (PC) is modified, or a conditional test is true, the instruction requires two cycles. The second
cycle is executed as a NOP.
2011-2015 Microchip Technology Inc.
DS40001576D-page 117
PIC12F752/HV752
16.2
Instruction Descriptions
ADDLW
Add literal and W
Syntax:
[ label ] ADDLW
k
Operands:
0 k 255
Operation:
(W) + k (W)
Status Affected:
C, DC, Z
Description:
The contents of the W register
are added to the 8-bit literal ‘k’
and the result is placed in the
W register.
ADDWF
Add W and f
Syntax:
[ label ] ADDWF
Operands:
BCF
Bit Clear f
Syntax:
[ label ] BCF
Operands:
0 f 127
0b7
Operation:
0 (f)
Status Affected:
None
Description:
Bit ‘b’ in register ‘f’ is cleared.
BSF
Bit Set f
f,b
Syntax:
[ label ] BSF
0 f 127
d 0,1
Operands:
0 f 127
0b7
Operation:
(W) + (f) (destination)
Operation:
1 (f)
Status Affected:
C, DC, Z
Status Affected:
None
Description:
Add the contents of the W register
with register ‘f’. If ‘d’ is ‘0’, the
result is stored in the W register. If
‘d’ is ‘1’, the result is stored back
in register ‘f’.
Description:
Bit ‘b’ in register ‘f’ is set.
ANDLW
AND literal with W
BTFSC
Syntax:
[ label ] ANDLW
Operands:
0 k 255
Operation:
(W) .AND. (k) (W)
Status Affected:
Z
Description:
The contents of W register are
AND’ed with the 8-bit literal ‘k’.
The result is placed in the W
register.
ANDWF
f,d
k
AND W with f
Syntax:
[ label ] ANDWF
Operands:
0 f 127
d 0,1
Bit Test f, Skip if Clear
Syntax:
[ label ] BTFSC f,b
Operands:
0 f 127
0b7
Operation:
skip if (f) = 0
Status Affected:
None
Description:
If bit ‘b’ in register ‘f’ is ‘1’, the next
instruction is executed.
If bit ‘b’ in register ‘f’ is ‘0’, the next
instruction is discarded, and a NOP
is executed instead, making this a
2-cycle instruction.
f,d
Operation:
(W) .AND. (f) (destination)
Status Affected:
Z
Description:
AND the W register with register
‘f’. If ‘d’ is ‘0’, the result is stored in
the W register. If ‘d’ is ‘1’, the
result is stored back in register ‘f’.
DS40001576D-page 118
f,b
2011-2015 Microchip Technology Inc.
PIC12F752/HV752
BTFSS
Bit Test f, Skip if Set
CLRWDT
Clear Watchdog Timer
Syntax:
[ label ] BTFSS f,b
Syntax:
[ label ] CLRWDT
Operands:
0 f 127
0bVDD) 20 mA
Note 1:
Maximum current rating requires even load distribution across I/O pins. Maximum current rating may be
limited by the device package power dissipation characteristics. See Table 20-6 to calculate device specific
limitations.
† NOTICE: Stresses above those listed under “Absolute Maximum Ratings” may cause permanent damage to the
device. This is a stress rating only and functional operation of the device at those or any other conditions above those
indicated in the operation listings of this specification is not implied. Exposure above maximum rating conditions for
extended periods may affect device reliability.
DS40001576D-page 150
2011-2015 Microchip Technology Inc.
PIC12F752/HV752
20.1
Standard Operating Conditions
The standard operating conditions for any device are defined as:
Operating Voltage:
Operating Temperature:
VDDMIN VDD VDDMAX
TA_MIN TA TA_MAX
VDD — Operating Supply Voltage(1)
PIC12F752
VDDMIN (Fosc 8 MHz) ........................................................................................................... +2.0V
VDDMIN (8 MHz Fosc 10 MHz) ........................................................................................... +3.0V
VDDMAX (10 MHz Fosc 20 MHz) ........................................................................................ +5.5V
PIC12HV752
VDDMIN (Fosc 8 MHz) ........................................................................................................... +2.0V
VDDMIN (8 MHz Fosc 10 MHz) ........................................................................................... +3.0V
VDDMAX (10 MHz Fosc 20 MHz) ........................................................................................ +5.0V
TA — Operating Ambient Temperature Range
Industrial Temperature
TA_MIN ...................................................................................................................................... -40°C
TA_MAX .................................................................................................................................... +85°C
Extended Temperature
TA_MIN ...................................................................................................................................... -40°C
TA_MAX .................................................................................................................................. +125°C
Note 1:
See Parameter D001, DS Characteristics: Supply Voltage.
2011-2015 Microchip Technology Inc.
DS40001576D-page 151
PIC12F752/HV752
FIGURE 20-1:
PIC12F752 VOLTAGE-FREQUENCY GRAPH,
-40°C TA +125°C
5.5
5.0
VDD (V)
4.5
4.0
3.5
3.0
2.5
2.0
0
8
10
20
Frequency (MHz)
Note 1: The shaded region indicates the permissible combinations of voltage and frequency.
FIGURE 20-2:
PIC12HV752 VOLTAGE-FREQUENCY GRAPH,
-40°C TA +125°C
5.0
VDD (V)
4.5
4.0
3.5
3.0
2.5
2.0
0
8
10
20
Frequency (MHz)
Note 1: The shaded region indicates the permissible combinations of voltage and frequency.
DS40001576D-page 152
2011-2015 Microchip Technology Inc.
PIC12F752/HV752
20.2
DC Characteristics
TABLE 20-1:
SUPPLY VOLTAGE
PIC12F752
Standard Operating Conditions (unless otherwise stated)
PIC12HV752
Param.
No.
D001
Sym.
VDD
Characteristic
Min.
Typ.†
D001
VDR
RAM Data Retention
D002
D003*
VPOR
SVDD
Conditions
VDDMAX
2.0
—
5.5
V
FOSC 8 MHz
3.0
—
5.5
V
FOSC 10 MHz
4.5
—
5.5
V
FOSC 20 MHz
2.0
—
5.0
V
FOSC 8 MHz(2)
3.0
—
5.0
V
FOSC 10 MHz(2)
4.5
—
5.0
V
FOSC 20 MHz(2)
Voltage(1)
1.5
—
—
V
Device in Sleep mode
1.5
—
—
V
Device in Sleep mode
VDD Start Voltage to ensure internal Power-on Reset signal
D003
D004*
Units
Supply Voltage
VDDMIN
D002*
Max.
—
1.6
—
V
—
1.6
—
V
VDD Rise Rate to ensure VDD Rise Rate internal Power-on Reset signal
0.05
—
—
V/ms See Table 17-1 for details.
* These parameters are characterized but not tested.
† Data in “Typ.” column is at 5.0V, 25°C unless otherwise stated. These parameters are for design guidance
only and are not tested.
Note 1: This is the limit to which VDD can be lowered in Sleep mode without losing RAM data.
2: On the PIC12HV752, VDD is regulated by a Shunt Regulator and is dependent on series resistor
(connected between the unregulated supply voltage and the VDD pin) to limit the current to 50 mA. See
Section “” for design requirements.
2011-2015 Microchip Technology Inc.
DS40001576D-page 153
PIC12F752/HV752
TABLE 20-2:
SUPPLY CURRENT (IDD)(1,2)
PIC12F752
Standard Operating Conditions (unless otherwise stated)
PIC12HV752
Param.
No.
Device Characteristics
Supply Current (IDD)
D010
D010
D016
D016
D011
D011
D012
D012
Min.
Typ.†
Max.
85°C
Conditions
Max.
125°C
Units
VDD
Note
(1, 2)
—
13
25
25
A
2.0
—
19
29
29
A
3.0
—
32
51
51
A
5.0
—
160
230
230
A
2.0
—
240
310
310
A
3.0
—
280
400
400
A
4.5
—
75
280
280
A
2.0
—
155
320
320
A
3.0
—
345
530
530
A
5.0
—
215
310
310
A
2.0
—
375
470
470
A
3.0
—
570
650
650
A
4.5
—
130
280
280
A
2.0
—
175
320
320
A
3.0
—
290
535
535
A
5.0
—
195
296
296
A
2.0
—
315
440
440
A
3.0
—
425
650
650
A
4.5
—
185
340
340
A
2.0
—
325
475
475
A
3.0
—
665
845
845
A
5.0
—
330
475
475
A
2.0
—
550
800
800
A
3.0
—
850
1200
1200
A
4.5
FOSC = 31 kHz
LFINTOSC mode
FOSC = 31 kHz
LFINTOSC mode
FOSC = 1 MHz
EC Oscillator mode
FOSC = 1 MHz
EC Oscillator mode
FOSC = 1 MHz
HFINTOSC mode
FOSC = 1 MHz
HFINTOSC mode
FOSC = 4 MHz
EC Oscillator mode
FOSC = 4 MHz
EC Oscillator mode
* These parameters are characterized but not tested.
† Data in “Typ.” column is at 5.0V, 25°C unless otherwise stated. These parameters are for design guidance
only and are not tested.
Note 1: The test conditions for all IDD measurements in active operation mode are: OSC1 = external square wave,
from rail-to-rail; all I/O pins tri-stated, pulled to VSS; MCLR = VDD; WDT disabled.
2: The supply current is mainly a function of the operating voltage and frequency. Other factors, such as I/O
pin loading and switching rate, oscillator type, internal code execution pattern and temperature, also have
an impact on the current consumption.
DS40001576D-page 154
2011-2015 Microchip Technology Inc.
PIC12F752/HV752
TABLE 20-2:
SUPPLY CURRENT (IDD)(1,2) (CONTINUED)
PIC12F752
Standard Operating Conditions (unless otherwise stated)
PIC12HV752
Param.
No.
Device Characteristics
Supply Current (IDD)
Min.
Typ.†
Conditions
Max.
85°C
Max.
125°C
Units
VDD
Note
(1, 2)
D013
D013
D014
D014
D015
D015
—
245
340
340
A
2.0
—
360
485
485
A
3.0
—
620
845
845
A
5.0
—
310
435
435
A
2.0
—
500
700
700
A
3.0
—
740
1100
1100
A
4.5
—
395
550
550
A
2.0
—
620
850
850
A
3.0
—
1.2
1.6
1.6
mA
5.0
—
460
650
650
A
2.0
—
750
1100
1100
A
3.0
—
1.2
1.6
1.6
mA
4.5
—
1.9
2.6
2.6
mA
4.5
—
2.2
3
3
mA
5.0
—
2.1
3
3
mA
4.5
FOSC = 4 MHz
HFINTOSC mode
FOSC = 4 MHz
HFINTOSC mode
FOSC = 8 MHz
HFINTOSC mode
FOSC = 8 MHz
HFINTOSC mode
FOSC = 20 MHz
EC Oscillator mode
FOSC = 20 MHz
EC Oscillator mode
* These parameters are characterized but not tested.
† Data in “Typ.” column is at 5.0V, 25°C unless otherwise stated. These parameters are for design guidance
only and are not tested.
Note 1: The test conditions for all IDD measurements in active operation mode are: OSC1 = external square wave,
from rail-to-rail; all I/O pins tri-stated, pulled to VSS; MCLR = VDD; WDT disabled.
2: The supply current is mainly a function of the operating voltage and frequency. Other factors, such as I/O
pin loading and switching rate, oscillator type, internal code execution pattern and temperature, also have
an impact on the current consumption.
2011-2015 Microchip Technology Inc.
DS40001576D-page 155
PIC12F752/HV752
TABLE 20-3:
POWER-DOWN CURRENTS (IPD) (1,2)
PIC12F752
Standard Operating Conditions (unless otherwise stated)
Sleep mode
PIC12HV752
Param.
Device
No.
Characteristics
Min.
Typ.†
Conditions
Max.
85°C
Max.
125°C
Units
Note
VDD
Power-down Base Current (IPD)(2)
D020
D020
—
0.05
1.2
4.5
A
2.0
—
0.15
1.6
5.5
A
3.0
—
0.35
2.1
9
A
5.0
—
135
200
200
A
2.0
—
210
280
280
A
3.0
—
260
350
350
A
4.5
Power-down Base Current
D021
D021
D022
D022
D023
D023
D024
D024
WDT, BOR, Comparator, VREF and
T1OSC disabled
(IPD)(2, 3)
—
0.5
1.5
5
A
2.0
—
2.5
4
8
A
3.0
—
9.5
17
19
A
5.0
—
135
200
200
A
2.0
—
210
285
285
A
3.0
—
265
360
360
A
4.5
—
5
9
15
A
3.0
—
6
12
19
A
5.0
—
215
285
285
A
3.0
—
265
360
360
A
4.5
—
160
235
245
A
2.0
—
180
270
280
A
3.0
—
220
350
360
A
5.0
—
280
415
415
A
2.0
—
385
540
540
A
3.0
—
455
735
735
A
4.5
—
50
70
75
A
2.0
—
55
80
90
A
3.0
—
70
90
120
A
5.0
—
185
205
205
A
2.0
—
265
315
315
A
3.0
—
320
445
445
A
4.5
WDT Current(1)
BOR Current(1)
CxSP = 1, Comparator Current(1),
single comparator enabled
CxSP = 0, Comparator Current(1),
single comparator enabled
* These parameters are characterized but not tested.
† Data in “Typ.” column is at 5.0V, 25°C unless otherwise stated. These parameters are for design guidance
only and are not tested.
Note 1: The peripheral current can be determined by subtracting the base IPD current from this limit. Max values
should be used when calculating total current consumption.
2: The power-down current in Sleep mode does not depend on the oscillator type. Power-down current is
measured with the part in Sleep mode, with all I/O pins in high-impedance state and tied to VSS.
3: Shunt regulator is always on and always draws operating current.
DS40001576D-page 156
2011-2015 Microchip Technology Inc.
PIC12F752/HV752
TABLE 20-3:
POWER-DOWN CURRENTS (IPD) (CONTINUED)(1,2)
PIC12F752
Standard Operating Conditions (unless otherwise stated)
Sleep mode
PIC12HV752
Param.
Device
No.
Characteristics
Min.
Typ.†
Max.
85°C
Conditions
Max.
125°C
Units
6.5
A
Note
VDD
Power-down Base Current (IPD)(2, 3)
D025
—
0.2
3.0
3.0
—
0.36
3.5
10
A
5.0
D025
—
210
280
280
A
3.0
—
260
350
350
A
4.5
D026
—
20.0
30
30
A
2.0
—
30.0
40
40
A
3.0
—
50.0
70
70
A
5.0
—
160
238
238
A
2.0
—
250
322
322
A
3.0
D026
D027
D027
D028
D028
—
310
448
448
A
4.5
—
295.0
436
485
A
2.0
—
300
450
500
A
3.0
—
325
475
515
A
5.0
—
395.0
605
605
A
2.0
—
470
710
710
A
3.0
—
505
765
765
A
4.5
—
5.5
10
16
A
2.0
—
7.0
12
18
A
3.0
—
8.5
14
22
A
5.0
—
140.0
205
205
A
2.0
—
220.0
290
290
A
3.0
—
270.0
360
360
A
4.5
A/D Current(1), no conversion in
progress
DAC Current(1)
FVR Current(1), FVRBUFEN = 1,
REFOUT buffer enabled
T1OSC Current,
TMR1CS = 11
* These parameters are characterized but not tested.
† Data in “Typ.” column is at 5.0V, 25°C unless otherwise stated. These parameters are for design guidance
only and are not tested.
Note 1: The peripheral current can be determined by subtracting the base IPD current from this limit. Max values
should be used when calculating total current consumption.
2: The power-down current in Sleep mode does not depend on the oscillator type. Power-down current is
measured with the part in Sleep mode, with all I/O pins in high-impedance state and tied to VSS.
3: Shunt regulator is always on and always draws operating current.
2011-2015 Microchip Technology Inc.
DS40001576D-page 157
PIC12F752/HV752
TABLE 20-4:
I/O PORTS
DC CHARACTERISTICS
Param.
No.
Sym.
VIL
Standard Operating Conditions (unless otherwise stated)
Characteristic
Min.
Typ.†
Max.
Units
—
—
Conditions
—
0.8
V
4.5V VDD 5.5V
—
0.15 VDD
V
2.0V VDD 4.5V
—
—
0.2 VDD
V
2.0V VDD 5.5V
—
—
0.2 VDD
V
2.0V VDD 5.5V
Input Low Voltage
I/O PORT:
D030
with TTL buffer
D030A
D031
with Schmitt Trigger buffer
D032
MCLR
VIH
Input High Voltage
I/O PORT:
D040
with TTL buffer
D040A
D041
with Schmitt Trigger buffer
D042
MCLR
Input Leakage Current
IIL
2.0
—
—
V
4.5V VDD 5.5V
0.25 VDD + 0.8
—
—
V
2.0V VDD 4.5V
0.8 VDD
—
—
V
2.0V VDD 5.5V
0.8 VDD
—
—
V
2.0V VDD 5.5V
(1)
D060
I/O ports
—
0.1
1
A
VSS VPIN VDD,
Pin at high-impedance, 85°C
D061
RA3/MCLR(2)
—
0.7
5
A
VSS VPIN VDD,
Pin at high-impedance, 85°C
—
0.1
5
A
EC Configuration
50
250
400
A
VDD = 5.0V, VPIN = VSS
—
—
0.6
V
IOL = 7 mA, VDD = 4.5V
-40°C TA +125°C
—
—
0.6
V
IOL = 8.5 mA, VDD = 4.5V
-40°C TA +85°C
—
—
0.6
V
IOL = 14 mA, VDD = 4.5V
-40°C TA +125°C
—
—
0.6
V
IOL = 17 mA, VDD = 4.5V
-40°C TA +85°C
VDD-0.7
—
—
V
IOH = -2.5 mA, VDD = 4.5V
-40°C TA +125°C
VDD-0.7
—
—
V
IOH = -3 mA, VDD = 4.5V
-40°C TA +85°C
VDD-0.7
—
—
V
IOH = -5 mA, VDD = 4.5V
-40°C TA +125°C
VDD-0.7
—
—
V
IOH = -6 mA, VDD = 4.5V
-40°C TA +85°C
D063
IPUR
Weak Pull-up Current
VOL
Output Low Voltage
(3)
D070*
D080
I/O Ports RA1, RA4 and RA5
I/O Ports RA0 and RA2
VOH
D090
Output High Voltage
I/O Ports RA1, RA4 and RA5
I/O Ports RA0 and RA2
*
†
Note 1:
2:
3:
These parameters are characterized but not tested.
Data in “Typ.” column is at 5.0V, 25°C unless otherwise stated. These parameters are for design guidance only and are
not tested.
Negative current is defined as current sourced by the pin.
The leakage current on the MCLR pin is strongly dependent on the applied voltage level. The specified levels represent
normal operating conditions. Higher leakage current may be measured at different input voltages.
This specification applies to all weak pull-up pins, including the weak pull-up found on RA3/MCLR. When RA3/MCLR is
configured as MCLR Reset pin, the weak pull-up is always enabled.
DS40001576D-page 158
2011-2015 Microchip Technology Inc.
PIC12F752/HV752
TABLE 20-4:
I/O PORTS (CONTINUED)
DC CHARACTERISTICS
Param.
No.
Sym.
Standard Operating Conditions (unless otherwise stated)
Characteristic
Min.
Typ.†
Max.
Units
Conditions
Capacitive Loading Specs on Output Pins
D101*
COSC2
OSC2 pin
—
—
15
pF
D101A*
CIO
All I/O pins
—
—
50
pF
*
†
Note 1:
2:
3:
These parameters are characterized but not tested.
Data in “Typ.” column is at 5.0V, 25°C unless otherwise stated. These parameters are for design guidance only and are
not tested.
Negative current is defined as current sourced by the pin.
The leakage current on the MCLR pin is strongly dependent on the applied voltage level. The specified levels represent
normal operating conditions. Higher leakage current may be measured at different input voltages.
This specification applies to all weak pull-up pins, including the weak pull-up found on RA3/MCLR. When RA3/MCLR is
configured as MCLR Reset pin, the weak pull-up is always enabled.
TABLE 20-5:
MEMORY PROGRAMMING SPECIFICATIONS
Standard Operating Conditions (unless otherwise stated)
Param.
No.
Sym.
Characteristic
Min.
Typ.†
Max.
Units
Conditions
Program Memory
Programming Specifications
D110
VIHH
Voltage on MCLR/VPP pin
10.0
—
13.0
V
D112
VBE
VDD for Bulk Erase
4.5
—
VDDMAX
V
D113
VPEW
VDD for Write or Row Erase
4.5
—
VDDMAX
V
D114
IPPPGM Current on MCLR/VPP during
Erase/Write
—
300
1000
A
D121
EP
Cell Endurance
10K
100K
—
E/W
-40C TA +85C
(Note 2)
D121A
EP
Cell Endurance
1K
10K
—
E/W
-40C TA +125C
(Note 2)
(Note 1)
Program Flash Memory
D122
VPRW
VDD for Read/Write
VDDMIN
—
VDDMAX
V
D123
TIW
Self-timed Write Cycle Time
—
2
2.5
ms
D124
TRETD
Characteristic Retention
40
—
—
Year Provided no other
specifications are violated
† Data in “Typ.” column is at 5.0V, 25°C unless otherwise stated. These parameters are for design guidance
only and are not tested.
Note 1: Required only if single-supply programming is disabled.
2: Self-write and Block Erase.
2011-2015 Microchip Technology Inc.
DS40001576D-page 159
PIC12F752/HV752
TABLE 20-6:
THERMAL CHARACTERISTICS
Standard Operating Conditions (unless otherwise stated)
Param.
No.
TH01
TH02
Sym.
JA
JC
Characteristic
Thermal Resistance Junction to Ambient
Thermal Resistance Junction to Case
Typ.
Units
Conditions
84.6
°C/W
8-pin PDIP package
149.5
°C/W
8-pin SOIC package
8-pin DFN 3x3mm package
60
°C/W
41.2
°C/W
8-pin PDIP package
39.9
°C/W
8-pin SOIC package
9
°C/W
8-pin DFN 3x3mm package
150
°C
—
W
PD = PINTERNAL + PI/O
TH03
TJMAX
Maximum Junction Temperature
TH04
PD
Power Dissipation
TH05
PINTERNAL Internal Power Dissipation
—
W
PINTERNAL = IDD x VDD(1)
TH06
PI/O
I/O Power Dissipation
—
W
PI/O = (IOL * VOL) + (IOH * (VDD
- VOH))
TH07
PDER
Derated Power
—
W
PDER = PDMAX (TJ - TA)/JA(2)
Note 1:
2:
IDD is current to run the chip alone without driving any load on the output pins.
TA = Ambient temperature; TJ = Junction Temperature
DS40001576D-page 160
2011-2015 Microchip Technology Inc.
PIC12F752/HV752
20.3
Timing Parameter Symbology
The timing parameter symbols have been created with
one of the following formats:
1. TppS2ppS
2. TppS
T
F
Frequency
Lowercase letters (pp) and their meanings:
pp
cc
CCP1
ck
CLKOUT
cs
CS
di
SDI
do
SDO
dt
Data in
io
I/O Port
mc
MCLR
Uppercase letters and their meanings:
S
F
Fall
H
High
I
Invalid (High-Impedance)
L
Low
FIGURE 20-3:
T
Time
osc
rd
rw
sc
ss
t0
t1
wr
OSC1
RD
RD or WR
SCK
SS
T0CKI
T1CKI
WR
P
R
V
Z
Period
Rise
Valid
High-Impedance
LOAD CONDITIONS
Load Condition
Pin
CL
VSS
Note:
CL = 50 pF for all pins.
2011-2015 Microchip Technology Inc.
DS40001576D-page 161
PIC12F752/HV752
20.4
AC Characteristics: PIC12F752/HV752 (Industrial, Extended)
FIGURE 20-4:
CLOCK TIMING
Q4
Q1
Q2
Q3
Q4
Q1
CLKIN
OS02
OS04
OS04
OS03
CLKOUT
CLKOUT
(CLKOUT Mode)
TABLE 20-7:
CLOCK OSCILLATOR TIMING REQUIREMENTS
Standard Operating Conditions (unless otherwise stated)
Param.
No.
Sym.
OS01
FOSC
Characteristic
External CLKIN Frequency(1)
(1)
OS02
TOSC
External CLKIN Period
OS03
TCY
Instruction Cycle Time(1)
*
†
Note 1:
Min.
Typ.†
Max.
Units
DC
—
20
MHz
Conditions
EC Oscillator mode
50
—
ns
EC Oscillator mode
200
TCY
DC
ns
TCY = 4/FOSC
These parameters are characterized but not tested.
Data in “Typ.” column is at 5V, 25°C unless otherwise stated. These parameters are for design guidance only and are
not tested.
Instruction cycle period (TCY) equals four times the input oscillator time base period. All specified values are based on
characterization data for that particular oscillator type under standard operating conditions with the device executing
code. Exceeding these specified limits may result in an unstable oscillator operation and/or higher than expected
current consumption. All devices are tested to operate at “min” values with an external clock applied to CLKIN pin.
When an external clock input is used, the “max” cycle time limit is “DC” (no clock) for all devices.
DS40001576D-page 162
2011-2015 Microchip Technology Inc.
PIC12F752/HV752
TABLE 20-8:
OSCILLATOR PARAMETERS
Standard Operating Conditions (unless otherwise stated)
Param.
No.
Sym.
Characteristic
OS06
TWARM
Internal Oscillator Switch when
running
OS07
INTOSC
Internal Calibrated
INTOSC Frequency(1)
(4 MHz)
OS08
HFOSC
OS09
LFOSC
OS10*
Internal Calibrated
HFINTOSC Frequency(1)
Internal LFINTOSC
Frequency
TIOSC ST HFINTOSC Wake-up from
Sleep Start-up Time
*
†
Note 1:
Freq.
Tolerance
Min.
Typ.†
Max.
Units
—
—
—
2
TOSC
1%
3.96
4.0
4.04
MHz
VDD = 3.5V, TA = 25°C
2%
3.92
4.0
4.08
MHz
2.5V VDD 5.5V,
0°C TA +85°C
5%
3.80
4.0
4.20
MHz
2.0V VDD 5.5V,
-40°C TA +85°C (Ind.),
-40°C TA +125°C (Ext.)
1%
7.92
8
8.08
MHz
VDD = 3.5V, TA = 25°C
2%
7.84
8
8.16
MHz
2.5V VDD 5.5V,
0°C TA +85°C
5%
7.60
8
8.40
MHz
2.0V VDD 5.5V,
-40°C TA +85°C (Ind.),
-40°C TA +125°C (Ext.)
—
—
31
—
kHz
—
—
—
—
12
7
6
24
14
11
s
s
s
Conditions
VDD = 2.0V -40°C TA +85°C
VDD = 3.0V -40°C TA +85°C
VDD = 5.0V -40°C TA +85°C
These parameters are characterized but not tested.
Data in “Typ.” column is at 5.0V, 25°C unless otherwise stated. These parameters are for design guidance only and are
not tested.
To ensure these oscillator frequency tolerances, VDD and VSS must be capacitively decoupled as close to the device as
possible. 0.1 F and 0.01 F values in parallel are recommended.
2011-2015 Microchip Technology Inc.
DS40001576D-page 163
PIC12F752/HV752
FIGURE 20-5:
CLKOUT AND I/O TIMING
Cycle
Write
Fetch
Read
Execute
Q4
Q1
Q2
Q3
FOSC
OS20
CLKOUT
OS21
OS19
OS18
OS16
OS13
OS17
I/O pin
(Input)
OS14
OS15
I/O pin
(Output)
New Value
Old Value
OS18, OS19
TABLE 20-9:
CLKOUT AND I/O TIMING PARAMETERS
Standard Operating Conditions (unless otherwise stated)
Param.
No.
OS13
Sym.
TCKL2IOV
Characteristic
CLKOUT to Port out valid(1)
CLKOUT(1)
Min.
Typ.†
Max.
Units
—
—
20
ns
Conditions
OS14
TIOV2CKH
Port input valid before
TOSC + 200 ns
—
—
ns
OS15
TOSH2IOV
FOSC (Q1 cycle) to Port out valid
—
50
70*
ns
VDD =5.0V
OS16
TOSH2IOI
FOSC (Q2 cycle) to Port input invalid
(I/O in setup time)
50
—
—
ns
VDD =5.0V
OS17
TIOV2OSH
Port input valid to FOSC(Q2 cycle)
(I/O in setup time)
20
—
—
ns
OS18*
TIOR
Port output rise time
—
—
40
15
72
32
ns
ns
VDD =2.0V
VDD =5.0V
OS19*
TIOF
Port output fall time
—
—
28
15
55
30
ns
ns
VDD =2.0V
VDD =5.0V
OS20*
TINP
INT pin input high or low time
25
—
—
ns
OS21*
TIOC
Interrupt-on-change new input level
time
TCY
—
—
ns
* These parameters are characterized but not tested.
† Data in “Typ.” column is at 5.0V, 25C unless otherwise stated.
Note 1: Measurements are taken in RC mode where CLKOUT output is 4 x TOSC.
DS40001576D-page 164
2011-2015 Microchip Technology Inc.
PIC12F752/HV752
FIGURE 20-6:
RESET, WATCHDOG TIMER AND POWER-UP TIMER TIMING
VDD
MCLR
30
Internal
POR
33
PWRT
Time-out
32
OSC
Start-Up Time
Internal Reset(1)
Watchdog Timer
Reset(1)
31
34
34
I/O pins
Note:
Asserted low.
FIGURE 20-7:
BROWN-OUT RESET TIMING AND CHARACTERISTICS
VDD
VBOR + VHYST
VBOR
(Device in Brown-out Reset)
(Device not in Brown-out Reset)
37
Reset
(due to BOR)
*
33*
64 ms delay only if PWRTE bit in the Configuration Word register is programmed to ‘0’.
2011-2015 Microchip Technology Inc.
DS40001576D-page 165
PIC12F752/HV752
TABLE 20-10: RESET, WATCHDOG TIMER, OSCILLATOR START-UP TIMER, POWER-UP TIMER
AND BROWN-OUT RESET PARAMETERS
Standard Operating Conditions (unless otherwise stated)
Param.
No.
Sym.
Characteristic
MCLR Pulse Width (low)
Min.
Typ.†
Max. Units
Conditions
2
5
—
—
—
—
s
s
VDD = 5V, -40°C to +85°C
VDD = 5V, -40°C to +125°C
10
10
20
20
30
35
ms
ms
VDD = 5V, -40°C to +85°C
VDD = 5V, -40°C to +125°C
30
TMCL
31
TWDTLP Low-Power Watchdog Timer
Time-out Period
32*
TPWRT
Power-up Timer Period,
PWRTE = 0 (No Prescaler)
40
65
140
ms
33*
TIOZ
I/O high-impedance from
MCLR Low or Watchdog Timer
Reset
—
—
2.0
s
34
VBOR
Brown-out Reset Voltage (1)
2
2.15
2.3
V
35*
VHYST
Brown-out Reset Hysteresis
—
100
—
mV
-40°C TA +85°C
36*
TBOR
Brown-out Reset DC Minimum
Detection Period
100
—
—
s
VDD VBOR
* These parameters are characterized but not tested.
† Data in “Typ.” column is at 5V, 25°C unless otherwise stated. These parameters are for design guidance
only and are not tested.
Note 1: To ensure these voltage tolerances, VDD and VSS must be capacitively decoupled as close to the device
as possible. 0.1 F and 0.01 F values in parallel are recommended.
DS40001576D-page 166
2011-2015 Microchip Technology Inc.
PIC12F752/HV752
FIGURE 20-8:
TIMER0 AND TIMER1 EXTERNAL CLOCK TIMINGS
T0CKI
40
41
42
T1CKI
45
46
49
47
TMR0 or
TMR1
TABLE 20-11: TIMER0 AND TIMER1 EXTERNAL CLOCK REQUIREMENTS
Standard Operating Conditions (unless otherwise stated)
Param.
No.
Sym.
Characteristic
40*
TT0H
T0CKI High Pulse Width
41*
TT0L
T0CKI Low Pulse Width
No Prescaler
Min.
Typ.†
Max.
Units
0.5 TCY + 20
—
—
ns
ns
With Prescaler
No Prescaler
10
—
—
0.5 TCY + 20
—
—
ns
10
—
—
ns
Greater of:
20 or TCY + 40
N
—
—
ns
With Prescaler
42*
TT0P
T0CKI Period
45*
TT1H
T1CKI High Synchronous, No Prescaler
Time
Synchronous, with Prescaler
0.5 TCY + 20
—
—
ns
15
—
—
ns
Asynchronous
30
—
—
ns
Synchronous, No Prescaler
0.5 TCY + 20
—
—
ns
Synchronous, with Prescaler
15
—
—
ns
46*
TT1L
T1CKI Low
Time
Asynchronous
47*
TT1P
T1CKI Input Synchronous
Period
30
—
—
ns
Greater of:
30 or TCY + 40
N
—
—
ns
Asynchronous
49*
TCKEZTMR1
*
†
Delay from External Clock Edge to Timer
Increment
2
60
—
—
ns
TOSC
—
7 TOSC
—
Conditions
N = prescale
value
N = prescale
value
Timers in Sync
mode
These parameters are characterized but not tested.
Data in “Typ.” column is at 5V, 25°C unless otherwise stated. These parameters are for design guidance only and are
not tested.
2011-2015 Microchip Technology Inc.
DS40001576D-page 167
PIC12F752/HV752
FIGURE 20-9:
PIC12F752/HV752 CAPTURE/COMPARE/PWM TIMINGS (CCP)
CCP1
(Capture mode)
CC01
CC02
CC03
Note:
Refer to Figure 20-3 for load conditions.
TABLE 20-12: CAPTURE/COMPARE/PWM REQUIREMENTS (CCP)
Standard Operating Conditions (unless otherwise stated)
Param.
Sym.
No.
Characteristic
CC01*
TccL
CCP1 Input Low Time
CC02*
TccH
CCP1 Input High Time
CC03*
TccP
CCP1 Input Period
No Prescaler
Min.
Typ.†
Max.
Units
0.5TCY + 20
—
—
ns
With Prescaler
20
—
—
ns
No Prescaler
0.5TCY + 20
—
—
ns
With Prescaler
20
—
—
ns
3TCY + 40
N
—
—
ns
Conditions
N = prescale
value (1, 4 or
16)
* These parameters are characterized but not tested.
† Data in “Typ.” column is at 5V, 25°C unless otherwise stated. These parameters are for design guidance
only and are not tested.
TABLE 20-13: COMPARATOR SPECIFICATIONS(1)
Standard Operating Conditions (unless otherwise stated)
Param.
No.
CM01
Sym.
Characteristics
Min.
Typ.†
Max.
Units
—
10
10
20
20
mV
mV
Comments
VIOFF
Input Offset Voltage
CM02
VICM
Input Common Mode Voltage
0
—
VDD – 1.5
V
CM03
CMRR
Common Mode Rejection Ratio
—
50
—
dB
Response Time
—
38
45
ns
CxSP = 1
—
81
100
ns
CxSP = 0
CM04A* TRT
CM05*
TMC20V
Comparator Mode Change to Output Valid
—
—
10
s
CM06
CHYSTER
Comparator Hysteresis
—
35
50
mV
CxSP = 1
CxSP = 0
* These parameters are characterized but not tested.
† Data in “Typ.” column is at 5V, 25°C unless otherwise stated. These parameters are for design guidance
only and are not tested.
Note 1: See Section 21.0 “DC and AC Characteristics Graphs and Charts” for operating characterization.
DS40001576D-page 168
2011-2015 Microchip Technology Inc.
PIC12F752/HV752
TABLE 20-14: DIGITAL-TO-ANALOG CONVERTER (DAC) SPECIFICATIONS(1)
Standard Operating Conditions (unless otherwise stated)
Param.
No.
Sym.
Characteristics
Min.
Typ.†
Max.
Units
DAC01* CLSB
Step Size(2)
—
VDD/ 32
—
V
DAC02* CACC
Absolute Accuracy
—
—
1/2
LSb
DAC03* CR
Unit Resistor Value (R)
—
5K
—
DAC04* CST
Settling Time(3)
—
—
10
s
Comments
* These parameters are characterized but not tested.
† Data in “Typ.” column is at 5V, 25°C unless otherwise stated. These parameters are for design guidance
only and are not tested.
Note 1: See Section 21.0 “DC and AC Characteristics Graphs and Charts” for operating characterization.
2: Setting DACRNG = 1 for full range mode. See Example 14-2 for limited range calculation.
3: Settling time measured while DACR transitions from ‘0000’ to ‘1111’.
TABLE 20-15: FIXED VOLTAGE REFERENCE SPECIFICATIONS
Standard Operating Conditions (unless otherwise stated)
Param
No.
Symbol
Characteristics
Min.
Typ.
Max.
Units
VR01
VFVR
FVR Voltage Output
1.116
1.2
1.284
V
VR02*
TSTABLE
FVR Turn On Time
—
200
—
s
*
Comments
These parameters are characterized but not tested.
TABLE 20-16: SHUNT REGULATOR SPECIFICATIONS (PIC12HV752 only)
Standard Operating Conditions (unless otherwise stated)
Param.
Symbol
No.
Characteristics
SR01
VSHUNT Shunt Voltage
SR02
ISHUNT
SR03*
TSETTLE Settling Time
SR04
CLOAD
Load Capacitance
SR05
ISNT
Regulator operating current
*
Shunt Current
Min.
Typ.
Max.
Units
Comments
4.75
5
5.5
V
1
—
50
mA
—
—
150
ns
To 1% of final value
0.01
—
10
F
Bypass capacitor on VDD
pin
—
180
—
A
Includes band gap
reference current
These parameters are characterized but not tested.
2011-2015 Microchip Technology Inc.
DS40001576D-page 169
PIC12F752/HV752
TABLE 20-17: ANALOG-TO-DIGITAL CONVERTER (ADC) CHARACTERISTICS(1,2,3)
Standard Operating Conditions (unless otherwise stated)
Param.
Sym.
No.
Characteristic
Min.
Typ.†
Max.
Units
Conditions
AD01
NR
Resolution
—
—
10
bit
AD02
EIL
Integral Error
—
—
1
LSb
VREF = 3.0V
AD03
EDL
Differential Error
—
—
1
LSb
No missing codes
VREF = 3.0V
AD04
EOFF
Offset Error
—
1.5
2.0
LSb
VREF = 3.0V
AD05
EGN
Gain Error
—
—
1.0
LSb
VREF = 3.0V
AD06
VREF
Reference Voltage
2.2
2.5
—
—
—
VDD
V
Absolute minimum to ensure 1 LSb
accuracy
AD07
VAIN
Full-Scale Range
VSS
—
VREF
V
AD08
ZAIN
Recommended
Impedance of Analog
Voltage Source
—
—
10
k
Can go higher if external 0.01 F
capacitor is present on input pin.
AD09*
IREF
VREF Input Current
10
—
1000
A
During VAIN acquisition.
Based on differential of VHOLD to
VAIN.
—
—
50
A
During A/D conversion cycle.
* These parameters are characterized but not tested.
† Data in “Typ.” column is at 5V, 25°C unless otherwise stated. These parameters are for design guidance
only and are not tested.
Note 1: Total Absolute Error includes integral, differential, offset and gain errors.
2: The ADC conversion result never decreases with an increase in the input voltage and has no missing
codes.
3: See Section 21.0 “DC and AC Characteristics Graphs and Charts” for operating characterization.
DS40001576D-page 170
2011-2015 Microchip Technology Inc.
PIC12F752/HV752
TABLE 20-18: ADC CONVERSION REQUIREMENTS
Standard Operating Conditions (unless otherwise stated)
Param.
Sym.
No.
Characteristic
Min.
Typ.†
ADC Internal FRC
Oscillator Period
3.0
6.0
1.6
ADC Clock Period
1.6
Max. Units
Conditions
9.0
s
At VDD = 2.5V
4.0
6.0
s
At VDD = 5.0V
—
9.0
s
FOSC-based, VREF 3.0V
3.0
—
9.0
s
TOSC-based, VREF full range(2)
—
11
—
TAD
Set GO/DONE bit to conversion
complete
AD132 TACQ Acquisition Time
*
—
11.5
—
s
AD133 TAMP Amplifier Settling
Time
*
—
—
5
s
AD130 TAD
*
AD131 TCNV
Conversion Time
(not including
Acquisition Time)(1)
Q4 to A/D Clock Start
AD134 TGO
THCD Holding Capacitor
Disconnect Time
—
TOSC/2
—
—
—
—
1/2 TAD
1/2 TAD + 1 TCY
—
—
—
FOSC-based
ADCS = x11 (ADC FRC mode)
* These parameters are characterized but not tested.
† Data in “Typ.” column is at 5.0V, 25°C unless otherwise stated. These parameters are for design guidance
only and are not tested.
Note 1: The ADRES register may be read on the following TCY cycle. See Section 12.4 “A/D Acquisition
Requirements” for minimum conditions.
2: Full range for PIC12HV752 powered by the shunt regulator is the 5V regulated voltage.
FIGURE 20-10:
PIC12F752/HV752 A/D CONVERSION TIMING (ADC CLOCK FOSC-BASED)
BSF ADCON0, GO
1 TCY
(TOSC/2)
AD134
AD131
Q4
AD130
A/D CLK
9
A/D Data
8
7
6
OLD_DATA
ADRES
2
1
0
NEW_DATA
1 TCY
ADIF
GO
Sample
3
DONE
AD132
2011-2015 Microchip Technology Inc.
Sampling Stopped
DS40001576D-page 171
PIC12F752/HV752
21.0
DC AND AC CHARACTERISTICS GRAPHS AND CHARTS
The graphs and tables provided in this section are for design guidance and are not tested.
In some graphs or tables, the data presented are outside specified operating range (i.e., outside specified VDD
range). This is for information only and devices are ensured to operate properly only within the specified range.
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.
“Typical” represents the mean of the distribution at 25C. “MAXIMUM”, “Max.”, “MINIMUM” or “Min.”
represents (mean + 3) or (mean - 3) respectively, where is a standard deviation, over each
temperature range.
DS40001576D-page 172
2011-2015 Microchip Technology Inc.
PIC12F752/HV752
FIGURE 21-1:
IDD, LFINTOSC, FOSC = 31 kHz, PIC12F752 ONLY
60
Max: Mean + 3ı (125°C)
Typical: Mean (25°C)
50
Max
IDD (µA)
40
Typical
30
20
10
0
1.5
2.0
2.5
3.0
3.5
4.0
4.5
5.0
5.5
VDD (V)
FIGURE 21-2:
IDD, LFINTOSC, FOSC = 31 kHz, PIC12HV752 ONLY
450
Max
400
Max: Mean + 3ı (125°C)
Typical: Mean (25°C)
350
IDD (µA)
300
Typical
250
200
150
100
50
0
1.5
2.0
2.5
3.0
3.5
4.0
4.5
5.0
VDD (V)
2011-2015 Microchip Technology Inc.
DS40001576D-page 173
PIC12F752/HV752
FIGURE 21-3:
IDD TYPICAL, HFINTOSC, PIC12F752 ONLY
1400
Typical: Mean (25°C)
1200
8 MHz
IDD (µA)
1000
800
4 MHz
600
400
1 MHz
200
0
1.5
2.0
2.5
3.0
3.5
4.0
4.5
5.0
5.5
VDD (V)
FIGURE 21-4:
IDD MAXIMUM, HFINTOSC, PIC12F752 ONLY
1800
Max: Mean + 3ı (125°C)
1600
8 MHz
1400
IDD (µA)
1200
1000
4 MHz
800
600
1 MHz
400
200
0
1.5
2.0
2.5
3.0
3.5
4.0
4.5
5.0
5.5
VDD (V)
DS40001576D-page 174
2011-2015 Microchip Technology Inc.
PIC12F752/HV752
FIGURE 21-5:
IDD TYPICAL, HFINTOSC, PIC12HV752 ONLY
1400
Typical: Mean (25°C)
1200
8 MHz
IDD (µA)
1000
800
4 MHz
600
1 MHz
400
200
0
1.5
2.0
2.5
3.0
3.5
4.0
4.5
5.0
VDD (V)
FIGURE 21-6:
IDD MAXIMUM, HFINTOSC, PIC12HV752 ONLY
1800
1600
8 MHz
Max: Mean + 3ı (125°C)
1400
1200
IDD (µA)
4 MHz
1000
800
1 MHz
600
400
200
0
1.5
2.0
2.5
3.0
3.5
4.0
4.5
5.0
VDD (V)
2011-2015 Microchip Technology Inc.
DS40001576D-page 175
PIC12F752/HV752
FIGURE 21-7:
IDD TYPICAL, EXTERNAL CLOCK (EC), PIC12F752 ONLY
700
4 MHz
Typical: Mean (25°C)
600
IDD (µA)
500
400
1 MHz
300
200
100
0
1.5
2.0
2.5
3.0
3.5
4.0
4.5
5.0
5.5
VDD (V)
FIGURE 21-8:
IDD MAXIMUM, EXTERNAL CLOCK (EC), PIC12F752 ONLY
900
4 MHz
Max: Mean + 3ı (125°C)
800
700
IDD (µA)
600
1 MHz
500
400
300
200
100
0
1.5
2.0
2.5
3.0
3.5
4.0
4.5
5.0
5.5
VDD (V)
DS40001576D-page 176
2011-2015 Microchip Technology Inc.
PIC12F752/HV752
FIGURE 21-9:
IDD TYPICAL, EXTERNAL CLOCK (EC), PIC12HV752 ONLY
900
4 MHz
800
Typical: Mean (25°C)
700
600
1 MHz
IDD (µA)
500
400
300
200
100
0
1.5
2.0
2.5
3.0
3.5
4.0
4.5
5.0
VDD (V)
FIGURE 21-10:
IDD MAXIMUM, EXTERNAL CLOCK (EC), PIC12HV752 ONLY
1400
Max: Mean + 3ı (125°C)
1200
4 MHz
IDD (µA)
1000
800
1 MHz
600
400
200
0
1.5
2.0
2.5
3.0
3.5
4.0
4.5
5.0
VDD (V)
2011-2015 Microchip Technology Inc.
DS40001576D-page 177
PIC12F752/HV752
FIGURE 21-11:
IDD, EXTERNAL CLOCK (EC), FOSC = 20 MHz, PIC12F752 ONLY
3.5
Max: Mean + 3ı (125°C)
Typical: Mean (25°C)
3.0
Max
2.5
IDD (mA)
Typical
2.0
1.5
1.0
0.5
0.0
4.4
4.5
4.6
4.7
4.8
4.9
5.0
5.1
VDD (V)
DS40001576D-page 178
2011-2015 Microchip Technology Inc.
PIC12F752/HV752
FIGURE 21-12:
IPD BASE, PIC12F752 ONLY
10
9
Max125
Max125: Mean + 3ı (125°C)
Max 85: Mean + 3ı (85°C)
Typical: Mean (25°C)
8
IPD (µA)
7
6
5
4
3
Max85
2
1
Typical
0
1.5
2.0
2.5
3.0
3.5
4.0
4.5
5.0
5.5
VDD (V)
FIGURE 21-13:
IPD BASE, PIC12HV752 ONLY
400
Max: Mean + 3ı (125°C)
Typical: Mean (25°C)
350
Max
IPD (µA)
300
Typical
250
200
150
100
50
0
1.5
2.0
2.5
3.0
3.5
4.0
4.5
5.0
VDD (V)
2011-2015 Microchip Technology Inc.
DS40001576D-page 179
PIC12F752/HV752
FIGURE 21-14:
IPD, WATCHDOG TIMER (WDT), PIC12F752 ONLY
20
Max125
18
Max125: Mean + 3ı (125°C)
Max 85: Mean + 3ı (85°C)
16
Max85
IPD (µ
(µA)
14
12
10
Typical
8
6
4
2
0
1.5
2.0
2.5
3.0
3.5
4.0
4.5
5.0
5.5
VDD (V)
FIGURE 21-15:
IPD, WATCHDOG TIMER (WDT), PIC12HV752 ONLY
400
350
300
IPD (µA
(µA)
Max
Max: Mean + 3ı (125°C)
Typical: Mean (25°C)
Typical
250
200
150
100
50
1.5
2.0
2.5
3.0
3.5
4.0
4.5
5.0
VDD (V)
DS40001576D-page 180
2011-2015 Microchip Technology Inc.
PIC12F752/HV752
FIGURE 21-16:
IPD FIXED VOLTAGE REFERENCE (FVR), PIC12F752 ONLY
600
Max125
Max85
500
IPD (µ
(µA)
400
Typical
300
Max125:
M
125 M
Mean + 3
3ı (125°C)
Max 85: Mean + 3ı (85°C)
200
100
0
1.5
2.0
2.5
3.0
3.5
4.0
4.5
5.0
5.5
VDD (V)
FIGURE 21-17:
IPD FIXED VOLTAGE REFERENCE (FVR), PIC12HV752 ONLY
900
M
Max:
M
Mean + 3
3ı (125°C)
Typical: Mean (25°C)
800
Max
700
IPD (µA
(µA)
600
500
Typical
yp
400
300
200
100
0
1.5
2.0
2.5
3.0
3.5
4.0
4.5
5.0
VDD (V)
2011-2015 Microchip Technology Inc.
DS40001576D-page 181
PIC12F752/HV752
FIGURE 21-18:
IPD, BROWN-OUT RESET (BOR), PIC12F752 ONLY
22
Max125: Mean + 3ı (125°C)
Max 85: Mean + 3ı (85°C)
Typical: Mean (25°C)
20
18
Max125
16
IPD (µA)
14
12
Max85
10
8
Typical
6
4
2
2.5
3.0
3.5
4.0
4.5
5.0
5.5
VDD (V)
FIGURE 21-19:
IPD, BROWN-OUT RESET (BOR), PIC12HV752 ONLY
400
Max: Mean + 3ı (125°C)
Typical: Mean (25°C)
350
Max
300
Typical
IPD (µA)
µA)
250
200
150
100
50
2.5
3.0
3.5
4.0
4.5
5.0
VDD (V)
DS40001576D-page 182
2011-2015 Microchip Technology Inc.
PIC12F752/HV752
FIGURE 21-20:
IPD, TIMER1 OSCILLATOR, FOSC = 32 kHz, PIC12F752 ONLY
25
Max125: Mean + 3ı (125°C)
Max 85: Mean + 3ı (85°C)
Typical: Mean (25°C)
IPD (µ
(µA)
20
Max125
15
Max85
10
Typical
5
0
1
5
1.5
2
0
2.0
2
5
2.5
3
0
3.0
3
5
3.5
4
0
4.0
4
5
4.5
5
0
5.0
5
5
5.5
VDD (V)
FIGURE 21-21:
IPD, TIMER1 OSCILLATOR, FOSC = 32 kHz, PIC12HV752 ONLY
400
Max
350
Max: Mean + 3ı (125°C)
Typical: Mean (25°C)
300
Typical
IPD (µA
(µA)
250
200
150
100
50
0
1.5
2.0
2.5
3.0
3.5
4.0
4.5
5.0
VDD (V)
2011-2015 Microchip Technology Inc.
DS40001576D-page 183
PIC12F752/HV752
FIGURE 21-22:
IPD, DAC, PIC12F752 ONLY
80
70
Max: Mean + 3ı (125°C)
Typical: Mean (25°C)
Max
60
IPD (µA
(µA)
50
Typical
40
30
20
10
0
1.5
2.0
2.5
3.0
3.5
4.0
4.5
5.0
5.5
VDD (V)
FIGURE 21-23:
IPD, DAC, PIC12HV752 ONLY
500
450
Max
Max: Mean + 3ı (125°C)
Typical: Mean (25°C)
400
IPD (µA
(µA)
350
Typical
300
250
200
150
100
50
0
15
1.5
2
2.0
0
2
2.5
5
3
3.0
0
3
3.5
5
4
4.0
0
4
4.5
5
5
5.0
0
VDD (V)
DS40001576D-page 184
2011-2015 Microchip Technology Inc.
PIC12F752/HV752
FIGURE 21-24:
IPD, COMPARATOR, LOW-POWER MODE, CxSP = 0, PIC12F752 ONLY
140
Max125:
M
125 M
Mean + 3
3ı (125°C)
Max 85: Mean + 3ı (85°C)
Typical: Mean (25°C)
120
Max125
100
IPD (µA
(µA)
Max85
80
Typical
60
40
20
0
1.5
2.0
2.5
3.0
3.5
4.0
4.5
5.0
5.5
VDD (V)
FIGURE 21-25:
IPD, COMPARATOR, LOW-POWER MODE, CxSP = 0, PIC12HV752 ONLY
500
450
Max
Max: Mean + 3ı (125°C)
Typical: Mean (25°C)
400
350
IPD ((µA)
Typical
300
250
200
150
100
50
0
1.5
2.0
2.5
3.0
3.5
4.0
4.5
5.0
VDD (V)
2011-2015 Microchip Technology Inc.
DS40001576D-page 185
PIC12F752/HV752
FIGURE 21-26:
IPD, COMPARATOR, NORMAL-POWER MODE, CxSP = 1, PIC12F752 ONLY
400
Max125: Mean + 3ı (125°C)
Max 85: Mean + 3ı (85°C)
Typical: Mean (25°C)
350
Max125
Max85
IPD (µA
(µA)
300
250
Typical
200
150
100
1.5
2.0
2.5
3.0
3.5
4.0
4.5
5.0
5.5
VDD (V)
FIGURE 21-27:
IPD, COMPARATOR, NORMAL-POWER MODE, CxSP = 1, PIC12HV752 ONLY
800
Max
700
Max: Mean + 3ı (125°C)
Typical: Mean (25°C)
600
IPD (µA
(µA)
500
Typical
400
300
200
100
0
1.5
2.0
2.5
3.0
3.5
4.0
4.5
5.0
VDD (V)
DS40001576D-page 186
2011-2015 Microchip Technology Inc.
PIC12F752/HV752
FIGURE 21-28:
IPD, ADC NO CONVERSION IN PROGRESS, PIC12F752 ONLY
12
Max125: Mean + 3ı (125°C)
Max 85: Mean + 3ı (85°C)
Typical: Mean (25°C)
10
Max125
IPD (µA
(µA)
8
6
4
Max85
2
Typical
0
2.5
3.0
3.5
4.0
4.5
5.0
5.5
VDD (V)
FIGURE 21-29:
IPD, ADC NO CONVERSION IN PROGRESS, PIC12HV752 ONLY
400
Max: Mean + 3ı (125°C)
Typical: Mean (25°C)
350
Max
IPD (µA
(µA)
300
Typical
250
200
150
100
2.5
3.0
3.5
4.0
4.5
5.0
VDD (V)
2011-2015 Microchip Technology Inc.
DS40001576D-page 187
PIC12F752/HV752
FIGURE 21-30:
VOH vs. IOH, RA0/RA2, OVER TEMPERATURE, VDD = 5.0V
5.1
5.0
Max125: Mean + 3ı (125°C)
Max 85: Mean + 3ı (85°C)
Typical: Mean (25°C)
Min: Mean - 3ı (-40°C)
4.9
VOH (V)
4.8
4.7
4.6
Min
4.5
Typical
4.4
Max85
4.3
Max125
4.2
4.1
-21
-18
-15
-12
-9
-6
-3
0
IOH (mA)
FIGURE 21-31:
VOH vs. IOH, RA1/RA4/RA5, OVER TEMPERATURE, VDD = 5.0V
5.2
Max: Mean + 3ı (125°C)
Typical: Mean (25°C)
Min: Mean - 3ı (-40°C)
5.0
Voh (V)
4.8
Min
4.6
4.4
Typical
4.2
Max
4.0
-5.5
-5.0
-4.5
-4.0
-3.5
-3.0
-2.5
-2.0
-1.5
-1.0
-0.5
0.0
Ioh (mA)
DS40001576D-page 188
2011-2015 Microchip Technology Inc.
PIC12F752/HV752
FIGURE 21-32: (
VOH vs.)IOH, RA0/RA2, OVER TEMPERATURE, VDD = 3.0V
3.0
Max125: Mean + 3ı (125°C)
Max 85: Mean + 3ı (85°C)
Typical: Mean (25°C)
Min: Mean - 3ı (-40°C)
VOH (V)
2.8
2.6
Min
2.4
Typical
Max85
2.2
Max125
2.0
-15
-12
-9
-6
-3
0
IOH (mA)
FIGURE 21-33:
VOH vs. IOH, RA1/RA4/RA5, OVER TEMPERATURE, VDD = 3.0V
3.5
3.0
VOH (V)
Min
2.5
Typical
2.0
1.5
1.0
-4.5
Max: Mean + 3ı (125°C)
Typical: Mean (25°C)
Min: Mean - 3ı (-40°C)
Max
-4.0
-3.5
-3.0
-2.5
-2.0
-1.5
-1.0
-0.5
0.0
IOH (mA)
2011-2015 Microchip Technology Inc.
DS40001576D-page 189
PIC12F752/HV752
FIGURE 21-34:
VOL vs. IOL, RA0/RA2, OVER TEMPERATURE, VDD = 5.0V
0.7
Max125
0.6
Max125: Mean + 3ı (125°C)
Max 85: Mean + 3ı (85°C)
Typical: Mean (25°C)
Min: Mean - 3ı (-40°C)
0.5
Max85
VOL (V)
Typical
0.4
Min
0.3
0.2
0.1
0
0
10
FIGURE 21-35:
20
IOL (mA)
30
40
VOL vs. IOL, RA1/RA4/RA5, OVER TEMPERATURE, VDD = 5.0V
0.45
Max125: Mean + 3ı (125°C)
Max85: Mean + 3ı (85°C)
Typical: Mean (25°C)
Min: Mean - 3ı (-40°C)
0.40
0.35
Max125
Max85
VOL (V)
0.30
Typical
0.25
0.20
Min
0.15
0.10
0.05
4.5
5.0
DS40001576D-page 190
5.5
6.0
6.5
7.0
7.5
8.0
IOL (mA)
8.5
9.0
9.5
10.0
10.5
2011-2015 Microchip Technology Inc.
PIC12F752/HV752
FIGURE 21-36:
VOL vs. IOL, RA0/RA2, OVER TEMPERATURE, VDD = 3.0V
1.2
1.1
0.9
0.8
VOL (V)
Max125
Max125: Mean + 3ı (125°C)
Max 85: Mean + 3ı (85°C)
Typical: Mean (25°C)
Min: Mean - 3ı (-40°C)
1.0
Max85
Typical
0.7
0.6
Min
0.5
0.4
0.3
0.2
0.1
0.0
0
5
10
15
20
25
30
35
40
IOL (mA)
FIGURE 21-37:
VOL vs. IOL, RA1/RA4/RA5, OVER TEMPERATURE, VDD = 3.0V
0.8
Max125: Mean + 3ı (125°C)
Max85: Mean + 3ı (85°C)
Typical: Mean (25°C)
Min: Mean - 3ı (-40°C
0.7
0.6
Max125
Max85
VOL (V)
0.5
Typical
0.4
0.3
Min
0.2
0.1
0.0
4
5
6
7
8
9
10
11
IOL (mA)
2011-2015 Microchip Technology Inc.
DS40001576D-page 191
PIC12F752/HV752
FIGURE 21-38:
SCHMITT TRIGGER INPUT THRESHOLD, VIN vs. VDD, OVER TEMPERATURE
4.0
Min
3.5
Max125: Mean + 3ı (125°C)
Max85: Mean + 3ı (85°C)
Typical: Mean (25°C)
Min: Mean - 3ı (-40°C)
3.0
Typical
VIN(V)
2.5
2.0
Max85
1.5
Max125
1.0
0.5
0.0
1.5
2.0
2.5
3.0
3.5
4.0
4.5
5.0
5.5
6.0
VDD(V)
FIGURE 21-39:
TTL INPUT THRESHOLD, VIN vs. VDD, OVER TEMPERATURE
1.7
Max125: Mean + 3ı (125°C)
Typical: Mean (25°C)
Min: Mean - 3ı (-40°C)
1.5
Min
Typical
VIN (V)
1.3
Max
1.1
0.9
0.7
0.5
1.5
DS40001576D-page 192
2.0
2.5
3.0
3.5
4.0
VDD (V)
4.5
5.0
5.5
6.0
2011-2015 Microchip Technology Inc.
PIC12F752/HV752
FIGURE 21-40:
SHUNT REGULATOR VOLTAGE, PIC12HV752 ONLY
5.16
Max125: Mean + 3ı (125°C)
Max85: Mean + 3ı (85°C)
Typical: Mean (25°C)
Min: Mean - 3ı (-40°C)
Shunt Regulator Voltage(V)
5.14
5.12
5.10
Min
Typical
Max85
Max125
5.08
5.06
5.04
5.02
5.00
4.98
4.96
4.94
0
10
20
30
40
50
60
Input Current (mA)
FIGURE 21-41:
TYPICAL HFINTOSC, START-UP TIMES vs. VDD, OVER TEMPERATURE
16
Max
14
Time (us)
12
Max: Mean + 3ı (85°C)
Typical: Mean (25°C)
Min: Mean - 3ı (-40°C)
Typical
10
Min
8
6
4
2
0
1.5
2.0
2.5
3.0
3.5
4.0
4.5
5.0
5.5
6.0
VDD (V)
2011-2015 Microchip Technology Inc.
DS40001576D-page 193
PIC12F752/HV752
FIGURE 21-42:
WDT TIME-OUT PERIOD
55
50
Max125: Mean + 3ı (125°C)
Max85: Mean + 3ı (85°C)
Typical: Mean (25°C)
Min: Mean - 3ı (-40°C)
45
Time (ms)
40
35
30
Max125
25
Max85
20
Typical
15
Min
10
5
1.5
2.0
2.5
3.0
3.5
4.0
4.5
5.0
5.5
VDD (V)
DS40001576D-page 194
2011-2015 Microchip Technology Inc.
PIC12F752/HV752
FIGURE 21-43:
S
COMPARATOR RESPONSE TIME OVER TEMPERATURE, NORMAL-POWER
MODE,
G
G CxSP = 1, RISING EDGE
80
75
Max: Mean + 3ı (125°C)
Typical: Mean (25°C)
Min: Mean - 3ı (-40°C)
Time (ns)
70
65
60
55
50
45
Max
40
Typical
35
Min
30
1.5
2.0
2.5
3.0
3.5
4.0
4.5
5.0
5.5
VDD (V)
FIGURE 21-44:
COMPARATOR RESPONSE TIME OVER TEMPERATURE, NORMAL-POWER
MODE, CxSP = 1, FALLING EDGE
90
Max: Mean + 3ı (125°C)
Typical: Mean (25°C)
Min: Mean - 3ı (-40°C)
Time (ns)
80
70
60
50
Max
Typical
40
Min
30
1.5
2.0
2.5
3.0
3.5
4.0
4.5
5.0
5.5
VDD (V)
2011-2015 Microchip Technology Inc.
DS40001576D-page 195
PIC12F752/HV752
22.0
PACKAGING INFORMATION
22.1
Package Marking Information
8-Lead PDIP (300 mil)
Example
XXXXXXXX
XXXXXNNN
12F752
E/P e3 121
YYWW
1109
8-Lead SOIC (3.90 mm)
Example
NNN
Legend:
XX...X
Y
YY
WW
NNN
e3
*
Note:
DS40001576D-page 196
12F752
ESN1109
121
Customer-specific information
Year code (last digit of calendar year)
Year code (last 2 digits of calendar year)
Week code (week of January 1 is week ‘01’)
Alphanumeric traceability code
Pb-free JEDEC® designator for Matte Tin (Sn)
This package is Pb-free. The Pb-free JEDEC designator ( e3 )
can be found on the outer packaging for this package.
In the event the full Microchip part number cannot be marked on one line, it will be
carried over to the next line, thus limiting the number of available characters for
customer-specific information.
2011-2015 Microchip Technology Inc.
PIC12F752/HV752
22.1
Package Marking Information (Continued)
8-Lead DFN (3x3x0.9 mm)
Example
XXXX
YYWW
NNN
MFU0
1109
121
PIN 1
TABLE 22-1:
PIN 1
8-LEAD 3x3 DFN (MF) TOP MARKING
Part Number
Marking
PIC12F752-E/MF
MFU0
PIC12F752-I/MF
MFV0
PIC12HV752-E/MF
MFW0
PIC12HV752-I/MF
MFX0
Legend:
XX...X
Y
YY
WW
NNN
e3
*
Note:
Customer-specific information
Year code (last digit of calendar year)
Year code (last 2 digits of calendar year)
Week code (week of January 1 is week ‘01’)
Alphanumeric traceability code
Pb-free JEDEC designator for Matte Tin (Sn)
This package is Pb-free. The Pb-free JEDEC designator ( e3 )
can be found on the outer packaging for this package.
In the event the full Microchip part number cannot be marked on one line, it will be
carried over to the next line, thus limiting the number of available characters for
customer-specific information.
2011-2015 Microchip Technology Inc.
DS40001576D-page 197
PIC12F752/HV752
22.2
Package Details
The following sections give the technical details of the packages.
8-Lead Plastic Dual In-Line (P) - 300 mil Body [PDIP]
Note:
For the most current package drawings, please see the Microchip Packaging Specification located at
http://www.microchip.com/packaging
D
A
N
B
E1
NOTE 1
1
2
TOP VIEW
E
C
A2
A
PLANE
L
c
A1
e
eB
8X b1
8X b
.010
C
SIDE VIEW
END VIEW
Microchip Technology Drawing No. C04-018D Sheet 1 of 2
DS40001576D-page 198
2011-2015 Microchip Technology Inc.
PIC12F752/HV752
8-Lead Plastic Dual In-Line (P) - 300 mil Body [PDIP]
Note:
For the most current package drawings, please see the Microchip Packaging Specification located at
http://www.microchip.com/packaging
ALTERNATE LEAD DESIGN
(VENDOR DEPENDENT)
DATUM A
DATUM A
b
b
e
2
e
2
e
Units
Dimension Limits
Number of Pins
N
e
Pitch
Top to Seating Plane
A
Molded Package Thickness
A2
Base to Seating Plane
A1
Shoulder to Shoulder Width
E
Molded Package Width
E1
Overall Length
D
Tip to Seating Plane
L
c
Lead Thickness
Upper Lead Width
b1
b
Lower Lead Width
Overall Row Spacing
eB
§
e
MIN
.115
.015
.290
.240
.348
.115
.008
.040
.014
-
INCHES
NOM
8
.100 BSC
.130
.310
.250
.365
.130
.010
.060
.018
-
MAX
.210
.195
.325
.280
.400
.150
.015
.070
.022
.430
Notes:
1. Pin 1 visual index feature may vary, but must be located within the hatched area.
2. § Significant Characteristic
3. Dimensions D and E1 do not include mold flash or protrusions. Mold flash or
protrusions shall not exceed .010" per side.
4. Dimensioning and tolerancing per ASME Y14.5M
BSC: Basic Dimension. Theoretically exact value shown without tolerances.
Microchip Technology Drawing No. C04-018D Sheet 2 of 2
2011-2015 Microchip Technology Inc.
DS40001576D-page 199
PIC12F752/HV752
Note:
For the most current package drawings, please see the Microchip Packaging Specification located at
http://www.microchip.com/packaging
DS40001576D-page 200
2011-2015 Microchip Technology Inc.
PIC12F752/HV752
Note:
For the most current package drawings, please see the Microchip Packaging Specification located at
http://www.microchip.com/packaging
2011-2015 Microchip Technology Inc.
DS40001576D-page 201
PIC12F752/HV752
!"#$%
&
!
"# $% &"'""
($)
%
*++&&&!
!+$
DS40001576D-page 202
2011-2015 Microchip Technology Inc.
PIC12F752/HV752
Note:
For the most current package drawings, please see the Microchip Packaging Specification located at
http://www.microchip.com/packaging
2011-2015 Microchip Technology Inc.
DS40001576D-page 203
PIC12F752/HV752
Note:
For the most current package drawings, please see the Microchip Packaging Specification located at
http://www.microchip.com/packaging
DS40001576D-page 204
2011-2015 Microchip Technology Inc.
PIC12F752/HV752
Note:
For the most current package drawings, please see the Microchip Packaging Specification located at
http://www.microchip.com/packaging
2011-2015 Microchip Technology Inc.
DS40001576D-page 205
PIC12F752/HV752
APPENDIX A:
DATA SHEET
REVISION HISTORY
Revision A (04/2011)
APPENDIX B:
MIGRATING FROM
PIC12HV615
This compares the features of the PIC12HV615 to the
PIC12HV752 family of devices.
Original release.
B.1
Revision B (11/2011)
PIC12HV615 to PIC12HV752
TABLE B-1:
FEATURE COMPARISON
Redefined operation of the COG module; Added slew
rate control to the COG module; Added zero latency
filter to the comparator; Updated Electrical
Specifications.
Max Operating Speed
Revision C (11/2013)
Redefined operation of the COG module; Updated the
I/O Ports chapter; Updated the Electrical Specifications
chapter; Added graphs to the DC and AC
Characteristics Graphs and Charts chapter; Other
minor corrections.
Feature
PIC12HV615
PIC12HV752
20 MHz
20 MHz
Max Program
Memory (Words)
1024
1024
Flash Self Read/
Self Write
No
Yes
SRAM (bytes)
64
64
Oscillator modes
8
2
4/8 MHz
1/4/8 MHz
and 31 kHz
Y
Y
Internal Pull-ups
GP0/1/2/3/4/5
RA0/1/2/3/4/5
Interrupt-on-change
GP0/1/2/3/4/5
RA0/1/2/3/4/5
4
4
10-bit
10-bit
INTOSC Frequencies
Brown-out Reset (BOR)
Revision D (10/2015)
Updated the eXtreme Low-Power Features section,
Table 1, Figure 1 and the RA3 pin description in
Table1-1; Updated PDIP package drawings in Section
22.2 (Package Details); Other minor corrections.
Analog-to-Digital
Converter (ADC)
Channels
A/D Resolution
Timers (8/16-bit)
2/1
3/1
Comparator
1
2 High Speed
ECCP/CCP
1/0
0/1
Complementary Output
Generator (COG)
No
Yes
Digital-to-Analog Converter
(DAC) 5-bit Dual Range
No
Yes
Fixed Voltage Reference
(FVR)
No
Yes
Internal Shunt Regulator
Yes
Yes
Note:
DS40001576D-page 206
This device has been designed to perform
to the parameters of its data sheet. It has
been tested to an electrical specification
designed to determine its conformance
with these parameters. Due to process
differences in the manufacture of this
device, this device may have different
performance characteristics than its earlier
version. These differences may cause this
device to perform differently in your
application than the earlier version of this
device.
2011-2015 Microchip Technology Inc.
PIC12F752/HV752
THE MICROCHIP WEB SITE
CUSTOMER SUPPORT
Microchip provides online support via our web site at
www.microchip.com. This web site is used as a means
to make files and information easily available to
customers. Accessible by using your favorite Internet
browser, the web site contains the following
information:
Users of Microchip products can receive assistance
through several channels:
• Product Support – Data sheets and errata,
application notes and sample programs, design
resources, user’s guides and hardware support
documents, latest software releases and archived
software
• General Technical Support – Frequently Asked
Questions (FAQ), technical support requests,
online discussion groups, Microchip consultant
program member listing
• Business of Microchip – Product selector and
ordering guides, latest Microchip press releases,
listing of seminars and events, listings of
Microchip sales offices, distributors and factory
representatives
•
•
•
•
Distributor or Representative
Local Sales Office
Field Application Engineer (FAE)
Technical Support
Customers
should
contact
their
distributor,
representative or Field Application Engineer (FAE) for
support. Local sales offices are also available to help
customers. A listing of sales offices and locations is
included in the back of this document.
Technical support is available through the web site
at: http://www.microchip.com/support
CUSTOMER CHANGE NOTIFICATION
SERVICE
Microchip’s customer notification service helps keep
customers current on Microchip products. Subscribers
will receive e-mail notification whenever there are
changes, updates, revisions or errata related to a
specified product family or development tool of interest.
To register, access the Microchip web site at
www.microchip.com. Under “Support”, click on
“Customer Change Notification” and follow the
registration instructions.
2011-2015 Microchip Technology Inc.
DS40001576D-page 207
PIC12F752/HV752
PRODUCT IDENTIFICATION SYSTEM
To order or obtain information, e.g., on pricing or delivery, refer to the factory or the listed sales office.
[X](1)
PART NO.
Device
-
X
Tape and Reel Temperature
Option
Range
/XX
XXX
Package
Pattern
Examples:
a)
b)
Device:
PIC12F752
PIC12HV752
Tape and Reel
Option:
Blank
T
= Standard packaging (tube or tray)
= Tape and Reel(1)
Temperature
Range:
I
E
= -40C to +85C
= -40C to +125C
Package:
P
SN
MF
c)
d)
Pattern:
=
=
=
(Industrial)
(Extended)
Plastic DIP (PDIP)
8-lead Small Outline (3.90 mm) (SOIC)
8-lead Plastic Dual Flat, No Lead (3x3) (DFN)
QTP, SQTP, Code or Special Requirements
(blank otherwise)
DS40001576D-page 208
PIC12F752T - I/MF 301
Tape and Reel,
Industrial temperature,
DFN 3x3 package,
QTP pattern #301
PIC12F752 - E/P
Extended temperature
PDIP package
PIC12F752 - E/SN
Extended temperature,
SOIC package
PIC12HV752 - E/MF
Extended temperature,
DFN 3x3 package
Note 1:
Tape and Reel identifier only appears in the
catalog part number description. This
identifier is used for ordering purposes and is
not printed on the device package. Check
with your Microchip Sales Office for package
availability with the Tape and Reel option.
2011-2015 Microchip Technology Inc.
Note the following details of the code protection feature on Microchip devices:
•
Microchip products meet the specification contained in their particular Microchip Data Sheet.
•
Microchip believes that its family of products is one of the most secure families of its kind on the market today, when used in the
intended manner and under normal conditions.
•
There are dishonest and possibly illegal methods used to breach the code protection feature. All of these methods, to our
knowledge, require using the Microchip products in a manner outside the operating specifications contained in Microchip’s Data
Sheets. Most likely, the person doing so is engaged in theft of intellectual property.
•
Microchip is willing to work with the customer who is concerned about the integrity of their code.
•
Neither Microchip nor any other semiconductor manufacturer can guarantee the security of their code. Code protection does not
mean that we are guaranteeing the product as “unbreakable.”
Code protection is constantly evolving. We at Microchip are committed to continuously improving the code protection features of our
products. Attempts to break Microchip’s code protection feature may be a violation of the Digital Millennium Copyright Act. If such acts
allow unauthorized access to your software or other copyrighted work, you may have a right to sue for relief under that Act.
Information contained in this publication regarding device
applications and the like is provided only for your convenience
and may be superseded by updates. It is your responsibility to
ensure that your application meets with your specifications.
MICROCHIP MAKES NO REPRESENTATIONS OR
WARRANTIES OF ANY KIND WHETHER EXPRESS OR
IMPLIED, WRITTEN OR ORAL, STATUTORY OR
OTHERWISE, RELATED TO THE INFORMATION,
INCLUDING BUT NOT LIMITED TO ITS CONDITION,
QUALITY, PERFORMANCE, MERCHANTABILITY OR
FITNESS FOR PURPOSE. Microchip disclaims all liability
arising from this information and its use. Use of Microchip
devices in life support and/or safety applications is entirely at
the buyer’s risk, and the buyer agrees to defend, indemnify and
hold harmless Microchip from any and all damages, claims,
suits, or expenses resulting from such use. No licenses are
conveyed, implicitly or otherwise, under any Microchip
intellectual property rights unless otherwise stated.
Trademarks
The Microchip name and logo, the Microchip logo, dsPIC,
FlashFlex, flexPWR, JukeBlox, KEELOQ, KEELOQ logo, Kleer,
LANCheck, MediaLB, MOST, MOST logo, MPLAB,
OptoLyzer, PIC, PICSTART, PIC32 logo, RightTouch, SpyNIC,
SST, SST Logo, SuperFlash and UNI/O are registered
trademarks of Microchip Technology Incorporated in the
U.S.A. and other countries.
The Embedded Control Solutions Company and mTouch are
registered trademarks of Microchip Technology Incorporated
in the U.S.A.
Analog-for-the-Digital Age, BodyCom, chipKIT, chipKIT logo,
CodeGuard, dsPICDEM, dsPICDEM.net, ECAN, In-Circuit
Serial Programming, ICSP, Inter-Chip Connectivity, KleerNet,
KleerNet logo, MiWi, motorBench, MPASM, MPF, MPLAB
Certified logo, MPLIB, MPLINK, MultiTRAK, NetDetach,
Omniscient Code Generation, PICDEM, PICDEM.net, PICkit,
PICtail, RightTouch logo, REAL ICE, SQI, Serial Quad I/O,
Total Endurance, TSHARC, USBCheck, VariSense,
ViewSpan, WiperLock, Wireless DNA, and ZENA are
trademarks of Microchip Technology Incorporated in the
U.S.A. and other countries.
SQTP is a service mark of Microchip Technology Incorporated
in the U.S.A.
Silicon Storage Technology is a registered trademark of
Microchip Technology Inc. in other countries.
GestIC is a registered trademark of Microchip Technology
Germany II GmbH & Co. KG, a subsidiary of Microchip
Technology Inc., in other countries.
All other trademarks mentioned herein are property of their
respective companies.
© 2011-2015, Microchip Technology Incorporated, Printed in
the U.S.A., All Rights Reserved.
ISBN: 978-1-63277-887-1
QUALITY MANAGEMENT SYSTEM
CERTIFIED BY DNV
== ISO/TS 16949 ==
2011-2015 Microchip Technology Inc.
Microchip received ISO/TS-16949:2009 certification for its worldwide
headquarters, design and wafer fabrication facilities in Chandler and
Tempe, Arizona; Gresham, Oregon and design centers in California
and India. The Company’s quality system processes and procedures
are for its PIC® MCUs and dsPIC® DSCs, KEELOQ® code hopping
devices, Serial EEPROMs, microperipherals, nonvolatile memory and
analog products. In addition, Microchip’s quality system for the design
and manufacture of development systems is ISO 9001:2000 certified.
DS40001576D-page 209
Worldwide Sales and Service
AMERICAS
ASIA/PACIFIC
ASIA/PACIFIC
EUROPE
Corporate Office
2355 West Chandler Blvd.
Chandler, AZ 85224-6199
Tel: 480-792-7200
Fax: 480-792-7277
Technical Support:
http://www.microchip.com/
support
Web Address:
www.microchip.com
Asia Pacific Office
Suites 3707-14, 37th Floor
Tower 6, The Gateway
Harbour City, Kowloon
China - Xiamen
Tel: 86-592-2388138
Fax: 86-592-2388130
Austria - Wels
Tel: 43-7242-2244-39
Fax: 43-7242-2244-393
China - Zhuhai
Tel: 86-756-3210040
Fax: 86-756-3210049
Denmark - Copenhagen
Tel: 45-4450-2828
Fax: 45-4485-2829
India - Bangalore
Tel: 91-80-3090-4444
Fax: 91-80-3090-4123
France - Paris
Tel: 33-1-69-53-63-20
Fax: 33-1-69-30-90-79
India - New Delhi
Tel: 91-11-4160-8631
Fax: 91-11-4160-8632
Germany - Dusseldorf
Tel: 49-2129-3766400
Atlanta
Duluth, GA
Tel: 678-957-9614
Fax: 678-957-1455
Hong Kong
Tel: 852-2943-5100
Fax: 852-2401-3431
Australia - Sydney
Tel: 61-2-9868-6733
Fax: 61-2-9868-6755
China - Beijing
Tel: 86-10-8569-7000
Fax: 86-10-8528-2104
Austin, TX
Tel: 512-257-3370
China - Chengdu
Tel: 86-28-8665-5511
Fax: 86-28-8665-7889
Boston
Westborough, MA
Tel: 774-760-0087
Fax: 774-760-0088
China - Chongqing
Tel: 86-23-8980-9588
Fax: 86-23-8980-9500
Chicago
Itasca, IL
Tel: 630-285-0071
Fax: 630-285-0075
Cleveland
Independence, OH
Tel: 216-447-0464
Fax: 216-447-0643
Dallas
Addison, TX
Tel: 972-818-7423
Fax: 972-818-2924
Detroit
Novi, MI
Tel: 248-848-4000
Houston, TX
Tel: 281-894-5983
Indianapolis
Noblesville, IN
Tel: 317-773-8323
Fax: 317-773-5453
Los Angeles
Mission Viejo, CA
Tel: 949-462-9523
Fax: 949-462-9608
New York, NY
Tel: 631-435-6000
San Jose, CA
Tel: 408-735-9110
Canada - Toronto
Tel: 905-673-0699
Fax: 905-673-6509
China - Dongguan
Tel: 86-769-8702-9880
China - Hangzhou
Tel: 86-571-8792-8115
Fax: 86-571-8792-8116
Germany - Munich
Tel: 49-89-627-144-0
Fax: 49-89-627-144-44
India - Pune
Tel: 91-20-3019-1500
Japan - Osaka
Tel: 81-6-6152-7160
Fax: 81-6-6152-9310
Germany - Pforzheim
Tel: 49-7231-424750
Italy - Milan
Tel: 39-0331-742611
Fax: 39-0331-466781
Japan - Tokyo
Tel: 81-3-6880- 3770
Fax: 81-3-6880-3771
Italy - Venice
Tel: 39-049-7625286
Korea - Daegu
Tel: 82-53-744-4301
Fax: 82-53-744-4302
Netherlands - Drunen
Tel: 31-416-690399
Fax: 31-416-690340
China - Hong Kong SAR
Tel: 852-2943-5100
Fax: 852-2401-3431
Korea - Seoul
Tel: 82-2-554-7200
Fax: 82-2-558-5932 or
82-2-558-5934
China - Nanjing
Tel: 86-25-8473-2460
Fax: 86-25-8473-2470
Malaysia - Kuala Lumpur
Tel: 60-3-6201-9857
Fax: 60-3-6201-9859
China - Qingdao
Tel: 86-532-8502-7355
Fax: 86-532-8502-7205
Malaysia - Penang
Tel: 60-4-227-8870
Fax: 60-4-227-4068
China - Shanghai
Tel: 86-21-5407-5533
Fax: 86-21-5407-5066
Philippines - Manila
Tel: 63-2-634-9065
Fax: 63-2-634-9069
China - Shenyang
Tel: 86-24-2334-2829
Fax: 86-24-2334-2393
Singapore
Tel: 65-6334-8870
Fax: 65-6334-8850
China - Shenzhen
Tel: 86-755-8864-2200
Fax: 86-755-8203-1760
Taiwan - Hsin Chu
Tel: 886-3-5778-366
Fax: 886-3-5770-955
China - Wuhan
Tel: 86-27-5980-5300
Fax: 86-27-5980-5118
Taiwan - Kaohsiung
Tel: 886-7-213-7828
China - Xian
Tel: 86-29-8833-7252
Fax: 86-29-8833-7256
Poland - Warsaw
Tel: 48-22-3325737
Spain - Madrid
Tel: 34-91-708-08-90
Fax: 34-91-708-08-91
Sweden - Stockholm
Tel: 46-8-5090-4654
UK - Wokingham
Tel: 44-118-921-5800
Fax: 44-118-921-5820
Taiwan - Taipei
Tel: 886-2-2508-8600
Fax: 886-2-2508-0102
Thailand - Bangkok
Tel: 66-2-694-1351
Fax: 66-2-694-1350
01/27/15
DS40001576D-page 210
2011-2015 Microchip Technology Inc.