Escolar Documentos
Profissional Documentos
Cultura Documentos
Standby Current:
- 20 nA @ 1.8V, typical
Operating Current:
- 25 A @ 1 MHz, 1.8V, typical
Watchdog Timer Current:
- 500 nA @ 1.8V, typical
Peripheral Features:
Four I/O Pins:
- One input-only pin
- High current sink/source for LED drivers
- Individually selectable weak pull-ups
- Interrupt-on-Change
Timer0: 8-Bit Timer/Counter with 8-Bit
Programmable Prescaler
Timer2: 8-Bit Timer/Counter with 8-Bit Period
Register, Prescaler and Postscaler
Two PWM modules:
- 10-bit PWM, max. frequency 16 kHz
- Combined to single 2-phase output
A/D Converter:
- 8-bit resolution with 3 channels
Configurable Logic Cell (CLC):
- 8 selectable input source signals
- Two inputs per module
- Software selectable logic functions including:
AND/OR/XOR/D Flop/D Latch/SR/JK
- External or internal inputs/outputs
- Operation while in Sleep
Numerically Controlled Oscillator (NCO):
- 20-bit accumulator
- 16-bit increment
- Linear frequency control
- High-speed clock input
- Selectable Output modes
- Fixed Duty Cycle (FDC)
- Pulse Frequency (PF) mode
Complementary Waveform Generator (CWG):
- Selectable falling and rising edge dead-band
control
- Polarity control
- Two auto-shutdown sources
- Multiple input sources: PWM, CLC, NCO
DS40001585B-page 1
PIC10(L)F320/322
Debug(1)
XLP
PIC10(L)F320
(1)
256
64
4
3
2
2
1
1
1
PIC10(L)F322
(1)
512
64
4
3
2
2
1
1
1
Note 1: I - Debugging, Integrated on Chip; H - Debugging, Available using Debug Header;
E - Emulation, Available using Emulation Header.
2: One pin is input-only.
Numerically Controlled
Oscillator (NCO)
Fixed Voltage
Reference (FVR)
Configurable Logic
Cell (CLC)
Complementary Wave
Generator (CWG)
PWM
Timers
(8-Bit)
I/Os(2)
Data SRAM
(bytes)
Program Memory
Flash (words)
Device
1
1
H
H
N
N
For other small form-factor package availability and marking information, please visit
http://www.microchip.com/packaging or contact your local sales office.
DS40001585B-page 2
PIC10(L)F320/322
FIGURE 1:
SOT-23
ICSPDAT/RA0 1
PIC10(L)F320
PIC10(L)F322
VSS 2
ICSPCLK/RA1 3
FIGURE 2:
RA3/MCLR/VPP
VDD
RA2
PDIP, DFN
N/C 1
RA2 3
ICSPCLK/RA1 4
TABLE 1:
I/O
8 RA3/MCLR/VPP
PIC10(L)F320
PIC10(L)F322
VDD 2
7 VSS
6 N/C
5 RA0/ICSPDAT
PWM
Interrupts Pull-ups
CWG
NCO
CLC
Basic
ICSP
RA0
AN0
PWM1
IOC0
CWG1A
CLC1IN0
ICSPDAT
RA1
AN1
PWM2
IOC1
CWG1B
NCO1CLK
CLC1
CLKIN
ICSPCLK
RA2
AN2
T0CKI
INT/IOC2
CWG1FLT
NCO1
CLC1IN1
CLKR
RA3
IOC3
MCLR
VPP
N/C
N/C
VDD
VDD
VSS
VSS
DS40001585B-page 3
PIC10(L)F320/322
Table of Contents
1.0 Device Overview .......................................................................................................................................................................... 6
2.0 Memory Organization ................................................................................................................................................................... 9
3.0 Device Configuration .................................................................................................................................................................. 19
4.0 Oscillator Module........................................................................................................................................................................ 24
5.0 Resets ........................................................................................................................................................................................ 28
6.0 Interrupts .................................................................................................................................................................................... 35
7.0 Power-Down Mode (Sleep) ........................................................................................................................................................ 44
8.0 Watchdog Timer (WDT) ............................................................................................................................................................. 46
9.0 Flash Program Memory Control ................................................................................................................................................. 50
10.0 I/O Port ....................................................................................................................................................................................... 67
11.0 Interrupt-On-Change .................................................................................................................................................................. 73
12.0 Fixed Voltage Reference (FVR) ................................................................................................................................................. 77
13.0 Internal Voltage Regulator (IVR) ................................................................................................................................................ 79
14.0 Temperature Indicator Module ................................................................................................................................................... 81
15.0 Analog-to-Digital Converter (ADC) Module ................................................................................................................................ 83
16.0 Timer0 Module ........................................................................................................................................................................... 93
17.0 Timer2 Module ........................................................................................................................................................................... 96
18.0 Pulse Width Modulation (PWM) Module..................................................................................................................................... 98
19.0 Configurable Logic Cell (CLC).................................................................................................................................................. 104
20.0 Numerically Controlled Oscillator (NCO) Module ......................................................................................................................119
21.0 Complementary Waveform Generator (CWG) Module ............................................................................................................ 129
22.0 In-Circuit Serial Programming (ICSP) ............................................................................................................................... 144
23.0 Instruction Set Summary .......................................................................................................................................................... 147
24.0 Electrical Specifications............................................................................................................................................................ 156
25.0 DC and AC Characteristics Graphs and Charts ....................................................................................................................... 176
26.0 Development Support............................................................................................................................................................... 177
27.0 Packaging Information.............................................................................................................................................................. 181
Appendix A: Data Sheet Revision History.......................................................................................................................................... 188
The Microchip Web Site ..................................................................................................................................................................... 189
Customer Change Notification Service .............................................................................................................................................. 189
Customer Support .............................................................................................................................................................................. 189
Product Identification System............................................................................................................................................................. 190
DS40001585B-page 4
PIC10(L)F320/322
TO OUR VALUED CUSTOMERS
It is our intention to provide our valued customers with the best documentation possible to ensure successful use of your Microchip
products. To this end, we will continue to improve our publications to better suit your needs. Our publications will be refined and
enhanced as new volumes and updates are introduced.
If you have any questions or comments regarding this publication, please contact the Marketing Communications Department via
E-mail at docerrors@microchip.com or fax the Reader Response Form in the back of this data sheet to (480) 792-4150. We
welcome your feedback.
Errata
An errata sheet, describing minor operational differences from the data sheet and recommended workarounds, may exist for current
devices. As device/documentation issues become known to us, we will publish an errata sheet. The errata will specify the revision
of silicon and revision of document to which it applies.
To determine if an errata sheet exists for a particular device, please check with one of the following:
Microchips Worldwide Web site; http://www.microchip.com
Your local Microchip sales office (see last page)
When contacting a sales office, please specify which device, revision of silicon and data sheet (include literature number) you are
using.
DS40001585B-page 5
PIC10(L)F320/322
1.0
DEVICE OVERVIEW
Peripheral
PIC10(L)F322
DEVICE PERIPHERAL
SUMMARY
PIC10(L)F320
TABLE 1-1:
Temperature Indicator
PWM1
PWM2
Timer0
Timer2
PWM Modules
Timers
DS40001585B-page 6
PIC10(L)F320/322
FIGURE 1-1:
Program
Flash Memory
RAM
CLKR
PORTA
Timing
Generation
CLKIN
CPU
INTRC
Oscillator
Figure 2-1
MCLR
Timer0
Temp.
Indicator
Note
1:
ADC
8-Bit
Timer2
FVR
PWM1
PWM2
NCO
CLC
CWG
DS40001585B-page 7
PIC10(L)F320/322
TABLE 1-2:
Name
RA0/PWM1/CLC1IN0/CWG1A/
AN0/ICSPDAT
RA1/PWM2/CLC1/CWG1B/AN1/
CLKIN/ICSPCLK/NCO1CLK
RA2/INT/T0CKI/NCO1/CLC1IN1/
CLKR/AN2/CWG1FLT
RA3/MCLR/VPP
Function
Input
Type
RA0
TTL
PWM1
CLC1IN0
ST
CWG1A
Output
Type
Description
CLC input.
AN0
AN
ICSPDAT
ST
RA1
TTL
PWM2
CLC1
CWG1B
AN1
AN
CLKIN
ST
ICSPCLK
ST
NCO1CLK
ST
RA2
TTL
INT
ST
External interrupt.
T0CKI
ST
NCO1
CLC1IN1
ST
CLKR
AN2
AN
CWG1FLT
ST
CLC input.
RA3
TTL
MCLR
ST
VPP
HV
Programming voltage.
VDD
VDD
Power
Positive supply.
VSS
VSS
Power
Ground reference.
DS40001585B-page 8
PIC10(L)F320/322
2.0
MEMORY ORGANIZATION
2.1
TABLE 2-1:
High-Endurance Flash
Memory Address Range (1)
PIC10(L)F320
256
00FFh
0F80h-00FFh
PIC10(L)F322
512
01FFh
1F80h-01FFh
Device
Note 1: High-endurance Flash applies to low byte of each address in the range.
DS40001585B-page 9
PIC10(L)F320/322
FIGURE 2-1:
FIGURE 2-2:
PC<12:0>
CALL,
RETURN, RETLW
RETFIE
CALL
RETURN, RETLW
RETFIE
13
13
Stack Level 0
Stack Level 1
Stack Level 0
Stack Level 1
Stack Level 8
Stack Level 8
Reset Vector
0000h
Reset Vector
0000h
Interrupt Vector
0004h
0005h
Interrupt Vector
0004h
0005h
On-chip
Program
Memory
Page 0
Rollover to Page 0
Wraps to Page 0
00FFh
0100h
On-chip
Program
Memory
Page 0
Wraps to Page 0
Rollover to Page 0
Wraps to Page 0
Wraps to Page 0
Wraps to Page 0
Rollover to Page 0
DS40001585B-page 10
FFFh
Rollover to Page 0
01FFh
0200h
FFFh
PIC10(L)F320/322
2.2
RP0
0
Bank 0 is selected
2.2.1
2.2.2
DS40001585B-page 11
PIC10(L)F320/322
2.2.2.1
STATUS Register
DS40001585B-page 12
PIC10(L)F320/322
REGISTER 2-1:
R/W-0/0
R/W-0/0
R/W-0/0
R-1/q
R-1/q
R/W-x/u
R/W-x/u
R/W-x/u
IRP
RP1
RP0
TO
PD
DC
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7
IRP: Reserved(2)
bit 6-5
RP<1:0>: Reserved(2)
bit 4
bit 3
bit 2
Z: Zero bit
1 = The result of an arithmetic or logic operation is zero
0 = The result of an arithmetic or logic operation is not zero
bit 1
bit 0
Note 1: For Borrow, the polarity is reversed. A subtraction is executed by adding the twos complement of the
second operand. For rotate (RRF, RLF) instructions, this bit is loaded with either the high or low-order bit of
the source register.
2: Maintain as 0.
DS40001585B-page 13
PIC10(L)F320/322
2.2.3
TABLE 2-2:
INDF(*)
00h
PMADRL
20h
TMR0
01h
PMADRH
21h
PCL
02h
PMDATL
22h
STATUS
03h
PMDATH
23h
FSR
04h
PMCON1
24h
PORTA
05h
PMCON2
25h
TRISA
06h
CLKRCON
26h
LATA
07h
NCO1ACCL
27h
ANSELA
08h
NCO1ACCH
28h
WPUA
09h
NCO1ACCU
29h
PCLATH
0Ah
NCO1INCL
2Ah
INTCON
0Bh
NCO1INCH
2Bh
PIR1
0Ch
Reserved
2Ch
PIE1
0Dh
NCO1CON
2Dh
OPTION_REG
0Eh
NCO1CLK
2Eh
2Fh
PCON
0Fh
Reserved
OSCCON
10h
WDTCON
30h
TMR2
11h
CLC1CON
31h
PR2
12h
CLC1SEL1
32h
T2CON
13h
CLC1SEL2
33h
PWM1DCL
14h
CLC1POL
34h
PWM1DCH
15h
CLC1GLS0
35h
PWM1CON
16h
CLC1GLS1
36h
PWM2DCL
17h
CLC1GLS2
37h
PWM2DCH
18h
CLC1GLS3
38h
PWM2CON
19h
CWG1CON0
39h
IOCAP
1Ah
CWG1CON1
3Ah
IOCAN
1Bh
CWG1CON2
3Bh
IOCAF
1Ch
CWG1DBR
3Ch
FVRCON
1Dh
CWG1DBF
3Dh
ADRES
1Eh
VREGCON
3Eh
1Fh
BORCON
3Fh
ADCON
Legend:
*
40h
60h
General
Purpose
Registers
General
Purpose
Registers
32 Bytes
32 Bytes
5Fh
7Fh
DS40001585B-page 14
PIC10(L)F320/322
TABLE 2-3:
Address
Name
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Value on
POR, BOR
Value on all
other resets
Bank 0
00h
INDF
Addressing this location uses contents of FSR to address data memory (not a physical register)
xxxx xxxx
xxxx xxxx
01h
TMR0
xxxx xxxx
uuuu uuuu
02h
PCL
0000 0000
0000 0000
03h
STATUS
0001 1xxx
000q quuu
04h
FSR
05h
PORTA
RA3
RA2
RA1
RA0
06h
TRISA
(1)
TRISA2
TRISA1
TRISA0
---- 1111
---- 1111
07h
LATA
LATA2
LATA1
LATA0
---- -xxx
---- -uuu
08h
ANSELA
ANSA2
ANSA1
ANSA0
---- -111
---- -111
09h
WPUA
WPUA3
WPUA2
WPUA1
WPUA0
---- 1111
---- 1111
0Ah
PCLATH
PCLH0
---- ---0
---- ---0
0Bh
INTCON
GIE
PEIE
TMR0IE
INTE
IOCIE
TMR0IF
INTF
IOCIF
0000 0000
0000 000u
0Ch
PIR1
ADIF
NCO1IF
CLC1IF
TMR2IF
-0-0 0-0-
-0-0 0-0-
0Dh
PIE1
TMR2IE
0Eh
OPTION_REG
IRP
RP1
RP0
ADIE
NCO1IE
CLC1IE
WPUEN
INTEDG
T0CS
T0SE
PSA
PCON
10h
OSCCON
11h
TMR2
12h
PR2
13h
T2CON
14h
PWM1DCL
15h
PWM1DCH
16h
PWM1CON
17h
PWM2DCL
18h
PWM2DCH
19h
PWM2CON
1Ah
IOCAP
1Bh
IOCAN
1Ch
IOCAF
1Dh
FVRCON
FVREN
FVRRDY
1Eh
ADRES
ADCON
Legend:
Note
1:
PD
DC
0Fh
1Fh
TO
POR
BOR
---- --uu
LFIOFR
HFIOFS
-110 0-00
-110 0-00
0000 0000
0000 0000
1111 1111
1111 1111
T2CKPS<1:0>
-000 0000
-000 0000
xx-- ----
uu-- ----
TMR2ON
uuuu uuuu
0000 ----
0000 ----
xx-- ----
uu-- ----
xxxx xxxx
uuuu uuuu
0000 ----
0000 ----
IOCAP3
IOCAP2
IOCAP1
IOCAP0
---- 0000
---- 0000
IOCAN3
IOCAN2
IOCAN1
IOCAN0
---- 0000
---- 0000
IOCAF3
IOCAF2
IOCAF1
IOCAF0
---- 0000
---- 0000
TSEN
TSRNG
0x00 --00
0x00 --00
xxxx xxxx
uuuu uuuu
0000 0000
0000 0000
ADFVR<1:0>
xxxx xxxx
PWM2DCH<7:0>
PWM2EN
PWM2DCL<1:0>
PWM1DCH<7:0>
PWM1EN
---- uuuu
TOUTPS<3:0>
PWM1DCL<1:0>
uuuu uuuu
---- xxxx
HFIOFR
IRCF<2:0>
PS<2:0>
xxxx xxxx
CHS<2:0>
GO/
DONE
ADON
DS40001585B-page 15
PIC10(L)F320/322
TABLE 2-3:
Address
Name
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Value on
POR, BOR
Value on all
other resets
0000 0000
0000 0000
PMADR8
---- ---0
---- ---0
Bank 0 (Continued)
20h
PMADRL
21h
PMADRH
PMADR<7:0>
22h
PMDATL
23h
PMDATH
24h
PMCON1
CFGS
25h
PMCON2
26h
CLKRCON
PMDAT<7:0>
PMDAT<13:8>
LWLO
FREE
WRERR
WREN
WR
RD
CLKROE
xxxx xxxx
uuuu uuuu
--xx xxxx
--uu uuuu
1000 0000
1000 q000
0000 0000
0000 0000
-0-- ----
-0-- ----
27h
NCO1ACCL
0000 0000
0000 0000
28h
NCO1ACCH
0000 0000
0000 0000
29h
NCO1ACCU
2Ah
NCO1INCL
2Bh
NCO1INCH
2Ch
2Dh
NCO1CON
2Eh
NCO1CLK
2Fh
---- 0000
---- 0000
0000 0001
0000 0001
0000 0000
0000 0000
Unimplemented
N1EN
N1OE
N1OUT
N1POL
N1PWS<2:0>
Reserved
30h
N1PFM
N1CKS<1:0>
Reserved
WDTCON
31h
CLC1CON
LC1EN
LC1OE
32h
CLC1SEL0
33h
CLC1SEL1
34h
CLC1POL
LC1POL
WDTPS<4:0>
SWDTEN
0000 ---0
00x0 ---0
000- --00
000- --00
xxxx xxxx
uuuu uuuu
--01 0110
--01 0110
LC1INTN
LC1MODE<2:0>
00x0 -000
00x0 -000
LC1D2S<2:0>
LC1D1S<2:0>
-xxx -xxx
-uuu -uuu
LC1D4S<2:0>
LC1D3S<2:0>
-xxx -xxx
-uuu -uuu
LC1OUT
LC1G2POL
0--- uuuu
CLC1GLS0
LC1G1D2N
LC1G1D1T
uuuu uuuu
CLC1GLS1
LC1G2D2N
LC1G2D1T
uuuu uuuu
CLC1GLS2
LC1G3D2N
LC1G3D1T
uuuu uuuu
38h
CLC1GLS3
uuuu uuuu
39h
CWG1CON0
35h
36h
37h
G1EN
G1OEB
G1ASDLB<1:0>
LC1INTP
G1OEA
G1POLB
G1ASDLA<1:0>
LC1G4POL LC1G3POL
LC1G4D2N
LC1G4D1T
G1POLA
G1CS0
3Ah
CWG1CON1
3Bh
CWG1CON2
G1ASE
G1ARSEN
3Ch
CWG1DBR
3Dh
CWG1DBF
3Eh
VREGCON
VREGPM1
3Fh
BORCON
SBOREN
BORFS
Legend:
Note
1:
G1IS<1:0>
0000 0--0
0000 0--0
xxxx --xx
uuuu --uu
uu-- --uu
CWG1DBR<5:0>
--xx xxxx
--uu uuuu
CWG1DBF<5:0>
--xx xxxx
--uu uuuu
Reserved
---- --01
---- --01
BORRDY
10-- ---q
uu-- ---u
DS40001585B-page 16
PIC10(L)F320/322
2.3
2.3.2
FIGURE 2-3:
LOADING OF PC IN
DIFFERENT SITUATIONS
PCH
PCL
12
PC
PCLATH<4:0>
Instruction with
PCL as
Destination
ALU Result
PCLATH
PCH
12
11 10
PCL
8
PC
GOTO, CALL
2
PCLATH<4:3>
11
OPCODE <10:0>
PCLATH
2.3.1
STACK
MODIFYING PCL
2.4
EXAMPLE 2-1:
MOVLW
MOVWF
NEXT
CLRF
INCF
BTFSS
GOTO
CONTINUE
INDIRECT ADDRESSING
0x40
FSR
INDF
FSR
FSR,7
NEXT
;initialize pointer
;to RAM
;clear INDF register
;inc pointer
;all done?
;no clear next
;yes continue
DS40001585B-page 17
PIC10(L)F320/322
FIGURE 2-4:
From Opcode
Indirect Addressing
0
Location Select
Location Select
00h
Data
Memory
7Fh
Bank 0
For memory map detail, see Figure 2-2.
DS40001585B-page 18
PIC10(L)F320/322
3.0
DEVICE CONFIGURATION
3.1
Configuration Word
DS40001585B-page 19
PIC10(L)F320/322
3.2
REGISTER 3-1:
R/P-1/1
R/P-1/1
WRT<1:0>
R/P-1/1
R/P-1/1
R/P-1/1
BORV
LPBOR
LVP
bit 13
R/P-1/1
R/P-1/1
R/P-1/1
CP
MCLRE
PWRTE
bit 8
R/P-1/1
R/P-1/1
R/P-1/1
WDTE<1:0>
R/P-1/1
BOREN<1:0>
bit 7
R/P-1/1
FOSC
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
P = Programmable bit
bit 13
Unimplemented: Read as 1
bit 12-11
bit 10
bit 9
bit 8
bit 7
bit 6
Note 1:
2:
3:
DS40001585B-page 20
PIC10(L)F320/322
REGISTER 3-1:
bit 5
bit 4-3
bit 2-1
bit 0
Note 1:
2:
3:
DS40001585B-page 21
PIC10(L)F320/322
3.3
Code Protection
3.3.1
3.4
Write Protection
3.5
User ID
DS40001585B-page 22
PIC10(L)F320/322
3.6
3.7
REGISTER 3-2:
DEV<8:3>
bit 13
R
bit 8
R
DEV<2:0>
REV<4:0>
bit 7
bit 0
Legend:
R = Readable bit
1 = Bit is set
bit 13-5
0 = Bit is cleared
DEV<8:0>: Device ID bits
Device
bit 4-0
DEVID<13:0> Values
DEV<8:0>
REV<4:0>
PIC10F320
10 1001 101
x xxxx
PIC10LF320
10 1001 111
x xxxx
PIC10F322
10 1001 100
x xxxx
PIC10LF322
10 1001 110
x xxxx
Note 1:
DS40001585B-page 23
PIC10(L)F320/322
4.0
OSCILLATOR MODULE
4.1
Overview
FIGURE 4-1:
HFINTOSC
16 MHz
HFIOFR(1)
HFIOFS(1)
LFIOFR(1)
111
110
101
100
011
010
250 kHz
31 kHz
001
000
MUX
Divider
LFINTOSC
31 kHz
16 MHz
8 MHz
4 MHz
2 MHz
1 MHz
500 kHz
INTOSC
FOSC
(Configuration
Word)
CLKIN
MUX
EC
System Clock
(CPU and
Peripherals)
CLKR
CLKROE
Note 1: HFIOFR, HFIOFS and LFIOFR are Status bits in the OSCCON register.
DS40001585B-page 24
PIC10(L)F320/322
4.2
4.3
4.3.1
4.3.2
in
INTOSC MODE
DS40001585B-page 25
PIC10(L)F320/322
4.4
REGISTER 4-1:
U-0
R/W-0/0
U-0
U-0
U-0
U-0
U-0
U-0
CLKROE
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
-n = Value at POR
1 = Bit is set
0 = Bit is cleared
x = Bit is unknown
Unimplemented: Read as 0
bit 6
bit 5-0
Unimplemented: Read as 0
4.5
REGISTER 4-2:
U-0
R/W-1/1
R/W-0/0
IRCF<2:0>
R-0/0
U-0
R-0/0
R-0/0
HFIOFR
LFIOFR
HFIOFS
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7
Unimplemented: Read as 0
bit 6-4
bit 3
bit 2
Unimplemented: Read as 0
bit 1
bit 0
DS40001585B-page 26
PIC10(L)F320/322
4.6
4.6.1
EC MODE
TABLE 4-1:
Name
Bit 6
CLKRCON
CLKROE
OSCCON
Legend:
CONFIG
Legend:
Bit 4
Bit 3
IRCF<2:0>
Bit 2
Bit 1
Bit 0
Register
on Page
26
HFIOFR
LFIOFR
HFIOFS
26
x = unknown, u = unchanged, = unimplemented locations read as 0. Shaded cells are not used by ECWG.
TABLE 4-2:
Name
Bit 5
Bits
Bit -/6
Bit 13/5
Bit 12/4
Bit 11/3
13:8
WRT<1:0>
7:0
CP
MCLRE
PWRTE
WDTE<1:0>
Bit 10/2
Bit 9/1
BORV
LPBOR
BOREN<1:0>
Bit 8/0
LVP
FOSC
Register
on Page
20
= unimplemented location, read as 0. Shaded cells are not used by clock sources.
DS40001585B-page 27
PIC10(L)F320/322
5.0
RESETS
FIGURE 5-1:
MCLRE
Sleep
WDT
Time-out
Device
Reset
Power-on
Reset
VDD
Brown-out
Reset
LPBOR
Reset
PWRT
Done
PWRTE
LFINTOSC
BOR
Active(1)
Note 1:
DS40001585B-page 28
PIC10(L)F320/322
5.1
5.2
The POR circuit holds the device in Reset until VDD has
reached an acceptable level for minimum operation.
Slow rising VDD, fast operating speeds or analog
performance may require greater than minimum VDD.
The PWRT, BOR or MCLR features can be used to
extend the start-up period until all device operation
conditions have been met.
5.1.1
TABLE 5-1:
BOREN<1:0>
SBOREN
Device Mode
BOR Mode
11
Active
10
Awake
Active
Sleep
Disabled
Active
Disabled
Disabled
01
00
Note 1: In these specific cases, Release of POR and Wake-up from Sleep, there is no delay in start-up. The BOR
ready flag, (BORRDY = 1), will be set before the CPU is ready to execute instructions because the BOR
circuit is forced on by the BOREN<1:0> bits.
5.2.1
BOR IS ALWAYS ON
5.2.2
5.2.3
DS40001585B-page 29
PIC10(L)F320/322
FIGURE 5-2:
BROWN-OUT SITUATIONS
VDD
VBOR
Internal
Reset
TPWRT(1)
VDD
VBOR
Internal
Reset
< TPWRT
TPWRT(1)
VDD
VBOR
Internal
Reset
Note 1:
5.3
TPWRT(1)
REGISTER 5-1:
R/W-1/u
R/W-0/u
U-0
U-0
U-0
U-0
U-0
R-q/u
SBOREN
BORFS(1)
BORRDY
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7
bit 6
bit 5-1
Unimplemented: Read as 0
bit 0
Note 1:
DS40001585B-page 30
PIC10(L)F320/322
5.4
5.4.1
ENABLING LPBOR
5.6
5.7
5.8
Power-Up Timer
5.4.1.1
5.5
MCLR CONFIGURATION
MCLRE
LVP
MCLR
Disabled
Enabled
Enabled
5.5.1
Start-up Sequence
MCLR
TABLE 5-2:
5.9
The total time-out will vary based on oscillator configuration and Power-up Timer configuration. See
Section 4.0 Oscillator Module for more information.
The Power-up Timer runs independently of MCLR
Reset. If MCLR is kept low long enough, the Power-up
Timer will expire. Upon bringing MCLR high, the device
will begin execution after 10 FOSC cycles (see Figure 53). This is useful for testing purposes or to synchronize
more than one device operating in parallel.
MCLR ENABLED
5.5.2
MCLR DISABLED
DS40001585B-page 31
PIC10(L)F320/322
FIGURE 5-3:
VDD
Internal POR
TPWRT
Power-Up Timer
MCLR
TMCLR
Internal RESET
Oscillator Modes
Internal Oscillator
Oscillator
FOSC
FOSC
DS40001585B-page 32
PIC10(L)F320/322
5.10
TABLE 5-3:
POR
BOR
TO
PD
Power-on Reset
Brown-out Reset
WDT Reset
TABLE 5-4:
Condition
STATUS
Register
PCON
Register
Power-on Reset
0000h
0001 1000
---- --0x
0000h
000u uuuu
---- --uu
0000h
0001 0uuu
---- --uu
WDT Reset
0000h
0000 uuuu
---- --uu
PC + 1
0000 0uuu
---- --uu
Brown-out Reset
0000h
0001 1uuu
---- --u0
0001 0uuu
---- --uu
Condition
PC + 1
(1)
DS40001585B-page 33
PIC10(L)F320/322
5.11
5.12
REGISTER 5-2:
U-0
U-0
U-0
U-0
U-0
U-0
R/W/HC-q/u
R/W/HC-q/u
POR
BOR
bit 7
bit 0
Legend:
HC = Bit is cleared by hardware
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7-2
Unimplemented: Read as 0
bit 1
bit 0
TABLE 5-5:
Name
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Register
on Page
BORCON
SBOREN
BORFS
BORRDY
30
POR
BOR
34
IRP
RP1
RP0
TO
PD
DC
13
SWDTEN
48
PCON
STATUS
WDTCON
WDTPS<4:0>
Legend: = unimplemented location, read as 0. Shaded cells are not used by Resets.
TABLE 5-6:
Name
CONFIG
Bits
Bit -/6
Bit 13/5
Bit 12/4
Bit 11/3
13:8
WRT<1:0>
7:0
CP
MCLRE
PWRTE
WDTE<1:0>
Bit 10/2
Bit 9/1
BORV
LPBOR
BOREN<1:0>
Bit 8/0
LVP
FOSC
Register
on Page
20
Legend: = unimplemented location, read as 0. Shaded cells are not used by Reset.
DS40001585B-page 34
PIC10(L)F320/322
6.0
INTERRUPTS
Operation
Interrupt Latency
Interrupts During Sleep
INT Pin
Context Saving during Interrupts
FIGURE 6-1:
INTERRUPT LOGIC
Rev. 10-000010A
7/30/2013
TMR0IF
TMR0IE
Peripheral Interrupts
(TMR1IF) PIR1<0>
(TMR1IE) PIE1<0>
Wake-up
(If in Sleep mode)
INTF
INTE
IOCIF
IOCIE
Interrupt
to CPU
PEIE
PIRn<7>
PIEn<7>
GIE
DS40001585B-page 35
PIC10(L)F320/322
6.1
Operation
6.2
Interrupt Latency
The INTCON and PIR1 registers record individual interrupts via interrupt flag bits. Interrupt flag bits will be set,
regardless of the status of the GIE, PEIE and individual
interrupt enable bits.
The following events happen when an interrupt event
occurs while the GIE bit is set:
Current prefetched instruction is flushed
GIE bit is cleared
Current Program Counter (PC) is pushed onto the
stack
PC is loaded with the interrupt vector 0004h
The firmware within the Interrupt Service Routine (ISR)
should determine the source of the interrupt by polling
the interrupt flag bits. The interrupt flag bits must be
cleared before exiting the ISR to avoid repeated
interrupts. Because the GIE bit is cleared, any interrupt
that occurs while executing the ISR will be recorded
through its interrupt flag, but will not cause the
processor to redirect to the interrupt vector.
The RETFIE instruction exits the ISR by popping the
previous address from the stack, and setting the GIE
bit.
For additional information on a specific interrupts
operation, refer to its peripheral chapter.
Note 1: Individual interrupt flag bits are set,
regardless of the state of any other
enable bits.
2: All interrupts will be ignored while the GIE
bit is cleared. Any interrupt occurring
while the GIE bit is clear will be serviced
when the GIE bit is set again.
DS40001585B-page 36
PIC10(L)F320/322
FIGURE 6-2:
INTERRUPT LATENCY
INTOSC
Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4
CLKR
Interrupt Sampled
during Q1
Interrupt
GIE
PC
Execute
PC-1
PC
1 Cycle Instruction at PC
PC+1
0004h
0005h
Inst(PC)
NOP
NOP
Inst(0004h)
PC+1/FSR
ADDR
New PC/
PC+1
0004h
0005h
Inst(PC)
NOP
NOP
Inst(0004h)
FSR ADDR
PC+1
PC+2
0004h
0005h
INST(PC)
NOP
NOP
NOP
Inst(0004h)
Inst(0005h)
FSR ADDR
PC+1
0004h
0005h
INST(PC)
NOP
NOP
Inst(0004h)
Interrupt
GIE
PC
Execute
PC-1
PC
2 Cycle Instruction at PC
Interrupt
GIE
PC
Execute
PC-1
PC
3 Cycle Instruction at PC
Interrupt
GIE
PC
Execute
PC-1
PC
3 Cycle Instruction at PC
PC+2
NOP
NOP
DS40001585B-page 37
PIC10(L)F320/322
FIGURE 6-3:
Q2
Q3
Q4
Q1
Q2
Q3
Q4
Q1
Q2
Q3
Q4
Q1
Q2
Q3
Q4
Q1
Q2
Q3
Q4
INTOSC
CLKR
(3)
INT pin
(1)
(1)
INTF
(4)
GIE
INSTRUCTION FLOW
PC
Instruction
Fetched
Instruction
Executed
Note 1:
PC
Inst (PC)
Inst (PC 1)
PC + 1
Inst (PC + 1)
Inst (PC)
PC + 1
Forced NOP
0004h
0005h
Inst (0004h)
Inst (0005h)
Forced NOP
Inst (0004h)
2:
Asynchronous interrupt latency = 3-5 TCY. Synchronous latency = 3-4 TCY, where TCY = instruction cycle time.
Latency is the same whether Inst (PC) is a single cycle or a 2-cycle instruction.
3:
For minimum width of INT pulse, refer to AC specifications in Section 24.0 Electrical Specifications.
4:
DS40001585B-page 38
PIC10(L)F320/322
6.3
6.4
INT Pin
EXAMPLE 6-1:
MOVWF
SWAPF
W_TEMP
STATUS,W
MOVWF
STATUS_TEMP
:
:(ISR)
:
SWAPF
STATUS_TEMP,W
MOVWF
SWAPF
SWAPF
6.5
STATUS
W_TEMP,F
W_TEMP,W
;Copy W to TEMP
;Swap status to
;Swaps are used
;Save status to
register
be saved into W
because they do not affect the status bits
bank zero STATUS_TEMP register
DS40001585B-page 39
PIC10(L)F320/322
6.6
REGISTER 6-1:
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
R-0/0
GIE
PEIE
TMR0IE
INTE
IOCIE
TMR0IF
INTF
IOCIF(1)
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7
bit 6
bit 5
bit 4
bit 3
bit 2
bit 1
bit 0
Note 1:
Note:
The IOCIF Flag bit is read-only and cleared when all the Interrupt-on-Change flags in the IOCAF register
have been cleared by software.
Interrupt flag bits are set when an interrupt
condition occurs, regardless of the state of
its corresponding enable bit or the Global
Interrupt Enable bit, GIE, of the INTCON
register. User software should ensure the
appropriate interrupt flag bits are clear
prior to enabling an interrupt.
DS40001585B-page 40
PIC10(L)F320/322
REGISTER 6-2:
U-0
R/W-0/0
U-0
R/W-0/0
R/W-0/0
U-0
R/W-0/0
U-0
ADIE
NCO1IE
CLC1IE
TMR2IE
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7
Unimplemented: Read as 0
bit 6
bit 5
Unimplemented: Read as 0
bit 4
bit 3
bit 2
Unimplemented: Read as 0
bit 1
bit 0
Unimplemented: Read as 0
Note:
DS40001585B-page 41
PIC10(L)F320/322
REGISTER 6-3:
U-0
R/W-0/0
U-0
R/W-0/0
R/W-0/0
U-0
R/W-0/0
U-0
ADIF
NCO1IF
CLC1IF
TMR2IF
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7
Unimplemented: Read as 0
bit 6
bit 5
Unimplemented: Read as 0
bit 4
bit 3
bit 2
Unimplemented: Read as 0
bit 1
bit 0
Unimplemented: Read as 0
Note:
DS40001585B-page 42
PIC10(L)F320/322
TABLE 6-1:
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Register
on Page
GIE
PEIE
TMR0IE
INTE
IOCIE
TMR0IF
INTF
IOCIF
40
IOCAF
IOCAF3
IOCAF2
IOCAF1
IOCAF0
76
IOCAN
IOCAN3
IOCAN2
IOCAN1
IOCAN0
75
IOCAP
IOCAP3
IOCAP2
IOCAP1
IOCAP0
75
Name
INTCON
OPTION_REG WPUEN
INTEDG
T0CS
T0SE
PSA
PIE1
ADIE
NCO1IE
CLC1IE
PS<2:0>
TMR2IE
95
41
PIR1
ADIF
NCO1IF
CLC1IF
TMR2IF
42
Legend: = unimplemented location, read as 0. Shaded cells are not used by Interrupts.
DS40001585B-page 43
PIC10(L)F320/322
7.0
7.1
1.
2.
3.
4.
5.
6.
1.
2.
3.
4.
5.
6.
7.
8.
DS40001585B-page 44
PIC10(L)F320/322
7.1.1
FIGURE 7-1:
Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1
Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4
INTOSC
CLKR
Interrupt Latency (1)
Interrupt flag
GIE bit
(INTCON reg.)
Processor in
Sleep
Instruction Flow
PC
Instruction
Fetched
Instruction
Executed
Note
1:
PC
PC + 1
Inst(PC) = Sleep
PC + 2
Inst(PC + 1)
Inst(PC + 2)
Sleep
Inst(PC + 1)
Inst(PC - 1)
Forced NOP
0004h
0005h
Inst(0004h)
Inst(0005h)
Forced NOP
Inst(0004h)
Name
Bit 7
Bit 6
Bit 5
Bit 4
STATUS
IRP
RP1
RP0
TO
Legend:
PC + 2
GIE = 1 assumed. In this case after wake-up, the processor calls the ISR at 0004h. If GIE = 0, execution will continue in-line.
TABLE 7-1:
WDTCON
PC + 2
Bit 3
Bit 2
Bit 1
PD
DC
WDTPS<4:0>
Bit 0
Register on
Page
13
SWDTEN
48
= unimplemented location, read as 0. Shaded cells are not used in Power-down mode.
DS40001585B-page 45
PIC10(L)F320/322
8.0
WATCHDOG TIMER
FIGURE 8-1:
WDTE<1:0> = 01
SWDTEN
WDTE<1:0> = 11
LFINTOSC
23-bit Programmable
Prescaler WDT
WDT Time-out
WDTE<1:0> = 10
Sleep
DS40001585B-page 46
WDTPS<4:0>
PIC10(L)F320/322
8.1
8.3
Time-Out Period
The WDTPS bits of the WDTCON register set the timeout period from 1 ms to 256 seconds (nominal). After a
Reset, the default time-out period is 2 seconds.
8.2
8.4
8.2.2
8.5
8.2.1
WDT IS ALWAYS ON
8.2.3
TABLE 8-1:
WDTE<1:0>
SWDTEN
Device
Mode
WDT
Mode
11
Active
10
Awake
Active
Sleep
Disabled
01
00
TABLE 8-2:
X
X
Any Reset
CLRWDT instruction is executed
Device enters Sleep
Device wakes up from Sleep
Oscillator fail
WDT is disabled
Active
Disabled
Disabled
WDT
WDTE<1:0> = 00
WDTE<1:0> = 01 and SWDTEN = 0
WDTE<1:0> = 10 and enter Sleep
Cleared
CLRWDT Command
Exit Sleep
Change INTOSC divider (IRCF bits)
Unaffected
DS40001585B-page 47
PIC10(L)F320/322
8.6
REGISTER 8-1:
U-0
U-0
R/W-0/0
R/W-1/1
R/W-0/0
R/W-1/1
R/W-1/1
WDTPS<4:0>
R/W-0/0
SWDTEN
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7-6
Unimplemented: Read as 0
bit 5-1
bit 0
Note 1:
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
DS40001585B-page 48
PIC10(L)F320/322
TABLE 8-3:
Name
Bit 6
OSCCON
STATUS
IRP
RP1
WDTCON
Bit 5
Bit 4
IRCF<2:0>
RP0
TO
Bit 3
Bit 2
Bit 1
Bit 0
Register
on Page
HFIOFR
LFIOFR
HFIOFS
26
PD
DC
13
SWDTEN
48
WDTPS<4:0>
Legend: x = unknown, u = unchanged, = unimplemented locations read as 0. Shaded cells are not used by
Watchdog Timer.
TABLE 8-4:
Name
CONFIG
Bits
Bit -/6
Bit 13/5
Bit 12/4
Bit 11/3
13:8
WRT<1:0>
7:0
CP
MCLRE
PWRTE
WDTE<1:0>
Bit 10/2
Bit 9/1
BORV
LPBOR
BOREN<1:0>
Bit 8/0
LVP
FOSC
Register
on Page
20
Legend: = unimplemented location, read as 0. Shaded cells are not used by Watchdog Timer.
DS40001585B-page 49
PIC10(L)F320/322
9.0
PMCON1
PMCON2
PMDATL
PMDATH
PMADRL
PMADRH
9.1
DS40001585B-page 50
9.1.1
9.2
See Table 9-1 for Erase Row size and the number of
write latches for Flash program memory.
PIC10(L)F320/322
TABLE 9-1:
FLASH MEMORY
ORGANIZATION BY DEVICE
Device
PIC10(L)F320
PIC10(L)F322
9.2.1
Row Erase
(words)
Write
Latches
(words)
16
16
Write
the
desired
address
to
the
PMADRH:PMADRL register pair.
Clear the CFGS bit of the PMCON1 register.
Then, set control bit RD of the PMCON1 register.
FIGURE 9-1:
FLASH PROGRAM
MEMORY READ
FLOWCHART
Start
Read Operation
Select
Program or Configuration Memory
(CFGS)
Select
Word Address
(PMADRH:PMADRL)
End
Read Operation
DS40001585B-page 51
PIC10(L)F320/322
FIGURE 9-2:
PC
Flash ADDR
Flash Data
PC + 1
INSTR (PC)
INSTR(PC - 1)
executed here
PC
+3
PC+3
PMADRH,PMADRL
INSTR (PC + 1)
BSF PMCON1,RD
executed here
PMDATH,PMDATL
INSTR(PC + 1)
instruction ignored
Forced NOP
executed here
PC + 4
INSTR (PC + 3)
INSTR(PC + 2)
instruction ignored
Forced NOP
executed here
PC + 5
INSTR (PC + 4)
INSTR(PC + 3)
executed here
INSTR(PC + 4)
executed here
RD bit
PMDATH
PMDATL
Register
EXAMPLE 9-1:
PMADRL
PROG_ADDR_LO
PMADRL
PROG_ADDR_HI
PMADRH
BCF
BSF
NOP
NOP
PMCON1,CFGS
PMCON1,RD
;
;
;
;
MOVF
MOVWF
MOVF
MOVWF
PMDATL,W
PROG_DATA_LO
PMDATH,W
PROG_DATA_HI
;
;
;
;
DS40001585B-page 52
PIC10(L)F320/322
9.2.2
Note:
FIGURE 9-3:
FLASH PROGRAM
MEMORY UNLOCK
SEQUENCE FLOWCHART
Start
Unlock Sequence
Write 055h to
PMCON2
Write 0AAh to
PMCON2
Initiate
Write or Erase operation
(WR = 1)
4. NOP instruction
5. NOP instruction
Once the WR bit is set, the processor will always force
two NOP instructions. When an Erase Row or Program
Row operation is being performed, the processor will stall
internal operations (typical 2 ms), until the operation is
complete and then resume with the next instruction.
When the operation is loading the program memory write
latches, the processor will always force the two NOP
instructions and continue uninterrupted with the next
instruction.
End
Unlock Sequence
DS40001585B-page 53
PIC10(L)F320/322
9.2.3
FIGURE 9-4:
FLASH PROGRAM
MEMORY ERASE
FLOWCHART
Start
Erase Operation
Disable Interrupts
(GIE = 0)
Select
Program or Configuration Memory
(CFGS)
Unlock Sequence
Figure 9-3
(FIGURE
x-x)
Re-enable Interrupts
(GIE = 1)
End
Erase Operation
DS40001585B-page 54
PIC10(L)F320/322
EXAMPLE 9-2:
Required
Sequence
BCF
BANKSEL
MOVF
MOVWF
MOVF
MOVWF
BCF
BSF
BSF
INTCON,GIE
PMADRL
ADDRL,W
PMADRL
ADDRH,W
PMADRH
PMCON1,CFGS
PMCON1,FREE
PMCON1,WREN
MOVLW
MOVWF
MOVLW
MOVWF
BSF
NOP
NOP
55h
PMCON2
0AAh
PMCON2
PMCON1,WR
BCF
BSF
PMCON1,WREN
INTCON,GIE
; Disable writes
; Enable interrupts
DS40001585B-page 55
PIC10(L)F320/322
9.2.4
1.
2.
3.
DS40001585B-page 56
1 0 7
4 3
PMADRL
PMADRH
-
r4
r3
r2
r1
r0
c3
c2
7
-
c1
c0
5
-
PMDATH
6
0
PMDATL
8
14
Program Memory Write Latches
14
Write Latch #0
00h
PMADRL<3:0>
14
14
14
Write Latch #1
01h
14
14
14
14
PMADRH<0>:
PMADRL<7:4>
CFGS = 0
Row
Address
Decode
Row
Addr
Addr
Addr
Addr
000h
0000h
0001h
000Eh
000Fh
001h
0010h
0011h
001Eh
001Fh
002h
0020h
0021h
002Eh
002Fh
01Eh
01E0h
01E1h
01EEh
01EFh
01Fh
01F0h
01F1h
01FEh
01FFh
000h
2000h - 2003h
USER ID 0 - 3
CFGS = 1
2004h - 2005h
2006h
2007h
2008h
reserved
DEVICEID
REVID
Configuration
Word
reserved
Configuration Memory
PIC10(L)F320/322
DS40001585B-page 57
FIGURE 9-5:
PIC10(L)F320/322
FIGURE 9-6:
Start
Write Operation
Disable Interrupts
(GIE = 0)
Select
Program or Config. Memory
(CFGS)
Enable Write/Erase
Operation (WREN = 1)
Last word to
write ?
Yes
No
Unlock Sequence
(Figure9-3
x-x)
Figure
Increment Address
(PMADRH:PMADRL++)
Unlock Sequence
(Figure9-3
x-x)
Figure
Disable
Write/Erase Operation
(WREN = 0)
Re-enable Interrupts
(GIE = 1)
End
Write Operation
DS40001585B-page 58
PIC10(L)F320/322
EXAMPLE 9-3:
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; This write routine assumes the following:
;
A valid starting address (the least significant bits = '00')
;
is loaded in ADDRH:ADDRL
;
ADDRH, ADDRL and DATADDR are all located in data memory
;
BANKSEL
PMADRH
MOVF
ADDRH,W
;Load initial address
MOVWF
PMADRH
;
MOVF
ADDRL,W
;
MOVWF
PMADRL
;
MOVF
DATAADDR,W
;Load initial data address
MOVWF
FSR
;
LOOP MOVF INDF,W
;Load first data byte into lower
MOVWF
PMDATL
;
INCF
FSR,F
;Next byte
MOVF
INDF,W
;Load second data byte into upper
MOVWF
PMDATH
;
INCF
FSR,F
;
BANKSEL PMCON1
BSF
PMCON1,WREN ;Enable writes
BCF
INTCON,GIE
;Disable interrupts (if using)
BTFSC
INTCON,GIE
;See AN576
GOTO
$-2
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
Required Sequence
MOVLW
55h
;Start of required write sequence:
MOVWF
PMCON2
;Write 55h
MOVLW
0AAh
;
MOVWF
PMCON2
;Write 0AAh
BSF
PMCON1,WR
;Set WR bit to begin write
NOP
;Required to transfer data to the buffer
NOP
;registers
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
BCF
PMCON1,WREN ;Disable writes
BSF
INTCON,GIE
;Enable interrupts (comment out if not using interrupts)
BANKSEL PMADRL
MOVF
PMADRL, W
INCF
PMADRL,F
;Increment address
ANDLW
0x03
;Indicates when sixteen words have been programmed
SUBLW
0x03
;Change value for different size write blocks
;0x0F = 16 words
;0x0B = 12 words
;0x07 = 8 words
;0x03 = 4 words
BTFSS
STATUS,Z
;Exit on a match,
GOTO
LOOP
;Continue if more data needs to be written
DS40001585B-page 59
PIC10(L)F320/322
9.3
FIGURE 9-7:
FLASH PROGRAM
MEMORY MODIFY
FLOWCHART
Start
Modify Operation
Read Operation
(Figure9-2
x.x)
Figure
Modify Image
The words to be modified are
changed in the RAM image
Erase Operation
(Figure9-4
x.x)
Figure
Write Operation
use RAM image
(Figure9-5
x.x)
Figure
End
Modify Operation
DS40001585B-page 60
PIC10(L)F320/322
9.4
TABLE 9-2:
Address
Function
Read Access
Write Access
2000h-2003h
2006h
2007h
User IDs
Device ID/Revision ID
Configuration Word
Yes
Yes
Yes
Yes
No
No
EXAMPLE 9-4:
* This code block will read 1 word of program memory at the memory address:
*
PROG_ADDR_LO (must be 00h-08h) data will be returned in the variables;
*
PROG_DATA_HI, PROG_DATA_LO
BANKSEL
MOVLW
MOVWF
CLRF
PMADRL
PROG_ADDR_LO
PMADRL
PMADRH
BSF
BCF
BSF
NOP
NOP
BSF
PMCON1,CFGS
INTCON,GIE
PMCON1,RD
INTCON,GIE
;
;
;
;
;
;
MOVF
MOVWF
MOVF
MOVWF
PMDATL,W
PROG_DATA_LO
PMDATH,W
PROG_DATA_HI
;
;
;
;
DS40001585B-page 61
PIC10(L)F320/322
9.5
Write Verify
FIGURE 9-8:
FLASH PROGRAM
MEMORY VERIFY
FLOWCHART
Start
Verify Operation
Read Operation
(Figure
Figure
9-2x.x)
PMDAT =
RAM image
?
Yes
No
No
Fail
Verify Operation
Last
Word ?
Yes
End
Verify Operation
DS40001585B-page 62
PIC10(L)F320/322
9.6
REGISTER 9-1:
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
PMDAT<7:0>
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7-0
PMDAT<7:0>: The value of the program memory word pointed to by PMADRH and PMADRL after a
program memory read command.
REGISTER 9-2:
U-0
U-0
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
PMDAT<13:8>
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7-6
Unimplemented: Read as 0
bit 5-0
PMDAT<13:8>: The value of the program memory word pointed to by PMADRH and PMADRL after a
program memory read command.
DS40001585B-page 63
PIC10(L)F320/322
REGISTER 9-3:
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
PMADR<7:0>
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7-0
REGISTER 9-4:
U-0
U-0
U-0
U-0
U-0
U-0
U-0
R/W-0/0
PMADR8
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7-1
Unimplemented: Read as 0
bit 0
DS40001585B-page 64
PIC10(L)F320/322
REGISTER 9-5:
U-1(1)
R/W-0/0
R/W-0/0
CFGS
LWLO
R/W/HC-0/0 R/W/HC-0/q(2)
FREE
WRERR
R/W-0/0
R/S/HC-0/0
R/S/HC-0/0
WREN
WR
RD
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7
Unimplemented: Read as 1
bit 6
bit 5
bit 4
bit 3
bit 2
bit 1
bit 0
Note 1:
2:
3:
DS40001585B-page 65
PIC10(L)F320/322
REGISTER 9-6:
W-0/0
W-0/0
W-0/0
W-0/0
W-0/0
W-0/0
W-0/0
W-0/0
bit 0
Legend:
R = Readable bit
W = Writable bit
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7-0
TABLE 9-3:
Name
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Register on
Page
INTCON
GIE
PEIE
TMR0IE
INTE
IOCIE
TMR0IF
INTF
IOCIF
40
PMCON1
CFGS
LWLO
FREE
WRERR
WREN
WR
RD
65
PMCON2
66
PMADRL
PMADR<7:0>
64
PMADRH
PMDATL
PMDATH
Legend:
CONFIG
Legend:
PMADR8
64
63
PMDAT<13:8>
63
= unimplemented location, read as 0. Shaded cells are not used by Flash program memory module.
TABLE 9-4:
Name
PMDAT<7:0>
Bits
Bit -/6
Bit 13/5
Bit 12/4
Bit 11/3
13:8
WRT<1:0>
7:0
CP
MCLR
PWRTE
WDTE<1:0>
Bit 10/2
Bit 9/1
BORV
LPBOR
BOREN<1:0>
Bit 8/0
LVP
FOSC
Register
on Page
20
= unimplemented location, read as 0. Shaded cells are not used by Flash program memory.
DS40001585B-page 66
PIC10(L)F320/322
10.0
I/O PORT
FIGURE 10-1:
Read LATA
D
Write LATA
Write PORTA
TRISA
CK
VDD
Data Register
Data Bus
I/O pin
Read PORTA
To peripherals
ANSELA
VSS
The Data Latch (LATA register) is useful for readmodify-write operations on the value that the I/O pins
are driving.
A write operation to the LATA register has the same
effect as a write to the corresponding PORTA register.
A read of the LATA register reads of the values held in
the I/O PORT latches, while a read of the PORTA
register reads the actual I/O pin value.
Ports that support analog inputs have an associated
ANSELA register. When an ANSEL bit is set, the digital
input buffer associated with that bit is disabled.
Disabling the input buffer prevents analog signal levels
on the pin between a logic high and low from causing
excessive current in the logic input circuitry. A
simplified model of a generic I/O port, without the
interfaces to other peripherals, is shown in Figure 10-1.
EXAMPLE 10-1:
;
;
;
;
INITIALIZING PORTA
BANKSEL
CLRF
BANKSEL
CLRF
BANKSEL
CLRF
BANKSEL
MOVLW
MOVWF
PORTA
PORTA
LATA
LATA
ANSELA
ANSELA
TRISA
B'00000011'
TRISA
DS40001585B-page 67
PIC10(L)F320/322
10.1
PORTA Registers
10.1.3
TABLE 10-1:
Function Priority(1)
RA0
ICSPDAT
CWG1A
PWM1
RA0
RA1
CWG1B
PWM2
CLC1
RA1
RA2
NCO1
CLKR
RA2
RA3
None
WEAK PULL-UPS
Each of the PORTA pins has an individually configurable internal weak pull-up. Control bits WPUA<3:0>
enable or disable each pull-up (see Register 10-5).
Each weak pull-up is automatically turned off when the
port pin is configured as an output. All pull-ups are disabled on a Power-on Reset by the WPUEN bit of the
OPTION_REG register.
10.1.2
Pin Name
10.1.1
Note 1:
ANSELA REGISTER
DS40001585B-page 68
PIC10(L)F320/322
10.2
REGISTER 10-1:
U-0
U-0
U-0
U-0
R-x/x
R/W-x/x
R/W-x/x
R/W-x/x
RA3
RA2
RA1
RA0
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7-4
Unimplemented: Read as 0
bit 3-0
Note 1:
Writes to PORTx are actually written to the corresponding LATx register. Reads from PORTx register
return actual I/O pin values.
REGISTER 10-2:
U-0
U-0
U-0
U-0
U-1
R/W-1/1
R/W-1/1
R/W-1/1
(1)
TRISA2
TRISA1
TRISA0
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7-4
Unimplemented: Read as 0
bit 3
Unimplemented: Read as 1
bit 2-0
Note 1:
Unimplemented, read as 1.
DS40001585B-page 69
PIC10(L)F320/322
REGISTER 10-3:
U-0
U-0
U-0
U-0
U-0
R/W-x/u
R/W-x/u
R/W-x/u
LATA2
LATA1
LATA0
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7-3
Unimplemented: Read as 0
bit 2-0
Note 1:
Writes to PORTx are actually written to the corresponding LATx register. Reads from LATx register return
register values, not I/O pin values.
REGISTER 10-4:
U-0
U-0
U-0
U-0
U-0
R/W-1/1
R/W-1/1
R/W-1/1
ANSA2
ANSA1
ANSA0
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7-3
Unimplemented: Read as 0
bit 2-0
ANSA<2:0>: Analog Select between Analog or Digital Function on Pins RA<2:0>, respectively
1 = Analog input. Pin is assigned as analog input(1). Digital Input buffer disabled.
0 = Digital I/O. Pin is assigned to port or Digital special function.
Note 1:
Setting a pin to an analog input automatically disables the digital input circuitry. Weak pull-ups, if
available, are unaffected. The corresponding TRIS bit must be set to Input mode by the user in order to
allow external control of the voltage on the pin.
DS40001585B-page 70
PIC10(L)F320/322
REGISTER 10-5:
U-0
U-0
U-0
U-0
R/W-1/1
R/W-1/1
R/W-1/1
R/W-1/1
WPUA3
WPUA2
WPUA1
WPUA0
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7-4
Unimplemented: Read as 0
bit 3-0
Note 1:
Enabling weak pull-ups also requires that the WPUEN bit of the OPTION_REG register be cleared
(Register 16-1).
DS40001585B-page 71
PIC10(L)F320/322
TABLE 10-2:
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Register
on Page
ANSELA
ANSA2
ANSA1
ANSA0
70
IOCAF
IOCAF3
IOCAF2
IOCAF1
IOCAF0
76
IOCAN
IOCAN3
IOCAN2
IOCAN1
IOCAN0
75
IOCAP
IOCAP3
IOCAP2
IOCAP1
IOCAP0
75
LATA
LATA2
LATA1
LATA0
70
PORTA
RA3
RA2
RA1
RA0
69
(1)
TRISA2
TRISA1
TRISA0
69
WPUA2
WPUA1
WPUA0
71
Name
TRISA
WPUA
WPUA3
Legend: x = unknown, u = unchanged, = unimplemented locations read as 0. Shaded cells are not used by
PORTA.
Note 1: Unimplemented, read as 1.
DS40001585B-page 72
PIC10(L)F320/322
11.0
INTERRUPT-ON-CHANGE
11.1
11.2
11.3
Interrupt Flags
11.4
EXAMPLE 11-1:
MOVLW
XORWF
ANDWF
11.5
0xff
IOCAF, W
IOCAF, F
Operation in Sleep
DS40001585B-page 73
PIC10(L)F320/322
FIGURE 11-1:
IOCANx
Q4Q1
CK
Edge
Detect
RAx
IOCAPx
Data Bus =
0 or 1
Write IOCAFx
CK
To Data Bus
IOCAFx
CK
IOCIE
R
Q2
From all other
IOCAFx individual
pin detectors
Q1
Q2
Q3
Q4
Q4Q1
DS40001585B-page 74
Q1
Q1
Q2
Q2
Q3
Q4
Q4Q1
IOC Interrupt
to CPU Core
Q3
Q4
Q4
Q4Q1
Q4Q1
PIC10(L)F320/322
11.6
Interrupt-On-Change Registers
REGISTER 11-1:
U-0
U-0
U-0
U-0
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
IOCAP3
IOCAP2
IOCAP1
IOCAP0
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7-4
Unimplemented: Read as 0.
bit 3-0
Note 1:
Interrupt-on-change also requires that the IOCIE bit of the INTCON register be set (Register 6-1).
REGISTER 11-2:
U-0
U-0
U-0
U-0
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
IOCAN3
IOCAN2
IOCAN1
IOCAN0
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7-4
Unimplemented: Read as 0.
bit 3-0
Note 1:
Interrupt-on-change also requires that the IOCIE bit of the INTCON register be set (Register 6-1).
DS40001585B-page 75
PIC10(L)F320/322
REGISTER 11-3:
U-0
U-0
U-0
U-0
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
IOCAF3
IOCAF2
IOCAF1
IOCAF0
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7-4
Unimplemented: Read as 0.
bit 3-0
Note 1:
Interrupt-on-change also requires that the IOCIE bit of the INTCON register be set (Register 6-1).
TABLE 11-1:
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Register
on Page
GIE
PEIE
TMR0IE
INTE
IOCIE
TMR0IF
INTF
IOCIF
40
IOCAF
IOCAF3
IOCAF2
IOCAF1
IOCAF0
76
IOCAN
IOCAN3
IOCAN2
IOCAN1
IOCAN0
75
IOCAP
IOCAP3
IOCAP2
IOCAP1
IOCAP0
75
TRISA
(1)
TRISA2
TRISA1
TRISA0
69
Name
INTCON
Legend: = unimplemented location, read as 0. Shaded cells are not used by Interrupt-on-Change.
Note 1: Unimplemented, read as 1.
DS40001585B-page 76
PIC10(L)F320/322
12.0
12.1
12.2
FIGURE 12-1:
2
x1
x2
x4
FVR
(To ADC Module)
1.024V Fixed
Reference
+
FVREN
FVRRDY
TABLE 12-1:
Peripheral
HFINTOSC
BOR
IVR
Conditions
Description
FOSC = 1
EC on CLKIN pin.
BOREN<1:0> = 11
DS40001585B-page 77
PIC10(L)F320/322
12.3
REGISTER 12-1:
R/W-0/0
R-q/q
FVREN
FVRRDY(1)
R/W-0/0
TSEN
(3)
R/W-0/0
TSRNG
(3)
U-0
U-0
R/W-0/0
R/W-0/0
ADFVR<1:0>
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7
bit 6
bit 5
bit 4
bit 3-2
Unimplemented: Read as 0
bit 1-0
Note 1:
2:
3:
TABLE 12-2:
Name
FVRCON
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
FVREN
FVRRDY
TSEN
TSRNG
Bit 1
Bit 0
ADFVR<1:0>
Register
on page
78
Legend: Shaded cells are not used with the Fixed Voltage Reference.
DS40001585B-page 78
PIC10(L)F320/322
13.0
INTERNAL VOLTAGE
REGULATOR (IVR)
TABLE 13-1:
VREGPM1 Bit
No
DS40001585B-page 79
PIC10(L)F320/322
REGISTER 13-1:
U-0
U-0
bit 7
Legend:
R = Readable bit
u = Bit is unchanged
1 = Bit is set
W = Writable bit
x = Bit is unknown
0 = Bit is cleared
U-0
U-0
U-0
R/W-0/0
VREGPM1
R/W-1/1
Reserved
bit 0
bit 7-2
Unimplemented: Read as 0
bit 1
bit 0
DS40001585B-page 80
PIC10(L)F320/322
14.0
TEMPERATURE INDICATOR
MODULE
FIGURE 14-1:
Rev. 10-000069A
7/31/2013
VDD
TSEN
14.1
TEMPERATURE CIRCUIT
DIAGRAM
TSRNG
VOUT
To ADC
Temp. Indicator
Circuit Operation
14.2
EQUATION 14-1:
VOUT RANGES
TABLE 14-1:
3.6V
1.8V
14.3
Temperature Output
14.4
DS40001585B-page 81
PIC10(L)F320/322
TABLE 14-2:
Name
FVRCON
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
FVREN
FVRRDY
TSEN
TSRNG
ADCON
ADRES
ADCS<2:0>
CHS<2:0>
A/D Result Register
Bit 1
Bit 0
ADFVR<1:0>
GO/
DONE
ADON
Register
on Page
78
88
89
Legend: = unimplemented location, read as 0. Shaded cells are not used by the temperature indicator module.
DS40001585B-page 82
PIC10(L)F320/322
15.0
ANALOG-TO-DIGITAL
CONVERTER (ADC) MODULE
FIGURE 15-1:
000
AN1
001
AN2
010
Reserved
011
Reserved
Reserved
100
Temp Indicator
110
FVR
111
101
VREF+ = VDD
ADC
8
GO/DONE
ADRES
ADON(1)
CHS<2:0>(2)
Note 1:
2:
VSS
DS40001585B-page 83
PIC10(L)F320/322
15.1
ADC Configuration
Port configuration
Channel selection
ADC conversion clock source
Interrupt control
15.1.1
PORT CONFIGURATION
15.1.2
CHANNEL SELECTION
15.1.4
CONVERSION CLOCK
The source of the conversion clock is software selectable via the ADCS bits of the ADCON register
(Register 15-1). There are seven possible clock
options:
FOSC/2
FOSC/4
FOSC/8
FOSC/16
FOSC/32
FOSC/64
FRC (dedicated internal RC oscillator)
15.1.3
DS40001585B-page 84
PIC10(L)F320/322
TABLE 15-1:
ADC
Clock Source
ADCS<2:0>
16 MHz
8 MHz
4 MHz
1 MHz
FOSC/2
000
125 ns(1)
250 ns(1)
500 ns(1)
2.0 s
FOSC/4
100
(1)
250 ns
(1)
FOSC/8
001
0.5 s(1)
FOSC/16
101
1.0 s
FOSC/32
010
2.0 s
FOSC/64
110
4.0 s
FRC
x11
1.0-6.0 s(1,3)
Legend:
Note 1:
2:
3:
1.0 s
4.0 s
1.0 s
2.0 s
8.0 s(2)
2.0 s
4.0 s
16.0 s(2)
500 ns
(2)
4.0 s
(2)
8.0 s
1.0-6.0 s(1,3)
32.0 s(2)
8.0 s
(2)
64.0 s(2)
16.0 s
1.0-6.0 s(1,3)
1.0-6.0 s(1,3)
FIGURE 15-2:
DS40001585B-page 85
PIC10(L)F320/322
15.1.5
INTERRUPTS
15.2
15.2.1
ADC Operation
STARTING A CONVERSION
15.2.2
COMPLETION OF A CONVERSION
15.2.3
TERMINATING A CONVERSION
15.2.4
DS40001585B-page 86
PIC10(L)F320/322
15.2.5
2.
3.
4.
5.
6.
7.
8.
Configure Port:
Disable pin output driver (Refer to the TRIS
register)
Configure pin as analog (Refer to the ANSEL
register)
Configure the ADC module:
Select ADC conversion clock
Select ADC input channel
Turn on ADC module
Configure ADC interrupt (optional):
Clear ADC interrupt flag
Enable ADC interrupt
Enable peripheral interrupt
Enable global interrupt(1)
Wait the required acquisition time(2).
Start conversion by setting the GO/DONE bit.
Wait for ADC conversion to complete by one of
the following:
Polling the GO/DONE bit
Waiting for the ADC interrupt (interrupts
enabled)
Read ADC Result.
Clear the ADC interrupt flag (required if interrupt
is enabled).
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: Refer to Section 15.4 A/D Acquisition
Requirements.
DS40001585B-page 87
PIC10(L)F320/322
15.3
REGISTER 15-1:
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
ADCS<2:0>
R/W-0/0
R/W-0/0
CHS<2:0>
R/W-0/0
R/W-0/0
GO/DONE
ADON
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7-5
bit 4-2
bit 1
bit 0
Note 1:
2:
DS40001585B-page 88
PIC10(L)F320/322
REGISTER 15-2:
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
ADRES<7:0>
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7-0
DS40001585B-page 89
PIC10(L)F320/322
15.4
EQUATION 15-1:
Assumptions:
T ACQ = Amplifier Settling Time + Hold Capacitor Charging Time + Temperature Coefficient
= T AMP + T C + T COFF
= 2s + T C + Temperature - 25C 0.05s/C
The value for TC can be approximated with the following equations:
1
= V CHOLD
V AP P LI ED 1 -------------------------n+1
2
1
TC
----------
RC
V AP P LI ED 1 e = V CHOLD
Tc
---------
1
RC
;combining [1] and [2]
V AP P LI ED 1 e = V A PP LIE D 1 -------------------------n+1
2
1
T C = C HOLD R IC + R SS + R S ln(1/511)
= 10pF 1k + 7k + 10k ln(0.001957)
= 1.12 s
Therefore:
T A CQ = 2s + 1.12s + 50C- 25C 0.05 s/C
= 4.37s
Note 1: The reference voltage (VREF) has no effect on the equation, since it cancels itself out.
2: The charge holding capacitor (CHOLD) is not discharged after each conversion.
3: The maximum recommended impedance for analog sources is 10 k. This is required to meet the pin
leakage specification.
DS40001585B-page 90
PIC10(L)F320/322
FIGURE 15-3:
Analog
Input
pin
Rs
VT 0.6V
CPIN
5 pF
VA
RIC 1k
Sampling
Switch
SS Rss
I LEAKAGE(1)
VT 0.6V
CHOLD = 10 pF
VSS/VREF-
Legend: CHOLD
CPIN
6V
5V
VDD 4V
3V
2V
= Sample/Hold Capacitance
= Input Capacitance
RSS
= Sampling Switch
VT
= Threshold Voltage
Note 1:
FIGURE 15-4:
5 6 7 8 9 10 11
Sampling Switch
(k)
Full-Scale Range
FFh
FEh
FDh
FCh
FBh
03h
02h
01h
00h
VREF-
Zero-Scale
Transition
1.5 LSB
Full-Scale
Transition
VREF+
DS40001585B-page 91
PIC10(L)F320/322
TABLE 15-2:
Name
ADCON
Bit 6
Bit 5
Bit 4
ADCS<2:0>
Bit 3
Bit 2
CHS<2:0>
ADRES
Bit 1
Bit 0
GO/DONE
ADON
ADRES<7:0>
Register
on Page
88
89
ANSELA
ANSA2
FVRCON
FVREN
FVRRDY
TSEN
TSRNG
INTCON
GIE
PEIE
TMR0IE
INTE
IOCIE
TMR0IF
INTF
IOCIF
40
PIE1
ADIE
NCO1IE
CLC1IE
TMR2IE
41
PIR1
ADIF
NCO1IF
CLC1IF
TMR2IF
42
TRISA
TRISA2
TRISA1
TRISA0
69
Legend:
ANSA1
ANSA0
ADFVR<1:0>
70
78
x = unknown, u = unchanged, = unimplemented read as 0, q = value depends on condition. Shaded cells are not
used for ADC module.
DS40001585B-page 92
PIC10(L)F320/322
16.0
TIMER0 MODULE
Note:
16.1.2
16.1
Timer0 Operation
16.1.1
FIGURE 16-1:
FOSC/4
Data Bus
0
T0CKI
1
1
8
SYNC
2 TCY
TMR0
0
T0SE
T0CS
8-bit
Prescaler
PSA
PS<2:0>
DS40001585B-page 93
PIC10(L)F320/322
16.1.3
SOFTWARE PROGRAMMABLE
PRESCALER
16.1.4
TIMER0 INTERRUPT
16.1.5
DS40001585B-page 94
PIC10(L)F320/322
REGISTER 16-1:
R/W-1/u
WPUEN
(1)
R/W-1/u
R/W-1/u
R/W-1/u
R/W-1/u
INTEDG
T0CS
T0SE
PSA
R/W-1/u
R/W-1/u
R/W-1/u
PS<2:0>
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7
bit 6
bit 5
bit 4
bit 3
bit 2-0
000
001
010
011
100
101
110
111
Note 1:
INTCON
1:2
1:4
1:8
1 : 16
1 : 32
1 : 64
1 : 128
1 : 256
WPUEN does not disable the pull-up for the MCLR input when MCLR = 1.
TABLE 16-1:
Name
TMR0 Rate
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Register on
Page
GIE
PEIE
TMR0IE
INTE
IOCIE
TMR0IF
INTF
IOCIF
40
T0SE
PSA
T0CS
TMR0
TRISA
PS<2:0>
95
TRISA2
40
TRISA1
TRISA0
69
Legend: = Unimplemented locations, read as 0, u = unchanged, x = unknown. Shaded cells are not used by the
Timer0 module.
DS40001585B-page 95
PIC10(L)F320/322
17.0
TIMER2 MODULE
17.1
Timer2 Operation
FIGURE 17-1:
FOSC/4
Prescaler
1:1, 1:4, 1:16, 1:64
2
TMR2
Comparator
Sets Flag
bit TMR2IF
Reset
EQ
Postscaler
1:1 to 1:16
T2CKPS<1:0>
PR2
4
TOUTPS<3:0>
DS40001585B-page 96
PIC10(L)F320/322
REGISTER 17-1:
U-0
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
TOUTPS<3:0>
R/W-0/0
TMR2ON
R/W-0/0
T2CKPS<1:0>
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7
Unimplemented: Read as 0
bit 6-3
bit 2
bit 1-0
TABLE 17-1:
Name
Bit 7
INTCON
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Register on
Page
GIE
PEIE
TMR0IE
INTE
IOCIE
TMR0IF
INTF
IOCIF
40
PIE1
ADIE
NCO1IE
CLC1IE
TMR2IE
41
PIR1
ADIF
NCO1IF
CLC1IF
TMR2IF
42
PR2
TMR2
T2CON
Legend:
96
TOUTPS<3:0>
96
TMR2ON
T2CKPS<1:0>
97
x = unknown, u = unchanged, - = unimplemented read as 0. Shaded cells are not used for Timer2 module.
DS40001585B-page 97
PIC10(L)F320/322
18.0
PULSE-WIDTH MODULATION
(PWM) MODULE
PR2
T2CON
PWMxDCH
PWMxDCL
PWMxCON
FIGURE 18-1:
PWMxDCL<7:6>
PWMxDCH
PWMxOUT
to other peripherals: CLC and CWG
Latched
(Not visible to user)
Comparator
0
PWMx
TMR2 Module
TMR2
(1)
Comparator
PR2
Clear Timer,
PWMx pin and
latch Duty Cycle
Note 1: 8-bit timer is concatenated with the two Least Significant bits of 1/FOSC adjusted by the Timer2
prescaler to create a 10-bit time base.
FIGURE 18-2:
PWM OUTPUT
Period
Pulse Width
TMR2 = 0
DS40001585B-page 98
TMR2 = PR2
TMR2 =
PWMxDCH<7:0>:PWMxDCL<7:6>
PIC10(L)F320/322
18.1
18.1.3
PWM PERIOD
EQUATION 18-1:
18.1.4
EQUATION 18-2:
PULSE WIDTH
EQUATION 18-3:
PWMxDCH:PWMxDCL<7:6>
Duty Cycle Ratio = ----------------------------------------------------------------------------------4 PR2 + 1
PWM PERIOD
TOSC = 1/FOSC
DS40001585B-page 99
PIC10(L)F320/322
18.1.5
PWM RESOLUTION
EQUATION 18-4:
PWM RESOLUTION
log 4 PR2 + 1
Resolution = ------------------------------------------ bits
log 2
Note:
TABLE 18-1:
PWM Frequency
0.31 kHz
78.12 kHz
156.3 kHz
208.3 kHz
64
0xFF
0xFF
0x3F
0x1F
0x17
10
10
10
6.6
PWM Frequency
0.31 kHz
4.90 kHz
19.61 kHz
76.92 kHz
153.85 kHz
200.0 kHz
64
0x65
0x65
0x65
0x19
0x0C
0x09
18.1.6
19.53 kHz
0xFF
TABLE 18-2:
4.88 kHz
18.1.7
18.1.8
EFFECTS OF RESET
Any Reset will force all ports to Input mode and the
PWM registers to their Reset states.
DS40001585B-page 100
PIC10(L)F320/322
18.1.9
6.
7.
8.
DS40001585B-page 101
PIC10(L)F320/322
18.2
REGISTER 18-1:
R/W-0/0
R/W-0/0
R-0/0
R/W-0/0
U-0
U-0
U-0
U-0
PWMxEN
PWMxOE
PWMxOUT
PWMxPOL
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7
bit 6
bit 5
bit 4
bit 3-0
Unimplemented: Read as 0
DS40001585B-page 102
PIC10(L)F320/322
REGISTER 18-2:
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
PWMxDCH<7:0>
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7-0
REGISTER 18-3:
R/W-x/u
R/W-x/u
U-0
U-0
U-0
U-0
U-0
U-0
PWMxDCL<7:6>
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7-6
bit 5-0
Unimplemented: Read as 0
TABLE 18-3:
Name
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Register
on Page
ANSELA
ANSA2
ANSA1
ANSA0
70
LATA
LATA2
LATA1
LATA0
70
PORTA
RA3
RA2
RA1
RA0
69
PR2
PWM1CON
PWM1OE
PWM1OUT
PWM1DCH
PWM1DCL
PWM2CON
T2CON
PWM1DCL<7:6>
PWM2EN
PWM2OE
103
103
PWM2POL
102
103
T2CKPS<1:0>
97
PWM2DCH<7:0>
PWM2DCL<7:6>
TOUTPS<3:0>
103
TMR2ON
102
PWM2OUT
TMR2
TRISA
PWM1DCH<7:0>
PWM2DCH
PWM2DCL
PWM1POL
96
96
TRISA2
TRISA1
TRISA0
69
Legend: - = Unimplemented locations, read as 0, u = unchanged, x = unknown. Shaded cells are not used by the PWM.
DS40001585B-page 103
PIC10(L)F320/322
19.0
The Configurable Logic Cell (CLCx) provides programmable logic that operates outside the speed limitations
of software execution. The logic cell selects any combination of the eight input signals and through the use of
configurable gates reduces the selected inputs to four
logic lines that drive one of eight selectable single-output logic functions.
Input sources are a combination of the following:
FIGURE 19-1:
CLCxIN[0]
Q1
CLCxIN[1]
CLCxIN[3]
CLCxIN[4]
CLCxIN[5]
CLCxIN[6]
CLCxIN[7]
CLCxIN[2]
LCxOUT
LE
LCxOE
LCxEN
lcxg1
TRIS Control
lcxg2
Logic
lcxg3
Function
lcxq
lcx_out
CLCx
lcxg4
LCxPOL
LCxMODE<2:0>
Interrupt
det
LCxINTP
LCxINTN
sets
CLCxIF
flag
Interrupt
det
DS40001585B-page 104
PIC10(L)F320/322
19.1
CLCx Setup
19.1.2
Programming the CLCx module is performed by configuring the four stages in the logic signal flow. The four
stages are:
Data selection
Data gating
Logic function selection
Output polarity
19.1.1
DATA SELECTION
There are eight signals available as inputs to the configurable logic. Four 8-input multiplexers are used to
select the inputs to pass on to the next stage.
Data inputs are selected with the CLCxSEL0 and
CLCxSEL1 registers (Register 19-3 and Register 19-4,
respectively).
Data selection is through four multiplexers as indicated
on the left side of Figure 19-2. Data inputs in the figure
are identified by a generic numbered input name.
Table 19-1 correlates the generic input name to the
actual signal for each CLC module. The columns
labeled lcxd1 through lcxd4 indicate the MUX output for
the selected data input. D1S through D4S are
abbreviations for the MUX select input codes:
LCxD1S<2:0> through LCxD4S<2:0>, respectively.
Selecting a data input in a column excludes all other
inputs in that column.
Note:
Each stage is setup at run time by writing to the corresponding CLCx Special Function Registers. This has
the added advantage of permitting logic reconfiguration
on-the-fly during program execution.
Data Input
lcxd1
D1S
lcxd2
D2S
lcxd3
D3S
lcxd4
D4S
CLC 1
CLCxIN[0]
000
000
000
000
CLCx
CLCxIN[1]
001
001
001
001
CLCxIN1
CLCxIN[2]
010
010
010
010
CLCxIN2
CLCxIN[3]
011
011
011
011
PWM1
CLCxIN[4]
100
100
100
100
PWM2
CLCxIN[5]
101
101
101
101
NCOx
CLCxIN[6]
110
110
110
110
FOSC
CLCxIN[7]
111
111
111
111
LFINTOSC
The gate stage is more than just signal direction. The gate
can be configured to direct each input signal as inverted
or non-inverted data. Directed signals are ANDed
together in each gate. The output of each gate can be
inverted before going on to the logic function stage.
The gating is in essence a 1-to-4 input AND/NAND/OR/
NOR gate. When every input is inverted and the output
is inverted, the gate is an OR of all enabled data inputs.
When the inputs and output are not inverted, the gate
is an AND or all enabled inputs.
Table 19-2 summarizes the basic logic that can be
obtained in gate 1 by using the gate logic select bits.
The table shows the logic of four input variables, but
each gate can be configured to use less than four. If no
inputs are selected, the output will be zero or one,
depending on the gate output polarity bit.
TABLE 19-2:
TABLE 19-1:
DATA GATING
CLCxGLS0
LCxGyPOL
Gate Logic
0x55
AND
0x55
NAND
0xAA
NOR
0xAA
OR
0x00
Logic 0
0x00
Logic 1
DS40001585B-page 105
PIC10(L)F320/322
19.1.3
LOGIC FUNCTION
AND-OR
OR-XOR
AND
S-R Latch
D Flip-Flop with Set and Reset
D Flip-Flop with Reset
J-K Flip-Flop with Reset
Transparent Latch with Set and Reset
19.1.4
OUTPUT POLARITY
DS40001585B-page 106
19.1.5
PIC10(L)F320/322
19.2
CLCx Interrupts
19.3
Effects of a Reset
19.4
DS40001585B-page 107
PIC10(L)F320/322
FIGURE 19-2:
CLCxIN[0]
CLCxIN[1]
CLCxIN[2]
CLCxIN[3]
CLCxIN[4]
CLCxIN[5]
CLCxIN[6]
CLCxIN[7]
000
Data Selection
Data GATE 1
lcxd1T
LCxD1G1T
lcxd1N
LCxD1G1N
111
LCxD2G1T
LCxD1S<2:0>
LCxD2G1N
CLCxIN[0]
CLCxIN[1]
CLCxIN[2]
CLCxIN[3]
CLCxIN[4]
CLCxIN[5]
CLCxIN[6]
CLCxIN[7]
LCxD3G1T
lcxd2T
LCxD3G1N
LCxD4G1T
111
LCxD4G1N
000
Data GATE 2
lcxg2
lcxd3T
lcxd3N
Data GATE 3
111
lcxg3
LCxD3S<2:0>
CLCxIN[0]
CLCxIN[1]
CLCxIN[2]
CLCxIN[3]
CLCxIN[4]
CLCxIN[5]
CLCxIN[6]
CLCxIN[7]
LCxG1POL
lcxd2N
LCxD2S<2:0>
CLCxIN[0]
CLCxIN[1]
CLCxIN[2]
CLCxIN[3]
CLCxIN[4]
CLCxIN[5]
CLCxIN[6]
CLCxIN[7]
lcxg1
000
000
lcxg4
lcxd4T
lcxd4N
111
LCxD4S<2:0>
Note:
DS40001585B-page 108
PIC10(L)F320/322
FIGURE 19-3:
OR - XOR
lcxg1
lcxg1
lcxg2
lcxq
lcxg3
lcxg4
lcxg2
lcxq
lcxg3
lcxg4
LCxMODE<2:0>= 000
LCxMODE<2:0>= 001
4-Input AND
S-R Latch
lcxg1
lcxg1
lcxg2
lcxg2
lcxq
lcxg3
lcxg3
lcxg4
lcxg4
LCxMODE<2:0>= 010
lcxq
LCxMODE<2:0>= 011
lcxg4
lcxg2
lcxg4
Q
lcxq
lcxg2
lcxg1
lcxg1
lcxq
R
lcxg3
lcxg3
LCxMODE<2:0>= 100
LCxMODE<2:0>= 101
lcxg2
lcxg1
lcxg4
lcxq
lcxg2
lcxg1
LE
lcxg3
lcxq
lcxg3
LCxMODE<2:0>= 110
LCxMODE<2:0>= 111
DS40001585B-page 109
PIC10(L)F320/322
19.5
REGISTER 19-1:
R/W-0/0
R/W-0/0
R-0/0
R/W-0/0
R/W-0/0
LCxEN
LCxOE
LCxOUT
LCxINTP
LCxINTN
R/W-0/0
R/W-0/0
R/W-0/0
LCxMODE<2:0>
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7
bit 6
bit 5
bit 4
LCxINTP: Configurable Logic Cell Positive Edge Going Interrupt Enable bit
1 = CLCxIF will be set when a rising edge occurs on lcx_out
0 = CLCxIF will not be set
bit 3
LCxINTN: Configurable Logic Cell Negative Edge Going Interrupt Enable bit
1 = CLCxIF will be set when a falling edge occurs on lcx_out
0 = CLCxIF will not be set
bit 2-0
DS40001585B-page 110
PIC10(L)F320/322
REGISTER 19-2:
R/W-x/u
U-0
U-0
U-0
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
LCxPOL
LCxG4POL
LCxG3POL
LCxG2POL
LCxG1POL
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7
bit 6-4
Unimplemented: Read as 0
bit 3
bit 2
bit 1
bit 0
DS40001585B-page 111
PIC10(L)F320/322
REGISTER 19-3:
U-0
R/W-x/u
R/W-x/u
R/W-x/u
(1)
LCxD2S<2:0>
U-0
R/W-x/u
R/W-x/u
R/W-x/u
(1)
LCxD1S<2:0>
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7
Unimplemented: Read as 0
bit 6-4
bit 3
Unimplemented: Read as 0
bit 2-0
Note 1:
DS40001585B-page 112
PIC10(L)F320/322
REGISTER 19-4:
U-0
R/W-x/u
R/W-x/u
R/W-x/u
(1)
LCxD4S<2:0>
U-0
R/W-x/u
R/W-x/u
R/W-x/u
(1)
LCxD3S<2:0>
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7
Unimplemented: Read as 0
bit 6-4
bit 3
Unimplemented: Read as 0
bit 2-0
Note 1:
DS40001585B-page 113
PIC10(L)F320/322
REGISTER 19-5:
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
LCxG1D4T
LCxG1D4N
LCxG1D3T
LCxG1D3N
LCxG1D2T
LCxG1D2N
LCxG1D1T
LCxG1D1N
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7
bit 6
bit 5
bit 4
bit 3
bit 2
bit 1
bit 0
DS40001585B-page 114
PIC10(L)F320/322
REGISTER 19-6:
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
LCxG2D4T
LCxG2D4N
LCxG2D3T
LCxG2D3N
LCxG2D2T
LCxG2D2N
LCxG2D1T
LCxG2D1N
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7
bit 6
bit 5
bit 4
bit 3
bit 2
bit 1
bit 0
DS40001585B-page 115
PIC10(L)F320/322
REGISTER 19-7:
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
LCxG3D4T
LCxG3D4N
LCxG3D3T
LCxG3D3N
LCxG3D2T
LCxG3D2N
LCxG3D1T
LCxG3D1N
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7
bit 6
bit 5
bit 4
bit 3
bit 2
bit 1
bit 0
DS40001585B-page 116
PIC10(L)F320/322
REGISTER 19-8:
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
LCxG4D4T
LCxG4D4N
LCxG4D3T
LCxG4D3N
LCxG4D2T
LCxG4D2N
LCxG4D1T
LCxG4D1N
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7
bit 6
bit 5
bit 4
bit 3
bit 2
bit 1
bit 0
DS40001585B-page 117
PIC10(L)F320/322
TABLE 19-3:
Name
Bit6
Bit5
Bit4
BIt3
Bit2
Bit1
Bit0
LC1MODE<2:0>
Register
on Page
CLC1CON
LC1EN
LC1OE
LC1OUT
LC1INTP
LC1INTN
CLC1GLS0
LC1G1D4T
LC1G1D4N
LC1G1D3T
LC1G1D3N
LC1G1D2T
LC1G1D2N
LC1G1D1T
LC1G1D1N
110
114
CLC1GLS1
LC1G2D4T
LC1G2D4N
LC1G2D3T
LC1G2D3N
LC1G2D2T
LC1G2D2N
LC1G2D1T
LC1G2D1N
115
CLC1GLS2
LC1G3D4T
LC1G3D4N
LC1G3D3T
LC1G3D3N
LC1G3D2T
LC1G3D2N
LC1G3D1T
LC1G3D1N
116
CLC1GLS3
LC1G4D4T
LC1G4D4N
LC1G4D3T
LC1G4D3N
LC1G4D2T
LC1G4D2N
LC1G4D1T
LC1G4D1N
117
CLC1POL
LC1POL
LC1G4POL
LC1G3POL
LC1G2POL
LC1G1POL
111
CLC1SEL0
LC1D2S<2:0>
LC1D1S<2:0>
112
CLC1SEL1
LC1D4S<2:0>
LC1D3S<2:0>
113
GIE
PEIE
TMR0IE
INTE
IOCIE
TMR0IF
INTF
IOCIF
40
PIE1
ADIE
NCO1IE
CLC1IE
TMR2IE
41
PIR1
ADIF
NCO1IF
CLC1IF
TMR2IF
42
TRISA
TRISA2
TRISA1
TRISA0
69
INTCON
Legend:
= unimplemented read as 0. Shaded cells are not used for CLC module.
DS40001585B-page 118
PIC10(L)F320/322
20.0
NUMERICALLY CONTROLLED
OSCILLATOR (NCO) MODULE
DS40001585B-page 119
NCOxINCH NCOxINCL
Rev. 10-000028A
7/30/2013
16
(1)
INCBUFH
INCBUFL
16
NCO_overflow
HFINTOSC
00
FOSC
01
LCx_out
10
20
Adder
20
NCOx_clk
11
NCO1CLK
NxCKS<1:0>
NCO_interrupt
set bit
NCOxIF
2
Fixed Duty
Cycle Mode
Circuitry
D
NxPFM
NxOE
TRIS bit
NCOx
NxPOL
NCOx_out
EN
Ripple
Counter
R
3
NxPWS<2:0>
Note 1:
Pulse
Frequency
Mode Circuitry
To Peripherals
NxOUT
Q1
The increment registers are double-buffered to allow for value changes to be made without first disabling the NCO module. The full increment value is loaded into the buffer registers on the
second rising edge of the NCOx_clk signal that occurs immediately after a write to NCOxINCL register. The buffers are not user-accessible and are shown here for reference.
PIC10(L)F320/322
DS40001585B-page 120
FIGURE 20-1:
PIC10(L)F320/322
20.1
NCOx OPERATION
20.1.3
ADDER
20.1.1
HFINTOSC
FOSC
LC1OUT
NCO1CLK pin
20.1.4
INCREMENT REGISTERS
NCOxINCL
NCOxINCH
The buffer loads are immediate when the module is disabled. Writing to the MS register first is necessary
because then the buffer is loaded synchronously with
the NCOx operation after the write is executed on the
lower increment register.
Note: The increment buffer registers are not useraccessible.
20.1.2
ACCUMULATOR
EQUATION 20-1:
DS40001585B-page 121
PIC10(L)F320/322
20.2
20.3
In Pulse Frequency (PF) mode, every time the Accumulator overflows, the output becomes active for one
or more clock periods. See Section 20.3.1 OUTPUT
PULSE WIDTH CONTROL for more information.
Once the clock period expires, the output returns to an
inactive state. This provides a pulsed output.
The output becomes active on the rising clock edge
immediately following the overflow event. For more
information, see Figure 20-2.
The value of the active and inactive states depends on
the Polarity bit, NxPOL in the NCOxCON register.
The PF mode is selected by setting the NxPFM bit in
the NCOxCON register.
20.3.1
When operating in PF mode, the active state of the output can vary in width by multiple clock periods. Various
pulse widths are selected with the NxPWS<2:0> bits in
the NCOxCLK register.
When the selected pulse width is greater than the
Accumulator overflow time frame, then NCOx operation is undefined.
20.4
The last stage in the NCOx module is the output polarity. The NxPOL bit in the NCOxCON register selects the
output polarity. Changing the polarity while the interrupts are enabled will cause an interrupt for the resulting output transition.
The NCOx output can be used internally by source
code or other peripherals. This is done by reading the
NxOUT (read-only) bit of the NCOxCON register.
DS40001585B-page 122
FIGURE 20-2:
NCO FIXED DUTY CYCLE (FDC) AND PULSE FREQUENCY MODE (PFM) OUTPUT OPERATION DIAGRAM
Rev. 10-000029A
11/7/2013
NCOx
Clock
Source
NCOx
Increment
Value
NCOx
Accumulator
Value
4000h
4000h
4000h
NCO_overflow
NCO_interrupt
DS40001585B-page 123
NCOx Output
PF Mode
NCOxPWS =
000
NCOx Output
PF Mode
NCOxPWS =
001
PIC10(L)F320/322
NCOx Output
FDC Mode
PIC10(L)F320/322
20.5
Interrupts
20.6
Effects of a Reset
20.7
Operation In Sleep
DS40001585B-page 124
PIC10(L)F320/322
20.8
REGISTER 20-1:
R/W-0/0
R/W-0/0
R-0/0
R/W-0/0
U-0
U-0
U-0
R/W-0/0
NxEN
NxOE
NxOUT
NxPOL
NxPFM
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7
bit 6
bit 5
bit 4
bit 3-1
Unimplemented: Read as 0.
bit 0
REGISTER 20-2:
R/W-0/0
R/W-0/0
R/W-0/0
NxPWS<2:0>(1,2)
U-0
U-0
U-0
R/W-0/0
R/W-0/0
NxCKS<1:0>
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7-5
bit 4-2
Unimplemented: Read as 0
bit 1-0
DS40001585B-page 125
PIC10(L)F320/322
REGISTER 20-3:
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
NCOxACC<7:0>
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7-0
REGISTER 20-4:
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
NCOxACC<15:8>
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7-0
REGISTER 20-5:
U-0
U-0
U-0
U-0
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
NCOxACC<19:16>
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7-4
Unimplemented: Read as 0
bit 3-0
DS40001585B-page 126
PIC10(L)F320/322
REGISTER 20-6:
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
R/W-1/1
NCOxINC<7:0>
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7-0
REGISTER 20-7:
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
NCOxINC<15:8>
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7-0
DS40001585B-page 127
PIC10(L)F320/322
TABLE 20-1:
Name
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
CLC1SEL0
LC1D2S2
LC1D2S1
LC1D2S0
LC1D1S2
LC1D1S1
LC1D1S0
112
CLC1SEL1
LC1D4S2
LC1D4S1
LC1D4S0
LC1D3S2
LC1D3S1
LC1D3S0
113
CWG1CON1
G1ASDLB<1:0>
INTCON
GIE
G1ASDLA<1:0>
TMR0IE
PEIE
INTE
IOCIE
TMR0IF
G1IS<1:0>
INTF
IOCIF
140
40
NCO1ACCH
NCO1ACCH<15:8>
126
NCO1ACCL
NCO1ACCL<7:0>
126
NCO1ACCU
NCO1CLK
NCO1CON
NCO1ACCU<19:16
N1PWS<2:0>
N1EN
N1OE
N1OUT
NCO1INCH
N1POL
N1PFM
NCO1INCH<15:8>
NCO1INCL
ADIE
NCO1IE
CLC1IE
PIR1
ADIF
NCO1IF
TRISA
125
125
127
NCO1INCL<7:0>
PIE1
Legend:
126
N1CKS<1:0>
127
TMR2IE
41
CLC1IF
TMR2IF
42
TRISA2
TRISA1
TRISA0
69
x = unknown, u = unchanged, = unimplemented read as 0, q = value depends on condition. Shaded cells are not
used for NCO module.
DS40001585B-page 128
PIC10(L)F320/322
21.0
COMPLEMENTARY WAVEFORM
GENERATOR (CWG) MODULE
The Complementary Waveform Generator (CWG) produces a complementary waveform with dead-band
delay from a selection of input sources.
The CWG module has the following features:
DS40001585B-page 129
GxASDLA
GxCS
00
FOSC
10
11
cwg_clock
GxASDLA = 01
GxOEA
CWGxDBR
HFINTOSC
GxIS
PWM1OUT
PWM2OUT
N1OUT
LC1OUT
EN
S
TRISx
GxPOLA
Input Source
CWGxDBF
6
EN
GxOEB
R
TRISx
0
GxPOLB
GxASDLB = 01
00
GxASE
Auto-Shutdown
Source
LC1OUT
GxASDCLC1
GxASE Data Bit
WRITE
x = CWG module number
GxARSEN
set dominate
CWGxA
shutdown
10
11
GxASDLB
CWGxB
PIC10(L)F320/322
DS40001585B-page 130
FIGURE 21-1:
PIC10(L)F320/322
FIGURE 21-2:
cwg_clock
PWM1
CWGxA
Rising Edge
Dead Band
CWGxB
DS40001585B-page 131
PIC10(L)F320/322
21.1
Fundamental Operation
21.4.2
POLARITY CONTROL
21.5
Dead-Band Control
21.6
21.2
Clock Source
21.3
PWM1
PWM2
N1OUT
LC1OUT
21.4
Output Control
21.4.1
OUTPUT ENABLES
DS40001585B-page 132
PIC10(L)F320/322
21.7
21.8
Dead-Band Uncertainty
DS40001585B-page 133
cwg_clock
Input Source
CWGxA
CWGxB
FIGURE 21-4:
DEAD-BAND OPERATION, CWGxDBR = 03H, CWGxDBF = 04H, SOURCE SHORTER THAN DEAD BAND
cwg_clock
Input Source
CWGxA
source shorter than dead band
CWGxB
PIC10(L)F320/322
DS40001585B-page 134
FIGURE 21-3:
PIC10(L)F320/322
EQUATION 21-1:
1
TDEADBAND_UNCERTAINTY = ----------------------------Fcwg_clock
EXAMPLE 21-1:
Fcwg_clock = 16 MHz
Therefore:
1
TDEADBAND_UNCERTAINTY = ----------------------------Fcwg_clock
1
= ------------------16 MHz
= 625ns
DS40001585B-page 135
PIC10(L)F320/322
21.9
Auto-shutdown Control
21.9.1
SHUTDOWN
The Shutdown state can be entered by either of the following two methods:
Software generated
External Input
21.9.1.1
21.9.1.2
DS40001585B-page 136
PIC10(L)F320/322
21.11 Configuring the CWG
21.11.2.1
1.
2.
3.
4.
5.
6.
7.
8.
9.
21.11.1
21.11.2.2
Auto-Restart
21.11.2
AUTO-SHUTDOWN RESTART
DS40001585B-page 137
PIC10(L)F320/322
DS40001585B-page 138
FIGURE 21-5:
CWG Input
Source
Shutdown Source
GxASE
CWG1A
CWG1B
Shutdown
FIGURE 21-6:
CWG Input
Source
2011-2014 Microchip Technology Inc.
Shutdown Source
GxASE
CWG1A
CWG1B
Output Resumes
PIC10(L)F320/322
21.12
REGISTER 21-1:
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
U-0
U-0
R/W-0/0
GxEN
GxOEB
GxOEA
GxPOLB
GxPOLA
GxCS0
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7
bit 6
bit 5
bit 4
bit 3
bit 2-1
Unimplemented: Read as 0
bit 0
DS40001585B-page 139
PIC10(L)F320/322
REGISTER 21-2:
R/W-x/u
R/W-x/u
GxASDLB<1:0>
R/W-x/u
R/W-x/u
GxASDLA<1:0>
U-0
U-0
R/W-0/0
R/W-0/0
GxIS<1:0>
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7-6
bit 5-4
bit 3-2
Unimplemented: Read as 0
bit 1-0
DS40001585B-page 140
PIC10(L)F320/322
REGISTER 21-3:
R/W/HC/HS-0/0
R/W-0/0
GxASE
GxARSEN
U-0
U-0
U-0
U-0
R/W-0/0
R/W-0/0
GxASDCLC1
GxASDFLT
bit 7
bit 0
Legend:
HC = Bit is cleared by hardware
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7
bit 6
bit 5-2
Unimplemented: Read as 0
bit 1
bit 0
DS40001585B-page 141
PIC10(L)F320/322
REGISTER 21-4:
U-0
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
CWGxDBR<5:0>
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7-6
Unimplemented: Read as 0
bit 5-0
REGISTER 21-5:
U-0
U-0
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
CWGxDBF<5:0>
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7-6
Unimplemented: Read as 0
bit 5-0
DS40001585B-page 142
PIC10(L)F320/322
TABLE 21-1:
Name
ANSELA
CWG1CON0
CWG1CON1
CWG1CON2
CWG1DBF
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Register
on Page
ANSA2
ANSA1
ANSA0
70
G1EN
G1OEB
G1OEA
G1POLB
G1CS0
G1ASDLB<1:0>
G1POLA
G1ASDLA<1:0>
G1IS<1:0>
139
140
G1ASE
G1ARSEN
CWG1DBF<5:0>
142
CWG1DBR<5:0>
142
G1ASDCLC1
G1ASDFLT
141
CWG1DBR
LATA
LATA2
LATA1
LATA0
70
TRISA
TRISA2
TRISA1
TRISA0
69
Legend:
x = unknown, u = unchanged, = unimplemented locations read as 0. Shaded cells are not used by CWG.
DS40001585B-page 143
PIC10(L)F320/322
22.0
IN-CIRCUIT SERIAL
PROGRAMMING (ICSP)
22.1
22.2
22.3
FIGURE 22-1:
VDD
ICSPDAT
NC
2 4 6
ICSPCLK
1 3 5
Target
VPP/MCLR
VSS
PC Board
Bottom Side
Pin Description*
1 = VPP/MCLR
2 = VDD Target
3 = VSS (ground)
4 = ICSPDAT
5 = ICSPCLK
6 = No Connect
DS40001585B-page 144
PIC10(L)F320/322
FIGURE 22-2:
Pin 1 Indicator
Pin Description*
1
2
3
4
5
6
1 = VPP/MCLR
2 = VDD Target
3 = VSS (ground)
4 = ICSPDAT
5 = ICSPCLK
6 = No Connect
DS40001585B-page 145
PIC10(L)F320/322
For additional interface recommendations, refer to your
specific device programmer manual prior to PCB
design.
It is recommended that isolation devices be used to
separate the programming pins from other circuitry.
The type of isolation is highly dependent on the specific
application and may include devices such as resistors,
diodes, or even jumpers. See Figure 22-3 for more
information.
FIGURE 22-3:
Device to be
Programmed
VDD
VDD
VDD
VPP
MCLR/VPP
VSS
VSS
Data
ICSPDAT
Clock
ICSPCLK
To Normal Connections
DS40001585B-page 146
PIC10(L)F320/322
23.0
The PIC10(L)F320/322 instruction set is highly orthogonal and is comprised of three basic categories:
Byte-oriented operations
Bit-oriented operations
Literal and control operations
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 23-1, while the various opcode
fields are summarized in Table 23-1.
Table 23-2 lists the instructions recognized by the
MPASMTM assembler.
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.
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.
All instruction examples use the format 0xhh to
represent a hexadecimal number, where h signifies a
hexadecimal digit.
23.1
Read-Modify-Write Operations
TABLE 23-1:
OPCODE FIELD
DESCRIPTIONS
Field
Description
Register file address (0x00 to 0x7F)
f
W
PC
Program Counter
TO
Time-out bit
Carry bit
C
DC
Z
PD
Power-down bit
FIGURE 23-1:
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 #)
General
13
OPCODE
k (literal)
11
OPCODE
10
0
k (literal)
DS40001585B-page 147
PIC10(L)F320/322
TABLE 23-2:
INSTRUCTION SET
Mnemonic,
Operands
Description
Cycles
14-Bit Opcode
MSb
LSb
Status
Affected
Notes
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
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
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
1
1
1 (2)
1 (2)
01
01
01
01
1, 2
1, 2
3
3
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
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.
DS40001585B-page 148
PIC10(L)F320/322
23.2
Instruction Descriptions
ADDLW
Syntax:
[ label ] ADDLW
Operands:
0 k 255
Operation:
(W) + k (W)
Status Affected:
C, DC, Z
Description:
BCF
Bit Clear f
Syntax:
[ label ] BCF
Operands:
0 f 127
0b7
Operation:
0 (f<b>)
Status Affected:
None
Description:
BSF
Bit Set f
Syntax:
[ label ] BSF
f,b
ADDWF
Add W and f
Syntax:
[ label ] ADDWF
Operands:
0 f 127
d 0,1
Operands:
0 f 127
0b7
Operation:
Operation:
1 (f<b>)
Status Affected:
C, DC, Z
Status Affected:
None
Description:
Description:
ANDLW
BTFSC
Syntax:
[ label ] ANDLW
Syntax:
Operands:
0 k 255
Operands:
Operation:
0 f 127
0b7
Status Affected:
Operation:
skip if (f<b>) = 0
Description:
Status Affected:
None
Description:
ANDWF
AND W with f
f,d
Syntax:
[ label ] ANDWF
Operands:
0 f 127
d 0,1
Operation:
f,d
Status Affected:
Description:
f,b
DS40001585B-page 149
PIC10(L)F320/322
BTFSS
CLRWDT
Syntax:
Syntax:
[ label ] CLRWDT
Operands:
0 f 127
0b<7
Operands:
None
Operation:
00h WDT
0 WDT prescaler,
1 TO
1 PD
Status Affected:
TO, PD
Description:
Operation:
skip if (f<b>) = 1
Status Affected:
None
Description:
CALL
Call Subroutine
COMF
Complement f
Syntax:
[ label ] CALL k
Syntax:
[ label ] COMF
Operands:
0 k 2047
Operands:
Operation:
(PC)+ 1 TOS,
k PC<10:0>,
(PCLATH<4:3>) PC<12:11>
0 f 127
d [0,1]
f,d
Operation:
(f) (destination)
Status Affected:
Description:
DECF
Decrement f
Syntax:
Status Affected:
None
Description:
CLRF
Clear f
Syntax:
[ label ] CLRF
Operands:
0 f 127
Operands:
Operation:
00h (f)
1Z
0 f 127
d [0,1]
Operation:
(f) - 1 (destination)
Status Affected:
Status Affected:
Description:
Description:
Decrement 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.
CLRW
Clear W
Syntax:
[ label ] CLRW
Operands:
None
Operation:
00h (W)
1Z
Status Affected:
Description:
DS40001585B-page 150
PIC10(L)F320/322
DECFSZ
Decrement f, Skip if 0
INCFSZ
Increment f, Skip if 0
Syntax:
Syntax:
[ label ]
Operands:
0 f 127
d [0,1]
Operands:
0 f 127
d [0,1]
Operation:
(f) - 1 (destination);
skip if result = 0
Operation:
(f) + 1 (destination),
skip if result = 0
Status Affected:
None
Status Affected:
None
Description:
Description:
GOTO
Unconditional Branch
IORLW
Syntax:
[ label ]
Syntax:
[ label ]
Operands:
0 k 2047
Operands:
0 k 255
Operation:
k PC<10:0>
PCLATH<4:3> PC<12:11>
Operation:
Status Affected:
Status Affected:
None
Description:
Description:
INCF
Increment f
IORWF
Inclusive OR W with f
Syntax:
[ label ]
Syntax:
[ label ]
Operands:
0 f 127
d [0,1]
Operands:
0 f 127
d [0,1]
Operation:
(f) + 1 (destination)
Operation:
Status Affected:
Status Affected:
Description:
Description:
GOTO k
INCF f,d
INCFSZ f,d
IORWF
f,d
DS40001585B-page 151
PIC10(L)F320/322
MOVWF
Move W to f
Syntax:
[ label ]
MOVF
Move f
Syntax:
[ label ]
Operands:
0 f 127
d [0,1]
Operands:
0 f 127
Operation:
(W) (f)
Operation:
(f) (dest)
Status Affected:
None
Status Affected:
Description:
Description:
Words:
Cycles:
Words:
Cycles:
Example:
MOVF f,d
MOVF
Example:
MOVW
F
MOVWF
OPTION_REG
Before Instruction
OPTION_REG =
W
=
After Instruction
OPTION_REG =
W
=
FSR, 0
0xFF
0x4F
0x4F
0x4F
After Instruction
W =
value in FSR
register
Z = 1
MOVLW
Move literal to W
NOP
No Operation
Syntax:
[ label ]
Syntax:
[ label ]
Operands:
0 k 255
Operands:
None
Operation:
k (W)
Operation:
No operation
Status Affected:
None
Status Affected:
None
Description:
Description:
No operation.
Words:
Cycles:
Words:
Cycles:
Example:
MOVLW k
Example:
MOVLW
NOP
0x5A
After Instruction
W =
DS40001585B-page 152
NOP
0x5A
PIC10(L)F320/322
RETFIE
RETLW
Syntax:
[ label ]
Syntax:
[ label ]
Operands:
None
Operands:
0 k 255
Operation:
TOS PC,
1 GIE
Operation:
k (W);
TOS PC
Status Affected:
None
Status Affected:
None
Description:
Description:
Words:
Cycles:
Example:
RETFIE
Words:
Cycles:
Example:
RETFIE
After Interrupt
PC =
GIE =
TOS
1
TABLE
RETLW k
ADDWF PC ;W = offset
RETLW k1 ;Begin table
RETLW k2 ;
DONE
Before Instruction
W = 0x07
After Instruction
W = value of k8
RETURN
Syntax:
[ label ]
Operands:
None
Operation:
TOS PC
Status Affected:
None
Description:
RETURN
DS40001585B-page 153
PIC10(L)F320/322
RLF
SLEEP
Syntax:
[ label ]
Syntax:
[ label ] SLEEP
Operands:
0 f 127
d [0,1]
Operands:
None
Operation:
Operation:
Status Affected:
Description:
00h WDT,
0 WDT prescaler,
1 TO,
0 PD
RLF
f,d
Words:
Cycles:
Example:
Status Affected:
TO, PD
Description:
Register f
RLF
REG1,0
Before Instruction
REG1
C
=
=
1110 0110
0
=
=
=
1110 0110
1100 1100
1
After Instruction
REG1
W
C
RRF
SUBLW
Syntax:
[ label ]
Syntax:
[ label ] SUBLW k
Operands:
0 k 255
k - (W) W)
RRF f,d
Operands:
0 f 127
d [0,1]
Operation:
Operation:
Status Affected:
Description:
Description:
DS40001585B-page 154
Register f
Condition
C=0
Wk
C=1
Wk
DC = 0
W<3:0> k<3:0>
DC = 1
W<3:0> k<3:0>
PIC10(L)F320/322
SUBWF
Subtract W from f
XORWF
Exclusive OR W with f
Syntax:
Syntax:
[ label ] XORWF
Operands:
0 f 127
d [0,1]
Operands:
0 f 127
d [0,1]
Operation:
Operation:
Status Affected:
Description:
Description:
Wf
C=1
Wf
DC = 0
W<3:0> f<3:0>
DC = 1
W<3:0> f<3:0>
SWAPF
Swap Nibbles in f
Syntax:
Operands:
0 f 127
d [0,1]
Operation:
(f<3:0>) (destination<7:4>),
(f<7:4>) (destination<3:0>)
Status Affected:
None
Description:
XORLW
f,d
Syntax:
[ label ] XORLW k
Operands:
0 k 255
Operation:
(W) .XOR. k W)
Status Affected:
Description:
DS40001585B-page 155
PIC10(L)F320/322
24.0
ELECTRICAL SPECIFICATIONS
24.1
Maximum current rating requires even load distribution across I/O pins. Maximum current rating may be
limited by the device package power dissipation characterizations, see Section 24.4 Thermal
Considerations to calculate device specifications.
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.
DS40001585B-page 156
PIC10(L)F320/322
24.2
The standard operating conditions for any device are defined as:
Operating Voltage:
Operating Temperature:
DS40001585B-page 157
PIC10(L)F320/322
PIC10F320/322 VOLTAGE FREQUENCY GRAPH, -40C TA +125C
FIGURE 24-1:
VDD (V)
5.5
2.5
2.3
10
16
20
Frequency (MHz)
Note 1: The shaded region indicates the permissible combinations of voltage and frequency.
2: Refer to Table 24-6 for each Oscillator modes supported frequencies.
VDD (V)
FIGURE 24-2:
3.6
2.5
1.8
0
10
16
20
Frequency (MHz)
Note 1: The shaded region indicates the permissible combinations of voltage and frequency.
2: Refer to Table 24-6 for each Oscillator modes supported frequencies.
DS40001585B-page 158
PIC10(L)F320/322
24.3
DC Characteristics
TABLE 24-1:
SUPPLY VOLTAGE
PIC10LF320/322
PIC10F320/322
Param.
No.
D001
Sym.
VDD
Characteristic
VDR
VPOR*
VPORR*
SVDD
Max.
Units
Conditions
1.8
2.5
3.6
3.6
V
V
FOSC 16 MHz:
FOSC 20 MHz
2.3
2.5
5.5
5.5
V
V
FOSC 16 MHz:
FOSC 20 MHz
1.5
1.7
1.6
D002*
D004*
Typ
Supply Voltage
D001
D002*
Min.
0.8
1.7
0.05
V/ms
Note
DS40001585B-page 159
PIC10(L)F320/322
FIGURE 24-3:
VDD
VPOR
VPORR
SVDD
VSS
NPOR(1)
POR REARM
VSS
TVLOW(3)
Note 1:
2:
3:
DS40001585B-page 160
TPOR(2)
PIC10(L)F320/322
TABLE 24-2:
PIC10LF320/322
PIC10F320/322
Param
No.
D013
D013
D014
D014
D015
D015
D016
D016
D016A
D016A
Note 1:
2:
Device
Characteristics
Conditions
Min.
Typ
Max.
Units
34
1.8
60
3.0
76
2.3
110
3.0
153
5.0
200
396
1.8
380
650
3.0
302
430
2.3
420
655
3.0
Note
VDD
502
775
5.0
0.8
1.3
mA
3.0
1.1
1.8
mA
3.6
0.8
1.4
mA
3.0
1.1
1.8
mA
5.0
2.4
1.8
3.0
31
2.3
40
3.0
71
5.0
2.4
1.8
3.0
31
2.3
40
3.0
71
5.0
FOSC = 8 MHz
EC mode
FOSC = 8 MHz
EC mode
FOSC = 20 MHz
EC mode
FOSC = 20 MHz
EC mode
FOSC = 32 kHz
LFINTOSC mode, 85C
FOSC = 32 kHz
LFINTOSC mode, 85C
FOSC = 32 kHz
LFINTOSC mode, 125C
FOSC = 32 kHz
LFINTOSC mode,125C
The test conditions for all IDD measurements in active operation mode are: CLKIN = external square wave, from
rail-to-rail; all I/O pins tri-stated, pulled to VDD; MCLR = VDD; WDT disabled.
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.
DS40001585B-page 161
PIC10(L)F320/322
TABLE 24-2:
PIC10LF320/322
PIC10F320/322
Param
No.
Device
Characteristics
D017
D017
D018
D018
D019
D019
Note 1:
2:
Conditions
Min.
Typ
Max.
Units
293
1.8
286
3.0
272
2.3
310
3.0
VDD
372
5.0
350
1.0
mA
1.8
530
1.1
mA
3.0
0.45
1.0
mA
2.3
0.56
1.1
mA
3.0
0.64
1.2
mA
5.0
0.46
1.1
mA
1.8
0.73
1.2
mA
3.0
0.60
1.1
mA
2.3
0.76
1.2
mA
3.0
0.85
1.3
mA
5.0
Note
FOSC = 8 MHz
HFINTOSC mode
FOSC = 8 MHz
HFINTOSC mode
FOSC = 16 MHz
HFINTOSC mode
FOSC = 16 MHz
HFINTOSC mode
The test conditions for all IDD measurements in active operation mode are: CLKIN = external square wave, from
rail-to-rail; all I/O pins tri-stated, pulled to VDD; MCLR = VDD; WDT disabled.
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.
DS40001585B-page 162
PIC10(L)F320/322
TABLE 24-3:
PIC10LF320/322
PIC10F320/322
Param
No.
Device Characteristics
D023
D023
D024
D024
Conditions
Min.
Typ
Max.
+85C
Max.
+125C
Units
0.06
1.1
1.8
0.08
1.3
3.0
0.20
1.1
2.3
0.30
1.4
3.0
0.40
2.4
2.4
5.0
0.5
11
1.8
0.8
11
13
3.0
4.0
10
12
2.3
4.2
12
14
3.0
Note
VDD
4.3
14
16
5.0
30
96
120
1.8
39
106
123
3.0
32
96
120
2.3
39
106
133
3.0
70
136
170
5.0
D026
7.5
16
18
3.0
D026
18
20
3.0
20
20.2
5.0
D026A
2.7
10
15
3.0
LPBOR Current
D026A
3.0
10
15
3.0
LPBOR Current
3.2
15
20
5.0
0.1
1.8
0.1
3.0
3.4
2.3
3.6
3.0
D025
D025
D028
D028
D029
D029
Note 1:
2:
3:
3.8
5.0
250
1.8
250
3.0
280
2.3
280
3.0
280
5.0
FVR current
FVR current
DS40001585B-page 163
PIC10(L)F320/322
TABLE 24-4:
I/O PORTS
Sym.
VIL
Characteristic
Min.
Typ
Max.
Units
Conditions
I/O PORT:
D032
D032A
D033
D034
MCLR
VIH
0.8
0.15 VDD
0.2 VDD
0.2 VDD
I/O ports:
D040
D040A
D041
D042
MCLR
IIL
2.0
0.25 VDD +
0.8
0.8 VDD
0.8 VDD
V
nA
D060
I/O ports
125
1000
nA
D061
MCLR
50
200
nA
25
25
100
140
200
300
0.6
VDD - 0.7
IPUR
D070*
VOL
D080
I/O ports
VOH
D090
I/O ports
DS40001585B-page 164
PIC10(L)F320/322
TABLE 24-5:
Sym.
Characteristic
Min.
Typ
Max.
Units
Conditions
D110
VIHH
8.0
9.0
D111
IDDP
10
mA
2.7
VDD
max.
VDD
min.
VDD
max.
1.0
mA
5.0
mA
D112
D113
VPEW
D114
D115
(Note 2)
D121
EP
Cell Endurance
10K
E/W
D122
VPR
VDD
min.
VDD
max.
D123
TIW
2.5
ms
D124
TRETD
Characteristic Retention
40
Year
Note 1:
2:
Provided no other
specifications are violated
Data in Typ column is at 3.0V, 25C unless otherwise stated. These parameters are for design guidance only and are
not tested.
Self-write and Block Erase.
Required only if single-supply programming is disabled.
DS40001585B-page 165
PIC10(L)F320/322
24.4
Thermal Considerations
TH01
TH02
TH03
TH04
TH05
Sym.
Characteristic
JA
JC
TJMAX
PD
Typ.
Units
Conditions
60
C/W
80
C/W
90
C/W
31.4
C/W
24
C/W
24
C/W
150
PD = PINTERNAL + PI/O
TH06
PI/O
TH07
PDER
Derated Power
Note 1: IDD is current to run the chip alone without driving any load on the output pins.
2: TA = Ambient Temperature
3: TJ = Junction Temperature
DS40001585B-page 166
PIC10(L)F320/322
24.5
AC Characteristics
Timing Parameter Symbology has 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
CLKR
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 24-4:
Time
osc
rd
rw
sc
ss
t0
t1
wr
CLKIN
RD
RD or WR
SCK
SS
T0CKI
T1CKI
WR
P
R
V
Z
Period
Rise
Valid
High-impedance
LOAD CONDITIONS
Rev. 10-000133A
8/1/2013
Load Condition
Pin
CL
VSS
DS40001585B-page 167
PIC10(L)F320/322
FIGURE 24-5:
CLOCK TIMING
Q4
Q1
Q2
Q3
Q4
Q1
CLKIN
OS02
OS03
CLKR
(CLKROE = 1)
TABLE 24-6:
Sym.
Characteristic
Min.
Typ
Max.
Units
Conditions
OS01
FOSC
DC
20
MHz
OS02
TOSC
31.25
ns
EC Oscillator mode
OS03
TCY
200
TCY
DC
ns
TCY = 4/FOSC
EC mode
TABLE 24-7:
OSCILLATOR PARAMETERS
Sym.
Characteristic
Freq.
Tolerance
Min.
Typ
Max.
Units
OS08
HFOSC
3%
-8 to +4%
16.0
16.0
MHz
MHz
OS09
LFOSC
25%
31
kHz
OS10*
TIOSC ST HFINTOSC
Wake-up from Sleep Start-up Time
Conditions
DS40001585B-page 168
PIC10(L)F320/322
FIGURE 24-6:
125
-15% to +12%
Temperature (C)
85
60
6.5%
25
0
-15% to +12%
-40
1.8
2.3
5.5
VDD (V)
DS40001585B-page 169
PIC10(L)F320/322
FIGURE 24-7:
Cycle
Write
Fetch
Q1
Q4
Read
Execute
Q2
Q3
FOSC
OS12
OS11
OS20
OS21
CLKR
OS19
OS18
OS16
OS13
OS17
I/O pin
(Input)
OS14
OS15
I/O pin
(Output)
New Value
Old Value
OS18, OS19
TABLE 24-8:
Sym.
Characteristic
Min.
Typ
Max.
Units
Conditions
OS11
TosH2ckL
FOSC to CLKOUT(1)
70
ns
OS12
TosH2ckH
FOSC to CLKOUT(1)
72
ns
(1)
OS13
TckL2ioV
OS14
TioV2ckH
OS15
TosH2ioV
OS16
20
ns
TOSC + 200 ns
ns
50
70*
ns
TosH2ioI
50
ns
OS17
TioV2osH
20
ns
OS18*
TioR
40
15
72
32
ns
VDD = 1.8V
3.3V VDD 5.0V
OS19*
TioF
28
15
55
30
ns
VDD = 1.8V
3.3V VDD 5.0V
OS20*
Tinp
25
ns
OS21*
Tioc
25
ns
DS40001585B-page 170
PIC10(L)F320/322
FIGURE 24-8:
VDD
MCLR
30
Internal
POR
33
PWRT
Time-out
Internal Reset(1)
Watchdog Timer
Reset(1)
31
34
34
I/O pins
Note 1: Asserted low.
FIGURE 24-9:
VDD
VBOR and VHYST
VBOR
37
Reset
(due to BOR)
33
DS40001585B-page 171
PIC10(L)F320/322
TABLE 24-9:
Sym.
Characteristic
Min.
Typ
Max.
Units
Conditions
30
TMCL
2
5
s
s
31
TWDTLP
10
16
27
ms
VDD = 3.3V-5V
1:16 Prescaler used
33*
TPWRT
40
64
140
ms
34*
TIOZ
2.0
35
VBOR
2.55
2.70
2.85
BORV = 0
2.30
1.80
2.40
1.90
2.55
2.05
V
V
BORV = 1 (PIC10F320/322)
BORV = 1 (PIC10LF320/322)
25
50
mV
-40C to +85C
VDD VBOR
36*
VHYST
37*
*
FIGURE 24-10:
T0CKI
40
41
42
TMR0
40*
Sym.
TT0H
Characteristic
Min.
No Prescaler
With Prescaler
41*
TT0L
No Prescaler
With Prescaler
42*
TT0P
T0CKI Period
Typ
Max.
Units
0.5 TCY + 20
ns
10
ns
0.5 TCY + 20
ns
10
ns
Greater of:
20 or TCY + 40
N
ns
Conditions
N = prescale value
(2, 4, ..., 256)
DS40001585B-page 172
PIC10(L)F320/322
FIGURE 24-11:
CLCxINn
CLC
Input time
CLCxINn
CLC
Input time
LCx_in[n](1)
LCx_in[n](1)
CLC
Module
LCx_out(1)
CLC
Output time
CLCx
CLC
Module
LCx_out(1)
CLC
Output time
CLCx
CLC01
CLC02
CLC03
Note 1: See FIGURE 19-1: CLCx Simplified Block Diagram, to identify specific CLC signals.
Sym.
Characteristic
Min.
Typ
Max. Units
Conditions
CLC01* TCLCIN
ns
CLC02* TCLC
24
12
ns
ns
VDD = 1.8V
VDD > 3.6V
OS18
(Note 1)
OS19
(Note 1)
45
MHz
Rise Time
Fall Time
DS40001585B-page 173
PIC10(L)F320/322
TABLE 24-12: A/D CONVERTER (ADC) CHARACTERISTICS:
Standard Operating Conditions (unless otherwise stated)
Param
Sym.
No.
Characteristic
Min.
Typ
Max.
Units
Conditions
AD01
NR
Resolution
AD02
EIL
Integral Error
1.7
AD03
EDL
Differential Error
AD04
2.5
AD05
EGN
2.0
AD06
1.8
VDD
AD07
VAIN
Full-Scale Range
VSS
VREF
AD08
ZAIN
Recommended Impedance of
Analog Voltage Source
10
Note 1:
2:
3:
4:
5:
Gain Error
bit
LSb VREF = 3.0V
LSb No missing codes
VREF = 3.0V
Sym.
AD130* TAD
AD131
TCNV
AD132* TACQ
Characteristic
Min.
Typ
Max.
Units
Conditions
1.0
6.0
TOSC-based
1.0
1.6
6.0
9.5
TAD
Acquisition Time
5.0
DS40001585B-page 174
PIC10(L)F320/322
FIGURE 24-12:
BSF ADCON, GO
AD134
1 Tcy
(TOSC/2(1))
AD131
Q4
AD130
A/D CLK
7
A/D Data
0
NEW_DATA
OLD_DATA
ADRES
1 Tcy
ADIF
GO
Sample
DONE
Sampling Stopped
AD132
Note 1: If the A/D clock source is selected as FRC, a time of TCY is added before the A/D clock starts. This allows the
SLEEP instruction to be executed.
FIGURE 24-13:
BSF ADCON, GO
AD134
(TOSC/2 + TCY(1))
1 Tcy
AD131
Q4
AD130
A/D CLK
7
A/D Data
OLD_DATA
ADRES
0
NEW_DATA
1 Tcy
ADIF
GO
Sample
DONE
AD132
Sampling Stopped
Note 1: If the A/D clock source is selected as FRC, a time of TCY is added before the A/D clock starts. This allows the
SLEEP instruction to be executed.
DS40001585B-page 175
PIC10(L)F320/322
25.0
DC AND AC
CHARACTERISTICS GRAPHS
AND CHARTS
DS40001585B-page 176
PIC10(L)F320/322
26.0
DEVELOPMENT SUPPORT
26.1
Multiple projects
Multiple tools
Multiple configurations
Simultaneous debugging sessions
DS40001585B-page 177
PIC10(L)F320/322
26.2
MPLAB XC Compilers
26.3
MPASM Assembler
26.4
26.5
DS40001585B-page 178
PIC10(L)F320/322
26.6
26.7
26.8
26.9
The MPLAB PICkit 3 allows debugging and programming of PIC and dsPIC Flash microcontrollers at a most
affordable price point using the powerful graphical user
interface of the MPLAB IDE. The MPLAB PICkit 3 is
connected to the design engineers PC using a fullspeed USB interface and can be connected to the target via a Microchip debug (RJ-11) connector (compatible with MPLAB ICD 3 and MPLAB REAL ICE). The
connector uses two device I/O pins and the Reset line
to implement in-circuit debugging and In-Circuit Serial
Programming (ICSP).
DS40001585B-page 179
PIC10(L)F320/322
26.11 Demonstration/Development
Boards, Evaluation Kits, and
Starter Kits
A wide variety of demonstration, development and
evaluation boards for various PIC MCUs and dsPIC
DSCs allows quick application development on fully
functional systems. Most boards include prototyping
areas for adding custom circuitry and provide application firmware and source code for examination and
modification.
The boards support a variety of features, including LEDs,
temperature sensors, switches, speakers, RS-232
interfaces, LCD displays, potentiometers and additional
EEPROM memory.
DS40001585B-page 180
PIC10(L)F320/322
27.0
PACKAGING INFORMATION
27.1
Example
LA11
XXNN
8-Lead PDIP (300 mil)
XXXXXXXX
XXXXXNNN
Example
10F320
I/P e3 07Q
1110
YYWW
Example
BAA
110
20
Legend: XX...X
Y
YY
WW
NNN
e3
*
Note:
Product-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.
DS40001585B-page 181
PIC10(L)F320/322
TABLE 27-1:
Part Number
PIC10F322(T)-I/MC
Marking
TABLE 27-2:
Part Number
Marking
BAA
PIC10F322(T)-I/OT
LA/LJ
PIC10F322(T)-E/MC
BAB
PIC10F322(T)-E/OT
LB/LK
PIC10F320(T)-I/MC
BAC
PIC10F320(T)-I/OT
LC
PIC10F320(T)-E/MC
BAD
PIC10F320(T)-E/OT
LD
PIC10LF322(T)-I/MC
BAF
PIC10LF322(T)-I/OT
LE
PIC10LF322(T)-E/MC
BAG
PIC10LF322(T)-E/OT
LF
PIC10LF320(T)-I/MC
BAH
PIC10LF320(T)-I/OT
LG
PIC10LF320(T)-E/MC
BAJ
PIC10LF320(T)-E/OT
LH
DS40001585B-page 182
PIC10(L)F320/322
27.2
Package Details
/HDG3ODVWLF6PDOO2XWOLQH7UDQVLVWRU27>627@
1RWH
)RUWKHPRVWFXUUHQWSDFNDJHGUDZLQJVSOHDVHVHHWKH0LFURFKLS3DFNDJLQJ6SHFLILFDWLRQORFDWHGDW
KWWSZZZPLFURFKLSFRPSDFNDJLQJ
b
4
E
E1
PIN 1 ID BY
LASER MARK
e
e1
D
A2
A1
L1
8QLWV
'LPHQVLRQ/LPLWV
1XPEHURI3LQV
0,//,0(7(56
0,1
120
0$;
3LWFK
%6&
2XWVLGH/HDG3LWFK
H
%6&
2YHUDOO+HLJKW
0ROGHG3DFNDJH7KLFNQHVV
$
6WDQGRII
$
2YHUDOO:LGWK
0ROGHG3DFNDJH:LGWK
(
2YHUDOO/HQJWK
'
)RRW/HQJWK
)RRWSULQW
/
)RRW$QJOH
/HDG7KLFNQHVV
/HDG:LGWK
E
1RWHV
'LPHQVLRQV'DQG(GRQRWLQFOXGHPROGIODVKRUSURWUXVLRQV0ROGIODVKRUSURWUXVLRQVVKDOOQRWH[FHHGPPSHUVLGH
'LPHQVLRQLQJDQGWROHUDQFLQJSHU$60(<0
%6& %DVLF'LPHQVLRQ7KHRUHWLFDOO\H[DFWYDOXHVKRZQZLWKRXWWROHUDQFHV
0LFURFKLS 7HFKQRORJ\ 'UDZLQJ &%
DS40001585B-page 183
PIC10(L)F320/322
Note:
For the most current package drawings, please see the Microchip Packaging Specification located at
http://www.microchip.com/packaging
DS40001585B-page 184
PIC10(L)F320/322
/HDG3ODVWLF'XDO,Q/LQH3PLO%RG\>3',3@
1RWH
)RUWKHPRVWFXUUHQWSDFNDJHGUDZLQJVSOHDVHVHHWKH0LFURFKLS3DFNDJLQJ6SHFLILFDWLRQORFDWHGDW
KWWSZZZPLFURFKLSFRPSDFNDJLQJ
NOTE 1
E1
2
D
E
A2
A1
e
eB
b1
b
8QLWV
'LPHQVLRQ/LPLWV
1XPEHURI3LQV
,1&+(6
0,1
120
0$;
3LWFK
7RSWR6HDWLQJ3ODQH
0ROGHG3DFNDJH7KLFNQHVV
$
%DVHWR6HDWLQJ3ODQH
$
6KRXOGHUWR6KRXOGHU:LGWK
0ROGHG3DFNDJH:LGWK
(
2YHUDOO/HQJWK
'
7LSWR6HDWLQJ3ODQH
/HDG7KLFNQHVV
E
H%
8SSHU/HDG:LGWK
/RZHU/HDG:LGWK
2YHUDOO5RZ6SDFLQJ
%6&
1RWHV
3LQYLVXDOLQGH[IHDWXUHPD\YDU\EXWPXVWEHORFDWHGZLWKWKHKDWFKHGDUHD
6LJQLILFDQW&KDUDFWHULVWLF
'LPHQVLRQV'DQG(GRQRWLQFOXGHPROGIODVKRUSURWUXVLRQV0ROGIODVKRUSURWUXVLRQVVKDOOQRWH[FHHGSHUVLGH
'LPHQVLRQLQJDQGWROHUDQFLQJSHU$60(<0
%6&%DVLF'LPHQVLRQ7KHRUHWLFDOO\H[DFWYDOXHVKRZQZLWKRXWWROHUDQFHV
0LFURFKLS 7HFKQRORJ\ 'UDZLQJ &%
DS40001585B-page 185
PIC10(L)F320/322
/HDG3ODVWLF'XDO)ODW1R/HDG3DFNDJH0&[[PP%RG\>')1@
1RWH
)RUWKHPRVWFXUUHQWSDFNDJHGUDZLQJVSOHDVHVHHWKH0LFURFKLS3DFNDJLQJ6SHFLILFDWLRQORFDWHGDW
KWWSZZZPLFURFKLSFRPSDFNDJLQJ
D
N
L
K
E2
EXPOSED PAD
NOTE 1
2
NOTE 1
D2
BOTTOM VIEW
TOP VIEW
A3
A1
NOTE 2
8QLWV
'LPHQVLRQ/LPLWV
1XPEHURI3LQV
0,//,0(7(56
0,1
120
0$;
3LWFK
2YHUDOO+HLJKW
6WDQGRII
$
&RQWDFW7KLFNQHVV
$
5()
2YHUDOO/HQJWK
'
%6&
2YHUDOO:LGWK
([SRVHG3DG/HQJWK
'
([SRVHG3DG:LGWK
(
&RQWDFW/HQJWK
&RQWDFWWR([SRVHG3DG
&RQWDFW:LGWK
%6&
%6&
1RWHV
3LQYLVXDOLQGH[IHDWXUHPD\YDU\EXWPXVWEHORFDWHGZLWKLQWKHKDWFKHGDUHD
3DFNDJHPD\KDYHRQHRUPRUHH[SRVHGWLHEDUVDWHQGV
3DFNDJHLVVDZVLQJXODWHG
'LPHQVLRQLQJDQGWROHUDQFLQJSHU$60(<0
%6& %DVLF'LPHQVLRQ7KHRUHWLFDOO\H[DFWYDOXHVKRZQZLWKRXWWROHUDQFHV
5() 5HIHUHQFH'LPHQVLRQXVXDOO\ZLWKRXWWROHUDQFHIRULQIRUPDWLRQSXUSRVHVRQO\
DS40001585B-page 186
PIC10(L)F320/322
Note:
For the most current package drawings, please see the Microchip Packaging Specification located at
http://www.microchip.com/packaging
DS40001585B-page 187
PIC10(L)F320/322
APPENDIX A:
DATA SHEET
REVISION HISTORY
Revision A (07/2011)
Original release.
Revision B (02/2014)
Electrical Specifications update and new formats;
Minor edits.
DS40001585B-page 188
PIC10(L)F320/322
THE MICROCHIP WEB SITE
CUSTOMER SUPPORT
Distributor or Representative
Local Sales Office
Field Application Engineer (FAE)
Technical Support
Customers
should
contact
their
distributor,
representative or Field Application Engineer (FAE) for
support. Local sales offices are also available to help
customers. A listing of sales offices and locations is
included in the back of this document.
Technical support is available through the web site
at: http://microchip.com/support
DS40001585B-page 189
PIC10(L)F320/322
PRODUCT IDENTIFICATION SYSTEM
To order or obtain information, e.g., on pricing or delivery, refer to the factory or the listed sales office.
[X](1)
PART NO.
Device
/XX
XXX
Package
Pattern
Examples:
a)
b)
Device:
Blank
T
Temperature
Range:
I
E
= -40C to +85C
= -40C to +125C
Package:
OT
P
MC
= SOT-23
= PDIP
= DFN
Pattern:
(Industrial)
(Extended)
DS40001585BA-page 190
c)
PIC10LF320T - I/OT
Tape and Reel,
Industrial temperature,
SOT-23 package
PIC10F322 - I/P
Industrial temperature
PDIP package
PIC10F322 - E/MC
Extended temperature,
DFN package
Note 1:
Note the following details of the code protection feature on Microchip devices:
Microchip products meet the specification contained in their particular Microchip Data Sheet.
Microchip believes that its family of products is one of the most secure families of its kind on the market today, when used in the
intended manner and under normal conditions.
There are dishonest and possibly illegal methods used to breach the code protection feature. All of these methods, to our
knowledge, require using the Microchip products in a manner outside the operating specifications contained in Microchips Data
Sheets. Most likely, the person doing so is engaged in theft of intellectual property.
Microchip is willing to work with the customer who is concerned about the integrity of their code.
Neither Microchip nor any other semiconductor manufacturer can guarantee the security of their code. Code protection does not
mean that we are guaranteeing the product as unbreakable.
Code protection is constantly evolving. We at Microchip are committed to continuously improving the code protection features of our
products. Attempts to break Microchips code protection feature may be a violation of the Digital Millennium Copyright Act. If such acts
allow unauthorized access to your software or other copyrighted work, you may have a right to sue for relief under that Act.
Trademarks
== ISO/TS 16949 ==
2011-2014 Microchip Technology Inc.
DS40001585B-page 191
ASIA/PACIFIC
ASIA/PACIFIC
EUROPE
Corporate Office
2355 West Chandler Blvd.
Chandler, AZ 85224-6199
Tel: 480-792-7200
Fax: 480-792-7277
Technical Support:
http://www.microchip.com/
support
Web Address:
www.microchip.com
India - Bangalore
Tel: 91-80-3090-4444
Fax: 91-80-3090-4123
Austria - Wels
Tel: 43-7242-2244-39
Fax: 43-7242-2244-393
Denmark - Copenhagen
Tel: 45-4450-2828
Fax: 45-4485-2829
Atlanta
Duluth, GA
Tel: 678-957-9614
Fax: 678-957-1455
Austin, TX
Tel: 512-257-3370
Boston
Westborough, MA
Tel: 774-760-0087
Fax: 774-760-0088
Chicago
Itasca, IL
Tel: 630-285-0071
Fax: 630-285-0075
Cleveland
Independence, OH
Tel: 216-447-0464
Fax: 216-447-0643
Dallas
Addison, TX
Tel: 972-818-7423
Fax: 972-818-2924
Detroit
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
DS40001585B-page 192
Australia - Sydney
Tel: 61-2-9868-6733
Fax: 61-2-9868-6755
China - Beijing
Tel: 86-10-8569-7000
Fax: 86-10-8528-2104
China - Chengdu
Tel: 86-28-8665-5511
Fax: 86-28-8665-7889
China - Chongqing
Tel: 86-23-8980-9588
Fax: 86-23-8980-9500
China - Hangzhou
Tel: 86-571-2819-3187
Fax: 86-571-2819-3189
China - Hong Kong SAR
Tel: 852-2943-5100
Fax: 852-2401-3431
China - Nanjing
Tel: 86-25-8473-2460
Fax: 86-25-8473-2470
China - Qingdao
Tel: 86-532-8502-7355
Fax: 86-532-8502-7205
China - Shanghai
Tel: 86-21-5407-5533
Fax: 86-21-5407-5066
China - Shenyang
Tel: 86-24-2334-2829
Fax: 86-24-2334-2393
China - Shenzhen
Tel: 86-755-8864-2200
Fax: 86-755-8203-1760
China - Wuhan
Tel: 86-27-5980-5300
Fax: 86-27-5980-5118
China - Xian
Tel: 86-29-8833-7252
Fax: 86-29-8833-7256
France - Paris
Tel: 33-1-69-53-63-20
Fax: 33-1-69-30-90-79
India - Pune
Tel: 91-20-3019-1500
Japan - Osaka
Tel: 81-6-6152-7160
Fax: 81-6-6152-9310
Germany - Dusseldorf
Tel: 49-2129-3766400
Japan - Tokyo
Tel: 81-3-6880- 3770
Fax: 81-3-6880-3771
Germany - Munich
Tel: 49-89-627-144-0
Fax: 49-89-627-144-44
Korea - Daegu
Tel: 82-53-744-4301
Fax: 82-53-744-4302
Germany - Pforzheim
Tel: 49-7231-424750
Italy - Milan
Tel: 39-0331-742611
Fax: 39-0331-466781
Korea - Seoul
Tel: 82-2-554-7200
Fax: 82-2-558-5932 or
82-2-558-5934
Italy - Venice
Tel: 39-049-7625286
Netherlands - Drunen
Tel: 31-416-690399
Fax: 31-416-690340
Malaysia - Penang
Tel: 60-4-227-8870
Fax: 60-4-227-4068
Poland - Warsaw
Tel: 48-22-3325737
Philippines - Manila
Tel: 63-2-634-9065
Fax: 63-2-634-9069
Singapore
Tel: 65-6334-8870
Fax: 65-6334-8850
Taiwan - Hsin Chu
Tel: 886-3-5778-366
Fax: 886-3-5770-955
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 - Kaohsiung
Tel: 886-7-213-7830
Taiwan - Taipei
Tel: 886-2-2508-8600
Fax: 886-2-2508-0102
Thailand - Bangkok
Tel: 66-2-694-1351
Fax: 66-2-694-1350
China - Xiamen
Tel: 86-592-2388138
Fax: 86-592-2388130
China - Zhuhai
Tel: 86-756-3210040
Fax: 86-756-3210049
10/28/13