Академический Документы
Профессиональный Документы
Культура Документы
Data Sheet
64/80/100-Pin, High-Performance,
1 Mbit Flash Microcontrollers
with Ethernet
Preliminary
DS39762B
Note the following details of the code protection feature on Microchip devices:
Microchip products meet the specification contained in their particular Microchip Data Sheet.
Microchip believes that its family of products is one of the most secure families of its kind on the market today, when used in the
intended manner and under normal conditions.
There are dishonest and possibly illegal methods used to breach the code protection feature. All of these methods, to our
knowledge, require using the Microchip products in a manner outside the operating specifications contained in Microchips Data
Sheets. Most likely, the person doing so is engaged in theft of intellectual property.
Microchip is willing to work with the customer who is concerned about the integrity of their code.
Neither Microchip nor any other semiconductor manufacturer can guarantee the security of their code. Code protection does not
mean that we are guaranteeing the product as unbreakable.
Code protection is constantly evolving. We at Microchip are committed to continuously improving the code protection features of our
products. Attempts to break Microchips code protection feature may be a violation of the Digital Millennium Copyright Act. If such acts
allow unauthorized access to your software or other copyrighted work, you may have a right to sue for relief under that Act.
Trademarks
The Microchip name and logo, the Microchip logo, Accuron,
dsPIC, KEELOQ, microID, MPLAB, PIC, PICmicro, PICSTART,
PRO MATE, PowerSmart, rfPIC and SmartShunt are
registered trademarks of Microchip Technology Incorporated
in the U.S.A. and other countries.
AmpLab, FilterLab, Migratable Memory, MXDEV, MXLAB,
SEEVAL, SmartSensor and The Embedded Control Solutions
Company are registered trademarks of Microchip Technology
Incorporated in the U.S.A.
Analog-for-the-Digital Age, Application Maestro, CodeGuard,
dsPICDEM, dsPICDEM.net, dsPICworks, ECAN,
ECONOMONITOR, FanSense, FlexROM, fuzzyLAB,
In-Circuit Serial Programming, ICSP, ICEPIC, Linear Active
Thermistor, Mindi, MiWi, MPASM, MPLIB, MPLINK, PICkit,
PICDEM, PICDEM.net, PICLAB, PICtail, PowerCal,
PowerInfo, PowerMate, PowerTool, REAL ICE, rfLAB,
rfPICDEM, Select Mode, Smart Serial, SmartTel, Total
Endurance, UNI/O, WiperLock and ZENA are trademarks of
Microchip Technology Incorporated in the U.S.A. and other
countries.
SQTP is a service mark of Microchip Technology Incorporated
in the U.S.A.
All other trademarks mentioned herein are property of their
respective companies.
2006, Microchip Technology Incorporated, Printed in the
U.S.A., All Rights Reserved.
Printed on recycled paper.
DS39762B-page ii
Preliminary
PIC18F97J60 FAMILY
64/80/100-Pin, High-Performance,
1-Mbit Flash Microcontrollers with Ethernet
Ethernet Features:
Peripheral Highlights:
Preliminary
DS39762B-page 1
Comparators
PIC18F66J60
64K
3808
8192
39
11
2/3
2/3
PIC18F66J65
96K
3808
8192
39
11
2/3
2/3
PIC18F67J60
128K
3808
8192
39
11
2/3
2/3
PIC18F86J60
64K
3808
8192
55
15
2/3
2/3
PIC18F86J65
96K
3808
8192
55
15
2/3
2/3
PIC18F87J60
128K
3808
8192
55
15
2/3
2/3
PIC18F96J60
64K
3808
8192
70
16
2/3
2/3
PIC18F96J65
96K
3808
8192
70
16
2/3
2/3
PIC18F97J60
128K
3808
8192
70
16
2/3
2/3
Flash
SRAM
Program
Data
Memory Memory
(bytes)
(bytes)
Device
MSSP
Ethernet
TX/RX
Buffer
(bytes)
I/O
10-Bit
A/D (ch)
CCP/
ECCP
SPI
Master
I2C
Timers
PSP
8/16-Bit
External
Memory Bus
EUSART
PIC18F97J60 FAMILY
VDDTX
TPOUT-
TPOUT+
VSSTX
RBIAS
VDDPLL
VSSPLL
VSS
VDD
RD2/CCP4/P3D
RD0/P1B
RE5/P1C
RE4/P3B
RE3/P3C
RE2/P2B
64-Pin TQFP
RD1/ECCP3/P3A
Pin Diagrams
64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49
RE1/P2C
48
VDDRX
RE0/P2D
2
3
4
5
6
47
TPIN+
TPINVSSRX
RB4/KBI0
RB5/KBI1
RB6/KBI2/PGC
VSS
RB0/INT0/FLT0
RB1/INT1
RB2/INT2
RB3/INT3
MCLR
RG4/CCP5/P1D
VSS
VDDCORE/VCAP
RF7/SS1
RF6/AN11
RF5/AN10/CVREF
RF4/AN9
RF3/AN8
RF2/AN7/C1OUT
46
45
7
8
9
PIC18F66J60
10
11
12
13
14
PIC18F67J60
44
43
42
41
40
PIC18F66J65
39
38
37
36
35
34
15
16
33
OSC2/CLKO
OSC1/CLKI
VDD
RB7/KBI3/PGD
RC5/SDO1
RC4/SDI1/SDA1
RC3/SCK1/SCL1
RC2/ECCP1/P1A
DS39762B-page 2
Preliminary
RC7/RX1/DT1
RC6/TX1/CK1
RC0/T1OSO/T13CKI
RA4/T0CKI
RC1/T1OSI/ECCP2/P2A
RA5/AN4
VDD
VSS
RA0/LEDA/AN0
RA1/LEDB/AN1
RA2/AN2/VREF-
RA3/AN3/VREF+
AVSS
AVDD
ENVREG
RF1/AN6/C2OUT
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
PIC18F97J60 FAMILY
Pin Diagrams (Continued)
VDDTX
TPOUT+
TPOUT-
VSSTX
RBIAS
VDDPLL
VSSPLL
RD2
RD1
VSS
VDD
RE7/ECCP2(1)/P2A(1)
RD0
RE6/P1B(2)
RE5/P1C(2)
RE4/P3B(2)
RE3/P3C(2)
RE2/P2B
RH0
RH1
80-Pin TQFP
80 79 78 77 76 75 74 73 72 71 70 69 68 67 66 65 64 63 62 61
RH2
60
VDDRX
RH3
RE1/P2C
RE0/P2D
3
4
5
6
7
59
58
57
56
55
TPIN+
TPINVSSRX
RG0/ECCP3/P3A
RG1/TX2/CK2
RB4/KBI0
RB5/KBI1
RB6/KBI2/PGC
VSS
OSC2/CLKO
OSC1/CLKI
VDD
RB7/KBI3/PGD
RC5/SDO1
RB0/INT0/FLT0
RB1/INT1
RB2/INT2
RB3/INT3
MCLR
RG4/CCP5/P1D
VSS
VDDCORE/VCAP
RF7/SS1
RF6/AN11
RF5/AN10/CVREF
RF4/AN9
RF3/AN8
RF2/AN7/C1OUT
8
9
10
11
12
13
14
15
16
RH7/AN15/P1B(2)
17
18
19
RH6/AN14/P1C(2)
20
54
53
52
51
50
PIC18F86J60
PIC18F86J65
PIC18F87J60
49
48
47
46
45
44
43
42
41
RC4/SDI1/SDA1
RC3/SCK1/SCL1
RC2/ECCP1/P1A
RG2/RX2/DT2
RG3/CCP4/P3D
Note 1:
2:
RJ5
RJ4
RC7/RX1/DT1
RC6/TX1/CK1
RC1/T1OSI/ECCP2(1)/P2A(1)
RC0/T1OSO/T13CKI
RA4/T0CKI
RA5/AN4
VDD
VSS
RA0/LEDA/AN0
RA1/LEDB/AN1
RA2/AN2/VREF-
RA3/AN3/VREF+
AVSS
AVDD
ENVREG
RF1/AN6/C2OUT
RH4/AN12/P3C(2)
RH5/AN13/P3B(2)
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
The ECCP2/P2A pin placement depends on the CCP2MX Configuration bit setting.
P1B, P1C, P3B and P3C pin placement depends on the ECCPMX Configuration bit setting.
Preliminary
DS39762B-page 3
PIC18F97J60 FAMILY
Pin Diagrams (Continued)
100
99
98
97
96
95
94
93
92
91
90
89
88
87
86
85
84
83
82
81
80
79
78
77
76
RH1/A17
RH0/A16
RE2/AD10/CS/P2B
RE3/AD11/P3C(2)
RE4/AD12/P3B(2)
RE5/AD13/P1C(2)
RE6/AD14/P1B(2)
RE7/AD15/ECCP2(1)/P2A(1)
RD0/AD0/PSP0
RD1/AD1/PSP1
RD2/AD2/PSP2
RD3/AD3/PSP3
RD4/AD4/PSP4/SDO2
RD5/AD5/PSP5/SDI2/SDA2
VDD
VSS
RD6/AD6/PSP6/SCK2/SCL2
RD7/AD7/PSP7/SS2
VSSPLL
VDDPLL
RBIAS
VSSTX
TPOUT+
TPOUTVDDTX
100-Pin TQFP
RH2/A18
RH3/A19
RE1/AD9/WR/P2C
RE0/AD8/RD/P2D
RB0/INT0/FLT0
RB1/INT1
RB2/INT2
RB3/INT3/ECCP2(1)/P2A(1)
NC
RG6
RG5
RF0/AN5
MCLR
RG4/CCP5/P1D
VSS
VDDCORE/VCAP
VDD
RF7/SS1
RF6/AN11
RF5/AN10/CVREF
RF4/AN9
RF3/AN8
RF2/AN7/C1OUT
PIC18F96J60
PIC18F96J65
PIC18F97J60
75
74
73
72
71
70
69
68
67
66
65
64
63
62
61
60
59
58
57
56
55
54
53
52
51
VDDRX
TPIN+
TPINVSSRX
RG0/ECCP3/P3A
RG1/TX2/CK2
RB4/KBI0
RB5/KBI1
RB6/KBI2/PGC
RJ2/WRL
VSS
OSC2/CLKO
OSC1/CLKI
VDD
RJ3/WRH
VSS
VDD
RJ6/LB
RB7/KBI3/PGD
RC5/SDO1
RC4/SDI1/SDA1
RC3/SCK1/SCL1
RC2/ECCP1/P1A
RG2/RX2/DT2
RG3/CCP4/P3D
Note 1:
2:
RC1/T1OSI/ECCP2(1)/P2A(1)
RC0/T1OSO/T13CKI
RC6/TX1/CK1
RC7/RX1/DT1
RJ4/BA0
RJ5/CE
RJ0/ALE
RJ1/OE
RH5/AN13/P3B(2)
RH4/AN12/P3C(2)
RF1/AN6/C2OUT
ENVREG
AVDD
AVSS
RA3/AN3/VREF+
RA2/AN2/VREFRA1/LEDB/AN1
RA0/LEDA/AN0
VSS
VDD
RG7
RJ7/UB
VSS
RA5/AN4
RA4/T0CKI
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
RH7/AN15/P1B(2)
RH6/AN14/P1C(2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
The ECCP2/P2A pin placement depends on the CCP2MX Configuration bit and Processor mode settings.
P1B, P1C, P3B and P3C pin placement depends on the ECCPMX Configuration bit setting.
DS39762B-page 4
Preliminary
PIC18F97J60 FAMILY
Table of Contents
1.0 Device Overview .......................................................................................................................................................................... 7
2.0 Oscillator Configurations ............................................................................................................................................................ 39
3.0 Power-Managed Modes ............................................................................................................................................................. 45
4.0 Reset .......................................................................................................................................................................................... 53
5.0 Memory Organization ................................................................................................................................................................. 67
6.0 Flash Program Memory.............................................................................................................................................................. 95
7.0 External Memory Bus ............................................................................................................................................................... 105
8.0 8 x 8 Hardware Multiplier.......................................................................................................................................................... 117
9.0 Interrupts .................................................................................................................................................................................. 119
10.0 I/O Ports ................................................................................................................................................................................... 135
11.0 Timer0 Module ......................................................................................................................................................................... 163
12.0 Timer1 Module ......................................................................................................................................................................... 167
13.0 Timer2 Module ......................................................................................................................................................................... 173
14.0 Timer3 Module ......................................................................................................................................................................... 175
15.0 Timer4 Module ......................................................................................................................................................................... 179
16.0 Capture/Compare/PWM (CCP) Modules ................................................................................................................................. 181
17.0 Enhanced Capture/Compare/PWM (ECCP) Module................................................................................................................ 189
18.0 Ethernet Module ....................................................................................................................................................................... 205
19.0 Master Synchronous Serial Port (MSSP) Module .................................................................................................................... 253
20.0 Enhanced Universal Synchronous Asynchronous Receiver Transmitter (EUSART) ............................................................... 299
21.0 10-Bit Analog-to-Digital Converter (A/D) Module ..................................................................................................................... 323
22.0 Comparator Module.................................................................................................................................................................. 333
23.0 Comparator Voltage Reference Module................................................................................................................................... 339
24.0 Special Features of the CPU.................................................................................................................................................... 343
25.0 Instruction Set Summary .......................................................................................................................................................... 357
26.0 Development Support............................................................................................................................................................... 407
27.0 Electrical Characteristics .......................................................................................................................................................... 411
28.0 DC and AC Characteristics Graphs and Tables....................................................................................................................... 447
29.0 Packaging Information.............................................................................................................................................................. 449
Appendix A: Revision History............................................................................................................................................................. 453
Appendix B: Device Differences ........................................................................................................................................................ 453
Index .................................................................................................................................................................................................. 455
The Microchip Web Site ..................................................................................................................................................................... 467
Customer Change Notification Service .............................................................................................................................................. 467
Customer Support .............................................................................................................................................................................. 467
Reader Response .............................................................................................................................................................................. 468
Product Identification System ............................................................................................................................................................ 469
Preliminary
DS39762B-page 5
PIC18F97J60 FAMILY
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.
DS39762B-page 6
Preliminary
PIC18F97J60 FAMILY
1.0
DEVICE OVERVIEW
1.1.2
PIC18F87J60
PIC18F66J65
PIC18F96J60
PIC18F67J60
PIC18F96J65
PIC18F86J60
PIC18F97J60
1.1.1
PIC18F86J65
1.1
EXPANDED MEMORY
Core Features
OSCILLATOR OPTIONS AND
FEATURES
1.1.3
1.1.4
1.1.5
EASY MIGRATION
Preliminary
DS39762B-page 7
PIC18F97J60 FAMILY
1.2
1.3
DS39762B-page 8
2.
3.
4.
Preliminary
PIC18F97J60 FAMILY
TABLE 1-1:
Operating Frequency
Program Memory (Bytes)
Program Memory (Instructions)
PIC18F66J60
PIC18F66J65
PIC18F67J60
DC 41.667 MHz
DC 41.667 MHz
DC 41.667 MHz
64K
96K
128K
32764
49148
65532
3808
Interrupt Sources
26
I/O Ports
Ports A, B, C, D, E, F, G
I/O Pins
39
Timers
Capture/Compare/PWM Modules
Serial Communications
Yes
No
No
11 Input Channels
POR, BOR, RESET Instruction, Stack Full,
Stack Underflow, MCLR , WDT (PWRT, OST)
75 Instructions, 83 with Extended Instruction Set Enabled
Packages
TABLE 1-2:
64-Pin TQFP
Operating Frequency
Program Memory (Bytes)
Program Memory (Instructions)
PIC18F86J60
PIC18F86J65
PIC18F87J60
DC 41.667 MHz
DC 41.667 MHz
DC 41.667 MHz
64K
96K
128K
32764
49148
65532
3808
Interrupt Sources
27
I/O Ports
Ports A, B, C, D, E, F, G, H, J
I/O Pins
55
Timers
Capture/Compare/PWM Modules
Serial Communications
Yes
No
No
15 Input Channels
POR, BOR, RESET Instruction, Stack Full,
Stack Underflow, MCLR , WDT (PWRT, OST)
75 Instructions, 83 with Extended Instruction Set Enabled
Packages
80-Pin TQFP
Preliminary
DS39762B-page 9
PIC18F97J60 FAMILY
TABLE 1-3:
Operating Frequency
Program Memory (Bytes)
Program Memory (Instructions)
PIC18F96J65
PIC18F97J60
PIC18F86J10
DC 41.667 MHz
DC 41.667 MHz
DC 41.667 MHz
64K
96K
128K
32764
49148
65532
3808
Interrupt Sources
29
I/O Ports
Ports A, B, C, D, E, F, G, H, J
I/O Pins
70
Timers
Capture/Compare/PWM Modules
Serial Communications
Yes
Yes
Yes
16 Input Channels
POR, BOR, RESET Instruction, Stack Full,
Stack Underflow, MCLR , WDT (PWRT, OST)
75 Instructions, 83 with Extended Instruction Set Enabled
Packages
DS39762B-page 10
100-Pin TQFP
Preliminary
PIC18F97J60 FAMILY
FIGURE 1-1:
Table Pointer<21>
RA0:RA5(1)
Data Memory
(3808 Bytes)
PCLATU PCLATH
21
PORTA
Data Latch
inc/dec logic
Address Latch
20
PCU PCH PCL
Program Counter
12
Data Address<12>
PORTB
RB0:RB7(1)
31 Level Stack
4
BSR
Address Latch
STKPTR
Program Memory
(64, 96, 128 Kbytes)
4
Access
Bank
12
FSR0
FSR1
FSR2
12
PORTC
Data Latch
RC0:RC7(1)
inc/dec
logic
8
Table Latch
Address
Decode
ROM Latch
PORTD
RD0:RD2(1)
IR
8
Instruction
Decode and
Control
OSC2/CLKO
OSC1/CLKI
PRODH PRODL
3
Power-up
Timer
Timing
Generation
INTRC
Oscillator
State Machine
Control Signals
Precision
Band Gap
Reference
Watchdog
Timer
Voltage
Regulator
Brown-out
Reset(2)
ENVREG
8
W
8
8
Power-on
Reset
RE0:RE5(1)
8 x 8 Multiply
BITOP
Oscillator
Start-up Timer
PORTE
PORTF
RF1:RF7(1)
ALU<8>
8
PORTG
RG4(1)
VDDCORE/VCAP
Note
VDD, VSS
MCLR
ADC
10-Bit
Timer0
Timer1
Timer2
Timer3
Timer4
Comparators
ECCP1
ECCP2
ECCP3
CCP4
CCP5
MSSP1
EUSART1
1:
2:
Preliminary
Ethernet
DS39762B-page 11
PIC18F97J60 FAMILY
FIGURE 1-2:
Table Pointer<21>
RA0:RA5(1)
Data Memory
(3808 Bytes)
PCLATU PCLATH
21
PORTA
Data Latch
inc/dec logic
Address Latch
20
PORTB
RB0:RB7(1)
12
Data Address<12>
31 Level Stack
4
BSR
Address Latch
STKPTR
Program Memory
(64, 96, 128 Kbytes)
12
FSR0
FSR1
FSR2
4
Access
Bank
PORTC
RC0:RC7(1)
12
Data Latch
inc/dec
logic
8
Table Latch
PORTD
RD0:RD2(1)
Address
Decode
ROM Latch
PORTE
IR
RE0:RE7(1)
8
Instruction
Decode &
Control
OSC2/CLKO
OSC1/CLKI
Power-on
Reset
RF1:RF7(1)
8 x 8 Multiply
8
W
BITOP
8
Oscillator
Start-up Timer
Precision
Band Gap
Reference
ENVREG
PORTF
PRODH PRODL
Power-up
Timer
Timing
Generation
INTRC
Oscillator
State Machine
Control Signals
PORTG
RG0:RG4(1)
8
ALU<8>
Watchdog
Timer
PORTH
RH0:RH7(1)
Brown-out
Reset(2)
Voltage
Regulator
PORTJ
VDDCORE/VCAP
ECCP1
Note
VDD, VSS
RJ4:RJ5(1)
MCLR
ADC
10-Bit
Timer0
Timer1
Timer2
Timer3
Timer4
Comparators
ECCP2
ECCP3
CCP4
CCP5
EUSART1
EUSART2
MSSP1
1:
2:
DS39762B-page 12
Preliminary
Ethernet
PIC18F97J60 FAMILY
FIGURE 1-3:
Table Pointer<21>
inc/dec logic
21
PORTA
Data Latch
RA0:RA5(1)
Data Memory
(3808 Bytes)
PCLATU PCLATH
Address Latch
20
PCU PCH PCL
Program Counter
PORTB
RB0:RB7(1)
12
Data Address<12>
31 Level Stack
4
Address Latch
STKPTR
Program Memory
(64, 96, 128 Kbytes)
12
BSR
PORTC
Access
Bank
FSR0
FSR1
FSR2
RC0:RC7(1)
12
Data Latch
inc/dec
logic
8
Table Latch
PORTD
RD0:RD7(1)
Address
Decode
ROM Latch
PORTE
IR
RE0:RE7(1)
AD15:AD0, A19:A16
(Multiplexed with PORTD,
PORTE and PORTH)
State Machine
Control Signals
OSC2/CLKO
OSC1/CLKI
Timing
Generation
INTRC
Oscillator
ENVREG
Power-up
Timer
RF0:RF7(1)
3
Voltage
Regulator
Brown-out
Reset(2)
8
W
PORTG
RG0:RG7(1)
8
ALU<8>
Power-on
Reset
Watchdog
Timer
8 x 8 Multiply
BITOP
8
Oscillator
Start-up Timer
Precision
Band Gap
Reference
PORTF
PRODH PRODL
Instruction
Decode &
Control
PORTH
8
RH0:RH7(1)
PORTJ
RJ0:RJ7(1)
VDDCORE/VCAP
VDD, VSS
MCLR
ADC
10-Bit
Timer0
Timer1
Timer2
Timer3
Timer4
ECCP1
ECCP2
ECCP3
CCP4
CCP5
EUSART1
Note
Comparators
EUSART2
1:
2:
Preliminary
MSSP1
MSSP2
Ethernet
DS39762B-page 13
PIC18F97J60 FAMILY
TABLE 1-4:
Pin
Type
Buffer
Type
MCLR
ST
OSC1/CLKI
OSC1
39
Pin Name
CLKI
OSC2/CLKO
OSC2
40
CLKO
Description
RA0/LEDA/AN0
RA0
LEDA
AN0
24
RA1/LEDB/AN1
RA1
LEDB
AN1
23
RA2/AN2/VREFRA2
AN2
VREF-
22
RA3/AN3/VREF+
RA3
AN3
VREF+
21
RA4/T0CKI
RA4
T0CKI
28
RA5/AN4
RA5
AN4
27
Legend:
TTL
ST
I
P
=
=
=
=
DS39762B-page 14
I/O
O
I
TTL
Analog
Digital I/O.
Ethernet LEDA indicator output.
Analog input 0.
I/O
O
I
TTL
Analog
Digital I/O.
Ethernet LEDB indicator output.
Analog input 1.
I/O
I
I
TTL
Analog
Analog
Digital I/O.
Analog input 2.
A/D reference voltage (low) input.
I/O
I
I
TTL
Analog
Analog
Digital I/O.
Analog input 3.
A/D reference voltage (high) input.
I/O
I
ST
ST
I/O
I
TTL
Analog
Digital I/O.
Timer0 external clock input.
Digital I/O.
Analog input 4.
CMOS
Analog
O
OD
Preliminary
=
=
=
=
PIC18F97J60 FAMILY
TABLE 1-4:
Pin Name
TQFP
Pin
Type
Buffer
Type
Description
PORTB is a bidirectional I/O port. PORTB can be software
programmed for internal weak pull-ups on all inputs.
RB0/INT0/FLT0
RB0
INT0
FLT0
RB1/INT1
RB1
INT1
RB2/INT2
RB2
INT2
RB3/INT3
RB3
INT3
RB4/KBI0
RB4
KBI0
44
RB5/KBI1
RB5
KBI1
43
RB6/KBI2/PGC
RB6
KBI2
PGC
42
RB7/KBI3/PGD
RB7
KBI3
PGD
37
Legend:
TTL
ST
I
P
=
=
=
=
I/O
I
I
TTL
ST
ST
Digital I/O.
External interrupt 0.
Enhanced PWM Fault input (ECCP modules); enabled
in software.
I/O
I
TTL
ST
Digital I/O.
External interrupt 1.
I/O
I
TTL
ST
Digital I/O.
External interrupt 2.
I/O
I
TTL
ST
Digital I/O.
External interrupt 3.
I/O
I
TTL
TTL
Digital I/O.
Interrupt-on-change pin.
I/O
I
TTL
TTL
Digital I/O.
Interrupt-on-change pin.
I/O
I
I/O
TTL
TTL
ST
Digital I/O.
Interrupt-on-change pin.
In-Circuit Debugger and ICSP programming clock pin.
I/O
I
I/O
TTL
TTL
ST
Digital I/O.
Interrupt-on-change pin.
In-Circuit Debugger and ICSP programming data pin.
CMOS
Analog
O
OD
Preliminary
=
=
=
=
DS39762B-page 15
PIC18F97J60 FAMILY
TABLE 1-4:
Pin Name
TQFP
Pin
Type
Buffer
Type
Description
PORTC is a bidirectional I/O port.
RC0/T1OSO/T13CKI
RC0
T1OSO
T13CKI
30
RC1/T1OSI/ECCP2/P2A
RC1
T1OSI
ECCP2
P2A
29
RC2/ECCP1/P1A
RC2
ECCP1
P1A
33
RC3/SCK1/SCL1
RC3
SCK1
SCL1
34
RC4/SDI1/SDA1
RC4
SDI1
SDA1
35
RC5/SDO1
RC5
SDO1
36
RC6/TX1/CK1
RC6
TX1
CK1
31
RC7/RX1/DT1
RC7
RX1
DT1
32
Legend:
TTL
ST
I
P
=
=
=
=
DS39762B-page 16
I/O
O
I
ST
ST
I/O
I
I/O
O
ST
CMOS
ST
Digital I/O.
Timer1 oscillator input.
Capture 2 input/Compare 2 output/PWM2 output.
ECCP2 PWM output A.
I/O
I/O
O
ST
ST
Digital I/O.
Capture 1 input/Compare 1 output/PWM1 output.
ECCP1 PWM output A.
I/O
I/O
I/O
ST
ST
ST
Digital I/O.
Synchronous serial clock input/output for SPI mode.
Synchronous serial clock input/output for I2C mode.
I/O
I
I/O
ST
ST
ST
Digital I/O.
SPI data in.
I2C data I/O.
I/O
O
ST
Digital I/O.
SPI data out.
I/O
O
I/O
ST
ST
Digital I/O.
EUSART1 asynchronous transmit.
EUSART1 synchronous clock (see related RX1/DT1 pin).
I/O
I
I/O
ST
ST
ST
Digital I/O.
EUSART1 asynchronous receive.
EUSART1 synchronous data (see related TX1/CK1 pin).
Digital I/O.
Timer1 oscillator output.
Timer1/Timer3 external clock input.
CMOS
Analog
O
OD
Preliminary
=
=
=
=
PIC18F97J60 FAMILY
TABLE 1-4:
Pin Name
TQFP
Pin
Type
Buffer
Type
Description
PORTD is a bidirectional I/O port.
RD0/P1B
RD0
P1B
60
RD1/ECCP3/P3A
RD1
ECCP3
P3A
59
RD2/CCP4/P3D
RD2
CCP4
P3D
58
Legend:
TTL
ST
I
P
=
=
=
=
I/O
O
ST
Digital I/O.
ECCP1 PWM output B.
I/O
I/O
O
ST
ST
Digital I/O.
Capture 3 input/Compare 3 output/PWM3 output.
ECCP3 PWM output A.
I/O
I/O
O
ST
ST
Digital I/O.
Capture 4 input/Compare 4 output/PWM4 output.
CCP4 PWM output D.
CMOS
Analog
O
OD
Preliminary
=
=
=
=
DS39762B-page 17
PIC18F97J60 FAMILY
TABLE 1-4:
Pin Name
TQFP
Pin
Type
Buffer
Type
Description
PORTE is a bidirectional I/O port.
RE0/P2D
RE0
P2D
RE1/P2C
RE1
P2C
RE2/P2B
RE2
P2B
64
RE3/P3C
RE3
P3C
63
RE4/P3B
RE4
P3B
62
RE5/P1C
RE5
P1C
61
Legend:
TTL
ST
I
P
=
=
=
=
DS39762B-page 18
I/O
O
ST
Digital I/O.
ECCP2 PWM output D.
I/O
O
ST
Digital I/O.
ECCP2 PWM output C.
I/O
O
ST
Digital I/O.
ECCP2 PWM output B.
I/O
O
ST
Digital I/O.
ECCP3 PWM output C.
I/O
O
ST
Digital I/O.
ECCP3 PWM output B.
I/O
O
ST
Digital I/O.
ECCP1 PWM output C.
CMOS
Analog
O
OD
Preliminary
=
=
=
=
PIC18F97J60 FAMILY
TABLE 1-4:
Pin Name
TQFP
Pin
Type
Buffer
Type
Description
PORTF is a bidirectional I/O port.
RF1/AN6/C2OUT
RF1
AN6
C2OUT
17
RF2/AN7/C1OUT
RF2
AN7
C1OUT
16
RF3/AN8
RF3
AN8
15
RF4/AN9
RF4
AN9
14
RF5/AN10/CVREF
RF5
AN10
CVREF
13
RF6/AN11
RF6
AN11
12
RF7/SS1
RF7
SS1
11
Legend:
TTL
ST
I
P
=
=
=
=
I/O
I
O
ST
Analog
Digital I/O.
Analog input 6.
Comparator 2 output.
I/O
I
O
ST
Analog
Digital I/O.
Analog input 7.
Comparator 1 output.
I/O
I
ST
Analog
Digital I/O.
Analog input 8.
I/O
I
ST
Analog
Digital I/O.
Analog input 9.
I/O
I
O
ST
Analog
Digital I/O.
Analog input 10.
Comparator reference voltage output.
I/O
I
ST
Analog
Digital I/O.
Analog input 11.
I/O
I
ST
TTL
Digital I/O.
SPI slave select input.
CMOS
Analog
O
OD
Preliminary
=
=
=
=
DS39762B-page 19
PIC18F97J60 FAMILY
TABLE 1-4:
Pin Name
TQFP
Pin
Type
Buffer
Type
Description
PORTG is a bidirectional I/O port.
RG4/CCP5/P1D
RG4
CCP5
P1D
I/O
I/O
O
ST
ST
Digital I/O.
Capture 5 input/Compare 5 output/PWM5 output.
ECCP1 PWM output D.
VSS
9, 25, 41, 56
VDD
26, 38, 57
AVSS
20
AVDD
19
ENVREG
18
ST
VDDCORE/VCAP
VDDCORE
10
P
VSSPLL
55
VDDPLL
54
VSSTX
52
VDDTX
49
VSSRX
45
VDDRX
48
RBIAS
53
TPOUT+
51
TPOUT-
50
TPIN+
47
46
VCAP
TPINLegend:
TTL
ST
I
P
=
=
=
=
DS39762B-page 20
Analog Bias current for Ethernet PHY. Must be tied to VSS via a resistor;
see Section 18.0 Ethernet Module for specification.
CMOS
Analog
O
OD
Preliminary
=
=
=
=
PIC18F97J60 FAMILY
TABLE 1-5:
Pin
Type
Buffer
Type
MCLR
ST
OSC1/CLKI
OSC1
49
Pin Name
CLKI
OSC2/CLKO
OSC2
50
CLKO
Description
RA0/LEDA/AN0
RA0
LEDA
AN0
30
RA1/LEDB/AN1
RA1
LEDB
AN1
29
RA2/AN2/VREFRA2
AN2
VREF-
28
RA3/AN3/VREF+
RA3
AN3
VREF+
27
RA4/T0CKI
RA4
T0CKI
34
RA5/AN4
RA5
AN4
33
Legend:
Note 1:
2:
3:
4:
I/O
O
I
TTL
Analog
Digital I/O.
Ethernet LEDA indicator output.
Analog input 0.
I/O
O
I
TTL
Analog
Digital I/O.
Ethernet LEDB indicator output.
Analog input 1.
I/O
I
I
TTL
Analog
Analog
Digital I/O.
Analog input 2.
A/D reference voltage (low) input.
I/O
I
I
TTL
Analog
Analog
Digital I/O.
Analog input 3.
A/D reference voltage (high) input.
I/O
I
ST
ST
I/O
I
TTL
Analog
Digital I/O.
Timer0 external clock input.
Digital I/O.
Analog input 4.
Preliminary
DS39762B-page 21
PIC18F97J60 FAMILY
TABLE 1-5:
Pin Name
TQFP
Pin
Type
Buffer
Type
Description
PORTB is a bidirectional I/O port. PORTB can be software
programmed for internal weak pull-ups on all inputs.
RB0/INT0/FLT0
RB0
INT0
FLT0
RB1/INT1
RB1
INT1
RB2/INT2
RB2
INT2
RB3/INT3
RB3
INT3
RB4/KBI0
RB4
KBI0
54
RB5/KBI1
RB5
KBI1
53
RB6/KBI2/PGC
RB6
KBI2
PGC
52
RB7/KBI3/PGD
RB7
KBI3
PGD
47
Legend:
Note 1:
2:
3:
4:
I/O
I
I
TTL
ST
ST
Digital I/O.
External interrupt 0.
Enhanced PWM Fault input (ECCP modules); enabled
in software.
I/O
I
TTL
ST
Digital I/O.
External interrupt 1.
I/O
I
TTL
ST
Digital I/O.
External interrupt 2.
I/O
I
TTL
ST
Digital I/O.
External interrupt 3.
I/O
I
TTL
TTL
Digital I/O.
Interrupt-on-change pin.
I/O
I
TTL
TTL
Digital I/O.
Interrupt-on-change pin.
I/O
I
I/O
TTL
TTL
ST
Digital I/O.
Interrupt-on-change pin.
In-Circuit Debugger and ICSP programming clock pin.
I/O
I
I/O
TTL
TTL
ST
Digital I/O.
Interrupt-on-change pin.
In-Circuit Debugger and ICSP programming data pin.
DS39762B-page 22
Preliminary
PIC18F97J60 FAMILY
TABLE 1-5:
Pin Name
TQFP
Pin
Type
Buffer
Type
Description
PORTC is a bidirectional I/O port.
RC0/T1OSO/T13CKI
RC0
T1OSO
T13CKI
36
RC1/T1OSI/ECCP2/P2A
RC1
T1OSI
ECCP2(1)
P2A(1)
35
RC2/ECCP1/P1A
RC2
ECCP1
P1A
43
RC3/SCK1/SCL1
RC3
SCK1
SCL1
44
RC4/SDI1/SDA1
RC4
SDI1
SDA1
45
RC5/SDO1
RC5
SDO1
46
RC6/TX1/CK1
RC6
TX1
CK1
37
RC7/RX1/DT1
RC7
RX1
DT1
38
Legend:
Note 1:
2:
3:
4:
I/O
O
I
ST
ST
Digital I/O.
Timer1 oscillator output.
Timer1/Timer3 external clock input.
I/O
I
I/O
O
ST
CMOS
ST
Digital I/O.
Timer1 oscillator input.
Capture 2 input/Compare 2 output/PWM2 output.
ECCP2 PWM output A.
I/O
I/O
O
ST
ST
Digital I/O.
Capture 1 input/Compare 1 output/PWM1 output.
ECCP1 PWM output A.
I/O
I/O
I/O
ST
ST
ST
Digital I/O.
Synchronous serial clock input/output for SPI mode.
Synchronous serial clock input/output for I2C mode.
I/O
I
I/O
ST
ST
ST
Digital I/O.
SPI data in.
I2C data I/O.
I/O
O
ST
Digital I/O.
SPI data out.
I/O
O
I/O
ST
ST
Digital I/O.
EUSART1 asynchronous transmit.
EUSART1 synchronous clock (see related RX1/DT1 pin).
I/O
I
I/O
ST
ST
ST
Digital I/O.
EUSART1 asynchronous receive.
EUSART1 synchronous data (see related TX1/CK1 pin).
Preliminary
DS39762B-page 23
PIC18F97J60 FAMILY
TABLE 1-5:
Pin Name
TQFP
Pin
Type
Buffer
Type
Description
PORTD is a bidirectional I/O port.
RD0
72
I/O
ST
Digital I/O.
RD1
69
I/O
ST
Digital I/O.
RD2
68
I/O
ST
Digital I/O.
PORTE is a bidirectional I/O port.
RE0/P2D
RE0
P2D
RE1/P2C
RE1
P2C
RE2/P2B
RE2
P2B
78
RE3/P3C
RE3
P3C(2)
77
RE4/P3B
RE4
P3B(2)
76
RE5/P1C
RE5
P1C(2)
75
RE6/P1B
RE6
P1B(2)
74
RE7/ECCP2/P2A
RE7
ECCP2(3)
P2A(3)
73
Legend:
Note 1:
2:
3:
4:
I/O
O
ST
Digital I/O.
ECCP2 PWM output D.
I/O
O
ST
Digital I/O.
ECCP2 PWM output C.
I/O
O
ST
Digital I/O.
ECCP2 PWM output B.
I/O
O
ST
Digital I/O.
ECCP3 PWM output C.
I/O
O
ST
Digital I/O.
ECCP3 PWM output B.
I/O
O
ST
Digital I/O.
ECCP1 PWM output C.
I/O
O
ST
Digital I/O.
ECCP1 PWM output B.
I/O
I/O
O
ST
ST
Digital I/O.
Capture 2 input/Compare 2 output/PWM2 output.
ECCP2 PWM output A.
DS39762B-page 24
Preliminary
PIC18F97J60 FAMILY
TABLE 1-5:
Pin Name
TQFP
Pin
Type
Buffer
Type
Description
PORTF is a bidirectional I/O port.
RF1/AN6/C2OUT
RF1
AN6
C2OUT
23
RF2/AN7/C1OUT
RF2
AN7
C1OUT
18
RF3/AN8
RF3
AN8
17
RF4/AN9
RF4
AN9
16
RF5/AN10/CVREF
RF5
AN10
CVREF
15
RF6/AN11
RF6
AN11
14
RF7/SS1
RF7
SS1
13
Legend:
Note 1:
2:
3:
4:
I/O
I
O
ST
Analog
Digital I/O.
Analog input 6.
Comparator 2 output.
I/O
I
O
ST
Analog
Digital I/O.
Analog input 7.
Comparator 1 output.
I/O
I
ST
Analog
Digital I/O.
Analog input 8.
I/O
I
ST
Analog
Digital I/O.
Analog input 9.
I/O
I
O
ST
Analog
Digital I/O.
Analog input 10.
Comparator reference voltage output.
I/O
I
ST
Analog
Digital I/O.
Analog input 11.
I/O
I
ST
TTL
Digital I/O.
SPI slave select input.
Preliminary
DS39762B-page 25
PIC18F97J60 FAMILY
TABLE 1-5:
Pin Name
TQFP
Pin
Type
Buffer
Type
Description
PORTG is a bidirectional I/O port.
RG0/ECCP3/P3A
RG0
ECCP3
P3A
56
RG1/TX2/CK2
RG1
TX2
CK2
55
RG2/RX2/DT2
RG2
RX2
DT2
42
RG3/CCP4/P3D
RG3
CCP4
P3D
41
RG4/CCP5/P1D
RG4
CCP5
P1D
10
Legend:
Note 1:
2:
3:
4:
I/O
I/O
O
ST
ST
Digital I/O.
Capture 3 input/Compare 3 output/PWM3 output.
ECCP3 PWM output A.
I/O
O
I/O
ST
ST
Digital I/O.
EUSART2 asynchronous transmit.
EUSART2 synchronous clock (see related RX2/DT2 pin).
I/O
I
I/O
ST
ST
ST
Digital I/O.
EUSART2 asynchronous receive.
EUSART2 synchronous data (see related TX2/CK2 pin).
I/O
I/O
O
ST
ST
Digital I/O.
Capture 4 input/Compare 4 output/PWM4 output.
ECCP3 PWM output D.
I/O
I/O
O
ST
ST
Digital I/O.
Capture 5 input/Compare 5 output/PWM5 output.
ECCP1 PWM output D.
DS39762B-page 26
Preliminary
PIC18F97J60 FAMILY
TABLE 1-5:
Pin Name
TQFP
Pin
Type
Buffer
Type
Description
PORTH is a bidirectional I/O port.
RH0
79
I/O
ST
Digital I/O.
RH1
80
I/O
ST
Digital I/O.
RH2
I/O
ST
Digital I/O.
RH3
I/O
ST
Digital I/O.
RH4/AN12/P3C
RH4
AN12
P3C(4)
22
I/O
I
O
ST
Analog
Digital I/O.
Analog input 12.
ECCP3 PWM output C.
RH5/AN13/P3B
RH5
AN13
P3B(4)
21
I/O
I
O
ST
Analog
Digital I/O.
Analog input 13.
ECCP3 PWM output B.
RH6/AN14/P1C
RH6
AN14
P1C(4)
20
I/O
I
O
ST
Analog
Digital I/O.
Analog input 14.
ECCP1 PWM output C.
RH7/AN15/P1B
RH7
AN15
P1B(4)
19
I/O
I
O
ST
Analog
Digital I/O.
Analog input 15.
ECCP1 PWM output B.
Legend:
Note 1:
2:
3:
4:
Preliminary
DS39762B-page 27
PIC18F97J60 FAMILY
TABLE 1-5:
Pin Name
TQFP
Pin
Type
Buffer
Type
Description
PORTJ is a bidirectional I/O port.
RJ4
39
I/O
ST
RJ5
40
I/O
ST
VSS
VDD
32, 48, 71
AVSS
26
AVDD
25
ENVREG
24
ST
VDDCORE/VCAP
VDDCORE
12
P
VCAP
Digital I/O.
Digital I/O
VSSPLL
67
VDDPLL
66
VSSTX
64
VDDTX
61
VSSRX
57
VDDRX
60
RBIAS
65
TPOUT+
63
TPOUT-
62
TPIN+
59
58
TPINLegend:
Note 1:
2:
3:
4:
Analog Bias current for Ethernet PHY. Must be tied to VSS via a resistor;
see Section 18.0 Ethernet Module for specification.
DS39762B-page 28
Preliminary
PIC18F97J60 FAMILY
TABLE 1-6:
Pin
Type
Buffer
Type
MCLR
13
ST
OSC1/CLKI
OSC1
63
Pin Name
CLKI
OSC2/CLKO
OSC2
64
CLKO
Description
RA0/LEDA/AN0
RA0
LEDA
AN0
35
RA1/LEDB/AN1
RA1
LEDB
AN1
34
RA2/AN2/VREFRA2
AN2
VREF-
33
RA3/AN3/VREF+
RA3
AN3
VREF+
32
RA4/T0CKI
RA4
T0CKI
42
RA5/AN4
RA5
AN4
41
Legend:
Note 1:
2:
3:
4:
5:
I/O
O
I
TTL
Analog
Digital I/O.
Ethernet LEDA indicator output.
Analog input 0.
I/O
O
I
TTL
Analog
Digital I/O.
Ethernet LEDB indicator output.
Analog input 1.
I/O
I
I
TTL
Analog
Analog
Digital I/O.
Analog input 2.
A/D reference voltage (low) input.
I/O
I
I
TTL
Analog
Analog
Digital I/O.
Analog input 3.
A/D reference voltage (high) input.
I/O
I
ST
ST
I/O
I
TTL
Analog
Digital I/O.
Timer0 external clock input.
Digital I/O.
Analog input 4.
Preliminary
DS39762B-page 29
PIC18F97J60 FAMILY
TABLE 1-6:
Pin Name
TQFP
Pin
Type
Buffer
Type
Description
PORTB is a bidirectional I/O port. PORTB can be software
programmed for internal weak pull-ups on all inputs.
RB0/INT0/FLT0
RB0
INT0
FLT0
RB1/INT1
RB1
INT1
RB2/INT2
RB2
INT2
RB3/INT3/ECCP2/P2A
RB3
INT3
ECCP2(1)
P2A(1)
RB4/KBI0
RB4
KBI0
69
RB5/KBI1
RB5
KBI1
68
RB6/KBI2/PGC
RB6
KBI2
PGC
67
RB7/KBI3/PGD
RB7
KBI3
PGD
57
Legend:
Note 1:
2:
3:
4:
5:
I/O
I
I
TTL
ST
ST
Digital I/O.
External interrupt 0.
Enhanced PWM Fault input (ECCP modules); enabled
in software.
I/O
I
TTL
ST
Digital I/O.
External interrupt 1.
I/O
I
TTL
ST
Digital I/O.
External interrupt 2.
I/O
I
I/O
O
TTL
ST
ST
Digital I/O.
External interrupt 3.
Capture 2 input/Compare 2 output/PWM2 output.
ECCP2 PWM output A.
I/O
I
TTL
TTL
Digital I/O.
Interrupt-on-change pin.
I/O
I
TTL
TTL
Digital I/O.
Interrupt-on-change pin.
I/O
I
I/O
TTL
TTL
ST
Digital I/O.
Interrupt-on-change pin.
In-Circuit Debugger and ICSP programming clock pin.
I/O
I
I/O
TTL
TTL
ST
Digital I/O.
Interrupt-on-change pin.
In-Circuit Debugger and ICSP programming data pin.
DS39762B-page 30
Preliminary
PIC18F97J60 FAMILY
TABLE 1-6:
Pin Name
TQFP
Pin
Type
Buffer
Type
Description
PORTC is a bidirectional I/O port.
RC0/T1OSO/T13CKI
RC0
T1OSO
T13CKI
44
RC1/T1OSI/ECCP2/P2A
RC1
T1OSI
ECCP2(2)
P2A(2)
43
RC2/ECCP1/P1A
RC2
ECCP1
P1A
53
RC3/SCK1/SCL1
RC3
SCK1
SCL1
54
RC4/SDI1/SDA1
RC4
SDI1
SDA1
55
RC5/SDO1
RC5
SDO1
56
RC6/TX1/CK1
RC6
TX1
CK1
45
RC7/RX1/DT1
RC7
RX1
DT1
46
Legend:
Note 1:
2:
3:
4:
5:
I/O
O
I
ST
ST
Digital I/O.
Timer1 oscillator output.
Timer1/Timer3 external clock input.
I/O
I
I/O
O
ST
CMOS
ST
Digital I/O.
Timer1 oscillator input.
Capture 2 input/Compare 2 output/PWM2 output.
ECCP2 PWM output A.
I/O
I/O
O
ST
ST
Digital I/O.
Capture 1 input/Compare 1 output/PWM1 output.
ECCP1 PWM output A.
I/O
I/O
I/O
ST
ST
ST
Digital I/O.
Synchronous serial clock input/output for SPI mode.
Synchronous serial clock input/output for I2C mode.
I/O
I
I/O
ST
ST
ST
Digital I/O.
SPI data in.
I2C data I/O.
I/O
O
ST
Digital I/O.
SPI data out.
I/O
O
I/O
ST
ST
Digital I/O.
EUSART1 asynchronous transmit.
EUSART1 synchronous clock (see related RX1/DT1 pin).
I/O
I
I/O
ST
ST
ST
Digital I/O.
EUSART1 asynchronous receive.
EUSART1 synchronous data (see related TX1/CK1 pin).
Preliminary
DS39762B-page 31
PIC18F97J60 FAMILY
TABLE 1-6:
Pin Name
TQFP
Pin
Type
Buffer
Type
Description
PORTD is a bidirectional I/O port.
RD0/AD0/PSP0
RD0
AD0
PSP0
92
RD1/AD1/PSP1
RD1
AD1
PSP1
91
RD2/AD2/PSP2
RD2
AD2
PSP2
90
RD3/AD3/PSP3
RD3
AD3
PSP3
89
RD4/AD4/PSP4/SDO2
RD4
AD4
PSP4
SDO2
88
RD5/AD5/PSP5/
SDI2/SDA2
RD5
AD5
PSP5
SDI2
SDA2
87
RD6/AD6/PSP6/
SCK2/SCL2
RD6
AD6
PSP6
SCK2
SCL2
84
RD7/AD7/PSP7/SS2
RD7
AD7
PSP7
SS2
83
Legend:
Note 1:
2:
3:
4:
5:
I/O
I/O
I/O
ST
TTL
TTL
Digital I/O.
External memory address/data 0.
Parallel Slave Port data.
I/O
I/O
I/O
ST
TTL
TTL
Digital I/O.
External memory address/data 1.
Parallel Slave Port data.
I/O
I/O
I/O
ST
TTL
TTL
Digital I/O.
External memory address/data 2.
Parallel Slave Port data.
I/O
I/O
I/O
ST
TTL
TTL
Digital I/O.
External memory address/data 3.
Parallel Slave Port data.
I/O
I/O
I/O
O
ST
TTL
TTL
Digital I/O.
External memory address/data 4.
Parallel Slave Port data.
SPI data out.
I/O
I/O
I/O
I
I/O
ST
TTL
TTL
ST
ST
Digital I/O.
External memory address/data 5.
Parallel Slave Port data.
SPI data in.
I2C data I/O.
I/O
I/O
I/O
I/O
I/O
ST
TTL
TTL
ST
ST
Digital I/O.
External memory address/data 6.
Parallel Slave Port data.
Synchronous serial clock input/output for SPI mode.
Synchronous serial clock input/output for I2C mode.
I/O
I/O
I/O
I
ST
TTL
TTL
TTL
Digital I/O.
External memory address/data 7.
Parallel Slave Port data.
SPI slave select input.
DS39762B-page 32
Preliminary
PIC18F97J60 FAMILY
TABLE 1-6:
Pin Name
TQFP
Pin
Type
Buffer
Type
Description
PORTE is a bidirectional I/O port.
RE0/AD8/RD/P2D
RE0
AD8
RD
P2D
RE1/AD9/WR/P2C
RE1
AD9
WR
P2C
RE2/AD10/CS/P2B
RE2
AD10
CS
P2B
98
RE3/AD11/P3C
RE3
AD11
P3C(3)
97
RE4/AD12/P3B
RE4
AD12
P3B(3)
96
RE5/AD13/P1C
RE5
AD13
P1C(3)
95
RE6/AD14/P1B
RE6
AD14
P1B(3)
94
RE7/AD15/ECCP2/P2A
RE7
AD15
ECCP2(4)
P2A(4)
93
Legend:
Note 1:
2:
3:
4:
5:
I/O
I/O
I
O
ST
TTL
TTL
Digital I/O.
External memory address/data 8.
Read control for Parallel Slave Port.
ECCP2 PWM output D.
I/O
I/O
I
O
ST
TTL
TTL
Digital I/O.
External memory address/data 9.
Write control for Parallel Slave Port.
ECCP2 PWM output C.
I/O
I/O
I
O
ST
TTL
TTL
Digital I/O.
External memory address/data 10.
Chip select control for Parallel Slave Port.
ECCP2 PWM output B.
I/O
I/O
O
ST
TTL
Digital I/O.
External memory address/data 11.
ECCP3 PWM output C.
I/O
I/O
O
ST
TTL
Digital I/O.
External memory address/data 12.
ECCP3 PWM output B.
I/O
I/O
O
ST
TTL
Digital I/O.
External memory address/data 13.
ECCP1 PWM output C.
I/O
I/O
O
ST
TTL
Digital I/O.
External memory address/data 14.
ECCP1 PWM output B.
I/O
I/O
I/O
O
ST
TTL
ST
Digital I/O.
External memory address/data 15.
Capture 2 input/Compare 2 output/PWM2 output.
ECCP2 PWM output A.
Preliminary
DS39762B-page 33
PIC18F97J60 FAMILY
TABLE 1-6:
Pin Name
TQFP
Pin
Type
Buffer
Type
Description
PORTF is a bidirectional I/O port.
RF0/AN5
RF0
AN5
12
RF1/AN6/C2OUT
RF1
AN6
C2OUT
28
RF2/AN7/C1OUT
RF2
AN7
C1OUT
23
RF3/AN8
RF3
AN8
22
RF4/AN9
RF4
AN9
21
RF5/AN10/CVREF
RF5
AN10
CVREF
20
RF6/AN11
RF6
AN11
19
RF7/SS1
RF7
SS1
18
Legend:
Note 1:
2:
3:
4:
5:
I/O
I
ST
Analog
Digital I/O.
Analog input 5.
I/O
I
O
ST
Analog
Digital I/O.
Analog input 6.
Comparator 2 output.
I/O
I
O
ST
Analog
Digital I/O.
Analog input 7.
Comparator 1 output.
I/O
I
ST
Analog
Digital I/O.
Analog input 8.
I/O
I
ST
Analog
Digital I/O.
Analog input 9.
I/O
I
O
ST
Analog
Digital I/O.
Analog input 10.
Comparator reference voltage output.
I/O
I
ST
Analog
Digital I/O.
Analog input 11.
I/O
I
ST
TTL
Digital I/O.
SPI slave select input.
DS39762B-page 34
Preliminary
PIC18F97J60 FAMILY
TABLE 1-6:
Pin Name
TQFP
Pin
Type
Buffer
Type
Description
PORTG is a bidirectional I/O port.
RG0/ECCP3/P3A
RG0
ECCP3
P3A
71
RG1/TX2/CK2
RG1
TX2
CK2
70
RG2/RX2/DT2
RG2
RX2
DT2
52
RG3/CCP4/P3D
RG3
CCP4
P3D
51
RG4/CCP5/P1D
RG4
CCP5
P1D
14
I/O
I/O
O
ST
ST
Digital I/O.
Capture 3 input/Compare 3 output/PWM3 output.
ECCP3 PWM output A.
I/O
O
I/O
ST
ST
Digital I/O.
EUSART2 asynchronous transmit.
EUSART2 synchronous clock (see related RX2/DT2 pin).
I/O
I
I/O
ST
ST
ST
Digital I/O.
EUSART2 asynchronous receive.
EUSART2 synchronous data (see related TX2/CK2 pin).
I/O
I/O
O
ST
ST
Digital I/O.
Capture 4 input/Compare 4 output/PWM4 output.
ECCP3 PWM output D.
I/O
I/O
O
ST
ST
Digital I/O.
Capture 5 input/Compare 5 output/PWM5 output.
ECCP1 PWM output D.
RG5
11
I/O
ST
Digital I/O.
RG6
10
I/O
ST
Digital I/O.
RG7
38
I/O
ST
Digital I/O.
Legend:
Note 1:
2:
3:
4:
5:
Preliminary
DS39762B-page 35
PIC18F97J60 FAMILY
TABLE 1-6:
Pin Name
TQFP
Pin
Type
Buffer
Type
Description
PORTH is a bidirectional I/O port.
RH0/A16
RH0
A16
99
RH1/A17
RH1
A17
100
RH2/A18
RH2
A18
RH3/A19
RH3
A19
RH4/AN12/P3C
RH4
AN12
P3C(5)
27
RH5/AN13/P3B
RH5
AN13
P3B(5)
26
RH6/AN14/P1C
RH6
AN14
P1C(5)
25
RH7/AN15/P1B
RH7
AN15
P1B(5)
24
Legend:
Note 1:
2:
3:
4:
5:
I/O
O
ST
Digital I/O.
External memory address 16.
I/O
O
ST
Digital I/O.
External memory address 17.
I/O
O
ST
Digital I/O.
External memory address 18.
I/O
O
ST
Digital I/O.
External memory address 19.
I/O
I
O
ST
Analog
Digital I/O.
Analog input 12.
ECCP3 PWM output C.
I/O
I
O
ST
Analog
Digital I/O.
Analog input 13.
ECCP3 PWM output B.
I/O
I
O
ST
Analog
Digital I/O.
Analog input 14.
ECCP1 PWM output C.
I/O
I
O
ST
Analog
Digital I/O.
Analog input 15.
ECCP1 PWM output B.
DS39762B-page 36
Preliminary
PIC18F97J60 FAMILY
TABLE 1-6:
Pin Name
TQFP
Pin
Type
Buffer
Type
Description
PORTJ is a bidirectional I/O port.
RJ0/ALE
RJ0
ALE
49
RJ1/OE
RJ1
OE
50
RJ2/WRL
RJ2
WRL
66
RJ3/WRH
RJ3
WRH
61
RJ4/BA0
RJ4
BA0
47
RJ5/CE
RJ5
CE
48
RJ6/LB
RJ6
LB
58
RJ7/UB
RJ7
UB
39
Legend:
Note 1:
2:
3:
4:
5:
I/O
O
ST
Digital I/O.
External memory address latch enable.
I/O
O
ST
Digital I/O.
External memory output enable.
I/O
O
ST
Digital I/O.
External memory write low control.
I/O
O
ST
Digital I/O.
External memory write high control.
I/O
O
ST
Digital I/O.
External memory byte address 0 control.
I/O
O
ST
Digital I/O
External memory chip enable control.
I/O
O
ST
Digital I/O.
External memory low byte control.
I/O
O
ST
Digital I/O.
External memory high byte control.
Preliminary
DS39762B-page 37
PIC18F97J60 FAMILY
TABLE 1-6:
Pin
Type
Buffer
Type
NC
No connect.
VSS
VDD
AVSS
31
AVDD
30
ENVREG
29
ST
VDDCORE/VCAP
VDDCORE
16
P
Pin Name
VCAP
Description
VSSPLL
82
VDDPLL
81
VSSTX
79
VDDTX
76
VSSRX
72
VDDRX
75
RBIAS
80
TPOUT+
78
TPOUT-
77
TPIN+
74
73
TPINLegend:
Note 1:
2:
3:
4:
5:
Analog Bias current for Ethernet PHY. Must be tied to VSS via a resistor;
see Section 18.0 Ethernet Module for specification.
DS39762B-page 38
Preliminary
PIC18F97J60 FAMILY
2.0
2.1
OSCILLATOR
CONFIGURATIONS
2.2
Oscillator Types
Overview
1.
2.
HS
HSPLL
3.
4.
EC
ECPLL
5.
INTRC
2.2.1
High-Speed Crystal/Resonator
High-Speed Crystal/Resonator
with Software PLL Control
External Clock with FOSC/4 Output
External Clock with Software PLL
Control
Internal 31 kHz Oscillator
OSCILLATOR CONTROL
FIGURE 2-1:
Primary Oscillator
Ethernet Clock
OSC2
OSC1
PLL
Prescaler
Clock
Control
PLL
Postscaler
5x PLL
T1OSO
T1OSC
T1OSCEN
Enable
Oscillator
FOSC2:FOSC0
OSCCON<1:0>
Secondary Oscillator
T1OSI
OSCTUNE<7:5>(1)
PLL/Prescaler/Postscaler
INTRC
Source
MUX
Sleep
Peripherals
CPU
Internal Oscillator
IDLEN
WDT, PWRT, FSCM
and Two-Speed Start-up
Clock Source Option
for Other Modules
Note 1:
See Table 2-2 for OSCTUNE register configurations and their corresponding frequencies.
Preliminary
DS39762B-page 39
PIC18F97J60 FAMILY
2.3
Crystal Oscillator/Ceramic
Resonators (HS Modes)
FIGURE 2-2:
CRYSTAL OSCILLATOR
OPERATION (HS OR
HSPLL CONFIGURATION)
C1(1)
OSC1
XTAL
C2(1)
To
Internal
Logic
RF(3)
Sleep
OSC2
Note 1:
RS(2)
PIC18FXXJ6X
3:
TABLE 2-1:
HS
2.4
The EC and ECPLL Oscillator modes require an external clock source to be connected to the OSC1 pin.
There is no oscillator start-up time required after a
Power-on Reset or after an exit from Sleep mode.
In the EC Oscillator mode, the oscillator frequency
divided by 4 is available on the OSC2 pin. This signal
may be used for test purposes or to synchronize other
logic. Figure 2-3 shows the pin connections for the EC
Oscillator mode.
2:
Osc Type
FIGURE 2-3:
Clock from
Ext. System
C2
33 pF
33 pF
OSC1/CLKI
PIC18FXXJ6X
FOSC/4
EXTERNAL CLOCK
INPUT OPERATION
(EC CONFIGURATION)
OSC2/CLKO
FIGURE 2-4:
EXTERNAL CLOCK
INPUT OPERATION
(HS CONFIGURATION)
OSC1
Clock from
Ext. System
PIC18FXXJ6X
(HS Mode)
Open
OSC2
DS39762B-page 40
Preliminary
PIC18F97J60 FAMILY
2.5
2.6
REGISTER 2-1:
2.6.1
PLL BLOCK
To accommodate a range of applications and microcontroller clock speeds, a separate PLL block is
incorporated into the clock system. It consists of three
components:
A configurable prescaler (1:2 or 1:3)
A 5x PLL frequency multiplier
A configurable postscaler (1:1, 1:2, or 1:3)
The operation of the PLL blocks components is
controlled by the OSCTUNE register (Register 2-1).
The use of the PLL blocks prescaler and postscaler,
with or without the PLL itself, provides a range of system clock frequencies to choose from, including the
unaltered 25 MHz of the primary oscillator. The full
range of possible oscillator configurations compatible
with Ethernet operation is shown in Table 2-2.
R/W-0
R/W-0
R/W-0
R/W-0
U-0
U-0
U-0
U-0
PPST1
PLLEN(1)
PPST0
PPRE
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
-n = Value at POR
1 = Bit is set
0 = Bit is cleared
bit 7
bit 6
bit 5
bit 4
bit 3-0
Unimplemented: Read as 0
Note 1:
x = Bit is unknown
Available only for ECPLL and HSPLL oscillator configurations; otherwise, this bit is unavailable and is read
as 0.
Preliminary
DS39762B-page 41
PIC18F97J60 FAMILY
TABLE 2-2:
5x PLL
PLL Prescaler
PLL Postscaler
PLL Block
Configuration
(OSCTUNE<7:4>)
Clock Frequency
(MHz)
Disabled
x101
(Note 1)
1111
31.2500
0111
20.8333
2
Enabled
Disabled
Disabled
x100
41.6667
1110
20.8333
0110
13.8889
Disabled(2)
Disabled
x00x
25 (Default)
1011
6.2500
0011
4.1667
1010
4.1667
0010
2.7778
2
3
2.7
DS39762B-page 42
Preliminary
PIC18F97J60 FAMILY
2.7.1
REGISTER 2-2:
R/W-0
IDLEN
U-0
U-0
R-q
U-0
R/W-0
R/W-0
OSTS(1)
SCS1
SCS0
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
-n = Value at POR
1 = Bit is set
0 = Bit is cleared
x = Bit is unknown
bit 7
bit 6-4
Unimplemented: Read as 0
bit 3
bit 2
Unimplemented: Read as 0
bit 1-0
Note 1:
Preliminary
DS39762B-page 43
PIC18F97J60 FAMILY
2.7.1.1
2.7.2
OSCILLATOR TRANSITIONS
2.8
2.9
Power-up Delays
TABLE 2-3:
Oscillator Mode
OSC1 Pin
OSC2 Pin
EC, ECPLL
HS, HSPLL
Note:
See Table 4-2 in Section 4.0 Reset for time-outs due to Sleep and MCLR Reset.
DS39762B-page 44
Preliminary
PIC18F97J60 FAMILY
3.0
POWER-MANAGED MODES
3.1.1
CLOCK SOURCES
Run mode
Idle mode
Sleep mode
3.1.2
3.1
TABLE 3-1:
ENTERING POWER-MANAGED
MODES
POWER-MANAGED MODES
OSCCON<7,1:0>
Mode
Module Clocking
Available Clock and Oscillator Source
IDLEN(1)
SCS1:SCS0
CPU
Peripherals
N/A
Off
Off
PRI_RUN
N/A
10
Clocked
Clocked
SEC_RUN
N/A
01
Clocked
Clocked
RC_RUN
N/A
11
Clocked
Clocked
Internal Oscillator
PRI_IDLE
10
Off
Clocked
SEC_IDLE
01
Off
Clocked
RC_IDLE
11
Off
Clocked
Internal Oscillator
Sleep
Note 1:
Preliminary
DS39762B-page 45
PIC18F97J60 FAMILY
3.1.3
3.1.4
3.2.1
Run Modes
SEC_RUN MODE
3.2
3.2.2
PRI_RUN MODE
DS39762B-page 46
Preliminary
PIC18F97J60 FAMILY
FIGURE 3-1:
T1OSI
Q2
1
n-1
Q3
Q4
Q1
Q2
Q3
Clock Transition
OSC1
CPU
Clock
Peripheral
Clock
Program
Counter
PC
FIGURE 3-2:
PC + 2
PC + 4
Q2
Q3
Q4
Q1
Q2 Q3 Q4 Q1 Q2 Q3
T1OSI
OSC1
TOST(1)
TPLL(1)
1
PLL Clock
Output
n-1 n
Clock
Transition
CPU Clock
Peripheral
Clock
Program
Counter
SCS1:SCS0 bits Changed
PC + 2
PC
PC + 4
Note 1: TOST = 1024 TOSC; TPLL = 2 ms (approx). These intervals are not shown to scale.
Preliminary
DS39762B-page 47
PIC18F97J60 FAMILY
3.2.3
RC_RUN MODE
FIGURE 3-3:
INTRC
Q2
1
n-1
Q3
Q4
Q1
Q2
Q3
Clock Transition
OSC1
CPU
Clock
Peripheral
Clock
Program
Counter
PC
FIGURE 3-4:
PC + 2
PC + 4
Q2
Q3
Q4
Q2 Q3 Q4 Q1 Q2 Q3
Q1
INTRC
OSC1
TOST(1)
TPLL(1)
1
PLL Clock
Output
n-1 n
Clock
Transition
CPU Clock
Peripheral
Clock
Program
Counter
SCS1:SCS0 bits Changed
PC
PC + 2
PC + 4
Note 1: TOST = 1024 TOSC; TPLL = 2 ms (approx). These intervals are not shown to scale.
DS39762B-page 48
Preliminary
PIC18F97J60 FAMILY
3.3
Sleep Mode
3.4
Idle Modes
Entering the Sleep mode from any other mode does not
require a clock switch. This is because no clocks are
needed once the controller has entered Sleep. If the
WDT is selected, the INTRC source will continue to
operate. If the Timer1 oscillator is enabled, it will also
continue to run.
FIGURE 3-5:
Q1 Q2 Q3 Q4 Q1
OSC1
CPU
Clock
Peripheral
Clock
Sleep
Program
Counter
PC
FIGURE 3-6:
PC + 2
Q1
OSC1
PLL Clock
Output
TOST(1)
TPLL(1)
CPU Clock
Peripheral
Clock
Program
Counter
PC
Wake Event
PC + 2
PC + 4
PC + 6
Note1: TOST = 1024 TOSC; TPLL = 2 ms (approx). These intervals are not shown to scale.
Preliminary
DS39762B-page 49
PIC18F97J60 FAMILY
3.4.1
PRI_IDLE MODE
3.4.2
FIGURE 3-7:
SEC_IDLE MODE
Note:
Q4
Q3
Q2
Q1
OSC1
CPU Clock
Peripheral
Clock
Program
Counter
FIGURE 3-8:
PC
PC + 2
Q2
Q3
Q4
OSC1
TCSD
CPU Clock
Peripheral
Clock
Program
Counter
PC
Wake Event
DS39762B-page 50
Preliminary
PIC18F97J60 FAMILY
3.4.3
RC_IDLE MODE
3.5.2
In RC_IDLE mode, the CPU is disabled but the peripherals continue to be clocked from the internal oscillator.
This mode allows for controllable power conservation
during Idle periods.
From RC_RUN mode, RC_IDLE mode is entered by
setting the IDLEN bit and executing a SLEEP instruction.
If the device is in another Run mode, first set IDLEN,
then clear the SCS bits and execute SLEEP. When the
clock source is switched to the INTRC, the primary
oscillator is shut down and the OSTS bit is cleared.
When a wake event occurs, the peripherals continue to
be clocked from the INTRC. After a delay of TCSD
following the wake event, the CPU begins executing
code being clocked by the INTRC. The IDLEN and
SCS bits are not affected by the wake-up. The INTRC
source will continue to run if either the WDT or the
Fail-Safe Clock Monitor is enabled.
3.5
3.5.3
EXIT BY RESET
3.5.1
EXIT BY INTERRUPT
3.5.4
Preliminary
DS39762B-page 51
PIC18F97J60 FAMILY
NOTES:
DS39762B-page 52
Preliminary
PIC18F97J60 FAMILY
4.0
RESET
FIGURE 4-1:
4.1
RCON Register
External Reset
MCLR
( )_IDLE
Sleep
WDT
Time-out
VDD Rise
Detect
POR Pulse
VDD
Brown-out
Reset(1)
S
PWRT
32 s
PWRT
INTRC
Note 1:
66 ms
Chip_Reset
The ENVREG pin must be tied high to enable Brown-out Reset. The Brown-out Reset is provided by the on-chip
voltage regulator when there is insufficient source voltage to maintain regulation.
Preliminary
DS39762B-page 53
PIC18F97J60 FAMILY
REGISTER 4-1:
R/W-0
U-0
R/W-1
R/W-1
R-1
R-1
R/W-0
R/W-0
IPEN
CM
RI
TO
PD
POR
BOR
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
-n = Value at POR
1 = Bit is set
0 = Bit is cleared
x = Bit is unknown
bit 7
bit 6
Unimplemented: Read as 0
bit 5
bit 4
bit 3
bit 2
bit 1
bit 0
Note 1: It is recommended that the POR bit be set after a Power-on Reset has been detected so that subsequent
Power-on Resets may be detected.
2: If the on-chip voltage regulator is disabled, BOR remains 0 at all times. See Section 4.4.1 Detecting
BOR for more information.
3: Brown-out Reset is said to have occurred when BOR is 0 and POR is 1 (assuming that POR was set to
1 by software immediately after a Power-on Reset).
DS39762B-page 54
Preliminary
PIC18F97J60 FAMILY
4.2
FIGURE 4-2:
EXTERNAL POWER-ON
RESET CIRCUIT (FOR
SLOW VDD POWER-UP)
VDD
VDD
D(1)
R(2)
4.3
R1(3)
MCLR
C
Note 1:
2:
3:
4.4
PIC18FXXJ6X
4.4.1
DETECTING BOR
4.5
Preliminary
DS39762B-page 55
PIC18F97J60 FAMILY
A CM Reset behaves similarly to a Master Clear Reset,
RESET instruction, WDT time-out or Stack Event Reset.
As with all hard and power Reset events, the device
Configuration Words are reloaded from the Flash Configuration Words in program memory as the device
restarts.
4.6
FIGURE 4-3:
4.6.1
TIME-OUT SEQUENCE
TIME-OUT SEQUENCE ON POWER-UP (MCLR TIED TO VDD, VDD RISE < TPWRT)
VDD
MCLR
INTERNAL POR
TPWRT
PWRT TIME-OUT
INTERNAL RESET
FIGURE 4-4:
VDD
MCLR
INTERNAL POR
TPWRT
PWRT TIME-OUT
INTERNAL RESET
DS39762B-page 56
Preliminary
PIC18F97J60 FAMILY
FIGURE 4-5:
VDD
MCLR
INTERNAL POR
TPWRT
PWRT TIME-OUT
INTERNAL RESET
FIGURE 4-6:
SLOW RISE TIME (MCLR TIED TO VDD, VDD RISE > TPWRT)
3.3V
VDD
0V
1V
MCLR
INTERNAL POR
TPWRT
PWRT TIME-OUT
INTERNAL RESET
Preliminary
DS39762B-page 57
PIC18F97J60 FAMILY
4.7
TABLE 4-1:
Condition
Program
Counter(1)
RCON Register
STKPTR Register
CM
RI
TO
PD
POR
BOR
STKFUL
STKUNF
Power-on Reset
0000h
RESET Instruction
0000h
Brown-out Reset
0000h
0000h
0000h
0000h
0000h
0000h
0000h
0000h
0000h
PC + 2
PC + 2
Legend: u = unchanged
Note 1: When the wake-up is due to an interrupt, and the GIEH or GIEL bit is set, the PC is loaded with the interrupt
vector (0008h or 0018h).
DS39762B-page 58
Preliminary
PIC18F97J60 FAMILY
TABLE 4-2:
Register
Applicable Devices
Power-on Reset,
Brown-out Reset
MCLR Reset,
WDT Reset,
RESET Instruction,
Stack Resets,
CM Reset
TOSU
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
---0 0000
---0 0000
---0 uuuu(1)
TOSH
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
0000 0000
0000 0000
uuuu uuuu(1)
TOSL
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
0000 0000
0000 0000
uuuu uuuu(1)
STKPTR
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
00-0 0000
uu-0 0000
uu-u uuuu(1)
PCLATU
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
---0 0000
---0 0000
---u uuuu
PCLATH
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
0000 0000
0000 0000
uuuu uuuu
PCL
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
0000 0000
0000 0000
PC + 2(2)
TBLPTRU
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
--00 0000
--00 0000
--uu uuuu
TBLPTRH
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
0000 0000
0000 0000
uuuu uuuu
TBLPTRL
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
0000 0000
0000 0000
uuuu uuuu
TABLAT
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
0000 0000
0000 0000
uuuu uuuu
PRODH
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
xxxx xxxx
uuuu uuuu
uuuu uuuu
PRODL
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
xxxx xxxx
uuuu uuuu
uuuu uuuu
INTCON
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
0000 000x
0000 000u
uuuu uuuu(3)
INTCON2
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
1111 1111
1111 1111
uuuu uuuu(3)
INTCON3
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
1100 0000
1100 0000
uuuu uuuu(3)
INDF0
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
N/A
N/A
N/A
POSTINC0
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
N/A
N/A
N/A
POSTDEC0
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
N/A
N/A
N/A
PREINC0
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
N/A
N/A
N/A
PLUSW0
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
N/A
N/A
N/A
FSR0H
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
---- xxxx
---- uuuu
---- uuuu
FSR0L
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
xxxx xxxx
uuuu uuuu
uuuu uuuu
WREG
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
xxxx xxxx
uuuu uuuu
uuuu uuuu
INDF1
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
N/A
N/A
N/A
POSTINC1
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
N/A
N/A
N/A
POSTDEC1
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
N/A
N/A
N/A
PREINC1
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
N/A
N/A
N/A
PLUSW1
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
N/A
N/A
N/A
FSR1H
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
---- xxxx
---- uuuu
---- uuuu
FSR1L
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
xxxx xxxx
uuuu uuuu
uuuu uuuu
BSR
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
---- 0000
---- 0000
---- uuuu
INDF2
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
N/A
N/A
N/A
POSTINC2
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
N/A
N/A
N/A
POSTDEC2
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
N/A
N/A
N/A
PREINC2
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
N/A
N/A
N/A
PLUSW2
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
N/A
N/A
N/A
FSR2H
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
---- xxxx
---- uuuu
---- uuuu
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
xxxx xxxx
uuuu uuuu
uuuu uuuu
FSR2L
Legend:
Note 1:
2:
3:
4:
Preliminary
DS39762B-page 59
PIC18F97J60 FAMILY
TABLE 4-2:
Register
Applicable Devices
Power-on Reset,
Brown-out Reset
MCLR Reset,
WDT Reset,
RESET Instruction,
Stack Resets,
CM Reset
STATUS
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
---x xxxx
---u uuuu
---u uuuu
TMR0H
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
0000 0000
0000 0000
uuuu uuuu
TMR0L
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
xxxx xxxx
uuuu uuuu
uuuu uuuu
T0CON
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
1111 1111
1111 1111
uuuu uuuu
OSCCON
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
0--- q-00
0--- q-00
u--- q-uu
ECON1
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
0000 00--
0000 00--
uuuu uu--
WDTCON
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
---- ---0
---- ---0
---- ---u
(4)
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
0-q1 1100
0-uq qquu
u-uu qquu
TMR1H
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
xxxx xxxx
uuuu uuuu
uuuu uuuu
TMR1L
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
xxxx xxxx
uuuu uuuu
uuuu uuuu
T1CON
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
0000 0000
u0uu uuuu
uuuu uuuu
TMR2
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
0000 0000
0000 0000
uuuu uuuu
PR2
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
1111 1111
1111 1111
1111 1111
T2CON
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
-000 0000
-000 0000
-uuu uuuu
SSP1BUF
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
xxxx xxxx
uuuu uuuu
uuuu uuuu
SSP1ADD
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
0000 0000
0000 0000
uuuu uuuu
SSP1STAT
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
0000 0000
0000 0000
uuuu uuuu
SSP1CON1
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
0000 0000
0000 0000
uuuu uuuu
SSP1CON2
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
0000 0000
0000 0000
uuuu uuuu
ADRESH
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
xxxx xxxx
uuuu uuuu
uuuu uuuu
ADRESL
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
xxxx xxxx
uuuu uuuu
uuuu uuuu
ADCON0
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
0-00 0000
0-00 0000
u-uu uuuu
ADCON1
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
--00 0000
--00 0000
--uu uuuu
ADCON2
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
0-00 0000
0-00 0000
u-uu uuuu
CCPR1H
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
xxxx xxxx
uuuu uuuu
uuuu uuuu
CCPR1L
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
xxxx xxxx
uuuu uuuu
uuuu uuuu
CCP1CON
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
0000 0000
0000 0000
uuuu uuuu
CCPR2H
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
xxxx xxxx
uuuu uuuu
uuuu uuuu
CCPR2L
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
xxxx xxxx
uuuu uuuu
uuuu uuuu
CCP2CON
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
0000 0000
0000 0000
uuuu uuuu
CCPR3H
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
xxxx xxxx
uuuu uuuu
uuuu uuuu
CCPR3L
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
xxxx xxxx
uuuu uuuu
uuuu uuuu
CCP3CON
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
0000 0000
0000 0000
uuuu uuuu
ECCP1AS
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
0000 0000
0000 0000
uuuu uuuu
CVRCON
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
0000 0000
0000 0000
uuuu uuuu
CMCON
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
0000 0111
0000 0111
uuuu uuuu
TMR3H
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
xxxx xxxx
uuuu uuuu
uuuu uuuu
TMR3L
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
xxxx xxxx
uuuu uuuu
uuuu uuuu
RCON
Legend:
Note 1:
2:
3:
4:
DS39762B-page 60
Preliminary
PIC18F97J60 FAMILY
TABLE 4-2:
Register
Applicable Devices
Power-on Reset,
Brown-out Reset
MCLR Reset,
WDT Reset,
RESET Instruction,
Stack Resets,
CM Reset
T3CON
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
0000 0000
uuuu uuuu
uuuu uuuu
PSPCON
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
0000 ----
0000 ----
uuuu ----
SPBRG1
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
0000 0000
0000 0000
uuuu uuuu
RCREG1
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
0000 0000
0000 0000
uuuu uuuu
TXREG1
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
xxxx xxxx
uuuu uuuu
uuuu uuuu
TXSTA1
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
0000 0010
0000 0010
uuuu uuuu
RCSTA1
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
0000 000x
0000 000x
uuuu uuuu
EECON2
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
---- ----
---- ----
---- ----
EECON1
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
---0 x00-
---0 x00-
---u uuu-
IPR3
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
1111 1111
1111 1111
uuuu uuuu
PIR3
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
0000 0000
0000 0000
uuuu uuuu(3)
PIE3
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
0000 0000
0000 0000
uuuu uuuu
IPR2
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
1111 1-11
1111 1-11
uuuu u-uu
PIR2
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
0000 0-00
0000 0-00
uuuu u-uu(3)
PIE2
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
0000 0-00
0000 0-00
uuuu u-uu
IPR1
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
1111 1111
1111 1111
uuuu uuuu
PIR1
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
0000 0000
0000 0000
uuuu uuuu(3)
PIE1
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
0000 0000
0000 0000
uuuu uuuu
MEMCON
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
0-00 --00
0-00 --00
u-uu --uu
OSCTUNE
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
0000 ----
0000 ----
uuuu ----
TRISJ
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
--11 ----
--11 ----
--uu ----
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
1111 1111
1111 1111
uuuu uuuu
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
1111 1111
1111 1111
uuuu uuuu
---u ----
TRISH
TRISG
TRISF
TRISE
TRISD
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
---1 ----
---1 ----
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
---1 1111
---1 1111
---u uuuu
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
1111 1111
1111 1111
uuuu uuuu
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
1111 111-
1111 111-
uuuu uuu-
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
1111 1111
1111 1111
uuuu uuuu
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
--11 1111
--11 1111
--uu uuuu
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
1111 1111
1111 1111
uuuu uuuu
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
---- -111
---- -111
---- -uuu
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
1111 1111
1111 1111
uuuu uuuu
TRISC
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
1111 1111
1111 1111
uuuu uuuu
TRISB
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
1111 1111
1111 1111
uuuu uuuu
TRISA
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
--11 1111
--11 1111
--uu uuuu
LATJ
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
--xx ----
--uu ----
--uu ----
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
xxxx xxxx
uuuu uuuu
uuuu uuuu
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
xxxx xxxx
uuuu uuuu
uuuu uuuu
LATH
Legend:
Note 1:
2:
3:
4:
Preliminary
DS39762B-page 61
PIC18F97J60 FAMILY
TABLE 4-2:
Applicable Devices
Power-on Reset,
Brown-out Reset
MCLR Reset,
WDT Reset,
RESET Instruction,
Stack Resets,
CM Reset
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
---x ----
---u ----
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
---x xxxx
---u uuuu
---u uuuu
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
xxxx xxxx
uuuu uuuu
uuuu uuuu
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
xxxx xxx-
uuuu uuu-
uuuu uuu-
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
xxxx xxxx
uuuu uuuu
uuuu uuuu
Register
LATG
LATF
LATE
LATD
---u ----
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
--xx xxxx
--uu uuuu
--uu uuuu
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
xxxx xxxx
uuuu uuuu
uuuu uuuu
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
---- -xxx
---- -uuu
---- -uuu
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
xxxx xxxx
uuuu uuuu
uuuu uuuu
LATC
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
xxxx xxxx
uuuu uuuu
uuuu uuuu
LATB
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
xxxx xxxx
uuuu uuuu
uuuu uuuu
LATA
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
00xx xxxx
00uu uuuu
uuuu uuuu
PORTJ
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
--xx ----
--uu ----
--uu ----
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
xxxx xxxx
uuuu uuuu
uuuu uuuu
PORTH
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
xxxx xxxx
uuuu uuuu
uuuu uuuu
PORTG
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
---x ----
---u ----
---u ----
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
---x xxxx
---u uuuu
---u uuuu
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
111x xxxx
111u uuuu
uuuu uuuu
PORTF
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
x000 000-
x000 000-
uuuu uuu-
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
x000 000-
x000 000-
uuuu uuu-
PORTE
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
--xx xxxx
--uu uuuu
--uu uuuu
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
xxxx xxxx
uuuu uuuu
uuuu uuuu
PORTD
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
---- -xxx
---- -uuu
---- -uuu
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
xxxx xxxx
uuuu uuuu
uuuu uuuu
PORTC
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
xxxx xxxx
uuuu uuuu
uuuu uuuu
PORTB
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
xxxx xxxx
uuuu uuuu
uuuu uuuu
PORTA
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
0-0x 0000
0-0u 0000
u-uu uuuu
SPBRGH1
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
0000 0000
0000 0000
uuuu uuuu
BAUDCON1
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
0100 0-00
0100 0-00
uuuu u-uu
SPBRGH2
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
0000 0000
0000 0000
uuuu uuuu
BAUDCON2
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
0100 0-00
0100 0-00
uuuu u-uu
ERDPTH
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
---0 1010
---0 1010
---u uuuu
ERDPTL
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
1111 0101
1111 0101
uuuu uuuu
ECCP1DEL
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
0000 0000
0000 0000
uuuu uuuu
TMR4
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
0000 0000
0000 0000
uuuu uuuu
PR4
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
1111 1111
1111 1111
1111 1111
T4CON
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
-000 0000
-000 0000
-uuu uuuu
CCPR4H
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
xxxx xxxx
uuuu uuuu
uuuu uuuu
CCPR4L
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
xxxx xxxx
uuuu uuuu
uuuu uuuu
Legend:
Note 1:
2:
3:
4:
DS39762B-page 62
Preliminary
PIC18F97J60 FAMILY
TABLE 4-2:
Register
Applicable Devices
Power-on Reset,
Brown-out Reset
MCLR Reset,
WDT Reset,
RESET Instruction,
Stack Resets,
CM Reset
CCP4CON
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
--00 0000
--00 0000
--uu uuuu
CCPR5H
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
xxxx xxxx
uuuu uuuu
uuuu uuuu
CCPR5L
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
xxxx xxxx
uuuu uuuu
uuuu uuuu
CCP5CON
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
--00 0000
--00 0000
--uu uuuu
SPBRG2
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
0000 0000
0000 0000
uuuu uuuu
RCREG2
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
0000 0000
0000 0000
uuuu uuuu
TXREG2
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
0000 0000
0000 0000
uuuu uuuu
TXSTA2
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
0000 0010
0000 0010
uuuu uuuu
RCSTA2
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
0000 000x
0000 000x
uuuu uuuu
ECCP3AS
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
0000 0000
0000 0000
uuuu uuuu
ECCP3DEL
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
0000 0000
0000 0000
uuuu uuuu
ECCP2AS
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
0000 0000
0000 0000
uuuu uuuu
ECCP2DEL
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
0000 0000
0000 0000
uuuu uuuu
SSP2BUF
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
xxxx xxxx
uuuu uuuu
uuuu uuuu
SSP2ADD
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
0000 0000
0000 0000
uuuu uuuu
SSP2STAT
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
0000 0000
0000 0000
uuuu uuuu
SSP2CON1
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
0000 0000
0000 0000
uuuu uuuu
SSP2CON2
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
0000 0000
0000 0000
uuuu uuuu
EDATA
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
xxxx xxxx
uuuu uuuu
uuuu uuuu
EIR
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
-000 0-00
-000 0-00
-uuu u-uu
ECON2
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
100- ----
100- ----
uuu- ----
ESTAT
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
-0-0 -000
-0-0 -000
-u-u -uuu
EIE
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
-000 0-00
-000 0-00
-uuu u-uu
EDMACSH
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
0000 0000
0000 0000
uuuu uuuu
EDMACSL
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
0000 0000
0000 0000
uuuu uuuu
EDMADSTH
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
---0 0000
---0 0000
---u uuuu
EDMADSTL
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
0000 0000
0000 0000
uuuu uuuu
EDMANDH
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
---0 0000
---0 0000
---u uuuu
EDMANDL
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
0000 0000
0000 0000
uuuu uuuu
EDMASTH
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
---0 0000
---0 0000
---u uuuu
EDMASTL
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
0000 0000
0000 0000
uuuu uuuu
ERXWRPTH
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
---0 0000
---0 0000
---u uuuu
ERXWRPTL
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
0000 0000
0000 0000
uuuu uuuu
ERXRDPTH
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
---0 0101
---0 0101
---u uuuu
ERXRDPTL
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
1111 1010
1111 1010
uuuu uuuu
ERXNDH
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
---1 1111
---1 1111
---u uuuu
ERXNDL
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
1111 1111
1111 1111
uuuu uuuu
ERXSTH
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
---0 0101
---0 0101
---u uuuu
ERXSTL
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
1111 1010
1111 1010
uuuu uuuu
Legend:
Note 1:
2:
3:
4:
Preliminary
DS39762B-page 63
PIC18F97J60 FAMILY
TABLE 4-2:
Register
Applicable Devices
Power-on Reset,
Brown-out Reset
MCLR Reset,
WDT Reset,
RESET Instruction,
Stack Resets,
CM Reset
ETXNDH
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
---0 0000
---0 0000
---u uuuu
ETXNDL
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
0000 0000
0000 0000
uuuu uuuu
ETXSTH
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
---0 0000
---0 0000
---u uuuu
ETXSTL
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
0000 0000
0000 0000
uuuu uuuu
EWRPTH
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
---0 0000
---0 0000
---u uuuu
EWRPTL
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
0000 0000
0000 0000
uuuu uuuu
EPKTCNT
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
0000 0000
0000 0000
uuuu uuuu
ERXFCON
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
1010 0001
1010 0001
uuuu uuuu
EPMOH
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
---0 0000
---0 0000
---u uuuu
EPMOL
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
0000 0000
0000 0000
uuuu uuuu
EPMCSH
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
0000 0000
0000 0000
uuuu uuuu
EPMCSL
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
0000 0000
0000 0000
uuuu uuuu
EPMM7
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
0000 0000
0000 0000
uuuu uuuu
EPMM6
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
0000 0000
0000 0000
uuuu uuuu
EPMM5
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
0000 0000
0000 0000
uuuu uuuu
EPMM4
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
0000 0000
0000 0000
uuuu uuuu
EPMM3
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
0000 0000
0000 0000
uuuu uuuu
EPMM2
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
0000 0000
0000 0000
uuuu uuuu
EPMM1
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
0000 0000
0000 0000
uuuu uuuu
EPMM0
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
0000 0000
0000 0000
uuuu uuuu
EHT7
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
0000 0000
0000 0000
uuuu uuuu
EHT6
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
0000 0000
0000 0000
uuuu uuuu
EHT5
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
0000 0000
0000 0000
uuuu uuuu
EHT4
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
0000 0000
0000 0000
uuuu uuuu
EHT3
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
0000 0000
0000 0000
uuuu uuuu
EHT2
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
0000 0000
0000 0000
uuuu uuuu
EHT1
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
0000 0000
0000 0000
uuuu uuuu
EHT0
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
0000 0000
0000 0000
uuuu uuuu
MIRDH
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
0000 0000
0000 0000
uuuu uuuu
MIRDL
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
0000 0000
0000 0000
uuuu uuuu
MIWRH
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
0000 0000
0000 0000
uuuu uuuu
MIWRL
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
0000 0000
0000 0000
uuuu uuuu
MIREGADR
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
---0 0000
---0 0000
---u uuuu
MICMD
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
---- --00
---- --00
---- --uu
MAMXFLH
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
0000 0110
0000 0110
uuuu uuuu
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
0000 0000
0000 0000
uuuu uuuu
MAMXFLL
Legend:
Note 1:
2:
3:
4:
DS39762B-page 64
Preliminary
PIC18F97J60 FAMILY
TABLE 4-2:
Register
Applicable Devices
Power-on Reset,
Brown-out Reset
MCLR Reset,
WDT Reset,
RESET Instruction,
Stack Resets,
CM Reset
MAIPGH
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
-000 0000
-000 0000
-uuu uuuu
MAIPGL
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
-000 0000
-000 0000
-uuu uuuu
MABBIPG
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
-000 0000
-000 0000
-uuu uuuu
MACON4
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
-000 --00
-000 --00
-uuu --uu
MACON3
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
0000 0000
0000 0000
uuuu uuuu
MACON1
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
---0 0000
---0 0000
---u uuuu
EPAUSH
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
0001 0000
0001 0000
000u uuuu
EPAUSL
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
0000 0000
0000 0000
uuuu uuuu
EFLOCON
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
---- -000
---- -000
---- -uuu
MISTAT
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
---- 0000
---- 0000
---- uuuu
MAADR2
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
0000 0000
0000 0000
uuuu uuuu
MAADR1
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
0000 0000
0000 0000
uuuu uuuu
MAADR4
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
0000 0000
0000 0000
uuuu uuuu
MAADR3
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
0000 0000
0000 0000
uuuu uuuu
MAADR6
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
0000 0000
0000 0000
uuuu uuuu
PIC18F6XJ6X
PIC18F8XJ6X
PIC18F9XJ6X
0000 0000
0000 0000
uuuu uuuu
MAADR5
Legend:
Note 1:
2:
3:
4:
Preliminary
DS39762B-page 65
PIC18F97J60 FAMILY
NOTES:
DS39762B-page 66
Preliminary
PIC18F97J60 FAMILY
MEMORY ORGANIZATION
5.1
FIGURE 5-1:
21
Stack Level 1
Stack Level 31
PIC18FX6J60
PIC18FX6J65
PIC18FX7J60
On-Chip
Memory
On-Chip
Memory
On-Chip
Memory
Config. Words
00FFFFh
Config. Words
017FFFh
Config. Words
Unimplemented
Read as 0
000000h
Unimplemented
Read as 0
01FFFFh
5.0
Unimplemented
Read as 0
1FFFFFh
Note:
Sizes of memory areas are not to scale. Sizes of program memory areas are enhanced to show detail.
Preliminary
DS39762B-page 67
PIC18F97J60 FAMILY
5.1.1
5.1.2
FIGURE 5-2:
Reset Vector
0000h
0008h
0018h
TABLE 5-1:
Device
FLASH CONFIGURATION
WORDS FOR PIC18F97J60
FAMILY DEVICES
Program
Memory
(Kbytes)
Configuration
Word Addresses
64
FFF8h to FFFFh
96
17FF8h to
17FFFh
128
1FFF8h to
1FFFFh
PIC18F66J60
On-Chip
Program Memory
PIC18F86J60
PIC18F96J60
PIC18F66J65
PIC18F86J65
PIC18F96J65
PIC18F67J60
(Top of Memory-7)
(Top of Memory)
PIC18F87J60
PIC18F97J60
Read as 0
1FFFFFh
Legend:
DS39762B-page 68
Preliminary
PIC18F97J60 FAMILY
5.1.3
PIC18F9XJ60/9XJ65 PROGRAM
MEMORY MODES
REGISTER 5-1:
R/WO-1
R/WO-1
R/WO-1
R/WO-1
R/WO-1
U-0
U-0
U-0
WAIT(1)
BW(1)
EMB1(1)
EMB0(1)
EASHFT(1)
bit 7
bit 0
Legend:
R = Readable bit
WO = Write-Once bit
0 = Bit is cleared
bit 7
bit 6
bit 5-4
bit 3
bit 2-0
Unimplemented: Read as 0
Note 1:
Preliminary
DS39762B-page 69
PIC18F97J60 FAMILY
5.1.4
EXTENDED MICROCONTROLLER
MODE AND ADDRESS SHIFTING
FIGURE 5-3:
Microcontroller Mode(1)
On-Chip
Memory
Space
External
Memory
Space
On-Chip
Memory
Space
No
Access
Note 1:
2:
000000h
(Top of Memory)
(Top of Memory) + 1
External
Memory
(Top of Memory)
(Top of Memory) + 1
External
Memory
Mapped
to
External
Memory
Space
Mapped
to
External
Memory
Space
1FFFFFh
(Top of Memory)
1FFFFFh
1FFFFFh
1FFFFFh
Legend:
On-Chip
Memory
Space
On-Chip
Program
Memory
On-Chip
Program
Memory
(Top of Memory)
(Top of Memory) + 1
Reads
0s
External
Memory
Space
000000h
000000h
On-Chip
Program
Memory
(Top of Memory) represents upper boundary of on-chip program memory space (see Figure 5-1 for device-specific
values). Shaded areas represent unimplemented or inaccessible areas depending on the mode.
This mode is the only available mode on 64-pin and 80-pin devices and the default on 100-pin devices.
These modes are only available on 100-pin devices.
TABLE 5-2:
Operating Mode
Execution
From
Table Read
From
Table Write
To
Execution
From
Table Read
From
Table Write
To
Microcontroller
Yes
Yes
Yes
No Access
No Access
No Access
Extended Microcontroller
Yes
Yes
Yes
Yes
Yes
Yes
DS39762B-page 70
Preliminary
PIC18F97J60 FAMILY
5.1.5
PROGRAM COUNTER
5.1.6
FIGURE 5-4:
5.1.6.1
Top-of-Stack Access
Only the top of the return address stack (TOS) is readable and writable. A set of three registers,
TOSU:TOSH:TOSL, holds the contents of the stack
location pointed to by the STKPTR register
(Figure 5-4). This allows users to implement a software
stack if necessary. After a CALL, RCALL or interrupt
(and ADDULNK and SUBULNK instructions if the
extended instruction set is enabled), the software can
read
the
pushed
value
by
reading
the
TOSU:TOSH:TOSL registers. These values can be
placed on a user-defined software stack. At return time,
the software can return these values to
TOSU:TOSH:TOSL and do a return.
The user must disable the global interrupt enable bits
while accessing the stack to prevent inadvertent stack
corruption.
Top-of-Stack Registers
TOSU
00h
TOSH
1Ah
11111
11110
11101
TOSL
34h
Top-of-Stack
001A34h
000D58h
Preliminary
STKPTR<4:0>
00010
00011
00010
00001
00000
DS39762B-page 71
PIC18F97J60 FAMILY
5.1.6.2
Note:
5.1.6.3
REGISTER 5-2:
R/C-0
R/C-0
U-0
R/W-0
R/W-0
R/W-0
R/W-0
R/W-0
STKFUL(1)
STKUNF(1)
SP4
SP3
SP2
SP1
SP0
bit 7
bit 0
Legend:
C = Clearable bit
R = Readable bit
W = Writable bit
-n = Value at POR
1 = Bit is set
0 = Bit is cleared
bit 7
bit 6
bit 5
Unimplemented: Read as 0
bit 4-0
Note 1:
x = Bit is unknown
DS39762B-page 72
Preliminary
PIC18F97J60 FAMILY
5.1.6.4
5.1.8
5.1.7
5.1.8.1
Computed GOTO
EXAMPLE 5-2:
EXAMPLE 5-1:
CALL
SUB1, FAST
SUB1
RETURN FAST
ORG
TABLE
5.1.8.2
MOVF
CALL
nn00h
ADDWF
RETLW
RETLW
RETLW
.
.
.
Table Reads
Preliminary
in
DS39762B-page 73
PIC18F97J60 FAMILY
5.2
5.2.2
5.2.1
CLOCKING SCHEME
FIGURE 5-5:
INSTRUCTION FLOW/PIPELINING
CLOCK/INSTRUCTION CYCLE
Q1
Q2
Q3
Q4
Q1
Q2
Q3
Q4
Q2
Q1
Q3
Q4
OSC1
Q1
Q2
Internal
Phase
Clock
Q3
Q4
PC
PC
PC + 2
PC + 4
OSC2/CLKO
(RC mode)
Execute INST (PC 2)
Fetch INST (PC)
EXAMPLE 5-3:
1. MOVLW 55h
4. BSF
TCY1
Fetch 1
Execute 1
2. MOVWF PORTB
3. BRA
SUB_1
Fetch 2
TCY2
TCY3
TCY4
TCY5
Execute 2
Fetch 3
Execute 3
Fetch 4
Flush (NOP)
Fetch SUB_1 Execute SUB_1
All instructions are single cycle, except for any program branches. These take two cycles since the fetch instruction
is flushed from the pipeline while the new instruction is being fetched and then executed.
DS39762B-page 74
Preliminary
PIC18F97J60 FAMILY
5.2.3
INSTRUCTIONS IN PROGRAM
MEMORY
The program memory is addressed in bytes. Instructions are stored as two bytes or four bytes in program
memory. The Least Significant Byte of an instruction
word is always stored in a program memory location
with an even address (LSb = 0). To maintain alignment
with instruction boundaries, the PC increments in steps
of 2 and the LSb will always read 0 (see Section 5.1.5
Program Counter).
Figure 5-6 shows an example of how instruction words
are stored in the program memory.
FIGURE 5-6:
LSB = 0
0Fh
EFh
F0h
C1h
F4h
55h
03h
00h
23h
56h
Program Memory
Byte Locations
5.2.4
Instruction 1:
Instruction 2:
MOVLW
GOTO
055h
0006h
Instruction 3:
MOVFF
123h, 456h
TWO-WORD INSTRUCTIONS
EXAMPLE 5-4:
Word Address
000000h
000002h
000004h
000006h
000008h
00000Ah
00000Ch
00000Eh
000010h
000012h
000014h
TWO-WORD INSTRUCTIONS
CASE 1:
Object Code
Source Code
TSTFSZ
REG1
; is RAM location 0?
MOVFF
REG1, REG2
ADDWF
REG3
CASE 2:
Object Code
Source Code
TSTFSZ
REG1
; is RAM location 0?
MOVFF
REG1, REG2
ADDWF
REG3
Preliminary
DS39762B-page 75
PIC18F97J60 FAMILY
5.3
Note:
5.3.1
DS39762B-page 76
Preliminary
PIC18F97J60 FAMILY
FIGURE 5-7:
BSR<3:0>
= 0000
= 0001
= 0010
= 0011
= 0100
= 0101
= 0110
= 0111
= 1000
= 1001
= 1010
= 1011
= 1100
= 1101
= 1110
Access RAM
Bank 0
FFh
00h
Bank 1
GPR
Bank 2
1FFh
200h
GPR
FFh
00h
Bank 3
2FFh
300h
GPR
3FFh
400h
FFh
00h
Bank 4
GPR
FFh
00h
4FFh
500h
GPR
Bank 5
FFh
00h
5FFh
600h
GPR
Bank 6
FFh
00h
6FFh
700h
GPR
Bank 7
FFh
00h
7FFh
800h
FFh
00h
Access Bank
00h
Access RAM Low
GPR
Bank 8
5Fh
Access RAM High 60h
(SFRs)
FFh
8FFh
900h
GPR
Bank 9
FFh
00h
9FFh
A00h
GPR
Bank 10
FFh
00h
AFFh
B00h
GPR
Bank 11
FFh
00h
BFFh
C00h
GPR
Bank 12
FFh
00h
CFFh
D00h
GPR
Bank 13
FFh
00h
GPR
Bank 14
FFh
00h
Ethernet SFR
FFh
SFR
Bank 15
000h
05Fh
060h
0FFh
100h
GPR
FFh
00h
= 1111
GPR
DFFh
E00h
E7Fh
E80h
EFFh
F00h
F5Fh
F60h
FFFh
Preliminary
DS39762B-page 77
PIC18F97J60 FAMILY
FIGURE 5-8:
7
0
0
0
000h
Data Memory
Bank 0
0
100h
Bank Select(2)
Bank 1
00h
FFh
00h
11
From Opcode(2)
11
11
11
11
0
1
FFh
00h
200h
Bank 2
FFh
00h
300h
Bank 3
through
Bank 13
FFh
00h
E00h
Bank 14
FFh
00h
F00h
FFFh
Note 1:
2:
5.3.2
Bank 15
FFh
The Access RAM bit of the instruction can be used to force an override of the selected bank (BSR<3:0>) to
the registers of the Access Bank.
The MOVFF instruction embeds the entire 12-bit address in the instruction.
ACCESS BANK
DS39762B-page 78
5.3.3
GENERAL PURPOSE
REGISTER FILE
Preliminary
PIC18F97J60 FAMILY
5.3.4
TABLE 5-3:
Address
Name
Address
FFFh
TOSU
FDFh
Name
FFEh
TOSH
FDEh POSTINC2(1)
FBEh
FFDh
TOSL
FDDh POSTDEC2(1)
FBDh
FFCh
STKPTR
FDCh
PREINC2(1)
FBCh
FFBh
PCLATU
FDBh
PLUSW2(1)
FBBh
INDF2(1)
Address
Name
Address
Name
Address
F9Fh
IPR1
F7Fh
SPBRGH1
CCPR1L
F9Eh
PIR1
F7Eh
BAUDCON1
CCP1CON
F9Dh
PIE1
F7Dh
SPBRGH2
CCPR2H
F9Ch
MEMCON(4)
F7Ch
BAUDCON2
CCPR2L
F9Bh
OSCTUNE
F7Bh
ERDPTH
FBFh
CCPR1H
(3)
Name
FFAh
PCLATH
FDAh
FSR2H
FBAh
CCP2CON
F9Ah
TRISJ
F7Ah
ERDPTL
FF9h
PCL
FD9h
FSR2L
FB9h
CCPR3H
F99h
TRISH(3)
F79h
ECCP1DEL
FF8h
TBLPTRU
FD8h
STATUS
FB8h
CCPR3L
F98h
TRISG
F78h
TMR4
FF7h
TBLPTRH
FD7h
TMR0H
FB7h
CCP3CON
F97h
TRISF
F77h
PR4
FF6h
TBLPTRL
FD6h
TMR0L
FB6h
ECCP1AS
F96h
TRISE
F76h
T4CON
FF5h
TABLAT
FD5h
T0CON
FB5h
CVRCON
F95h
TRISD
F75h
CCPR4H
FF4h
PRODH
FD4h
(2)
FB4h
CMCON
F94h
TRISC
F74h
CCPR4L
FF3h
PRODL
FD3h
OSCCON
FB3h
TMR3H
F93h
TRISB
F73h
CCP4CON
FF2h
INTCON
FD2h
ECON1
FB2h
TMR3L
F92h
TRISA
F72h
CCPR5H
FF1h
INTCON2
FD1h
WDTCON
FB1h
T3CON
F91h
LATJ(3)
F71h
CCPR5L
FF0h
INTCON3
FD0h
RCON
FB0h
PSPCON
F90h
LATH(3)
F70h
CCP5CON
FEFh
INDF0(1)
FCFh
TMR1H
FAFh
SPBRG1
F8Fh
LATG
F6Fh
SPBRG2
(1)
FCEh
TMR1L
FAEh
RCREG1
F8Eh
LATF
F6Eh
RCREG2
FEDh POSTDEC0(1)
FCDh
T1CON
FADh
TXREG1
F8Dh
LATE
F6Dh
TXREG2
FEEh POSTINC0
FECh
PREINC0(1)
FCCh
TMR2
FACh
TXSTA1
F8Ch
LATD
F6Ch
TXSTA2
FEBh
PLUSW0(1)
FCBh
PR2
FABh
RCSTA1
F8Bh
LATC
F6Bh
RCSTA2
FEAh
FSR0H
FCAh
T2CON
FAAh
(2)
F8Ah
LATB
F6Ah
ECCP3AS
FE9h
FSR0L
FC9h
SSP1BUF
FA9h
(2)
F89h
LATA
F69h
ECCP3DEL
FE8h
WREG
FC8h
SSP1ADD
FA8h
(2)
F88h
PORTJ(3)
F68h
ECCP2AS
FE7h
INDF1(1)
FC7h
SSP1STAT
FA7h
EECON2(1)
F87h
PORTH(3)
F67h
ECCP2DEL
FE6h
POSTINC1(1)
FC6h
SSP1CON1
FA6h
EECON1
F86h
PORTG
F66h
SSP2BUF
FE5h POSTDEC1(1)
FC5h
SSP1CON2
FA5h
IPR3
F85h
PORTF
F65h
SSP2ADD
FE4h
PREINC1(1)
FC4h
ADRESH
FA4h
PIR3
F84h
PORTE
F64h
SSP2STAT
FE3h
PLUSW1(1)
FC3h
ADRESL
FA3h
PIE3
F83h
PORTD
F63h
SSP2CON1
FE2h
FSR1H
FC2h
ADCON0
FA2h
IPR2
F82h
PORTC
F62h
SSP2CON2
FE1h
FSR1L
FC1h
ADCON1
FA1h
PIR2
F81h
PORTB
F61h
EDATA
FE0h
BSR
FC0h
ADCON2
FA0h
PIE2
F80h
PORTA
F60h
EIR
Note 1:
2:
3:
4:
Preliminary
DS39762B-page 79
PIC18F97J60 FAMILY
5.3.5
ETHERNET SFRs
Note:
TABLE 5-4:
Address
Name
EFFh
EFEh
(1)
ECON2
Address
EDFh
Name
(1)
(1)
Address
EBFh
Name
Address
Name
(1)
E9Fh
(1)
(1)
EDEh
EBEh
E9Eh
(1)
EBDh
(1)
E9Dh
(1)
EBCh
(1)
E9Ch
(1)
EBBh
(1)
E9Bh
(1)
EBAh
(1)
E9Ah
(1)
EFDh
ESTAT
EDDh
(1)
EFCh
(1)
EDCh
(1)
(1)
EFBh
EIE
EDBh
EFAh
(1)
EDAh
(1)
EF9h
(2)
ED9h
EPKTCNT
EB9h
MIRDH
E99h
EPAUSH
EF8h
(2)
ED8h
ERXFCON
EB8h
MIRDL
E98h
EPAUSL
EB7h
MIWRH
E97h
EFLOCON
EB6h
MIWRL
E96h
(2)
E95h
(2)
E94h
(2)
E93h
(2)
EF7h
EDMACSH
ED7h
(1)
EF6h
EDMACSL
ED6h
(1)
EF5h
EDMADSTH
ED5h
EPMOH
EB5h
EF4h
EDMADSTL
ED4h
EPMOL
EB4h
EF3h
EF2h
EDMANDH
EDMANDL
ED3h
(2)
EB3h
ED2h
(2)
EB2h
(1)
MIREGADR
(2)
E92h
(2)
(1)
E91h
(2)
MICMD
EF1h
EDMASTH
ED1h
EPMCSH
EB1h
EF0h
EDMASTL
ED0h
EPMCSL
EB0h
(1)
E90h
(2)
EAFh
(2)
E8Fh
(2)
EAEh
(1)
E8Eh
(2)
(1)
E8Dh
(2)
EEFh
EEEh
ERXWRPTH
ERXWRPTL
ECFh
ECEh
EPMM7
EPMM6
EEDh
ERXRDPTH
ECDh
EPMM5
EADh
EECh
ERXRDPTL
ECCh
EPMM4
EACh
(1)
E8Ch
(2)
EEBh
ERXNDH
ECBh
EPMM3
EABh
MAMXFLH
E8Bh
(2)
EEAh
ERXNDL
ECAh
EPMM2
EAAh
MAMXFLL
E8Ah
MISTAT
EE9h
ERXSTH
EC9h
EPMM1
EA9h
(1)
E89h
(1)
EE8h
ERXSTL
EC8h
EPMM0
EA8h
(1)
E88h
(1)
EE7h
ETXNDH
EC7h
EHT7
EA7h
MAIPGH
E87h
(1)
EE6h
ETXNDL
EC6h
EHT6
EA6h
MAIPGL
E86h
(1)
EE5h
ETXSTH
EC5h
EHT5
EA5h
E85h
MAADR2
EE4h
ETXSTL
EC4h
EHT4
EA4h
MABBIPG
E84h
MAADR1
EE3h
EWRPTH
EC3h
EHT3
EA3h
MACON4
E83h
MAADR4
EE2h
EWRPTL
EC2h
EHT2
EA2h
MACON3
E82h
MAADR3
EE1h
(1)
EC1h
EHT1
EA1h
(1)
E81h
MAADR6
EE0h
(1)
EC0h
EHT0
EA0h
MACON1
E80h
MAADR5
Note 1:
2:
(2)
DS39762B-page 80
Preliminary
PIC18F97J60 FAMILY
TABLE 5-5:
File Name
TOSU
Bit 6
Bit 5
Bit 4
TOSL
STKPTR
STKFUL(1)
STKUNF(1)
PCLATU
bit 21(2)
PCL
TBLPTRU
TBLPTRH
bit 21
Bit 2
Bit 1
Bit 0
TOSH
PCLATH
Bit 3
SP4
SP3
SP2
SP1
SP0
Values on Details on
POR, BOR
Page:
---0 0000
59, 71
0000 0000
59, 71
0000 0000
59, 71
00-0 0000
59, 72
---0 0000
59, 71
0000 0000
59, 71
0000 0000
59, 71
--00 0000
59, 98
0000 0000
59, 98
TBLPTRL
0000 0000
59, 98
TABLAT
0000 0000
59, 98
PRODH
xxxx xxxx
59, 117
PRODL
xxxx xxxx
59, 117
0000 000x
59, 121
INTCON
GIE/GIEH
PEIE/GIEL
TMR0IE
INT0IE
RBIE
TMR0IF
INT0IF
RBIF
INTCON2
RBPU
INTEDG0
INTEDG1
INTEDG2
INTEDG3
TMR0IP
INT3IP
RBIP
1111 1111
59, 122
INTCON3
INT2IP
INT1IP
INT3IE
INT2IE
INT1IE
INT3IF
INT2IF
INT1IF
1100 0000
59, 123
59, 89
INDF0
Uses contents of FSR0 to address data memory value of FSR0 not changed (not a physical register)
N/A
POSTINC0
Uses contents of FSR0 to address data memory value of FSR0 post-incremented (not a physical register)
N/A
59, 90
POSTDEC0
Uses contents of FSR0 to address data memory value of FSR0 post-decremented (not a physical register)
N/A
59, 90
PREINC0
Uses contents of FSR0 to address data memory value of FSR0 pre-incremented (not a physical register)
N/A
59, 90
PLUSW0
Uses contents of FSR0 to address data memory value of FSR0 pre-incremented (not a physical register)
value of FSR0 offset by W
N/A
59, 90
FSR0H
---- xxxx
59, 89
FSR0L
xxxx xxxx
59, 90
xxxx xxxx
59
N/A
59, 89
WREG
Working Register
INDF1
Uses contents of FSR1 to address data memory value of FSR1 not changed (not a physical register)
POSTINC1
Uses contents of FSR1 to address data memory value of FSR1 post-incremented (not a physical register)
N/A
59, 90
POSTDEC1
Uses contents of FSR1 to address data memory value of FSR1 post-decremented (not a physical register)
N/A
59, 90
PREINC1
Uses contents of FSR1 to address data memory value of FSR1 pre-incremented (not a physical register)
N/A
59, 90
PLUSW1
Uses contents of FSR1 to address data memory value of FSR1 pre-incremented (not a physical register)
value of FSR1 offset by W
N/A
59, 90
FSR1H
FSR1L
BSR
---- 0000
59, 89
Uses contents of FSR2 to address data memory value of FSR2 not changed (not a physical register)
N/A
59, 89
POSTINC2
Uses contents of FSR2 to address data memory value of FSR2 post-incremented (not a physical register)
N/A
59, 90
POSTDEC2
Uses contents of FSR2 to address data memory value of FSR2 post-decremented (not a physical register)
N/A
59, 90
PREINC2
Uses contents of FSR2 to address data memory value of FSR2 pre-incremented (not a physical register)
N/A
59, 90
PLUSW2
Uses contents of FSR2 to address data memory value of FSR2 pre-incremented (not a physical register)
value of FSR2 offset by W
N/A
59, 90
FSR2L
59, 89
59, 89
INDF2
FSR2H
---- xxxx
xxxx xxxx
---- xxxx
59, 89
xxxx xxxx
59, 89
Legend: x = unknown, u = unchanged, - = unimplemented, read as 0, q = value depends on condition, r = reserved bit, do not modify. Shaded cells
are unimplemented, read as 0.
Note 1: Bit 7 and bit 6 are cleared by user software or by a POR.
2: Bit 21 of the PC is only available in Serial Programming modes.
3: Reset value is 0 when Two-Speed Start-up is enabled and 1 if disabled.
4: Alternate names and definitions for these bits when the MSSP module is operating in I2C Slave mode.
5: These bits and/or registers are only available in 100-pin devices; otherwise, they are unimplemented and read as 0. Reset values shown
apply only to 100-pin devices.
6: These bits and/or registers are only available in 80-pin and 100-pin devices; in 64-pin devices, they are unimplemented and read as 0. Reset
values are shown for 100-pin devices.
7: In Microcontroller mode, the bits in this register are unwritable and read as 0.
8: PLLEN is only available when either ECPLL or HSPLL Oscillator mode is selected; otherwise, read as 0.
9: Implemented in 100-pin devices in Microcontroller mode only.
Preliminary
DS39762B-page 81
PIC18F97J60 FAMILY
TABLE 5-5:
File Name
STATUS
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
OV
DC
TMR0H
TMR0L
Values on Details on
POR, BOR
Page:
---x xxxx
60, 87
0000 0000
60, 163
xxxx xxxx
60, 163
TMR0ON
T08BIT
T0CS
T0SE
PSA
T0PS2
T0PS1
T0PS0
1111 1111
60, 163
OSCCON
IDLEN
OSTS(3)
SCS1
SCS0
0--- q-00
60, 43
ECON1
TXRST
RXRST
DMAST
CSUMEN
TXRTS
RXEN
0000 00--
60, 212
SWDTEN
--- ---0
60, 351
IPEN
CM
RI
TO
PD
POR
BOR
T0CON
WDTCON
RCON
TMR1H
xxxx xxxx
60, 167
TMR1L
xxxx xxxx
60, 167
0000 0000
60, 167
60, 173
T1CON
RD16
T1RUN
T1CKPS1
T1CKPS0
T1OSCEN
T1SYNC
TMR1CS
TMR1ON
TMR2
Timer2 Register
0000 0000
PR2
1111 1111
60, 173
-000 0000
60, 173
60, 263
T2CON
T2OUTPS3
T2OUTPS2
T2OUTPS1
T2OUTPS0
TMR2ON
T2CKPS1
T2CKPS0
SSP1BUF
xxxx xxxx
SSP1ADD
MSSP1 Address Register (I2C Slave mode), MSSP1 Baud Rate Reload Register (I2C Master mode)
0000 0000
60, 263
SSP1STAT
SMP
CKE
D/A
R/W
UA
BF
0000 0000
60, 254,
264
SSP1CON1
WCOL
SSPOV
SSPEN
CKP
SSPM3
SSPM2
SSPM1
SSPM0
0000 0000
60, 255,
265
0000 0000
60, 266
SSP1CON2
GCEN
ACKSTAT
ACKDT
ACKEN
RCEN
PEN
RSEN
SEN
GCEN
ACKSTAT
ADMSK5(4)
ADMSK4(4)
ADMSK3(4)
ADMSK2(4)
ADMSK1(4)
SEN
ADRESH
xxxx xxxx
60, 331
ADRESL
xxxx xxxx
60, 331
ADCON0
ADCAL
CHS3
CHS2
CHS1
CHS0
GO/DONE
ADON
0-00 0000
60, 323
ADCON1
VCFG1
VCFG0
PCFG3
PCFG2
PCFG1
PCFG0
--00 0000
60, 324
ADCON2
ADFM
ACQT2
ACQT1
ACQT0
ADCS2
ADCS1
ADCS0
0-00 0000
60, 325
CCPR1H
xxxx xxxx
60, 185
CCPR1L
xxxx xxxx
60, 185
0000 0000
60, 189
CCP1CON
P1M1
P1M0
DC1B1
DC1B0
CCP1M3
CCP1M2
CCP1M1
CCP1M0
CCPR2H
xxxx xxxx
60, 185
CCPR2L
xxxx xxxx
60, 185
0000 0000
60, 189
CCP2CON
P2M1
P2M0
DC2B1
DC2B0
CCP2M3
CCP2M2
CCP2M1
CCP2M0
CCPR3H
xxxx xxxx
60, 185
CCPR3L
xxxx xxxx
60, 185
CCP3CON
ECCP1AS
P3M1
P3M0
ECCP1ASE ECCP1AS2
DC3B1
DC3B0
CCP3M3
CCP3M2
CCP3M1
CCP3M0
0000 0000
60, 189
ECCP1AS1
ECCP1AS0
PSS1AC1
PSS1AC0
PSS1BD1
PSS1BD0
0000 0000
60, 201
CVRCON
CVREN
CVROE
CVRR
CVRSS
CVR3
CVR2
CVR1
CVR0
0000 0000
60, 339
CMCON
C2OUT
C1OUT
C2INV
C1INV
CIS
CM2
CM1
CM0
0000 0111
60, 333
TMR3H
xxxx xxxx
60, 175
TMR3L
xxxx xxxx
60, 175
Legend: x = unknown, u = unchanged, - = unimplemented, read as 0, q = value depends on condition, r = reserved bit, do not modify. Shaded cells
are unimplemented, read as 0.
Note 1: Bit 7 and bit 6 are cleared by user software or by a POR.
2: Bit 21 of the PC is only available in Serial Programming modes.
3: Reset value is 0 when Two-Speed Start-up is enabled and 1 if disabled.
4: Alternate names and definitions for these bits when the MSSP module is operating in I2C Slave mode.
5: These bits and/or registers are only available in 100-pin devices; otherwise, they are unimplemented and read as 0. Reset values shown
apply only to 100-pin devices.
6: These bits and/or registers are only available in 80-pin and 100-pin devices; in 64-pin devices, they are unimplemented and read as 0. Reset
values are shown for 100-pin devices.
7: In Microcontroller mode, the bits in this register are unwritable and read as 0.
8: PLLEN is only available when either ECPLL or HSPLL Oscillator mode is selected; otherwise, read as 0.
9: Implemented in 100-pin devices in Microcontroller mode only.
DS39762B-page 82
Preliminary
PIC18F97J60 FAMILY
TABLE 5-5:
File Name
T3CON
PSPCON(5)
SPBRG1
Bit 6
Bit 5
RD16
T3CCP2
IBF
OBF
Values on Details on
POR, BOR
Page:
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
T3CKPS1
T3CKPS0
T3CCP1
T3SYNC
TMR3CS
TMR3ON
0000 0000
IBOV
PSPMODE
0000 ----
61, 160
0000 0000
61, 304
61, 175
RCREG1
0000 0000
61, 311
TXREG1
xxxx xxxx
61, 313
TXSTA1
CSRC
TX9
TXEN
SYNC
SENDB
BRGH
TRMT
TX9D
0000 0010
61, 304
RCSTA1
SPEN
RX9
SREN
CREN
ADDEN
FERR
OERR
RX9D
0000 000x
61, 304
---- ----
61, 96
EECON2
EECON1
FREE
WRERR
WREN
WR
---0 x00-
61, 97
IPR3
SSP2IP(5)
BCL2IP(5)
RC2IP(6)
TX2IP(6)
TMR4IP
CCP5IP
CCP4IP
CCP3IP
1111 1111
61, 132
PIR3
SSP2IF(5)
BCL2IF(5)
RC2IF(6)
TX2IF(6)
TMR4IF
CCP5IF
CCP4IF
CCP3IF
0000 0000
61, 126
PIE3
SSP2IE(5)
(5)
(6)
TX2IE(6)
TMR4IE
CCP5IE
CCP4IE
CCP3IE
0000 0000
61, 129
IPR2
OSCFIP
CMIP
ETHIP
BCL1IP
TMR3IP
CCP2IP
1111 1-11
61, 131
PIR2
OSCFIF
CMIF
ETHIF
BCL1IF
TMR3IF
CCP2IF
0000 0-00
61, 125
PIE2
OSCFIE
CMIE
ETHIE
BCL1IE
TMR3IE
CCP2IE
0000 0-00
61, 128
IPR1
PSPIP(9)
ADIP
RC1IP
TX1IP
SSP1IP
CCP1IP
TMR2IP
TMR1IP
1111 1111
61, 130
PIR1
PSPIF(9)
ADIF
RC1IF
TX1IF
SSP1IF
CCP1IF
TMR2IF
TMR1IF
0000 0000
61, 124
PIE1
BCL2IE
RC2IE
PSPIE(9)
ADIE
RC1IE
TX1IE
SSP1IE
CCP1IE
TMR2IE
TMR1IE
0000 0000
61, 127
MEMCON(5,7)
EBDIS
WAIT1
WAIT0
WM1
WM0
0-00 --00
61, 106
OSCTUNE
PPST1
PLLEN(8)
PPST0
PPRE
0000 ----
61, 41
TRISJ(6)
TRISJ7(5)
TRISJ6(5)
TRISJ5(6)
TRISJ4(6)
TRISJ3(5)
TRISJ2(5)
TRISJ1(5)
TRISJ0(5)
1111 1111
61, 158
TRISH(6)
TRISH7(6)
TRISH6(6)
TRISH5(6)
TRISH4(6)
TRISH3(6)
TRISH2(6)
TRISH1(6)
TRISH0(6)
1111 1111
61, 156
TRISG
TRISG7(5)
TRISG6(5)
TRISG5(5)
TRISG4
TRISG3(6)
TRISG2(6)
TRISG1(6)
TRISG0(6)
1111 1111
61, 154
TRISF
TRISF7
TRISF6
TRISF5
TRISF4
TRISF3
TRISF2
TRISF1
TRISF0(5)
1111 1111
61, 151
TRISE
TRISE7(6)
TRISE6(6)
TRISE5
TRISE4
TRISE3
TRISE2
TRISE1
TRISE0
1111 1111
61, 149
TRISD
TRISD7(5)
TRISD6(5)
TRISD5(5)
TRISD4(5)
TRISD3(5)
TRISD2
TRISD1
TRISD0
1111 1111
61, 146
TRISC
TRISC7
TRISC6
TRISC5
TRISC4
TRISC3
TRISC2
TRISC1
TRISC0
1111 1111
61, 143
TRISB
TRISB7
TRISB6
TRISB5
TRISB4
TRISB3
TRISB2
TRISB1
TRISB0
1111 1111
61, 140
TRISA
TRISA5
TRISA4
TRISA3
TRISA2
TRISA1
TRISA0
--11 1111
61, 137
LATJ(6)
LATJ7(5)
LATJ6(5)
LATJ5(6)
LATJ4(6)
LATJ3(5)
LATJ2(5)
LATJ1(5)
LATJ0(5)
xxxx xxxx
61, 158
LATH(6)
LATH7(6)
LATH6(6)
LATH5(6)
LATH4(6)
LATH3(6)
LATH2(6)
LATH1(6)
LATH0(6)
xxxx xxxx
61, 156
LATG
LATG7(5)
LATG6(5)
LATG5(5)
LATG4
LATG3(6)
LATG2(6)
LATG1(6)
LATG0(6)
xxxx xxxx
62, 154
LATF
LATF7
LATF6
LATF5
LATF4
LATF3
LATF2
LATF1
LATF0(5)
xxxx xxxx
62, 151
LATE
LATE7(6)
LATE6(6)
LATE5
LATE4
LATE3
LATE2
LATE1
LATE0
xxxx xxxx
62, 149
LATD
LATD7(5)
LATD6(5)
LATD5(5)
LATD4(5)
LATD3(5)
LATD2
LATD1
LATD0
xxxx xxxx
62, 146
LATC
LATC7
LATC6
LATC5
LATC4
LATC3
LATC2
LATC1
LATC0
xxxx xxxx
62, 143
LATB
LATB7
LATB6
LATB5
LATB4
LATB3
LATB2
LATB1
LATB0
xxxx xxxx
62, 140
LATA
RDPU
REPU
LATA5
LATA4
LATA3
LATA2
LATA1
LATA0
00xx xxxx
62, 137
PORTJ(6)
RJ7(5)
RJ6(5)
RJ5(6)
RJ4(6)
RJ3(5)
RJ2(5)
RJ1(5)
RJ0(5)
xxxx xxxx
62, 158
PORTH(6)
RH7(6)
RH6(6)
RH5(6)
RH4(6)
RH3(6)
RH2(6)
RH1(6)
RH0(6)
0000 xxxx
62, 156
PORTG
RG7(5)
RG6(5)
RG5(5)
RG4
RG3(6)
RG2(6)
RG1(6)
RG0(6)
111x xxxx
62, 154
Legend: x = unknown, u = unchanged, - = unimplemented, read as 0, q = value depends on condition, r = reserved bit, do not modify. Shaded cells
are unimplemented, read as 0.
Note 1: Bit 7 and bit 6 are cleared by user software or by a POR.
2: Bit 21 of the PC is only available in Serial Programming modes.
3: Reset value is 0 when Two-Speed Start-up is enabled and 1 if disabled.
4: Alternate names and definitions for these bits when the MSSP module is operating in I2C Slave mode.
5: These bits and/or registers are only available in 100-pin devices; otherwise, they are unimplemented and read as 0. Reset values shown
apply only to 100-pin devices.
6: These bits and/or registers are only available in 80-pin and 100-pin devices; in 64-pin devices, they are unimplemented and read as 0. Reset
values are shown for 100-pin devices.
7: In Microcontroller mode, the bits in this register are unwritable and read as 0.
8: PLLEN is only available when either ECPLL or HSPLL Oscillator mode is selected; otherwise, read as 0.
9: Implemented in 100-pin devices in Microcontroller mode only.
Preliminary
DS39762B-page 83
PIC18F97J60 FAMILY
TABLE 5-5:
File Name
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
PORTF
RF7
RF6
RF5
RF4
RF3
RF2
RF1
RF0(5)
0000 0000
62, 151
PORTE
RE7(6)
RE6
RE5
RE4
RE3
RE2
RE1
RE0
xxxx xxxx
62, 149
PORTD
RD7(5)
RD6(5)
RD5(5)
RD4(5)
RD3(5)
RD2
RD1
RD0
xxxx xxxx
62, 146
PORTC
RC7
RC6
RC5
RC4
RC3
RC2
RC1
RC0
xxxx xxxx
62, 143
PORTB
RB7
RB6
RB5
RB4
RB3
RB2
RB1
RB0
xxxx xxxx
62, 140
PORTA
RJPU(6)
RA5
RA4
RA3
RA2
RA1
RA0
0-0x 0000
62, 137
SPBRGH1
BAUDCON1
SPBRGH2
BAUDCON2
ERDPTH
ERDPTL
ECCP1DEL
(6)
RCIDL
RXDTP
TXCKP
BRG16
WUE
ABDEN
BRG16
WUE
ABDEN
RCIDL
RXDTP
TXCKP
P1DC6
P1DC5
P1DC4
P1DC3
P1DC2
P1DC1
P1DC0
0000 0000
62, 304
0100 0-00
62, 302
0000 0000
62, 304
0100 0-00
62, 302
---0 0101
62, 209
1111 1010
62, 209
0000 0000
62, 200
62, 179
TMR4
Timer4 Register
0000 0000
PR4
1111 1111
62, 179
-000 0000
62, 179
T4CON
T4OUTPS3
T4OUTPS2
T4OUTPS1
T4OUTPS0
TMR4ON
T4CKPS1
T4CKPS0
CCPR4H
xxxx xxxx
62, 185
CCPR4L
xxxx xxxx
62, 185
--00 0000
63, 181
CCP4CON
DC4B1
DC4B0
CCP4M3
CCP4M2
CCP4M1
CCP4M0
CCPR5H
xxxx xxxx
63, 185
CCPR5L
xxxx xxxx
63, 185
--00 0000
63, 181
63, 304
CCP5CON
DC5B1
DC5B0
CCP5M3
CCP5M2
CCP5M1
CCP5M0
SPBRG2
0000 0000
RCREG2
0000 0000
63, 311
TXREG2
0000 0000
63, 313
TXSTA2
CSRC
TX9
TXEN
SYNC
SENDB
BRGH
TRMT
TX9D
0000 0010
63, 300
RCSTA2
SPEN
RX9
SREN
CREN
ADDEN
FERR
OERR
RX9D
0000 000x
63, 301
ECCP3AS1
ECCP3AS0
PSS3AC1
PSS3AC0
PSS3BD1
PSS3BD0
0000 0000
63, 201
P3DC5
P3DC4
P3DC3
P3DC2
P3DC1
P3DC0
0000 0000
63, 200
ECCP2AS1
ECCP2AS0
PSS2AC1
PSS2AC0
PSS2BD1
PSS2BD0
0000 0000
63, 201
P2DC5
P2DC4
P2DC3
P2DC2
P2DC1
P2DC0
0000 0000
63, 200
ECCP3AS
ECCP3DEL
ECCP2AS
ECCP2DEL
ECCP3ASE ECCP3AS2
P3RSEN
P3DC6
ECCP2ASE ECCP2AS2
P2RSEN
P2DC6
SSP2BUF
xxxx xxxx
63, 263
SSP2ADD
MSSP2 Address Register (I2C Slave mode), MSSP2 Baud Rate Reload Register (I2C Master mode)
0000 0000
63, 263
SSP2STAT
SMP
CKE
D/A
R/W
UA
BF
0000 0000
63, 254
SSP2CON1
WCOL
SSPOV
SSPEN
CKP
SSPM3
SSPM2
SSPM1
SSPM0
0000 0000
63, 255,
265
0000 0000
63, 266
xxxx xxxx
63, 209
SSP2CON2
EDATA
EIR
ECON2
GCEN
ACKSTAT
ACKDT
ACKEN
RCEN
PEN
RSEN
SEN
GCEN
ACKSTAT
ADMSK5(4)
ADMSK4(4)
ADMSK3(4)
ADMSK2(4)
ADMSK1(4)
SEN
PKTIF
DMAIF
LINKIF
TXIF
TXERIF
RXERIF
-000 0-00
63, 226
AUTOINC
PKTDEC
ETHEN
100- ----
63, 213
Legend: x = unknown, u = unchanged, - = unimplemented, read as 0, q = value depends on condition, r = reserved bit, do not modify. Shaded cells
are unimplemented, read as 0.
Note 1: Bit 7 and bit 6 are cleared by user software or by a POR.
2: Bit 21 of the PC is only available in Serial Programming modes.
3: Reset value is 0 when Two-Speed Start-up is enabled and 1 if disabled.
4: Alternate names and definitions for these bits when the MSSP module is operating in I2C Slave mode.
5: These bits and/or registers are only available in 100-pin devices; otherwise, they are unimplemented and read as 0. Reset values shown
apply only to 100-pin devices.
6: These bits and/or registers are only available in 80-pin and 100-pin devices; in 64-pin devices, they are unimplemented and read as 0. Reset
values are shown for 100-pin devices.
7: In Microcontroller mode, the bits in this register are unwritable and read as 0.
8: PLLEN is only available when either ECPLL or HSPLL Oscillator mode is selected; otherwise, read as 0.
9: Implemented in 100-pin devices in Microcontroller mode only.
DS39762B-page 84
Preliminary
PIC18F97J60 FAMILY
TABLE 5-5:
File Name
Bit 6
Bit 5
ESTAT
BUFER
EIE
PKTIE
DMAIE
EDMACSH
EDMACSL
EDMADSTH
EDMADSTL
EDMANDH
EDMANDL
EDMASTH
EDMASTL
ERXWRPTH
ERXWRPTL
ERXRDPTH
ERXRDPTL
ERXNDH
ERXNDL
ERXSTH
ERXSTL
ETXNDH
ETXNDL
ETXSTH
ETXSTL
EWRPTH
Bit 1
Bit 0
RXBUSY
TXABRT
PHYRDY
-0-0 -000
LINKIE
TXIE
TXERIE
RXERIE
-000 0-00
63, 225
0000 0000
63, 250
0000 0000
63, 250
EPKTCNT
EPMOH
Bit 2
UCEN
ANDOR
CRCEN
Values on Details on
POR, BOR
Page:
Bit 3
EWRPTL
ERXFCON
Bit 4
PMEN
MPEN
HTEN
MCEN
BCEN
63, 213
---0 0000
63, 250
0000 0000
63, 250
---0 0000
63, 250
0000 0000
63, 250
---0 0000
63, 250
0000 0000
63, 250
---0 0000
63, 210
0000 0000
63, 210
---0 0101
63, 210
1111 1010
63, 210
---1 1111
63, 210
1111 1111
63, 210
---0 0101
63, 210
1111 1010
63, 210
---0 0000
64, 211
0000 0000
64, 211
---0 0000
64, 211
0000 0000
64, 211
---0 0000
64, 209
0000 0000
64, 209
0000 0000
64, 237
1010 0001
64, 245
---0 0000
64, 248
0000 0000
64, 248
EPMOL
EPMCSH
0000 0000
64, 248
EPMCSL
0000 0000
64, 248
EPMM7
0000 0000
64, 248
EPMM6
0000 0000
64, 248
EPMM5
0000 0000
64, 248
EPMM4
0000 0000
64, 248
EPMM3
0000 0000
64, 248
EPMM2
0000 0000
64, 248
EPMM1
0000 0000
64, 248
EPMM0
0000 0000
64, 248
Legend: x = unknown, u = unchanged, - = unimplemented, read as 0, q = value depends on condition, r = reserved bit, do not modify. Shaded cells
are unimplemented, read as 0.
Note 1: Bit 7 and bit 6 are cleared by user software or by a POR.
2: Bit 21 of the PC is only available in Serial Programming modes.
3: Reset value is 0 when Two-Speed Start-up is enabled and 1 if disabled.
4: Alternate names and definitions for these bits when the MSSP module is operating in I2C Slave mode.
5: These bits and/or registers are only available in 100-pin devices; otherwise, they are unimplemented and read as 0. Reset values shown
apply only to 100-pin devices.
6: These bits and/or registers are only available in 80-pin and 100-pin devices; in 64-pin devices, they are unimplemented and read as 0. Reset
values are shown for 100-pin devices.
7: In Microcontroller mode, the bits in this register are unwritable and read as 0.
8: PLLEN is only available when either ECPLL or HSPLL Oscillator mode is selected; otherwise, read as 0.
9: Implemented in 100-pin devices in Microcontroller mode only.
Preliminary
DS39762B-page 85
PIC18F97J60 FAMILY
TABLE 5-5:
File Name
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Values on Details on
POR, BOR
Page:
EHT7
0000 0000
64, 244
EHT6
0000 0000
64, 244
EHT5
0000 0000
64, 244
EHT4
0000 0000
64, 244
EHT3
0000 0000
64, 244
EHT2
0000 0000
64, 244
EHT1
0000 0000
64, 244
EHT0
0000 0000
64, 244
MIRDH
0000 0000
64, 217
MIRDL
0000 0000
64, 217
MIWRH
0000 0000
64, 217
MIWRL
0000 0000
64, 217
---0 0000
64, 217
MIREGADR
MICMD
---- --00
64, 216
MAMXFLH
MIISCAN
MIIRD
0000 0110
64, 230
MAMXFLL
0000 0000
64, 230
-000 0000
65, 230
MAIPGH
MAIPGL
-000 0000
65, 230
MABBIPG
BBIPG6
BBIPG5
BBIPG4
BBIPG3
BBIPG2
BBIPG1
BBIPG0
-000 0000
65, 231
MACON4
DEFER
-000 --00
65, 216
MACON3
PADCFG2
PADCFG1
PADCFG0
TXCRCEN
PHDREN
HFRMEN
FRMLNEN
FULDPX
0000 0000
65, 215
MACON1
TXPAUS
RXPAUS
PASSALL
MARXEN
---0 0000
65, 214
65, 243
EPAUSH
0001 0000
EPAUSL
0000 0000
65, 243
EFLOCON
MISTAT
FCEN1
FCEN0
---- -000
65, 243
NVALID
SCAN
BUSY
---- 0000
65, 217
MAADR2
0000 0000
65, 230
MAADR1
0000 0000
65, 230
MAADR4
0000 0000
65, 230
MAADR3
0000 0000
65, 230
MAADR6
0000 0000
65, 230
MAADR5
0000 0000
65, 230
Legend: x = unknown, u = unchanged, - = unimplemented, read as 0, q = value depends on condition, r = reserved bit, do not modify. Shaded cells
are unimplemented, read as 0.
Note 1: Bit 7 and bit 6 are cleared by user software or by a POR.
2: Bit 21 of the PC is only available in Serial Programming modes.
3: Reset value is 0 when Two-Speed Start-up is enabled and 1 if disabled.
4: Alternate names and definitions for these bits when the MSSP module is operating in I2C Slave mode.
5: These bits and/or registers are only available in 100-pin devices; otherwise, they are unimplemented and read as 0. Reset values shown
apply only to 100-pin devices.
6: These bits and/or registers are only available in 80-pin and 100-pin devices; in 64-pin devices, they are unimplemented and read as 0. Reset
values are shown for 100-pin devices.
7: In Microcontroller mode, the bits in this register are unwritable and read as 0.
8: PLLEN is only available when either ECPLL or HSPLL Oscillator mode is selected; otherwise, read as 0.
9: Implemented in 100-pin devices in Microcontroller mode only.
DS39762B-page 86
Preliminary
PIC18F97J60 FAMILY
5.3.6
STATUS REGISTER
REGISTER 5-3:
register then reads back as 000u u1uu. It is recommended, therefore, that only BCF, BSF, SWAPF, MOVFF
and MOVWF instructions are used to alter the STATUS
register because these instructions do not affect the Z,
C, DC, OV or N bits in the STATUS register.
For other instructions not affecting any Status bits, see
the instruction set summaries in Table 25-2 and
Table 25-3.
Note:
STATUS REGISTER
U-0
U-0
U-0
R/W-x
R/W-x
R/W-x
R/W-x
R/W-x
OV
DC(1)
C(2)
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
-n = Value at POR
1 = Bit is set
0 = Bit is cleared
x = Bit is unknown
bit 7-5
Unimplemented: Read as 0
bit 4
N: Negative bit
This bit is used for signed arithmetic (2s complement). It indicates whether the result was negative
(ALU MSb = 1).
1 = Result was negative
0 = Result was positive
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 non-zero
bit 1
bit 0
C: Carry/Borrow bit(2)
For ADDWF, ADDLW, SUBLW and SUBWF instructions:
1 = A carry-out from the Most Significant bit of the result occurred
0 = No carry-out from the Most Significant bit of the result occurred
Note 1:
2:
For Borrow, the polarity is reversed. A subtraction is executed by adding the 2s complement of the second
operand. For rotate (RRF, RLF) instructions, this bit is loaded with either bit 4 or bit 3 of the source register.
For Borrow, the polarity is reversed. A subtraction is executed by adding the 2s 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.
Preliminary
DS39762B-page 87
PIC18F97J60 FAMILY
5.4
Note:
5.4.2
5.4.3
5.4.1
EXAMPLE 5-5:
DIRECT ADDRESSING
DS39762B-page 88
INDIRECT ADDRESSING
NEXT
LFSR
CLRF
BTFSS FSR0H, 1
BRA
CONTINUE
Preliminary
NEXT
;
;
;
;
;
;
;
;
Clear INDF
register then
inc pointer
All done with
Bank1?
NO, clear next
YES, continue
PIC18F97J60 FAMILY
5.4.3.1
FIGURE 5-9:
INDIRECT ADDRESSING
000h
Bank 0
ADDWF, INDF1, 1
100h
Bank 1
200h
Bank 2
300h
FSR1H:FSR1L
7
x x x x 1 1 1 1
1 1 0 0 1 1 0 0
Bank 3
through
Bank 13
Bank 14
F00h
FFFh
Bank 15
Data Memory
Preliminary
DS39762B-page 89
PIC18F97J60 FAMILY
5.4.3.2
5.4.3.3
DS39762B-page 90
5.5
5.6
Preliminary
PIC18F97J60 FAMILY
5.6.1
5.6.2
INSTRUCTIONS AFFECTED BY
INDEXED LITERAL OFFSET MODE
Preliminary
DS39762B-page 91
PIC18F97J60 FAMILY
FIGURE 5-10:
000h
060h
Bank 0
100h
00h
Bank 1
through
Bank 14
60h
Valid Range
for f
FFh
F00h
Access RAM
Bank 15
F40h
SFRs
FFFh
Data Memory
000h
Bank 0
060h
100h
001001da ffffffff
Bank 1
through
Bank 14
FSR2H
FSR2L
F00h
Bank 15
F40h
SFRs
FFFh
Data Memory
BSR
00000000
000h
Bank 0
060h
100h
001001da ffffffff
Bank 1
through
Bank 14
F00h
Bank 15
F40h
SFRs
FFFh
Data Memory
DS39762B-page 92
Preliminary
PIC18F97J60 FAMILY
5.6.3
FIGURE 5-11:
Remapping of the Access Bank applies only to operations using the Indexed Literal Offset mode. Operations
that use the BSR (Access RAM bit is 1) will continue
to use Direct Addressing as before. Any indirect or
indexed operation that explicitly uses any of the indirect
file operands (including FSR2) will continue to operate
as standard Indirect Addressing. Any instruction that
uses the Access Bank, but includes a register address
of greater than 05Fh, will use Direct Addressing and
the normal Access Bank map.
5.6.4
Example Situation:
ADDWF f, d, a
FSR2H:FSR2L = 120h
000h
05Fh
100h
120h
17Fh
Bank 0
Window
00h
Bank 1
Bank 1 Window
200h
5Fh
60h
Not Accessible
Bank 2
through
Bank 14
SFRs
FFh
Access Bank
F00h
Bank 15
F60h
FFFh
SFRs
Data Memory
Preliminary
DS39762B-page 93
PIC18F97J60 FAMILY
NOTES:
DS39762B-page 94
Preliminary
PIC18F97J60 FAMILY
6.0
6.1
FIGURE 6-1:
Program Memory
Table Pointer(1)
TBLPTRU
TBLPTRH
Program Memory
(TBLPTR)
Note 1:
Preliminary
DS39762B-page 95
PIC18F97J60 FAMILY
FIGURE 6-2:
Program Memory
Holding Registers
Table Pointer(1)
TBLPTRU
TBLPTRH
TABLAT
Program Memory
(TBLPTR)
Note 1:
6.2
Table Pointer actually points to one of 64 holding registers, the address of which is determined by
TBLPTRL<5:0>. The process for physically writing data to the program memory array is discussed in
Section 6.5 Writing to Flash Program Memory.
Control Registers
EECON1 register
EECON2 register
TABLAT register
TBLPTR registers
6.2.1
DS39762B-page 96
Preliminary
PIC18F97J60 FAMILY
REGISTER 6-1:
U-0
U-0
U-0
R/W-0
R/W-x
R/W-0
R/S-0
U-0
FREE
WRERR
WREN
WR
bit 7
bit 0
Legend:
S = Settable bit
R = Readable bit
W = Writable bit
-n = Value at POR
1 = Bit is set
0 = Bit is cleared
x = Bit is unknown
bit 7-5
Unimplemented: Read as 0
bit 4
bit 3
bit 2
bit 1
bit 0
Unimplemented: Read as 0
Preliminary
DS39762B-page 97
PIC18F97J60 FAMILY
6.2.2
6.2.4
6.2.3
TABLE 6-1:
Example
TBLRD*
TBLWT*
TBLRD*+
TBLWT*+
TBLRD*TBLWT*-
TBLRD+*
TBLWT+*
FIGURE 6-3:
21
16
15
TBLPTRH
TBLPTRL
Table Erase
TBLPTR<20:10>
Table Write
TBLPTR<20:6>
DS39762B-page 98
Preliminary
PIC18F97J60 FAMILY
6.3
FIGURE 6-4:
Program Memory
TBLPTR = xxxxx0
TBLPTR = xxxxx1
Instruction Register
(IR)
EXAMPLE 6-1:
FETCH
TBLRD
TABLAT
Read Register
MOVLW
MOVWF
MOVLW
MOVWF
MOVLW
MOVWF
CODE_ADDR_UPPER
TBLPTRU
CODE_ADDR_HIGH
TBLPTRH
CODE_ADDR_LOW
TBLPTRL
READ_WORD
TBLRD*+
MOVF
MOVWF
TBLRD*+
MOVFW
MOVF
TABLAT, W
WORD_EVEN
TABLAT, W
WORD_ODD
Preliminary
DS39762B-page 99
PIC18F97J60 FAMILY
6.4
EXAMPLE 6-2:
6.4.1
3.
4.
5.
6.
7.
8.
CODE_ADDR_UPPER
TBLPTRU
CODE_ADDR_HIGH
TBLPTRH
CODE_ADDR_LOW
TBLPTRL
BSF
BSF
BCF
MOVLW
MOVWF
MOVLW
MOVWF
BSF
BSF
EECON1,
EECON1,
INTCON,
55h
EECON2
0AAh
EECON2
EECON1,
INTCON,
ERASE_ROW
Required
Sequence
DS39762B-page 100
WREN
FREE
GIE
; write 55h
WR
GIE
; write 0AAh
; start erase (CPU stall)
; re-enable interrupts
Preliminary
PIC18F97J60 FAMILY
6.5
FIGURE 6-5:
8
TBLPTR = xxxxx0
TBLPTR = xxxxx1
Holding Register
TBLPTR = xxxx3F
TBLPTR = xxxxx2
Holding Register
Holding Register
Holding Register
Program Memory
6.5.1
2.
3.
4.
5.
6.
7.
8.
Preliminary
DS39762B-page 101
PIC18F97J60 FAMILY
EXAMPLE 6-3:
CODE_ADDR_UPPER
TBLPTRU
CODE_ADDR_HIGH
TBLPTRH
CODE_ADDR_LOW
TBLPTRL
BSF
BSF
BCF
MOVLW
MOVWF
MOVLW
MOVWF
BSF
BSF
MOVLW
MOVWF
EECON1, WREN
EECON1, FREE
INTCON, GIE
55h
EECON2
0AAh
EECON2
EECON1, WR
INTCON, GIE
D'16'
WRITE_COUNTER
MOVLW
MOVWF
MOVLW
MOVWF
MOVLW
MOVWF
D'64'
COUNTER
BUFFER_ADDR_HIGH
FSR0H
BUFFER_ADDR_LOW
FSR0L
ERASE_BLOCK
; write 55h
; write 0AAh
; start erase (CPU stall)
; re-enable interrupts
; Need to write 16 blocks of 64 to write
; one erase block of 1024
RESTART_BUFFER
; point to buffer
FILL_BUFFER
...
WRITE_BUFFER
MOVLW
MOVWF
D64
COUNTER
WRITE_BYTE_TO_HREGS
MOVFF
POSTINC0, WREG
MOVWF
TABLAT
TBLWT+*
DECFSZ
BRA
COUNTER
WRITE_BYTE_TO_HREGS
BSF
BCF
MOVLW
MOVWF
MOVLW
MOVWF
BSF
BSF
BCF
EECON1,
INTCON,
55h
EECON2
0AAh
EECON2
EECON1,
INTCON,
EECON1,
DECFSZ
BRA
WRITE_COUNTER
RESTART_BUFFER
;
;
;
;
;
PROGRAM_MEMORY
Required
Sequence
DS39762B-page 102
WREN
GIE
WR
GIE
WREN
write 0AAh
start program (CPU stall)
re-enable interrupts
disable write to memory
Preliminary
PIC18F97J60 FAMILY
6.5.2
WRITE VERIFY
6.5.4
6.5.3
UNEXPECTED TERMINATION OF
WRITE OPERATION
TABLE 6-2:
PROTECTION AGAINST
SPURIOUS WRITES
6.6
Name
Bit 7
Bit 6
Bit 5
TBLPTRU
bit 21
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Reset
Values
on Page:
59
59
59
TABLAT
INTCON
EECON2
EECON1
59
INT0IE
FREE
RBIE
WRERR
TMR0IF
INT0IF
RBIF
59
WREN
WR
61
61
Legend: = unimplemented, read as 0. Shaded cells are not used during Flash/EEPROM access.
Preliminary
DS39762B-page 103
PIC18F97J60 FAMILY
NOTES:
DS39762B-page 104
Preliminary
PIC18F97J60 FAMILY
7.0
Note:
TABLE 7-1:
Name
Bit
RD0/AD0
PORTD
RD1/AD1
PORTD
RD2/AD2
PORTD
RD3/AD3
PORTD
RD4/AD4
PORTD
RD5/AD5
PORTD
RD6/AD6
PORTD
RD7/AD7
PORTD
RE0/AD8
PORTE
RE1/AD9
PORTE
RE2/AD10
PORTE
RE3/AD11
PORTE
RE4/AD12
PORTE
RE5/AD13
PORTE
RE6/AD14
PORTE
RE7/AD15
PORTE
RH0/A16
PORTH
Address bit 16
RH1/A17
PORTH
Address bit 17
RH2/A18
PORTH
Address bit 18
RH3/A19
PORTH
Address bit 19
RJ0/ALE
PORTJ
RJ1/OE
PORTJ
RJ2/WRL
PORTJ
RJ3/WRH
PORTJ
RJ4/BA0
PORTJ
RJ5/CE
PORTJ
RJ6/LB
PORTJ
RJ7/UB
PORTJ
Note:
For the sake of clarity, only I/O port and external bus assignments are shown here. One or more additional
multiplexed features may be available on some pins.
Preliminary
DS39762B-page 105
PIC18F97J60 FAMILY
7.1
REGISTER 7-1:
R/W-0
U-0
R/W-0
R/W-0
U-0
U-0
R/W-0
R/W-0
EBDIS
WAIT1
WAIT0
WM1
WM0
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
-n = Value at POR
1 = Bit is set
0 = Bit is cleared
x = Bit is unknown
bit 7
bit 6
Unimplemented: Read as 0
bit 5-4
WAIT1:WAIT0: Table Reads and Writes Bus Cycle Wait Count bits
11 = Table reads and writes will wait 0 TCY
10 = Table reads and writes will wait 1 TCY
01 = Table reads and writes will wait 2 TCY
00 = Table reads and writes will wait 3 TCY
bit 3-2
Unimplemented: Read as 0
bit 1-0
WM1:WM0: TBLWT Operation with 16-Bit Data Bus Width Select bits
1x = Word Write mode: WRH active when TABLAT is written to and TBLPTR contains an odd
address. When TBLPTR contains an even address, writing to TABLAT loads a holding latch with
the value written.
01 = Byte Select mode: TABLAT data copied on both MSB and LSB; WRH and (UB or LB)
will activate
00 = Byte Write mode: TABLAT data copied on both MSB and LSB; WRH or WRL will activate
DS39762B-page 106
Preliminary
PIC18F97J60 FAMILY
7.2
7.2.1
The PIC18F97J60 family of devices can be independently configured for different address and data widths
on the same memory bus. Both address and data
widths are set by Configuration bits in the CONFIG3L
register. As Configuration bits, this means that these
options can only be configured by programming the
device and are not controllable in software.
The BW bit selects an 8-bit or 16-bit data bus width.
Setting this bit (default) selects a data width of 16 bits.
The EMB1:EMB0 bits determine both the program
memory operating mode and the address bus width. The
available options are 20-bit, 16-bit and 12-bit, as well as
the default Microcontroller mode (external bus disabled).
Selecting a 16-bit or 12-bit width makes a corresponding
number of high-order lines available for I/O functions.
These pins are no longer affected by the setting of the
EBDIS bit. For example, selecting a 16-Bit Addressing
mode (EMB1:EMB0 = 01) disables A19:A16 and allows
the PORTH<3:0> bits to function without interruptions
from the bus. Using the smaller address widths allows
users to tailor the memory bus to the size of the external
memory space for a particular design while freeing up
pins for dedicated I/O operation.
Because the EMB bits have the effect of disabling pins for
memory bus operations, it is important to always select
an address width at least equal to the data width. If a
12-bit address width is used with a 16-bit data width, the
upper four bits of data will not be available on the bus.
All combinations of address and data widths require
multiplexing of address and data information on the
same lines. The address and data multiplexing, as well
as I/O ports made available by the use of smaller
address widths, are summarized in Table 7-2.
TABLE 7-2:
Data Width
7.2.2
ADDRESS AND DATA LINES FOR DIFFERENT ADDRESS AND DATA WIDTHS
Address Width
16-bit
AD7:AD0
(PORTD<7:0>)
20-bit
16-bit
16-bit
21-BIT ADDRESSING
12-bit
8-bit
20-bit
AD15:AD0
(PORTD<7:0>,
PORTE<7:0>)
Preliminary
Ports Available
for I/O
AD11:AD8
(PORTE<3:0>)
PORTE<7:4>,
All of PORTH
AD15:AD8
(PORTE<7:0>)
All of PORTH
A19:A16, AD15:AD8
(PORTH<3:0>,
PORTE<7:0>)
All of PORTH
A19:A16
(PORTH<3:0>)
DS39762B-page 107
PIC18F97J60 FAMILY
7.3
Wait States
7.4
7.5
7.6
DS39762B-page 108
Preliminary
PIC18F97J60 FAMILY
7.6.1
FIGURE 7-1:
PIC18F97J60
AD<7:0>
(MSB)
373
A<19:0>
D<15:8>
(LSB)
A<x:0>
A<x:0>
D<7:0>
D<7:0>
CE
AD<15:8>
373
OE
D<7:0>
CE
WR
(2)
OE
WR(2)
ALE
A<19:16>(1)
CE
OE
WRH
WRL
Address Bus
Data Bus
Control Lines
Note 1:
2:
Upper order address lines are used only for 20-bit address widths.
This signal only applies to table writes. See Section 6.1 Table Reads and Table Writes.
Preliminary
DS39762B-page 109
PIC18F97J60 FAMILY
7.6.2
FIGURE 7-2:
PIC18F97J60
AD<7:0>
373
A<20:1>
D<15:0>
A<x:0>
JEDEC Word
EPROM Memory
D<15:0>
CE
AD<15:8>
OE
WR(2)
373
ALE
A<19:16>(1)
CE
OE
WRH
Address Bus
Data Bus
Control Lines
Note 1:
2:
Upper order address lines are used only for 20-bit address widths.
This signal only applies to table writes. See Section 6.1 Table Reads and Table Writes.
DS39762B-page 110
Preliminary
PIC18F97J60 FAMILY
7.6.3
FIGURE 7-3:
PIC18F97J60
AD<7:0>
373
A<20:1>
A<x:1>
JEDEC Word
FLASH Memory
D<15:0>
D<15:0>
138(3)
AD<15:8>
373
CE
A0
BYTE/WORD
ALE
OE WR(1)
A<19:16>(2)
OE
WRH
A<20:1>
A<x:1>
BA0
JEDEC Word
SRAM Memory
I/O
D<15:0>
CE
LB
UB
LB
UB
D<15:0>
OE WR(1)
Address Bus
Data Bus
Control Lines
Note 1:
This signal only applies to table writes. See Section 6.1 Table Reads and Table Writes.
2:
Upper order address lines are used only for 20-bit address width.
3:
Preliminary
DS39762B-page 111
PIC18F97J60 FAMILY
7.6.4
FIGURE 7-4:
Q2
Q3
Q4
Q1
Q2
Q3
Q4
Q1
Q2
A<19:16>
Q3
Q4
Q1
Q2
Q3
Q4
0Ch
CF33h
AD<15:0>
9256h
CE
ALE
OE
Memory
Cycle
Opcode Fetch
TBLRD*
from 000100h
Opcode Fetch
MOVLW 55h
from 000102h
TBLRD 92h
from 199E67h
Opcode Fetch
ADDLW 55h
from 000104h
Instruction
Execution
INST(PC 2)
TBLRD Cycle 1
TBLRD Cycle 2
MOVLW
FIGURE 7-5:
Q2
A<19:16>
AD<15:0>
Q3
Q4
Q1
Q2
00h
3AAAh
Q3
Q4
Q1
00h
0003h
3AABh
0E55h
CE
ALE
OE
Memory
Cycle
Opcode Fetch
SLEEP
from 007554h
Opcode Fetch
MOVLW 55h
from 007556h
Instruction
Execution
INST(PC 2)
SLEEP
DS39762B-page 112
Preliminary
PIC18F97J60 FAMILY
7.7
FIGURE 7-6:
373
A<19:0>
A<x:1>
A0
D<15:8>
D<7:0>
AD<15:8>(1)
CE
A<19:16>(1)
OE
WR(2)
BA0
CE
OE
WRL
Address Bus
Data Bus
Control Lines
Note 1:
2:
Upper order address bits are used only for 20-bit address width. The upper AD byte is used for all
address widths except 8-bit.
This signal only applies to table writes. See Section 6.1 Table Reads and Table Writes.
Preliminary
DS39762B-page 113
PIC18F97J60 FAMILY
7.7.1
FIGURE 7-7:
Q2
Q3
Q4
Q1
Q2
Q3
Q4
Q1
Q2
Q3
Q4
Q1
Q2
Q3
Q4
0Ch
A<19:16>
CFh
AD<15:8>
AD<7:0>
33h
92h
CE
ALE
OE
Memory
Cycle
Opcode Fetch
TBLRD*
from 000100h
Opcode Fetch
MOVLW 55h
from 000102h
TBLRD 92h
from 199E67h
Opcode Fetch
ADDLW 55h
from 000104h
Instruction
Execution
INST(PC 2)
TBLRD Cycle 1
TBLRD Cycle 2
MOVLW
FIGURE 7-8:
Q2
A<19:16>
Q4
Q1
Q2
3Ah
AAh
00h
Q3
Q4
Q1
00h
00h
AD<15:8>
AD<7:0>
Q3
3Ah
03h
ABh
0Eh
55h
BA0
CE
ALE
OE
Memory
Cycle
Opcode Fetch
SLEEP
from 007554h
Opcode Fetch
MOVLW 55h
from 007556h
Instruction
Execution
INST(PC 2)
SLEEP
DS39762B-page 114
Preliminary
PIC18F97J60 FAMILY
7.8
Operation in Power-Managed
Modes
Preliminary
DS39762B-page 115
PIC18F97J60 FAMILY
NOTES:
DS39762B-page 116
Preliminary
PIC18F97J60 FAMILY
8.0
8 x 8 HARDWARE MULTIPLIER
8.1
Introduction
EXAMPLE 8-1:
MOVF
MULWF
ARG1, W
ARG2
EXAMPLE 8-2:
8.2
8 x 8 UNSIGNED
MULTIPLY ROUTINE
;
; ARG1 * ARG2 ->
; PRODH:PRODL
8 x 8 SIGNED MULTIPLY
ROUTINE
MOVF
MULWF
ARG1, W
ARG2
BTFSC
SUBWF
ARG2, SB
PRODH, F
MOVF
BTFSC
SUBWF
ARG2, W
ARG1, SB
PRODH, F
;
;
;
;
;
Operation
TABLE 8-1:
Routine
8 x 8 unsigned
8 x 8 signed
16 x 16 unsigned
16 x 16 signed
Multiply Method
Without hardware multiply
Program
Memory
(Words)
Cycles
(Max)
@ 40 MHz
@ 10 MHz
@ 4 MHz
13
69
6.9 s
27.6 s
69 s
Time
Hardware multiply
100 ns
400 ns
1 s
33
91
9.1 s
36.4 s
91 s
Hardware multiply
600 ns
2.4 s
6 s
21
242
24.2 s
96.8 s
242 s
Hardware multiply
28
28
2.8 s
11.2 s
28 s
52
254
25.4 s
102.6 s
254 s
Hardware multiply
35
40
4.0 s
16.0 s
40 s
Preliminary
DS39762B-page 117
PIC18F97J60 FAMILY
Example 8-3 shows the sequence to do a 16 x 16
unsigned multiplication. Equation 8-1 shows the
algorithm that is used. The 32-bit result is stored in four
registers (RES3:RES0).
EQUATION 8-1:
RES3:RES0
=
=
EXAMPLE 8-3:
16 x 16 UNSIGNED
MULTIPLICATION
ALGORITHM
ARG1H:ARG1L ARG2H:ARG2L
(ARG1H ARG2H 216) +
(ARG1H ARG2L 28) +
(ARG1L ARG2H 28) +
(ARG1L ARG2L)
EQUATION 8-2:
EXAMPLE 8-4:
16 x 16 UNSIGNED
MULTIPLY ROUTINE
MOVF
MULWF
ARG1L, W
ARG2L
MOVFF
MOVFF
PRODH, RES1
PRODL, RES0
MOVF
MULWF
ARG1H, W
ARG2H
MOVFF
MOVFF
PRODH, RES3
PRODL, RES2
MOVF
MULWF
ARG1L, W
ARG2H
MOVF
ADDWF
MOVF
ADDWFC
CLRF
ADDWFC
PRODL, W
RES1, F
PRODH, W
RES2, F
WREG
RES3, F
MOVF
MULWF
ARG1H, W
ARG2L
MOVF
ADDWF
MOVF
ADDWFC
CLRF
ADDWFC
PRODL, W
RES1, F
PRODH, W
RES2, F
WREG
RES3, F
; ARG1L * ARG2L->
; PRODH:PRODL
;
;
ARG1L * ARG2H->
PRODH:PRODL
Add cross
products
ARG1H * ARG2L->
PRODH:PRODL
Add cross
products
MOVFF
MOVFF
PRODH, RES1
PRODL, RES0
MOVF
MULWF
ARG1H, W
ARG2H
MOVFF
MOVFF
PRODH, RES3
PRODL, RES2
MOVF
MULWF
ARG1L, W
ARG2H
MOVF
ADDWF
MOVF
ADDWFC
CLRF
ADDWFC
PRODL, W
RES1, F
PRODH, W
RES2, F
WREG
RES3, F
MOVF
MULWF
ARG1H, W
ARG2L
MOVF
ADDWF
MOVF
ADDWFC
CLRF
ADDWFC
PRODL, W
RES1, F
PRODH, W
RES2, F
WREG
RES3, F
BTFSS
BRA
MOVF
SUBWF
MOVF
SUBWFB
ARG2H, 7
SIGN_ARG1
ARG1L, W
RES2
ARG1H, W
RES3
; ARG2H:ARG2L neg?
; no, check ARG1
;
;
;
ARG1H, 7
CONT_CODE
ARG2L, W
RES2
ARG2H, W
RES3
; ARG1H:ARG1L neg?
; no, done
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
DS39762B-page 118
ARG1L, W
ARG2L
;
;
;
;
;
;
;
;
;
;
MOVF
MULWF
;
;
;
;
;
;
;
;
;
16 x 16 SIGNED
MULTIPLY ROUTINE
;
; ARG1H * ARG2H->
; PRODH:PRODL
;
;
16 x 16 SIGNED
MULTIPLICATION
ALGORITHM
;
SIGN_ARG1
BTFSS
BRA
MOVF
SUBWF
MOVF
SUBWFB
;
CONT_CODE
:
Preliminary
PIC18F97J60 FAMILY
9.0
INTERRUPTS
RCON
INTCON
INTCON2
INTCON3
PIR1, PIR2, PIR3
PIE1, PIE2, PIE3
IPR1, IPR2, IPR3
Preliminary
DS39762B-page 119
PIC18F97J60 FAMILY
FIGURE 9-1:
PIR1<7:0>
PIE1<7:0>
IPR1<7:0>
PIR2<7:5,3,1:0>
PIE2<7:5,3,1:0>
IPR2<7:5,3,1:0>
Wake-up if in
Idle or Sleep modes
TMR0IF
TMR0IE
TMR0IP
RBIF
RBIE
RBIP
INT0IF
INT0IE
INT1IF
INT1IE
INT1IP
INT2IF
INT2IE
INT2IP
INT3IF
INT3IE
INT3IP
Interrupt to CPU
Vector to Location
0008h
GIE/GIEH
IPEN
IPEN
PEIE/GIEL
PIR3<7:0>
PIE3<7:0>
IPR3<7:0>
IPEN
PIR1<7:0>
PIE1<7:0>
IPR1<7:0>
PIR2<7:5,3,1:0>
PIE2<7:5,3,1:0>
IPR2<7:5,3,1:0>
PIR3<7:0>
PIE3<7:0>
IPR3<7:0>
TMR0IF
TMR0IE
TMR0IP
RBIF
RBIE
RBIP
Interrupt to CPU
Vector to Location
0018h
IPEN
GIE/GIEH
PEIE/GIEL
INT1IF
INT1IE
INT1IP
INT2IF
INT2IE
INT2IP
INT3IF
INT3IE
INT3IP
DS39762B-page 120
Preliminary
PIC18F97J60 FAMILY
9.1
INTCON Registers
Note:
REGISTER 9-1:
R/W-0
R/W-0
R/W-0
R/W-0
R/W-0
R/W-0
R/W-0
R/W-x
GIE/GIEH
PEIE/GIEL
TMR0IE
INT0IE
RBIE
TMR0IF
INT0IF
RBIF(1)
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
-n = Value at POR
1 = Bit is set
0 = Bit is cleared
x = Bit is unknown
bit 7
bit 6
bit 5
bit 4
bit 3
bit 2
bit 1
bit 0
Note 1:
A mismatch condition will continue to set this bit. Reading PORTB will end the mismatch condition and
allow the bit to be cleared.
Preliminary
DS39762B-page 121
PIC18F97J60 FAMILY
REGISTER 9-2:
R/W-1
R/W-1
R/W-1
R/W-1
R/W-1
R/W-1
R/W-1
R/W-1
RBPU
INTEDG0
INTEDG1
INTEDG2
INTEDG3
TMR0IP
INT3IP
RBIP
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
-n = Value at POR
1 = Bit is set
0 = Bit is cleared
bit 7
bit 6
bit 5
bit 4
bit 3
bit 2
bit 1
bit 0
Note:
x = Bit is unknown
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. User software should ensure the appropriate interrupt flag bits
are clear prior to enabling an interrupt. This feature allows for software polling.
DS39762B-page 122
Preliminary
PIC18F97J60 FAMILY
REGISTER 9-3:
R/W-1
R/W-1
R/W-0
R/W-0
R/W-0
R/W-0
R/W-0
R/W-0
INT2IP
INT1IP
INT3IE
INT2IE
INT1IE
INT3IF
INT2IF
INT1IF
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
-n = Value at POR
1 = Bit is set
0 = Bit is cleared
bit 7
bit 6
bit 5
bit 4
bit 3
bit 2
bit 1
bit 0
Note:
x = Bit is unknown
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. User software should ensure the appropriate interrupt flag bits
are clear prior to enabling an interrupt. This feature allows for software polling.
Preliminary
DS39762B-page 123
PIC18F97J60 FAMILY
9.2
PIR Registers
The PIR registers contain the individual flag bits for the
peripheral interrupts. Due to the number of peripheral
interrupt sources, there are three Peripheral Interrupt
Request (Flag) registers (PIR1, PIR2, PIR3).
REGISTER 9-4:
R/W-0
R/W-0
R-0
R-0
R/W-0
R/W-0
R/W-0
R/W-0
PSPIF(1)
ADIF
RC1IF
TX1IF
SSP1IF
CCP1IF
TMR2IF
TMR1IF
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
-n = Value at POR
1 = Bit is set
0 = Bit is cleared
x = Bit is unknown
bit 7
bit 6
bit 5
bit 4
bit 3
bit 2
bit 1
bit 0
Note 1:
DS39762B-page 124
Preliminary
PIC18F97J60 FAMILY
REGISTER 9-5:
R/W-0
R/W-0
R/W-0
R/W-0
R/W-0
U-0
R/W-0
R/W-0
OSCFIF
CMIF
ETHIF
BCL1IF
TMR3IF
CCP2IF
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
-n = Value at POR
1 = Bit is set
0 = Bit is cleared
x = Bit is unknown
bit 7
bit 6
bit 5
bit 4
Reserved: Maintain as 0
bit 3
bit 2
Unimplemented: Read as 0
bit 1
bit 0
Preliminary
DS39762B-page 125
PIC18F97J60 FAMILY
REGISTER 9-6:
R/W-0
SSP2IF
(1)
R/W-0
R-0
R-0
R/W-0
R/W-0
R/W-0
R/W-0
BCL2IF(1)
RC2IF(2)
TX2IF(2)
TMR4IF
CCP5IF
CCP4IF
CCP3IF
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
-n = Value at POR
1 = Bit is set
0 = Bit is cleared
x = Bit is unknown
bit 7
bit 6
bit 5
bit 4
bit 3
bit 2
bit 1
bit 0
Note 1:
2:
DS39762B-page 126
Preliminary
PIC18F97J60 FAMILY
9.3
PIE Registers
REGISTER 9-7:
R/W-0
R/W-0
R/W-0
R/W-0
R/W-0
R/W-0
R/W-0
R/W-0
PSPIE(1)
ADIE
RC1IE
TX1IE
SSP1IE
CCP1IE
TMR2IE
TMR1IE
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
-n = Value at POR
1 = Bit is set
0 = Bit is cleared
bit 7
bit 6
bit 5
bit 4
bit 3
bit 2
bit 1
bit 0
Note 1:
x = Bit is unknown
Preliminary
DS39762B-page 127
PIC18F97J60 FAMILY
REGISTER 9-8:
R/W-0
R/W-0
R/W-0
R/W-0
R/W-0
U-0
R/W-0
R/W-0
OSCFIE
CMIE
ETHIE
BCL1IE
TMR3IE
CCP2IE
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
-n = Value at POR
1 = Bit is set
0 = Bit is cleared
bit 7
bit 6
bit 5
bit 4
Reserved: Maintain as 0
bit 3
bit 2
Unimplemented: Read as 0
bit 1
bit 0
DS39762B-page 128
Preliminary
x = Bit is unknown
PIC18F97J60 FAMILY
REGISTER 9-9:
R/W-0
R/W-0
R-0
R-0
R/W-0
R/W-0
R/W-0
R/W-0
SSP2IE(1)
BCL2IE(1)
RC2IE(2)
TX2IE(2)
TMR4IE
CCP5IE
CCP4IE
CCP3IE
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
-n = Value at POR
1 = Bit is set
0 = Bit is cleared
bit 7
bit 6
bit 5
bit 4
bit 3
bit 2
bit 1
bit 0
Note 1:
2:
x = Bit is unknown
Preliminary
DS39762B-page 129
PIC18F97J60 FAMILY
9.4
IPR Registers
REGISTER 9-10:
R/W-1
R/W-1
R/W-1
R/W-1
R/W-1
R/W-1
R/W-1
R/W-1
PSPIP(1)
ADIP
RC1IP
TX1IP
SSP1IP
CCP1IP
TMR2IP
TMR1IP
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
-n = Value at POR
1 = Bit is set
0 = Bit is cleared
bit 7
bit 6
bit 5
bit 4
x = Bit is unknown
1 = High priority
0 = Low priority
bit 3
bit 2
bit 1
bit 0
Note 1:
DS39762B-page 130
Preliminary
PIC18F97J60 FAMILY
REGISTER 9-11:
R/W-1
R/W-1
R/W-1
R/W-1
R/W-1
U-0
R/W-1
R/W-1
OSCFIP
CMIP
ETHIP
BCL1IP
TMR3IP
CCP2IP
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
-n = Value at POR
1 = Bit is set
0 = Bit is cleared
bit 7
bit 6
bit 5
bit 4
Reserved: Maintain as 1
bit 3
bit 2
Unimplemented: Read as 0
bit 1
bit 0
Preliminary
x = Bit is unknown
DS39762B-page 131
PIC18F97J60 FAMILY
REGISTER 9-12:
R/W-1
R/W-1
R/W-1
R/W-1
R/W-1
R/W-1
R/W-1
R/W-1
SSP2IP(1)
BCL2IP(1)
RC2IP(2)
TX2IP(2)
TMR4IP
CCP5IP
CCP4IP
CCP3IP
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
-n = Value at POR
1 = Bit is set
0 = Bit is cleared
bit 7
bit 6
bit 5
bit 4
x = Bit is unknown
1 = High priority
0 = Low priority
bit 3
bit 2
bit 1
bit 0
Note 1:
2:
DS39762B-page 132
Preliminary
PIC18F97J60 FAMILY
9.5
RCON Register
REGISTER 9-13:
R/W-0
U-0
R/W-1
R/W-1
R-1
R-1
R/W-0
R/W-0
IPEN
CM
RI
TO
PD
POR
BOR
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
-n = Value at POR
1 = Bit is set
0 = Bit is cleared
bit 7
bit 6
Unimplemented: Read as 0
bit 5
bit 4
bit 3
bit 2
bit 1
bit 0
Preliminary
x = Bit is unknown
DS39762B-page 133
PIC18F97J60 FAMILY
9.6
9.7
TMR0 Interrupt
9.8
EXAMPLE 9-1:
9.9
MOVWF
W_TEMP
MOVFF
STATUS, STATUS_TEMP
MOVFF
BSR, BSR_TEMP
;
; USER ISR CODE
;
MOVFF
BSR_TEMP, BSR
MOVF
W_TEMP, W
MOVFF
STATUS_TEMP, STATUS
DS39762B-page 134
PORTB Interrupt-on-Change
; Restore BSR
; Restore WREG
; Restore STATUS
Preliminary
PIC18F97J60 FAMILY
10.0
I/O PORTS
10.1
FIGURE 10-1:
10.1.1
TABLE 10-1:
Port
Drive
PORTA(1)
(2)
PORTF
PORTG(2)
PORTH(3)
PORTD(2)
RD LAT
Medium
High
PORTE
Data
Bus
PORTJ(3)
I/O pin(1)
WR LAT
or PORT
CK
PORTB
PORTC
Data Latch
Note 1:
D
2:
WR TRIS
CK
TRIS Latch
Input
Buffer
3:
RD TRIS
ENEN
RD PORT
Note 1:
Preliminary
DS39762B-page 135
PIC18F97J60 FAMILY
10.1.2
TABLE 10-2:
Port or Pin
PORTA<5:0>
Tolerated
Input
VDD
PORTF<6:1>(1)
Description
Only VDD input levels
tolerated.
PORTH<7:4>(2)
PORTB<7:0>
PORTC<7:0>
PORTD<7:0>(1)
5.5V
PORTE<7:0>
PORTF<7>
PORTG<7:0>(1)
PORTH<3:0>(2)
PORTJ<7:0>(2)
Note 1:
2:
10.2
EXAMPLE 10-1:
CLRF
CLRF
MOVLW
MOVWF
MOVWF
MOVWF
MOVLW
MOVWF
PORTA
;
;
;
LATA
;
;
;
07h
;
ADCON1 ;
07h
;
CMCON
;
0CFh
;
;
;
TRISA
;
;
INITIALIZING PORTA
Initialize PORTA by
clearing output
data latches
Alternate method
to clear output
data latches
Configure A/D
for digital inputs
Configure comparators
for digital input
Value used to
initialize data
direction
Set RA<3:0> as inputs
RA<5:4> as outputs
DS39762B-page 136
Preliminary
PIC18F97J60 FAMILY
TABLE 10-3:
PORTA FUNCTIONS
Pin Name
Function
RA0/LEDA/AN0
RA0
RA1/LEDB/AN1
RA2/AN2/VREF-
RA3/AN3/VREF+
RA4/T0CKI
RA5/AN4
TRIS
Setting
I/O
DIG
TTL
LEDA
DIG
AN0
ANA
RA1
DIG
TTL
LEDB
DIG
AN1
ANA
RA2
DIG
TTL
AN2
ANA
VREF-
ANA
RA3
DIG
TTL
AN3
ANA
VREF+
ANA
RA4
DIG
ST
T0CKI
ST
RA5
DIG
TTL
ANA
O = Output, I = Input, ANA = Analog Signal, DIG = Digital Output, ST = Schmitt Buffer Input, TTL = TTL Buffer Input,
x = Dont care (TRIS bit does not affect port direction or is overridden for this option).
TABLE 10-4:
Name
Description
AN4
Legend:
I/O
Type
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Reset
Values on
Page:
RJPU(1)
RA5
RA4
RA3
RA2
RA1
RA0
62
LATA
RDPU
REPU
LATA5
LATA4
LATA3
LATA2
LATA1
LATA0
62
TRISA
TRISA5
TRISA4
TRISA3
TRISA2
TRISA1
TRISA0
61
ADCON1
VCFG1
VCFG0
PCFG3
PCFG2
PCFG1
PCFG0
60
PORTA
Preliminary
DS39762B-page 137
PIC18F97J60 FAMILY
10.3
EXAMPLE 10-2:
CLRF
PORTB
CLRF
LATB
MOVLW
0CFh
MOVWF
TRISB
Initialize PORTB by
clearing output
data latches
Alternate method
to clear output
data latches
Value used to
initialize data
direction
Set RB<3:0> as inputs
RB<5:4> as outputs
RB<7:6> as inputs
a)
b)
DS39762B-page 138
INITIALIZING PORTB
;
;
;
;
;
;
;
;
;
;
;
;
For 100-pin devices operating in Extended Microcontroller mode, RB3 can be configured as the
alternate peripheral pin for the ECCP2 module and
Enhanced PWM output 2A by clearing the CCP2MX
Configuration bit. If the devices are in Microcontroller
mode, the alternate assignment for ECCP2 is RE7. As
with other ECCP2 configurations, the user must ensure
that the TRISB<3> bit is set appropriately for the
intended operation.
Preliminary
PIC18F97J60 FAMILY
TABLE 10-5:
PORTB FUNCTIONS
Pin Name
Function
TRIS
Setting
I/O
RB0/INT0/FLT0
RB0
DIG
TTL
ST
INT0
RB1/INT1
RB2/INT2
RB3/INT3/
ECCP2/P2A
RB4/KBI0
RB5/KBI1
RB6/KBI2/PGC
RB7/KBI3/PGD
Legend:
Note 1:
2:
I/O
Type
Description
FLT0
ST
RB1
DIG
TTL
INT1
ST
RB2
DIG
TTL
INT2
ST
RB3
DIG
TTL
INT3
ST
ECCP2(1)
DIG
ECCP2 compare output and PWM output; takes priority over port data.
ST
P2A(1)
DIG
RB4
DIG
TTL
KBI0
TTL
Interrupt-on-pin change.
RB5
DIG
TTL
KBI1
TTL
Interrupt-on-pin change.
RB6
DIG
TTL
KBI2
TTL
Interrupt-on-pin change.
PGC
ST
Serial execution (ICSP) clock input for ICSP and ICD operation.(2)
RB7
DIG
TTL
KBI3
TTL
Interrupt-on-pin change.
PGD
DIG
ST
O = Output, I = Input, DIG = Digital Output, ST = Schmitt Buffer Input, TTL = TTL Buffer Input,
x = Dont care (TRIS bit does not affect port direction or is overridden for this option).
Alternate assignment for ECCP2/P2A when the CCP2MX Configuration bit is cleared (100-pin devices in Extended
Microcontroller mode). Default assignment is RC1.
All other pin functions are disabled when ICSP or ICD is enabled.
Preliminary
DS39762B-page 139
PIC18F97J60 FAMILY
TABLE 10-6:
Name
PORTB
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Reset
Values
on Page:
RB7
RB6
RB5
RB4
RB3
RB2
RB1
RB0
62
LATB
LATB7
LATB6
LATB5
LATB4
LATB3
LATB2
LATB1
LATB0
62
TRISB
TRISB7
TRISB6
TRISB5
TRISB4
TRISB3
TRISB2
TRISB1
TRISB0
61
TMR0IE
INT0IE
RBIE
TMR0IF
INT0IF
RBIF
59
INT3IP
RBIP
59
INT2IF
INT1IF
59
INTCON
GIE/GIEH PEIE/GIEL
INTCON2
RBPU
INTCON3
INT2IP
INT1IP
INT3IE
INT2IE
INT1IE
INT3IF
DS39762B-page 140
Preliminary
PIC18F97J60 FAMILY
10.4
Note:
EXAMPLE 10-3:
CLRF
PORTC
CLRF
LATC
MOVLW
0CFh
MOVWF
TRISC
INITIALIZING PORTC
;
;
;
;
;
;
;
;
;
;
;
;
Initialize PORTC by
clearing output
data latches
Alternate method
to clear output
data latches
Value used to
initialize data
direction
Set RC<3:0> as inputs
RC<5:4> as outputs
RC<7:6> as inputs
Preliminary
DS39762B-page 141
PIC18F97J60 FAMILY
TABLE 10-7:
Pin Name
RC0/T1OSO/
T13CKI
RC1/T1OSI/
ECCP2/P2A
RC2/ECCP1/
P1A
PORTC FUNCTIONS
Function
TRIS
Setting
I/O
I/O
Type
RC0
DIG
ST
T1OSO
ANA
T13CKI
ST
RC1
DIG
ST
T1OSI
ANA
ECCP2(1)
DIG
ECCP2 compare output and PWM output; takes priority over port data.
ST
P2A(1)
DIG
RC2
DIG
ST
DIG
ECCP1 compare output and PWM output; takes priority over port data.
ST
P1A
DIG
RC3
DIG
ST
DIG
SPI clock output (MSSP1 module); takes priority over port data.
ST
DIG
I2C clock output (MSSP1 module); takes priority over port data.
ST
I2C clock input (MSSP1 module); input type depends on module setting.
DIG
ST
Legend:
Note 1:
SDI1
ST
SDA1
DIG
I2C data output (MSSP1 module); takes priority over port data.
ST
I2C data input (MSSP1 module); input type depends on module setting.
DIG
ST
SDO1
DIG
SPI data output (MSSP1 module); takes priority over port data.
RC6
DIG
ST
TX1
DIG
Synchronous serial data output (EUSART1 module); takes priority over port data.
CK1
DIG
RC5
RC7/RX1/DT1
RC4
RC6/TX1/CK1
SCL1
RC5/SDO1
SCK1
RC4/SDI1/
SDA1
1
ECCP1
RC3/SCK1/
SCL1
Description
ST
RC7
DIG
ST
RX1
ST
DT1
DIG
ST
O = Output, I = Input, ANA = Analog Signal, DIG = Digital Output, ST = Schmitt Buffer Input,
x = Dont care (TRIS bit does not affect port direction or is overridden for this option).
Default assignment for ECCP2/P2A when CCP2MX Configuration bit is set.
DS39762B-page 142
Preliminary
PIC18F97J60 FAMILY
TABLE 10-8:
Name
PORTC
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Reset
Values
on Page:
RC7
RC6
RC5
RC4
RC3
RC2
RC1
RC0
62
LATC
LATC7
LATC6
LATC5
LATC4
LATC3
LATC2
LATC1
LATC0
62
TRISC
TRISC7
TRISC6
TRISC5
TRISC4
TRISC3
TRISC2
TRISC1
TRISC0
61
Preliminary
DS39762B-page 143
PIC18F97J60 FAMILY
10.5
EXAMPLE 10-4:
CLRF
PORTD
CLRF
LATD
MOVLW
0CFh
MOVWF
TRISD
DS39762B-page 144
Preliminary
INITIALIZING PORTD
;
;
;
;
;
;
;
;
;
;
;
;
Initialize PORTD by
clearing output
data latches
Alternate method
to clear output
data latches
Value used to
initialize data
direction
Set RD<3:0> as inputs
RD<5:4> as outputs
RD<7:6> as inputs
PIC18F97J60 FAMILY
TABLE 10-9:
PORTD FUNCTIONS
Pin Name
Function
TRIS
Setting
I/O
I/O
Type
RD0/AD0/PSP0
(RD0/P1B)
RD0
DIG
ST
DIG
TTL
DIG
PSP read output data (LATD<0>); takes priority over port data.
TTL
DIG
ECCP1 Enhanced PWM output, channel B; takes priority over port and
PSP data. May be configured for tri-state during Enhanced PWM
shutdown events.
DIG
ST
DIG
TTL
DIG
PSP read output data (LATD<1>); takes priority over port data.
TTL
DIG
ECCP3 compare and PWM output; takes priority over port data.
(1)
AD0
PSP0(1)
(3)
P1B
RD1/AD1/PSP1
(RD1/ECCP3/
P3A)
RD1
AD1(1)
PSP1
(1)
ECCP3(3)
RD2/AD2/PSP2
(RD2/CCP4/
P3D)
ST
P3A(3)
DIG
ECCP3 Enhanced PWM output, channel A; takes priority over port and
PSP data. May be configured for tri-state during Enhanced PWM
shutdown events.
RD2
DIG
ST
DIG
TTL
DIG
PSP read output data (LATD<2>); takes priority over port data.
TTL
DIG
CCP4 compare output and PWM output; takes priority over port data.
ST
P3D(3)
DIG
RD3(1)
DIG
(1)
AD2
PSP2(1)
(3)
CCP4
RD3/AD3/
PSP3(1)
AD3(1)
PSP3(1)
RD4/AD4/
PSP4/SDO2(1)
RD4(1)
AD4(1)
PSP4
(1)
SDO2(1)
Legend:
Note 1:
2:
3:
Description
ST
DIG
TTL
DIG
PSP read output data (LATD<3>); takes priority over port data.
TTL
DIG
ST
DIG
TTL
DIG
PSP read output data (LATD<4>); takes priority over port data.
TTL
DIG
SPI data output (MSSP2 module); takes priority over port data.
O = Output, I = Input, DIG = Digital Output, ST = Schmitt Buffer Input, TTL = TTL Buffer Input,
x = Dont care (TRIS bit does not affect port direction or is overridden for this option).
These features or port pins are implemented only on 100-pin devices.
External memory interface I/O takes priority over all other digital and PSP I/O.
These features are implemented on this pin only on 64-pin devices; for all other devices, they are multiplexed with
RE6/RH7 (P1B), RG0 (ECCP3/P3A) or RG3 (CCP4/P3D).
Preliminary
DS39762B-page 145
PIC18F97J60 FAMILY
TABLE 10-9:
Pin Name
RD5/AD5/
PSP5/SDI2/
SDA2(1)
TRIS
Setting
I/O
I/O
Type
RD5(1)
DIG
AD5(1)
PSP5(1)
RD6/AD6/
PSP6/SCK2/
SCL2(1)
ST
DIG
TTL
DIG
PSP read output data (LATD<5>); takes priority over port data.
PSP write data input.
TTL
ST
SDA2(1)
DIG
I2C data output (MSSP2 module); takes priority over port data.
ST
DIG
ST
DIG-3
TTL
DIG
PSP read output data (LATD<6>); takes priority over port data.
TTL
DIG
SPI clock output (MSSP2 module); takes priority over port data.
ST
DIG
I2C clock output (MSSP2 module); takes priority over port data.
ST
DIG
ST
DIG
TTL
DIG
PSP read output data (LATD<7>); takes priority over port data.
TTL
TTL
RD6(1)
AD6(1)
(1)
(1)
SCL2(1)
RD7(1)
(1)
AD7
PSP7
SS2
Note 1:
2:
3:
SCK2
Legend:
SDI2(1)
PSP6
RD7/AD7/
PSP7/SS2(1)
Description
(1)
(1)
O = Output, I = Input, DIG = Digital Output, ST = Schmitt Buffer Input, TTL = TTL Buffer Input,
x = Dont care (TRIS bit does not affect port direction or is overridden for this option).
These features or port pins are implemented only on 100-pin devices.
External memory interface I/O takes priority over all other digital and PSP I/O.
These features are implemented on this pin only on 64-pin devices; for all other devices, they are multiplexed with
RE6/RH7 (P1B), RG0 (ECCP3/P3A) or RG3 (CCP4/P3D).
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
RD7(1)
RD6(1)
RD5(1)
RD4(1)
RD3(1)
RD2
LATD5(1)
LATD4(1)
LATD3(1)
LATD2
Bit 0
Reset
Values
on Page:
RD1
RD0
62
LATD1
LATD0
62
Bit 1
LATD
LATD7
LATD6(1)
TRISD
TRISD7(1)
TRISD6(1)
TRISD5(1)
TRISD4(1)
TRISD3(1)
TRISD2
TRISD1
TRISD0
61
RDPU
REPU
LATA5
LATA4
LATA3
LATA2
LATA1
LATA0
62
LATA
(1)
Bit 2
DS39762B-page 146
Preliminary
PIC18F97J60 FAMILY
10.6
EXAMPLE 10-5:
CLRF
PORTE
CLRF
LATE
MOVLW
03h
MOVWF
TRISE
Preliminary
INITIALIZING PORTE
;
;
;
;
;
;
;
;
;
;
;
Initialize PORTE by
clearing output
data latches
Alternate method
to clear output
data latches
Value used to
initialize data
direction
Set RE<1:0> as inputs
RE<7:2> as outputs
DS39762B-page 147
PIC18F97J60 FAMILY
TABLE 10-11:
Pin Name
PORTE FUNCTIONS
Function
TRIS
Setting
I/O
I/O
Type
RE0
DIG
ST
DIG
TTL
RE0/AD8/RD/
P2D
AD8(1)
RD
RE1/AD9/WR/
P2C
(6)
TTL
P2D
DIG
RE1
DIG
ST
DIG
TTL
AD9(1)
WR(6)
TTL
P2C
DIG
RE2
DIG
ST
DIG
TTL
RE2/AD10/CS/
P2B
AD10(1)
CS
(6)
TTL
P2B
DIG
ECCP2 Enhanced PWM output, channel B; takes priority over port and
PSP data. May be configured for tri-state during Enhanced PWM
shutdown events.
RE3
DIG
ST
AD11(1)
DIG
TTL
P3C(3)
DIG
RE4
DIG
ST
DIG
TTL
DIG
ECCP3 Enhanced PWM output, channel B; takes priority over port and
PSP data. May be configured for tri-state during Enhanced PWM
shutdown events.
RE3/AD11/
P3C
RE4/AD12/
P3B
AD12(1)
(3)
P3B
Legend:
Note 1:
2:
3:
4:
5:
6:
Description
O = Output, I = Input, DIG = Digital Output, ST = Schmitt Buffer Input, TTL = TTL Buffer Input,
x = Dont care (TRIS bit does not affect port direction or is overridden for this option).
EMB functions implemented on 100-pin devices only.
External memory interface I/O takes priority over all other digital and PSP I/O.
Default assignments for P1B/P1C and P3B/P3C when ECCPMX Configuration bit is set (80-pin and 100-pin devices).
Unimplemented on 64-pin devices.
Alternate assignment for ECCP2/P2A when CCP2MX Configuration bit is cleared (80-pin and 100-pin devices in
Microcontroller mode).
Unimplemented on 64-pin and 80-pin devices.
DS39762B-page 148
Preliminary
PIC18F97J60 FAMILY
TABLE 10-11:
Pin Name
RE5/AD13/
P1C
TRIS
Setting
I/O
I/O
Type
RE5
DIG
ST
DIG
TTL
P1C(3)
DIG
RE6
DIG
ST
DIG
TTL
DIG
ECCP1 Enhanced PWM output, channel B; takes priority over port and
PSP data. May be configured for tri-state during Enhanced PWM
shutdown events.
DIG
ST
DIG
TTL
DIG
AD14(1)
(3)
P1B
RE7/AD15/
ECCP2/P2A(4)
RE7
AD15(1)
ECCP2
(5)
P2A(5)
Legend:
Note 1:
2:
3:
4:
5:
6:
1
AD13(1)
RE6/AD14/
P1B(4)
Description
ST
DIG
ECCP2 Enhanced PWM output, channel A; takes priority over port and
PSP data. May be configured for tri-state during Enhanced PWM
shutdown events.
O = Output, I = Input, DIG = Digital Output, ST = Schmitt Buffer Input, TTL = TTL Buffer Input,
x = Dont care (TRIS bit does not affect port direction or is overridden for this option).
EMB functions implemented on 100-pin devices only.
External memory interface I/O takes priority over all other digital and PSP I/O.
Default assignments for P1B/P1C and P3B/P3C when ECCPMX Configuration bit is set (80-pin and 100-pin devices).
Unimplemented on 64-pin devices.
Alternate assignment for ECCP2/P2A when CCP2MX Configuration bit is cleared (80-pin and 100-pin devices in
Microcontroller mode).
Unimplemented on 64-pin and 80-pin devices.
Bit 7
Bit 6
RE7(1)
RE6(1)
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Reset
Values
on Page:
RE5
RE4
RE3
RE2
RE1
RE0
62
LATE
LATE7
LATE6(1)
LATE5
LATE4
LATE3
LATE2
LATE1
LATE0
62
TRISE
TRISE7(1) TRISE6(1)
TRISE5
TRISE4
TRISE3
TRISE2
TRISE1
TRISE0
61
LATA5
LATA4
LATA3
LATA2
LATA1
LATA0
62
LATA
(1)
RDPU
REPU
Preliminary
DS39762B-page 149
PIC18F97J60 FAMILY
10.7
EXAMPLE 10-6:
CLRF
CLRF
MOVLW
MOVWF
MOVLW
MOVWF
MOVLW
MOVWF
DS39762B-page 150
Preliminary
PORTF
;
;
;
LATF
;
;
;
07h
;
CMCON
;
0Fh
;
ADCON1 ;
0CEh
;
;
;
TRISF
;
;
;
INITIALIZING PORTF
Initialize PORTF by
clearing output
data latches
Alternate method
to clear output
data latches
Turn off comparators
Set PORTF as digital I/O
Value used to
initialize data
direction
Set RF3:RF1 as inputs
RF5:RF4 as outputs
RF7:RF6 as inputs
PIC18F97J60 FAMILY
TABLE 10-13: PORTF FUNCTIONS
Pin Name
Function
TRIS
Setting
I/O
I/O
Type
RF0/AN5(1)
RF0(1)
DIG
ST
RF1/AN6/
C2OUT
RF2/AN7/
C1OUT
RF3/AN8
RF4/AN9
RF5/AN10/
CVREF
RF6/AN11
RF7/SS1
Legend:
Note 1:
Description
AN5(1)
ANA
RF1
DIG
ST
AN6
ANA
C2OUT
DIG
RF2
DIG
ST
AN7
ANA
C1OUT
TTL
RF3
DIG
ST
AN8
ANA
RF4
DIG
ST
AN9
ANA
A/D input channel 9 and comparator C2- input. Default input configuration on
POR; does not affect digital output.
RF5
DIG
LATF<5> data output; not affected by analog input. Disabled when CVREF
output enabled.
ST
PORTF<5> data input; disabled when analog input enabled. Disabled when
CVREF output enabled.
AN10
ANA
A/D input channel 10 and comparator C1+ input. Default input configuration on POR.
CVREF
ANA
Comparator voltage reference output. Enabling this feature disables digital I/O.
RF6
DIG
ST
AN11
ANA
A/D input channel 11 and comparator C1- input. Default input configuration on
POR; does not affect digital output.
RF7
DIG
ST
SS1
TTL
A/D input channel 8 and comparator C2+ input. Default input configuration on
POR; not affected by analog output.
O = Output, I = Input, ANA = Analog Signal, DIG = Digital Output, ST = Schmitt Buffer Input, TTL = TTL Buffer Input,
x = Dont care (TRIS bit does not affect port direction or is overridden for this option).
Implemented on 100-pin devices only.
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Reset
Values
on Page:
RF7
RF6
RF5
RF4
RF3
RF2
RF1
RF0(1)
62
LATF7
LATF6
LATF5
LATF4
LATF3
LATF2
LATF1
LATF0(1)
62
TRISF7
TRISF6
TRISF5
TRISF4
TRISF3
TRISF2
TRISF1
VCFG1
VCFG0
PCFG3
PCFG2
PCFG1
TRISF0
(1)
61
PCFG0
60
CMCON
C2OUT
C1OUT
C2INV
C1INV
CIS
CM2
CM1
CM0
60
CVRCON
CVREN
CVROE
CVRR
CVRSS
CVR3
CVR2
CVR1
CVR0
60
Preliminary
DS39762B-page 151
PIC18F97J60 FAMILY
10.8
EXAMPLE 10-7:
CLRF
PORTG
CLRF
LATG
MOVLW
04h
MOVWF
TRISG
DS39762B-page 152
Preliminary
INITIALIZING PORTG
;
;
;
;
;
;
;
;
;
;
;
;
Initialize PORTG by
clearing output
data latches
Alternate method
to clear output
data latches
Value used to
initialize data
direction
Set RG1:RG0 as outputs
RG2 as input
RG4:RG3 as inputs
PIC18F97J60 FAMILY
TABLE 10-15: PORTG FUNCTIONS
Pin Name
RG0/ECCP3/
P3A(1)
Function
TRIS
Setting
I/O
I/O
Type
RG0(1)
DIG
ST
DIG
ECCP3 compare and PWM output; takes priority over port data.
ST
(1)
DIG
ECCP3 Enhanced PWM output, channel A; takes priority over port and
PSP data. May be configured for tri-state during Enhanced PWM
shutdown events.
RG1(1)
DIG
ST
TX2(1)
DIG
CK2(1)
DIG
ECCP3(1)
P3A
RG1/TX2/
CK2(1)
RG2/RX2/
DT2(1)
RG3/CCP4/
P3D(1)
RG2(1)
DIG
ST
ST
DIG
ST
DIG
RG3(1)
ST
DIG
CCP4 compare output and PWM output; takes priority over port data.
ST
P3D(1)
DIG
ECCP3 Enhanced PWM output, channel D; takes priority over port and
PSP data. May be configured for tri-state during Enhanced PWM
shutdown events.
RG4
DIG
ST
DIG
CCP5 compare output and PWM output; takes priority over port data.
ST
P1D
DIG
ECCP1 Enhanced PWM output, channel D; takes priority over port and
PSP data. May be configured for tri-state during Enhanced PWM
shutdown events.
RG5(2)
DIG
ST
DIG
RG6(2)
RG7(2)
RG7(2)
Note 1:
2:
ST
RG6(2)
Legend:
DT2(1)
CCP5
RG5(2)
RX2(1)
CCP4(1)
RG4/CCP5/
P1D
Description
ST
DIG
ST
Preliminary
DS39762B-page 153
PIC18F97J60 FAMILY
TABLE 10-16: SUMMARY OF REGISTERS ASSOCIATED WITH PORTG
Name
PORTG
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Reset
Values on
Page:
RG7(1)
RG6(1)
RG5(1)
RG4
RG3(2)
RG2(2)
RG1(2)
RG0(2)
62
LATG6(1)
LATG5(1)
LATG4
LATG3(2)
LATG2(2)
LATG1(2)
LATG0(2)
62
(1)
LATG
LATG7
TRISG
TRISG7(1)
Note 1:
2:
(1)
TRISG6
(1)
TRISG5
TRISG4
TRISG3
(2)
(2)
TRISG2
TRISG1
(2)
TRISG0
(2)
61
DS39762B-page 154
Preliminary
PIC18F97J60 FAMILY
10.9
Note:
EXAMPLE 10-8:
CLRF
PORTH
CLRF
LATH
MOVLW
MOVWF
MOVLW
0Fh
ADCON1
0CFh
MOVWF
TRISH
Preliminary
INITIALIZING PORTH
;
;
;
;
;
;
;
;
;
;
;
;
;
;
Initialize PORTH by
clearing output
data latches
Alternate method
to clear output
data latches
Configure PORTH as
digital I/O
Value used to
initialize data
direction
Set RH3:RH0 as inputs
RH5:RH4 as outputs
RH7:RH6 as inputs
DS39762B-page 155
PIC18F97J60 FAMILY
TABLE 10-17: PORTH FUNCTIONS
Pin Name
RH0/A16
RH1/A17
RH2/A18
RH3/A19
RH4/AN12/P3C
Function
TRIS
Setting
I/O
I/O
Type
RH0
DIG
ST
A16(1)
DIG
External memory interface, address line 16. Takes priority over port data.
RH1
DIG
ST
A17(1)
DIG
External memory interface, address line 17. Takes priority over port data.
RH2
DIG
ST
A18(1)
DIG
External memory interface, address line 18. Takes priority over port data.
RH3
DIG
ST
A19(1)
DIG
External memory interface, address line 19. Takes priority over port data.
RH4
DIG
ST
ANA
A/D input channel 12. Default input configuration on POR; does not affect
digital output.
ECCP3 Enhanced PWM output, channel C; takes priority over port and PSP
data. May be configured for tri-state during Enhanced PWM shutdown events.
AN12
RH5/AN13/P3B
P3C(2)
DIG
RH5
DIG
ST
ANA
A/D input channel 13. Default input configuration on POR; does not affect
digital output.
ECCP3 Enhanced PWM output, channel B; takes priority over port and PSP
data. May be configured for tri-state during Enhanced PWM shutdown events.
AN13
RH6/AN14/P1C
P3B(2)
DIG
RH6
DIG
ST
ANA
A/D input channel 14. Default input configuration on POR; does not affect
digital output.
ECCP1 Enhanced PWM output, channel C; takes priority over port and PSP
data. May be configured for tri-state during Enhanced PWM shutdown events.
AN14
RH7/AN15/P1B
P1C(2)
DIG
RH7
DIG
ST
ANA
A/D input channel 15. Default input configuration on POR; does not affect
digital output.
DIG
ECCP1 Enhanced PWM output, channel B; takes priority over port and PSP
data. May be configured for tri-state during Enhanced PWM shutdown events.
AN15
P1B(2)
Legend:
Note 1:
2:
Description
O = Output, I = Input, ANA = Analog Signal, DIG = Digital Output, ST = Schmitt Buffer Input,
x = Dont care (TRIS bit does not affect port direction or is overridden for this option).
Unimplemented on 80-pin devices.
Alternate assignments for P1B/P1C and P3B/P3C when ECCPMX Configuration bit is cleared (80-pin and 100-pin
devices only). Default assignments are PORTE<6:3>.
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Reset
Values
on Page:
RH7
RH6
RH5
RH4
RH3
RH2
RH1
RH0
62
LATH
LATH7
LATH6
LATH5
LATH4
LATH3
LATH2
LATH1
LATH0
61
TRISH
TRISH7
TRISH6
TRISH5
TRISH4
TRISH3
TRISH2
TRISH1
TRISH0
61
DS39762B-page 156
Preliminary
PIC18F97J60 FAMILY
10.10 PORTJ, TRISJ and
LATJ Registers
Note:
EXAMPLE 10-9:
CLRF
PORTJ
CLRF
LATJ
MOVLW
0CFh
MOVWF
TRISJ
INITIALIZING PORTJ
;
;
;
;
;
;
;
;
;
;
;
;
Initialize PORTG by
clearing output
data latches
Alternate method
to clear output
data latches
Value used to
initialize data
direction
Set RJ3:RJ0 as inputs
RJ5:RJ4 as output
RJ7:RJ6 as inputs
Preliminary
DS39762B-page 157
PIC18F97J60 FAMILY
TABLE 10-19: PORTJ FUNCTIONS
Pin Name
RJ0/ALE(1)
RJ1/OE(1)
RJ2/WRL(1)
RJ3/WRH(1)
Function
TRIS
Setting
I/O
I/O
Type
RJ0(1)
DIG
ST
ALE(1)
DIG
RJ1(1)
DIG
ST
OE(1)
DIG
RJ2(1)
DIG
ST
WRL(1)
DIG
External memory bus write low byte control; takes priority over
digital I/O.
RJ3(1)
DIG
ST
WRH(1)
DIG
External memory interface write high byte control output; takes priority
over digital I/O.
RJ4
DIG
ST
DIG
DIG
ST
CE(2)
DIG
RJ6(1)
DIG
RJ4/BA0
(2)
BA0
RJ5/CE
RJ6/LB(1)
RJ7/UB(1)
RJ5
Note 1:
2:
ST
LB(1)
DIG
RJ7(1)
DIG
ST
DIG
UB
Legend:
Description
(1)
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Reset
Values
on Page:
RJ7(1)
RJ6(1)
RJ5
RJ4
RJ3(1)
RJ2(1)
RJ1(1)
RJ0(1)
62
LATJ
LATJ7(1)
TRISJ
TRISJ7(1) TRISJ6(1)
PORTA
RJPU
LATJ6
(1)
(1)
(1)
LATJ1
61
61
LATJ5
LATJ4
LATJ3
TRISJ4
RA5
RA4
RA2
RA1
LATJ0
(1)
TRISJ5
RA3
LATJ2
(1)
RA0
62
DS39762B-page 158
Preliminary
PIC18F97J60 FAMILY
FIGURE 10-2:
Data Bus
D
WR LATD
or PORTD
Data Latch
The PSP can directly interface to an 8-bit microprocessor data bus. The external microprocessor can
read or write the PORTD latch as an 8-bit latch. Setting
bit, PSPMODE, enables port pin RE0/AD8/RD/P2D to
be the RD input, RE1/AD9//WR/P2C to be the WR
input and RE2/AD10//CS/P2B to be the CS (Chip
Select) input. For this functionality, the corresponding
data direction bits of the TRISE register (TRISE<2:0>)
must be configured as inputs (set).
RD PORTD
TTL
D
ENEN
TRIS Latch
RD LATD
RDx
pin
CK
Note:
Read
TTL
RD
Chip Select
TTL
CS
Write
TTL
WR
Preliminary
DS39762B-page 159
PIC18F97J60 FAMILY
REGISTER 10-1:
R-0
R-0
R/W-0
R/W-0
U-0
U-0
U-0
U-0
IBF
OBF
IBOV
PSPMODE
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
-n = Value at POR
1 = Bit is set
0 = Bit is cleared
x = Bit is unknown
bit 7
bit 6
bit 5
bit 4
bit 3-0
Unimplemented: Read as 0
FIGURE 10-3:
Q2
Q3
Q4
Q1
Q2
Q3
Q4
Q1
Q2
Q3
Q4
CS
WR
RD
PORTD<7:0>
IBF
OBF
PSPIF
DS39762B-page 160
Preliminary
PIC18F97J60 FAMILY
FIGURE 10-4:
Q2
Q3
Q4
Q1
Q2
Q3
Q4
Q1
Q2
Q3
Q4
CS
WR
RD
PORTD<7:0>
IBF
OBF
PSPIF
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Reset
Values
on Page:
PORTD
RD7
RD6
RD5
RD4
RD3
RD2
RD1
RD0
62
LATD
LATD7
LATD6
LATD5
LATD4
LATD3
LATD2
LATD1
LATD0
62
TRISD
TRISD7
TRISD6
TRISD5
TRISD4
TRISD3
TRISD2
TRISD1
TRISD0
61
PORTE
RE7
RE6
RE5
RE4
RE3
RE2
RE1
RE0
62
LATE
LATE7
LATE6
LATE5
LATE4
LATE3
LATE2
LATE1
LATE0
62
TRISE
TRISE7
TRISE6
TRISE5
TRISE4
TRISE3
TRISE2
TRISE1
TRISE0
61
IBF
OBF
IBOV
PSPMODE
61
PSPCON
TMR0IE
INT0IE
RBIE
TMR0IF
INT0IF
RBIF
59
PIR1
PSPIF
ADIF
RC1IF
TX1IF
SSP1IF
CCP1IF
TMR2IF
TMR1IF
61
PIE1
PSPIE
ADIE
RC1IE
TX1IE
SSP1IE
CCP1IE
TMR2IE
TMR1IE
61
IPR1
PSPIP
ADIP
RC1IP
TX1IP
SSP1IP
CCP1IP
TMR2IP
TMR1IP
61
INTCON
GIE/GIEH PEIE/GIEL
Legend: = unimplemented, read as 0. Shaded cells are not used by the Parallel Slave Port.
Preliminary
DS39762B-page 161
PIC18F97J60 FAMILY
NOTES:
DS39762B-page 162
Preliminary
PIC18F97J60 FAMILY
11.0
TIMER0 MODULE
REGISTER 11-1:
R/W-1
R/W-1
R/W-1
R/W-1
R/W-1
R/W-1
R/W-1
R/W-1
TMR0ON
T08BIT
T0CS
T0SE
PSA
T0PS2
T0PS1
T0PS0
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
-n = Value at POR
1 = Bit is set
0 = Bit is cleared
x = Bit is unknown
bit 7
bit 6
bit 5
bit 4
bit 3
bit 2-0
Preliminary
DS39762B-page 163
PIC18F97J60 FAMILY
11.1
Timer0 Operation
FIGURE 11-1:
11.2
0
1
1
Programmable
Prescaler
T0CKI pin
Sync with
Internal
Clocks
(2 TCY Delay)
T0SE
T0CS
T0PS2:T0PS0
PSA
Note:
Set
TMR0IF
on Overflow
TMR0L
Upon Reset, Timer0 is enabled in 8-bit mode with clock input from T0CKI max. prescale.
FIGURE 11-2:
FOSC/4
0
1
1
Programmable
Prescaler
T0CKI pin
TMR0
High Byte
TMR0L
Set
TMR0IF
on Overflow
(2 TCY Delay)
T0SE
T0CS
Sync with
Internal
Clocks
Read TMR0L
T0PS2:T0PS0
Write TMR0L
PSA
TMR0H
8
8
Internal Data Bus
Note:
Upon Reset, Timer0 is enabled in 8-bit mode with clock input from T0CKI max. prescale.
DS39762B-page 164
Preliminary
PIC18F97J60 FAMILY
11.3
11.3.1
Prescaler
TABLE 11-1:
Name
11.4
Timer0 Interrupt
Bit 6
Bit 5
TMR0L
TMR0H
INTCON
INTCON2
SWITCHING PRESCALER
ASSIGNMENT
RBPU
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Reset
Values
on Page:
60
60
INT0IE
RBIE
TMR0IF
INT0IF
RBIF
59
TMR0IP
INT3IP
RBIP
59
T0CON
TMR0ON
T08BIT
T0CS
T0SE
PSA
T0PS2
T0PS1
T0PS0
60
TRISA
TRISA5
TRISA4
TRISA3
TRISA2
TRISA1
TRISA0
61
Preliminary
DS39762B-page 165
PIC18F97J60 FAMILY
NOTES:
DS39762B-page 166
Preliminary
PIC18F97J60 FAMILY
12.0
TIMER1 MODULE
REGISTER 12-1:
R/W-0
RD16
T1RUN
R/W-0
T1CKPS1
R/W-0
T1CKPS0
R/W-0
T1OSCEN
R/W-0
R/W-0
R/W-0
T1SYNC
TMR1CS
TMR1ON
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
-n = Value at POR
1 = Bit is set
0 = Bit is cleared
x = Bit is unknown
bit 7
bit 6
bit 5-4
bit 3
bit 2
bit 1
bit 0
Preliminary
DS39762B-page 167
PIC18F97J60 FAMILY
12.1
Timer1 Operation
FIGURE 12-1:
On/Off
T1OSO/T13CKI
1
FOSC/4
Internal
Clock
T1OSI
T1OSCEN(1)
Synchronize
Prescaler
1, 2, 4, 8
Detect
0
2
Sleep Input
Timer1
On/Off
TMR1CS
T1CKPS1:T1CKPS0
T1SYNC
TMR1ON
Clear TMR1
(ECCPx Special Event Trigger)
Set
TMR1IF
on Overflow
TMR1
High Byte
TMR1L
Note 1: When enable bit, T1OSCEN, is cleared, the inverter and feedback resistor are turned off to eliminate power drain.
FIGURE 12-2:
T1OSO/T13CKI
T1OSI
1
FOSC/4
Internal
Clock
Synchronize
Detect
Prescaler
1, 2, 4, 8
0
2
Sleep Input
TMR1CS
T1OSCEN(1)
T1CKPS1:T1CKPS0
T1SYNC
TMR1ON
Clear TMR1
(ECCPx Special Event Trigger)
Timer1
On/Off
TMR1
High Byte
TMR1L
Set
TMR1IF
on Overflow
Read TMR1L
Write TMR1L
8
TMR1H
8
8
Internal Data Bus
Note 1: When enable bit, T1OSCEN, is cleared, the inverter and feedback resistor are turned off to eliminate power drain.
DS39762B-page 168
Preliminary
PIC18F97J60 FAMILY
12.2
TABLE 12-1:
Oscillator
Type
Freq.
C1
C2
LP
32 kHz
27 pF(1)
27 pF(1)
12.3
Timer1 Oscillator
FIGURE 12-3:
EXTERNAL
COMPONENTS FOR THE
TIMER1 OSCILLATOR
C1
27 pF
PIC18F97J60
T1OSO
C2
27 pF
See the Notes with Table 12-1 for additional
information about capacitor selection.
12.3.1
USING TIMER1 AS A
CLOCK SOURCE
XTAL
32.768 kHz
Note:
12.3.2
T1OSI
Preliminary
DS39762B-page 169
PIC18F97J60 FAMILY
If a high-speed circuit must be located near the oscillator (such as the ECCP1 pin in Output Compare or PWM
mode, or the primary oscillator using the OSC2 pin), a
grounded guard ring around the oscillator circuit, as
shown in Figure 12-4, may be helpful when used on a
single-sided PCB or in addition to a ground plane.
FIGURE 12-4:
VSS
OSC1
OSC2
RC1
RC2
Note: Not drawn to scale.
Timer1 Interrupt
12.7
DS39762B-page 170
RC0
12.5
12.6
OSCILLATOR CIRCUIT
WITH GROUNDED
GUARD RING
VDD
12.4
Note:
Considerations in Asynchronous
Counter Mode
Preliminary
PIC18F97J60 FAMILY
The Real-Time Clock application code in Example 12-1
shows a typical ISR for Timer1, as well as the optional
code required if the update cannot be done reliably
within the required interval.
EXAMPLE 12-1:
RTCinit
MOVLW
MOVWF
CLRF
MOVLW
MOVWF
CLRF
CLRF
MOVLW
MOVWF
BSF
RETURN
80h
TMR1H
TMR1L
b00001111
T1CON
secs
mins
.12
hours
PIE1, TMR1IE
RTCisr
TABLE 12-2:
Name
INTCON
BTFSC
BRA
BTFSS
BRA
TMR1L,0
$-2
TMR1L,0
$-2
BSF
BCF
INCF
MOVLW
CPFSGT
RETURN
CLRF
INCF
MOVLW
CPFSGT
RETURN
CLRF
INCF
MOVLW
CPFSGT
RETURN
CLRF
RETURN
TMR1H, 7
PIR1, TMR1IF
secs, F
.59
secs
secs
mins, F
.59
mins
mins
hours, F
.23
hours
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
No, done
Clear seconds
Increment minutes
60 minutes elapsed?
;
;
;
;
No, done
clear minutes
Increment hours
24 hours elapsed?
; No, done
; Reset hours
; Done
hours
Bit 6
GIE/GIEH PEIE/GIEL
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Reset
Values
on Page:
TMR0IE
INT0IE
RBIE
TMR0IF
INT0IF
RBIF
59
PIR1
PSPIF
ADIF
RC1IF
TX1IF
SSP1IF
CCP1IF
TMR2IF
TMR1IF
61
PIE1
PSPIE
ADIE
RC1IE
TX1IE
SSP1IE
CCP1IE
TMR2IE
TMR1IE
61
IPR1
PSPIP
ADIP
RC1IP
TX1IP
SSP1IP
CCP1IP
TMR2IP
TMR1IP
61
TMR1L
60
TMR1H
60
T1CON
RD16
T1RUN
TMR1CS
TMR1ON
60
Preliminary
DS39762B-page 171
PIC18F97J60 FAMILY
NOTES:
DS39762B-page 172
Preliminary
PIC18F97J60 FAMILY
13.0
TIMER2 MODULE
13.1
Timer2 Operation
REGISTER 13-1:
U-0
R/W-0
R/W-0
R/W-0
R/W-0
R/W-0
R/W-0
R/W-0
T2OUTPS3
T2OUTPS2
T2OUTPS1
T2OUTPS0
TMR2ON
T2CKPS1
T2CKPS0
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
-n = Value at POR
1 = Bit is set
0 = Bit is cleared
bit 7
Unimplemented: Read as 0
bit 6-3
bit 2
bit 1-0
Preliminary
x = Bit is unknown
DS39762B-page 173
PIC18F97J60 FAMILY
13.2
Timer2 Interrupt
13.3
Timer2 Output
FIGURE 13-1:
1:1 to 1:16
Postscaler
T2OUTPS3:T2OUTPS0
Set TMR2IF
TMR2 Output
(to PWM or MSSPx)
T2CKPS1:T2CKPS0
TMR2/PR2
Match
Reset
1:1, 1:4, 1:16
Prescaler
FOSC/4
TMR2
PR2
Comparator
8
8
TABLE 13-1:
Name
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Reset
Values
on Page:
TMR0IE
INT0IE
RBIE
TMR0IF
INT0IF
RBIF
59
PIR1
PSPIF
ADIF
RC1IF
TX1IF
SSP1IF
CCP1IF
TMR2IF
TMR1IF
61
PIE1
PSPIE
ADIE
RC1IE
TX1IE
SSP1IE
CCP1IE
TMR2IE
TMR1IE
61
IPR1
PSPIP
ADIP
RC1IP
TX1IP
SSP1IP
CCP1IP
TMR2IP
TMR1IP
61
TMR2
T2CON
PR2
Timer2 Register
60
T2CKPS1 T2CKPS0
60
60
Legend: = unimplemented, read as 0. Shaded cells are not used by the Timer2 module.
DS39762B-page 174
Preliminary
PIC18F97J60 FAMILY
14.0
TIMER3 MODULE
REGISTER 14-1:
R/W-0
R/W-0
R/W-0
R/W-0
R/W-0
R/W-0
R/W-0
R/W-0
RD16
T3CCP2
T3CKPS1
T3CKPS0
T3CCP1
T3SYNC
TMR3CS
TMR3ON
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
-n = Value at POR
1 = Bit is set
0 = Bit is cleared
x = Bit is unknown
bit 7
bit 6,3
bit 5-4
bit 2
bit 1
bit 0
Preliminary
DS39762B-page 175
PIC18F97J60 FAMILY
14.1
Timer3 Operation
As
with
Timer1,
the
RC1/T1OSI
and
RC0/T1OSO/T13CKI pins become inputs when the
Timer1 oscillator is enabled. This means the values of
TRISC<1:0> are ignored and the pins are read as 0.
FIGURE 14-1:
T1OSO/T13CKI
1
FOSC/4
Internal
Clock
T1OSI
T1OSCEN
(1)
Synchronize
Detect
Prescaler
1, 2, 4, 8
0
2
Sleep Input
Timer3
On/Off
TMR3CS
T3CKPS1:T3CKPS0
T3SYNC
TMR3ON
Clear TMR3
Set
TMR3IF
on Overflow
TMR3
High Byte
TMR3L
Note 1: When enable bit, T1OSCEN, is cleared, the inverter and feedback resistor are turned off to eliminate power drain.
FIGURE 14-2:
T1OSO/T13CKI
FOSC/4
Internal
Clock
T1OSI
Synchronize
Detect
Prescaler
1, 2, 4, 8
0
2
Sleep Input
(1)
Timer3
On/Off
TMR3CS
T1OSCEN
T3CKPS1:T3CKPS0
T3SYNC
TMR3ON
ECCPx Special Event Trigger
ECCPx Select from T3CON<6,3>
Clear TMR3
Set
TMR3IF
on Overflow
TMR3
High Byte
TMR3L
Read TMR1L
Write TMR1L
8
TMR3H
8
8
Internal Data Bus
Note 1: When enable bit, T1OSCEN, is cleared, the inverter and feedback resistor are turned off to eliminate power drain.
DS39762B-page 176
Preliminary
PIC18F97J60 FAMILY
14.2
14.4
Timer3 Interrupt
14.5
14.3
TABLE 14-1:
Name
INTCON
Bit 6
GIE/GIEH PEIE/GIEL
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Reset
Values
on Page:
TMR0IE
INT0IE
RBIE
TMR0IF
INT0IF
RBIF
59
PIR2
OSCFIF
CMIF
ETHIF
BCL1IF
TMR3IF
CCP2IF
61
PIE2
OSCFIE
CMIE
ETHIE
BCL1IE
TMR3IE
CCP2IE
61
IPR2
OSCFIP
CMIP
ETHIP
BCL1IP
TMR3IP
CCP2IP
61
TMR3L
60
TMR3H
60
T1CON
RD16
T1RUN
TMR1CS
TMR1ON
60
T3CON
RD16
T3CCP2
T3CKPS1 T3CKPS0
TMR3CS
TMR3ON
61
T3CCP1
T3SYNC
Legend: = unimplemented, read as 0, r = reserved. Shaded cells are not used by the Timer3 module.
Preliminary
DS39762B-page 177
PIC18F97J60 FAMILY
NOTES:
DS39762B-page 178
Preliminary
PIC18F97J60 FAMILY
15.0
TIMER4 MODULE
15.1
Timer4 Operation
REGISTER 15-1:
U-0
R/W-0
R/W-0
R/W-0
R/W-0
R/W-0
R/W-0
R/W-0
T4OUTPS3
T4OUTPS2
T4OUTPS1
T4OUTPS0
TMR4ON
T4CKPS1
T4CKPS0
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
-n = Value at POR
1 = Bit is set
0 = Bit is cleared
bit 7
Unimplemented: Read as 0
bit 6-3
bit 2
bit 1-0
Preliminary
x = Bit is unknown
DS39762B-page 179
PIC18F97J60 FAMILY
15.2
Timer4 Interrupt
15.3
FIGURE 15-1:
Output of TMR4
1:1 to 1:16
Postscaler
T4OUTPS3:T4OUTPS0
Set TMR4IF
TMR4 Output
(to PWM)
T4CKPS1:T4CKPS0
TMR4/PR4
Match
Reset
FOSC/4
Comparator
TMR4
PR4
8
8
TABLE 15-1:
Name
Bit 7
Bit 6
SSP2IP
BCL2IP
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Reset
Values
on Page:
TMR0IE
INT0IE
RBIE
TMR0IF
INT0IF
RBIF
59
RC2IP
TX2IP
TMR4IP
CCP5IP
CCP4IP
CCP3IP
61
PIR3
SSP2IF
BCL2IF
RC2IF
TX2IF
TMR4IF
CCP5IF
CCP4IF
CCP3IF
61
PIE3
SSP2IE
BCL2IE
RC2IE
TX2IE
TMR4IE
CCP5IE
CCP4IE
CCP3IE
61
TMR4
T4CON
PR4
Timer4 Register
62
62
62
Legend: = unimplemented, read as 0. Shaded cells are not used by the Timer4 module.
DS39762B-page 180
Preliminary
PIC18F97J60 FAMILY
16.0
CAPTURE/COMPARE/PWM
(CCP) MODULES
register. For the sake of clarity, all CCPx module operation in the following sections is described with respect
to CCP4, but is equally applicable to CCP5.
REGISTER 16-1:
U-0
U-0
R/W-0
R/W-0
R/W-0
R/W-0
R/W-0
R/W-0
DCxB1
DCxB0
CCPxM3
CCPxM2
CCPxM1
CCPxM0
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
-n = Value at POR
1 = Bit is set
0 = Bit is cleared
x = Bit is unknown
bit 7-6
Unimplemented: Read as 0
bit 5-4
bit 3-0
Preliminary
DS39762B-page 181
PIC18F97J60 FAMILY
16.1
16.1.1
16.1.2
TABLE 16-1:
CCPx/ECCPx Mode
Timer Resource
Capture
Compare
PWM
Timer1 or Timer3
Timer1 or Timer3
Timer2 or Timer4
FIGURE 16-1:
T3CCP<2:1> = 00
T3CCP<2:1> = 01
T3CCP<2:1> = 10
T3CCP<2:1> = 11
TMR1
TMR1
TMR1
TMR1
TMR3
TMR3
ECCP1
ECCP1
TMR3
ECCP1
TMR3
ECCP1
ECCP2
ECCP2
ECCP3
ECCP3
ECCP3
ECCP3
CCP4
CCP4
CCP4
CCP4
CCP5
CCP5
CCP5
CCP5
TMR2
TMR4
DS39762B-page 182
TMR2
TMR4
ECCP2
TMR2
ECCP2
TMR4
TMR2
TMR4
Preliminary
PIC18F97J60 FAMILY
16.2
16.2.3
Capture Mode
16.2.4
16.2.2
If RG4/CCP5/P1D is configured as an
output, a write to the port can cause a
capture condition.
EXAMPLE 16-1:
CLRF
MOVLW
FIGURE 16-2:
CCPx PRESCALER
16.2.1
SOFTWARE INTERRUPT
MOVWF
CHANGING BETWEEN
CAPTURE PRESCALERS
(CCP5 SHOWN)
CCP5CON
; Turn CCP module off
NEW_CAPT_PS ; Load WREG with the
; new prescaler mode
; value and CCP ON
CCP5CON
; Load CCP5CON with
; this value
TMR3L
Set CCP4IF
T3CCP2
CCP4 Pin
Prescaler
1, 4, 16
and
Edge Detect
CCPR4H
T3CCP2
4
CCP4CON<3:0>
Q1:Q4
CCP5CON<3:0>
TMR3
Enable
CCPR4L
TMR1
Enable
TMR1H
TMR1L
TMR3H
TMR3L
Set CCP5IF
4
T3CCP1
T3CCP2
TMR3
Enable
CCP5 Pin
Prescaler
1, 4, 16
and
Edge Detect
CCPR5H
CCPR5L
TMR1
Enable
T3CCP2
T3CCP1
Preliminary
TMR1H
TMR1L
DS39762B-page 183
PIC18F97J60 FAMILY
16.3
Compare Mode
Note:
16.3.2
FIGURE 16-3:
16.3.1
16.3.3
Set CCP4IF
CCPR4L
CCP4 pin
Comparator
Output
Logic
Compare
Match
R
TRIS
Output Enable
4
CCP4CON<3:0>
0
TMR1H
TMR1L
TMR3H
TMR3L
T3CCP1
T3CCP2
Set CCP5IF
Comparator
CCPR5H
CCP5 pin
Compare
Match
Output
Logic
4
CCPR5L
R
TRIS
Output Enable
CCP5CON<3:0>
DS39762B-page 184
Preliminary
PIC18F97J60 FAMILY
TABLE 16-2:
Name
INTCON
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Reset
Values
on Page:
INT0IE
RBIE
TMR0IF
INT0IF
RBIF
59
RCON
IPEN
CM
RI
TO
PD
POR
BOR
60
PIR1
PSPIF
ADIF
RC1IF
TX1IF
SSP1IF
CCP1IF
TMR2IF
TMR1IF
61
PIE1
PSPIE
ADIE
RC1IE
TX1IE
SSP1IE
CCP1IE
TMR2IE
TMR1IE
61
IPR1
PSPIP
ADIP
RC1IP
TX1IP
SSP1IP
CCP1IP
TMR2IP
TMR1IP
61
PIR2
OSCFIF
CMIF
ETHIF
BCL1IF
TMR3IF
CCP2IF
61
PIE2
OSCFIE
CMIE
ETHIE
BCL1IE
TMR3IE
CCP2IE
61
IPR2
OSCFIP
CMIP
ETHIP
BCL1IP
TMR3IP
CCP2IP
61
PIR3
SSP2IF
BCL2IF
RC2IF
TX2IF
TMR4IF
CCP5IF
CCP4IF
CCP3IF
61
PIE3
SSP2IE
BCL2IE
RC2IE
TX2IE
TMR4IE
CCP5IE
CCP4IE
CCP3IE
61
IPR3
SSP2IP
BCL2IP
RC2IP
TX2IP
TMR4IP
CCP5IP
CCP4IP
CCP3IP
61
TRISG4
TRISG3(1)
TRISG2
TRISG1
TRISG0
TRISG
TRISG7
TRISG6
TRISG5
61
TMR1L
60
TMR1H
60
T1CON
RD16
T1RUN
TMR3H
TMR3L
T3CON
RD16
TMR1CS TMR1ON
60
60
60
T3CCP1
T3SYNC
TMR3CS TMR3ON
61
CCPR4L
62
CCPR4H
62
CCPR5L
63
CCPR5H
63
CCP4CON
DC4B1
DC4B0
CCP4M3
CCP4M2
CCP4M1
CCP4M0
63
CCP5CON
DC5B1
DC5B0
CCP5M3
CCP5M2
CCP5M1
CCP5M0
63
Legend: = unimplemented, read as 0, r = reserved. Shaded cells are not used by Capture/Compare, Timer1 or
Timer3.
Note 1: This bit is only available in 80-pin and 100-pin devices; otherwise, it is unimplemented and reads as 0.
Preliminary
DS39762B-page 185
PIC18F97J60 FAMILY
16.4
16.4.1
PWM Mode
FIGURE 16-4:
EQUATION 16-1:
PWM Period = [(PR2) + 1] 4 TOSC
(TMR2 Prescale Value)
PWM frequency is defined as 1/[PWM period].
When TMR2 (TMR4) is equal to PR2 (PR4), the
following three events occur on the next increment
cycle:
TMR2 (TMR4) is cleared
The CCPx pin is set (exception: if PWM duty
cycle = 0%, the CCPx pin will not be set)
The PWM duty cycle is latched from CCPRxL into
CCPRxH
Note:
0
CCPxCON<5:4>
CCPRxL
Latch
Duty Cycle
(1)
CCPRxH
Comparator
R
Reset
CCPx
pin
TMRx
TMRx = PRx
Match
16.4.2
2 LSbs Latched
From Q clocks
Comparator
PRx
TRIS
Output Enable
FIGURE 16-5:
PWM OUTPUT
PWM PERIOD
EQUATION 16-2:
PWM Duty Cycle = (CCPRXL:CCPXCON<5:4>)
TOSC (TMRx Prescale Value)
CCPRxL and CCPxCON<5:4> can be written to at any
time, but the duty cycle value is not latched into
CCPRxH until after a match between PR2 (PR4) and
TMR2 (TMR4) occurs (i.e., the period is complete). In
PWM mode, CCPRxH is a read-only register.
Period
Duty Cycle
TMR2 (TMR4) = PR2 (PR4)
TMR2 (TMR4) = Duty Cycle
TMR2 (TMR4) = PR2 (TMR4)
DS39762B-page 186
Preliminary
PIC18F97J60 FAMILY
The CCPRxH register and a 2-bit internal latch are
used to double-buffer the PWM duty cycle. This
double-buffering is essential for glitchless PWM
operation.
When the CCPRxH and 2-bit latch match TMR2
(TMR4), concatenated with an internal 2-bit Q clock or
2 bits of the TMR2 (TMR4) prescaler, the CCPx pin is
cleared.
The maximum PWM resolution (bits) for a given PWM
frequency is given by Equation 16-3:
16.4.3
2.
3.
4.
EQUATION 16-3:
FOSC
log FPWM
PWM Resolution (max) =
log(2)
Note:
5.
bits
TABLE 16-3:
PWM Frequency
Timer Prescaler (1, 4, 16)
PR2 Value
Maximum Resolution (bits)
2.44 kHz
9.77 kHz
39.06 kHz
156.25 kHz
312.50 kHz
416.67 kHz
16
FFh
FFh
FFh
3Fh
1Fh
17h
10
10
10
6.58
Preliminary
DS39762B-page 187
PIC18F97J60 FAMILY
TABLE 16-4:
Name
INTCON
Bit 6
GIE/GIEH PEIE/GIEL
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Reset
Values
on Page:
TMR0IE
INT0IE
RBIE
TMR0IF
INT0IF
RBIF
59
IPEN
CM
RI
TO
PD
POR
BOR
60
PIR1
PSPIF
ADIF
RC1IF
TX1IF
SSP1IF
CCP1IF
TMR2IF
TMR1IF
61
PIE1
PSPIE
ADIE
RC1IE
TX1IE
SSP1IE
CCP1IE
TMR2IE
TMR1IE
61
IPR1
PSPIP
ADIP
RC1IP
TX1IP
SSP1IP
CCP1IP
TMR2IP
TMR1IP
61
RCON
PIR3
SSP2IF
BCL2IF
RC2IF
TX2IF
TMR4IF
CCP5IF
CCP4IF
CCP3IF
61
PIE3
SSP2IE
BCL2IE
RC2IE
TX2IE
TMR4IE
CCP5IE
CCP4IE
CCP3IE
61
IPR3
SSP2IP
BCL2IP
RC2IP
TX2IP
TMR4IP
CCP5IP
CCP4IP
CCP3IP
61
TRISG
TRISG7
TRISG6
TRISG5
TRISG4
TRISG3(1)
TRISG2
TRISG1
TRISG0
61
TMR2
Timer2 Register
60
PR2
60
T2CON
TMR4
Timer4 Register
PR4
T4CON
60
62
62
62
CCPR4L
62
CCPR4H
62
CCPR5L
63
CCPR5H
63
CCP4CON
DC4B1
DC4B0
CCP4M3
63
CCP5CON
DC5B1
DC5B0
CCP5M3
63
Legend: = unimplemented, read as 0. Shaded cells are not used by PWM, Timer2 or Timer4.
Note 1: This bit is only available in 80-pin and 100-pin devices; otherwise, it is unimplemented and reads as 0.
DS39762B-page 188
Preliminary
PIC18F97J60 FAMILY
17.0
ENHANCED CAPTURE/
COMPARE/PWM (ECCP)
MODULES
REGISTER 17-1:
R/W-0
R/W-0
R/W-0
R/W-0
R/W-0
R/W-0
R/W-0
R/W-0
PxM1
PxM0
DCxB1
DCxB0
CCPxM3
CCPxM2
CCPxM1
CCPxM0
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
-n = Value at POR
1 = Bit is set
0 = Bit is cleared
x = Bit is unknown
bit 7-6
bit 5-4
bit 3-0
Note 1:
Implemented only for ECCP1 and ECCP2; same as 1010 for ECCP3.
Preliminary
DS39762B-page 189
PIC18F97J60 FAMILY
17.1
17.1.1
17.1.2
17.1.3
17.1.4
DS39762B-page 190
Preliminary
PIC18F97J60 FAMILY
TABLE 17-1:
ECCP Mode
RC2
RD0 or
RE6(1)
RE5
RG4
RH7(2)
RH6(2)
00xx 11xx
ECCP1
RD0/RE6
RE5
RG4/CCP5
RH7/AN15
RH6/AN14
Dual PWM
10xx 11xx
P1A
P1B
RE5
RG4/CCP5
RH7/AN15
RH6/AN14
Quad PWM
x1xx 11xx
P1A
P1B
P1C
P1D
RH7/AN15
RH6/AN14
00xx 11xx
ECCP1
RD0/RE6
RE5/AD13
RG4/CCP5
RH7/AN15
RH6/AN14
Dual PWM
10xx 11xx
P1A
RD0/RE6
RE5/AD13
RG4/CCP5
P1B
RH6/AN14
Quad PWM(3)
x1xx 11xx
P1A
RD0/RE6
RE5/AD13
P1D
P1B
P1C
100-Pin Devices, ECCPMX = 1, Extended Microcontroller mode with 16-Bit or 20-Bit Address Width:
Compatible CCP
Legend:
Note 1:
2:
3:
00xx 11xx
ECCP1
RD0/RE6
RE5/AD13
RG4/CCP5
RH7/AN15
RH6/AN14
x = Dont care. Shaded cells indicate pin assignments not used by ECCP1 in a given mode.
P1B is multiplexed with RD0 on 64-pin devices, and RE6 on 80-pin and 100-pin devices.
These pin options are not available on 64-pin devices.
With ECCP1 in Quad PWM mode, the CCP5 pins output is overridden by P1D; otherwise, CCP5 is fully
operational.
TABLE 17-2:
ECCP Mode
CCP2CON
Configuration
Compatible CCP
00xx 11xx
RB3/INT3
ECCP2
RE7
RE2
Dual PWM
10xx 11xx
RB3/INT3
P2A
RE7
Quad PWM
x1xx 11xx
RB3/INT3
P2A
RE7
Compatible CCP
00xx 11xx
RB3/INT3
RC1/T1OS1
ECCP2
Dual PWM
10xx 11xx
RB3/INT3
RC1/T1OS1
P2A
Quad PWM
x1xx 11xx
RB3/INT3
RC1/T1OS1
P2A
Compatible CCP
00xx 11xx
ECCP2
RC1/T1OS1
RE7/AD15
Dual PWM
10xx 11xx
P2A
RC1/T1OS1
Quad PWM
x1xx 11xx
P2A
RC1/T1OS1
RB3
RC1
RE7
RE2
RE1
RE0
RE1
RE0
P2B
RE1
RE0
P2B
P2C
P2D
RE2
RE1
RE0
P2B
RE1
RE0
P2B
P2C
P2D
RE2/CS
RE1/WR
RE0/RD
RE7/AD15
P2B
RE1/WR
RE0/RD
RE7/AD15
P2B
P2C
P2D
Legend: x = Dont care. Shaded cells indicate pin assignments not used by ECCP2 in a given mode.
Preliminary
DS39762B-page 191
PIC18F97J60 FAMILY
TABLE 17-3:
ECCP Mode
RD1 or
RG0(1)
RE4
RD2 or
RG3(1)
RE3
RH5(2)
RH4(2)
00xx 11xx
ECCP3
RE4
RE3
RD2/RG3
RH5/AN13
RH4/AN12
Dual PWM
10xx 11xx
P3A
P3B
RE3
RD2/RG3
RH5/AN13
RH4/AN12
Quad PWM
x1xx 11xx
P3A
P3B
P3C
P3D
RH5/AN13
RH4/AN12
00xx 11xx
ECCP3
RE6/AD14
RE5/AD13
RD2/RG3
RH5/AN13
RH4/AN12
Dual PWM
10xx 11xx
P3A
RE6/AD14
RE5/AD13
RD2/RG3
P3B
RH4/AN12
Quad PWM(3)
x1xx 11xx
P3A
RE6/AD14
RE5/AD13
P3D
P3B
P3C
00xx 11xx
ECCP3
RE4/AD12
RE3/AD11
RD2/RG3
RH5/AN13
RH4/AN12
Dual PWM
10xx 11xx
P3A
P3B
RE3/AD11
RD2/RG3
RH5/AN13
RH4/AN12
100-Pin Devices, ECCPMX = 1, Extended Microcontroller mode with 16-Bit or 20-Bit Address Width:
Compatible CCP
Legend:
Note 1:
2:
3:
17.2
00xx 11xx
ECCP3
RE6/AD14
17.2.1
RE5/AD13
RD2/RG3
RH5/AN13
RH4/AN12
x = Dont care. Shaded cells indicate pin assignments not used by ECCP3 in a given mode.
ECCP3/P3A and CCP4/P3D are multiplexed with RD1 and RD2 on 64-pin devices, and RG0 and RG3 on
80-pin and 100-pin devices.
These pin options are not available on 64-pin devices.
With ECCP3 in Quad PWM mode, the CCP4 pins output is overridden by P3D; otherwise, CCP4 is fully
operational.
DS39762B-page 192
17.3
Preliminary
PIC18F97J60 FAMILY
17.4
FIGURE 17-1:
17.4.1
PWM PERIOD
EQUATION 17-1:
PWM Period = [(PR2) + 1] 4 TOSC
(TMR2 Prescale Value)
PWM frequency is defined as 1/[PWM period]. When
TMR2 is equal to PR2, the following three events occur
on the next increment cycle:
TMR2 is cleared
The ECCP1 pin is set (if PWM duty cycle = 0%,
the ECCP1 pin will not be set)
The PWM duty cycle is copied from CCPR1L into
CCPR1H
Note:
CCP1CON<5:4>
CCP1M<3:0>
4
P1M1<1:0>
2
CCPR1L
ECCP1/P1A
ECCP1/P1A
TRISx<x>
CCPR1H (Slave)
P1B
R
Comparator
Output
Controller
P1B
TRISx<x>
P1C
TMR2
TRISx<x>
S
P1D
Comparator
PR2
P1C
(Note 1)
Clear Timer,
set ECCP1 pin and
latch D.C.
P1D
TRISx<x>
ECCP1DEL
Note: The 8-bit timer TMR2 register is concatenated with the 2-bit internal Q clock, or 2 bits of the prescaler, to create the 10-bit
time base.
Preliminary
DS39762B-page 193
PIC18F97J60 FAMILY
17.4.2
Note:
17.4.3
EQUATION 17-2:
Single Output
Half-Bridge Output
Full-Bridge Output, Forward mode
Full-Bridge Output, Reverse mode
EQUATION 17-3:
log FOSC
FPWM
PWM Resolution (max) =
log(2)
TABLE 17-4:
) bits
PWM Frequency
Timer Prescaler (1, 4, 16)
PR2 Value
Maximum Resolution (bits)
DS39762B-page 194
2.44 kHz
9.77 kHz
39.06 kHz
156.25 kHz
312.50 kHz
416.67 kHz
16
FFh
FFh
FFh
3Fh
1Fh
17h
10
10
10
6.58
Preliminary
PIC18F97J60 FAMILY
FIGURE 17-2:
CCP1CON<7:6>
SIGNAL
PR2 + 1
Duty
Cycle
Period
00 (Single Output)
P1A Modulated
Delay(1)
Delay(1)
P1A Modulated
10
(Half-Bridge)
P1B Modulated
P1A Active
01
(Full-Bridge,
Forward)
P1B Inactive
P1C Inactive
P1D Modulated
P1A Inactive
11
(Full-Bridge,
Reverse)
P1B Modulated
P1C Active
P1D Inactive
FIGURE 17-3:
CCP1CON<7:6>
SIGNAL
Duty
Cycle
PR2 + 1
Period
00
(Single Output)
P1A Modulated
P1A Modulated
10
(Half-Bridge)
Delay(1)
Delay(1)
P1B Modulated
P1A Active
01
(Full-Bridge,
Forward)
P1B Inactive
P1C Inactive
P1D Modulated
P1A Inactive
11
(Full-Bridge,
Reverse)
P1B Modulated
P1C Active
P1D Inactive
Relationships:
Period = 4 * TOSC * (PR2 + 1) * (TMR2 Prescale Value)
Duty Cycle = TOSC * (CCPR1L<7:0>:CCP1CON<5:4>) * (TMR2 Prescale Value)
Delay = 4 * TOSC * (ECCP1DEL<6:0>)
Note 1: Dead-band delay is programmed using the ECCP1DEL register (Section 17.4.6 Programmable
Dead-Band Delay).
Preliminary
DS39762B-page 195
PIC18F97J60 FAMILY
17.4.4
HALF-BRIDGE MODE
FIGURE 17-4:
HALF-BRIDGE PWM
OUTPUT
Period
Period
Duty Cycle
P1A(2)
td
td
P1B(2)
(1)
(1)
(1)
FIGURE 17-5:
FET
Driver
+
V
-
P1A
Load
FET
Driver
+
V
-
P1B
V-
FET
Driver
P1A
FET
Driver
Load
FET
Driver
P1B
V-
DS39762B-page 196
Preliminary
PIC18F97J60 FAMILY
17.4.5
FULL-BRIDGE MODE
FIGURE 17-6:
Forward Mode
Period
P1A(2)
Duty Cycle
P1B(2)
P1C(2)
P1D(2)
(1)
(1)
Reverse Mode
Period
Duty Cycle
P1A(2)
P1B(2)
P1C(2)
P1D(2)
(1)
(1)
Note 1: At this time, the TMR2 register is equal to the PR2 register.
Note 2: Output signal is shown as active-high.
Preliminary
DS39762B-page 197
PIC18F97J60 FAMILY
FIGURE 17-7:
PIC18F97J60
FET
Driver
QC
QA
FET
Driver
P1A
Load
P1B
FET
Driver
P1C
FET
Driver
QD
QB
VP1D
17.4.5.1
DS39762B-page 198
1.
2.
Figure 17-9 shows an example where the PWM direction changes from forward to reverse at a near 100%
duty cycle. At time t1, the outputs, P1A and P1D,
become inactive, while output, P1C, becomes active. In
this example, since the turn-off time of the power
devices is longer than the turn-on time, a shoot-through
current may flow through power devices, QC and QD
(see Figure 17-7), for the duration of t. The same
phenomenon will occur to power devices, QA and QB,
for PWM direction change from reverse to forward.
If changing PWM direction at high duty cycle is required
for an application, one of the following requirements
must be met:
1.
2.
Preliminary
PIC18F97J60 FAMILY
FIGURE 17-8:
SIGNAL
Period
P1A (Active-High)
P1B (Active-High)
DC
P1C (Active-High)
(Note 2)
P1D (Active-High)
DC
Note 1: The direction bit in the ECCP1 Control register (CCP1CON<7>) is written at any time during the PWM cycle.
2: When changing directions, the P1A and P1C signals switch before the end of the current PWM cycle at intervals
of 4 TOSC, 16 TOSC or 64 TOSC, depending on the Timer2 prescaler value. The modulated P1B and P1D signals
are inactive at this time.
FIGURE 17-9:
t1
Reverse Period
P1A(1)
P1B(1)
DC
P1C(1)
P1D(1)
DC
tON(2)
Potential
Shoot-Through
Current(1)
Note 1: All signals are shown as active-high.
2: tON is the turn-on delay of power switch QC and its driver.
3: tOFF is the turn-off delay of power switch QD and its driver.
Preliminary
DS39762B-page 199
PIC18F97J60 FAMILY
17.4.6
PROGRAMMABLE DEAD-BAND
DELAY
17.4.7
ENHANCED PWM
AUTO-SHUTDOWN
REGISTER 17-2:
R/W-0
R/W-0
R/W-0
R/W-0
R/W-0
R/W-0
R/W-0
R/W-0
P1RSEN
P1DC6
P1DC5
P1DC4
P1DC3
P1DC2
P1DC1
P1DC0
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
-n = Value at POR
1 = Bit is set
0 = Bit is cleared
x = Bit is unknown
bit 7
bit 6-0
DS39762B-page 200
Preliminary
PIC18F97J60 FAMILY
REGISTER 17-3:
R/W-0
R/W-0
R/W-0
R/W-0
R/W-0
R/W-0
R/W-0
R/W-0
ECCP1ASE
ECCP1AS2
ECCP1AS1
ECCP1AS0
PSS1AC1
PSS1AC0
PSS1BD1
PSS1BD0
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
-n = Value at POR
1 = Bit is set
0 = Bit is cleared
x = Bit is unknown
bit 7
bit 6-4
bit 3-2
bit 1-0
17.4.7.1
17.4.8
START-UP CONSIDERATIONS
Preliminary
DS39762B-page 201
PIC18F97J60 FAMILY
The P1A, P1B, P1C and P1D output latches may not be
in the proper states when the PWM module is initialized.
Enabling the PWM pins for output at the same time as
the ECCP1 module may cause damage to the application circuit. The ECCP1 module must be enabled in the
FIGURE 17-10:
Shutdown Event
ECCP1ASE bit
PWM Activity
Normal PWM
Start of
PWM Period
FIGURE 17-11:
Shutdown
Shutdown
Event Occurs Event Clears
PWM
Resumes
Shutdown Event
ECCP1ASE bit
PWM Activity
Normal PWM
Start of
PWM Period
DS39762B-page 202
ECCP1ASE
Cleared by
Shutdown
Shutdown Firmware PWM
Event Occurs Event Clears
Resumes
Preliminary
PIC18F97J60 FAMILY
17.4.9
8.
2.
3.
4.
5.
6.
7.
17.4.10
EFFECTS OF A RESET
Preliminary
DS39762B-page 203
PIC18F97J60 FAMILY
TABLE 17-5:
Name
INTCON
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Reset
Values
on Page:
GIE/GIEH
PEIE/GIEL
TMR0IE
INT0IE
RBIE
TMR0IF
INT0IF
RBIF
59
60
RCON
IPEN
CM
RI
TO
PD
POR
BOR
PIR1
PSPIF
ADIF
RC1IF
TX1IF
SSP1IF
CCP1IF
TMR2IF
TMR1IF
61
PIE1
PSPIE
ADIE
RC1IE
TX1IE
SSP1IE
CCP1IE
TMR2IE
TMR1IE
61
IPR1
PSPIP
ADIP
RC1IP
TX1IP
SSP1IP
CCP1IP
TMR2IP
TMR1IP
61
PIR2
OSCFIF
CMIF
ETHIF
BCL1IF
TMR3IF
CCP2IF
61
PIE2
OSCFIE
CMIE
ETHIE
BCL1IE
TMR3IE
CCP2IE
61
IPR2
OSCFIP
CMIP
ETHIP
BCL1IP
TMR3IP
CCP2IP
61
PIR3
SSP2IF
BCL2IF
RC2IF
TX2IF
TMR4IF
CCP5IF
CCP4IF
CCP3IF
61
PIE3
SSP2IE
BCL2IE
RC2IE
TX2IE
TMR4IE
CCP5IE
CCP4IE
CCP3IE
61
IPR3
SSP2IP
BCL2IP
RC2IP
TX2IP
TMR4IP
CCP5IP
CCP4IP
CCP3IP
61
TRISB
TRISB7
TRISB6
TRISB5
TRISB4
TRISB3
TRISB2
TRISB1
TRISB0
61
TRISC
TRISC7
TRISC6
TRISC5
TRISC4
TRISC3
TRISC2
TRISC1
TRISC0
61
61
TRISD(1)
TRISD7
TRISD6
TRISD5
TRISD4
TRISD3
TRISD2
TRISD1
TRISD0
TRISE
TRISE7(2)
TRISE6(2)
TRISE5
TRISE4
TRISE3
TRISE2
TRISE1
TRISE0
61
TRISG
TRISG7
TRISG6
TRISG5
TRISG4
TRISG3(2)
TRISG2
TRISG1
TRISG0(2)
61
TRISH(2)
TRISH7
TRISH6
TRISH5
TRISH4
TRISH3
TRISH2
TRISH1
TRISH0
61
TMR1L
TMR1H
T1CON
T1RUN
60
T1OSCEN
T1SYNC
TMR1CS
TMR1ON
60
TMR2ON
T2CKPS1
T2CKPS0
60
RD16
TMR2
60
T1CKPS1
T1CKPS0
Timer2 Register
T2CON
60
PR2
60
TMR3L
60
TMR3H
T3CON
TMR4
T3CCP2
60
T3CKPS1
T3CKPS0
T3CCP1
T3SYNC
TMR3CS
TMR3ON
Timer4 Register
T4CON
61
62
TMR4ON
T4CKPS1
T4CKPS0
62
PR4
CCPRxL(3)
60
CCPRxH(3)
60
CCPxCON(3)
ECCPxAS(3)
ECCPxDEL(3)
Legend:
Note 1:
2:
3:
PxM1
PxM0
62
DCxB1
DCxB0
PxDC6
PxDC5
PxDC4
CCPxM3
CCPxM2
CCPxM1
CCPxM0
60
PSSXAC1
PSSXAC0
PSSXBD1
PSSXBD0
60, 63
PxDC3
PxDC2
PxDC1
PxDC0
63
= unimplemented, read as 0, r = reserved. Shaded cells are not used during ECCPx operation.
Applicable to 64-pin devices only.
Registers and/or specific bits are unimplemented on 64-pin devices.
Generic term for all of the identical registers of this name for all Enhanced CCPx modules, where x identifies the individual
module (ECCP1, ECCP2 or ECCP3). Bit assignments and Reset values for all registers of the same generic name are
identical.
DS39762B-page 204
Preliminary
PIC18F97J60 FAMILY
18.0
ETHERNET MODULE
1.
2.
3.
4.
5.
FIGURE 18-1:
8-Kbyte
Ethernet RAM
Buffer
PHY
Arbiter
ch0
TPOUT+
RXF (Filter)
MII
Interface
ch1
ch0
ch2
TX
TPOUT-
DMA and
IP Checksum
TPIN+
TX
ch1
RX
TXBM
Ethernet
Buffer
Addresses
Flow Control
Ethernet
Data
MIIM
Interface
TPIN-
RBIAS
Host Interface
Ethernet
Buffer Pointers
EDATA
Ethernet
Control
MIRD/MIWR
MIREGADR
LEDA/LEDB Control
Microcontroller SFRs
Preliminary
DS39762B-page 205
PIC18F97J60 FAMILY
18.1
18.1.1
In addition to the signal connections, the Ethernet module has its own independent voltage source and ground
connections for the PHY module. Separate connections
are provided for the receiver (VDDRX and VSSRX), the
transmitter (VDDTX and VSSTX) and the transmitters
internal PLL (VDDPLL and VSSPLL). Although the voltage
requirements are the same as VDD and VSS for the
microcontroller, the pins are not internally connected.
For the Ethernet module to operate properly, supply
voltage and ground must be connected to these pins. All
of the microcontrollers power and ground supply pins
should be externally connected to the same power
source or ground node, with no inductors or other filter
components between the microcontroller and Ethernet
modules VDD pins.
Besides the independent voltage connections, the PHY
module has a separate bias current input pin, RBIAS.
A bias current, derived from an external resistor, must
be applied to RBIAS for proper transceiver operation.
LED CONFIGURATION
DS39762B-page 206
TABLE 18-1:
Stretch Length
18.1.2
TNSTRCH (normal)
40
TMSTRCH (medium)
70
TLSTRCH (long)
140
18.1.3
OSCILLATOR REQUIREMENTS
18.1.3.1
Start-up Timer
Preliminary
PIC18F97J60 FAMILY
18.1.4
FIGURE 18-2:
PIC18FXXJ6X
3.3V
RJ-45
CMC(3)
TPOUT+
49.9, 1%
(4)
Ferrite
Bead(1,2)
C1
OSC1
49.9, 1%
25 MHz
0.1 F(2)
1:1 CT
TPOUT-
CMC(3)
TPIN+
C2
49.9, 1%
(4)
OSC2
49.9, 1%
0.1 F
1:1 CT
TPIN-
2.26 k, 1%
75(2)
RBIAS
75(2)
LEDB
75(2)
LEDA
75(2)
7
8
1 nF, 2 kV(3)
Note
1:
2:
These components are installed for EMI reduction purposes. Power Over Ethernet applications may require their removal.
3:
Recommended insertion point for Common-Mode Chokes (CMCs) if required for EMI reduction.
4:
See Section 2.3 Crystal Oscillator/Ceramic Resonators (HS Modes) for recommended values.
Preliminary
DS39762B-page 207
PIC18F97J60 FAMILY
18.2
FIGURE 18-3:
Microcontroller SFRs
Ethernet Module
Ethernet Buffer
0000h
EDATA
ERDPT(H:L)
EWRPT(H:L)
ETXST(H:L)
ETXND(H:L)
ERXST(H:L)
ERXND(H:L)
ERXRDPT(H:L)
ERXWRPT(H:L)
Ethernet Data
1FFFh
Buffer Address
PHY Registers
PHY Register Data (In/Out)
MIRD(H:L)
MIWR(H:L)
00h
1Fh
PHY Register Address
MIREGADR
Note:
Microcontroller SFRs are not shown in the order of their placement in the data memory space. Memory areas are
not shown to scale.
DS39762B-page 208
Preliminary
PIC18F97J60 FAMILY
18.2.1
When the AUTOINC bit (ECON2<7>) is set, the associated Read or Write Pointer increments by one
address following each read or write operation. This
eliminates the need to constantly update a pointer after
each read or write, simplifying multiple sequential
operations. By default, the AUTOINC bit is set.
18.2.1.1
FIGURE 18-4:
0000h
AAh
Transmit
Buffer
Receive
Buffer
(Circular FIFO)
55h
1FFFh
Preliminary
DS39762B-page 209
PIC18F97J60 FAMILY
18.2.1.2
Receive Buffer
FIGURE 18-5:
ERXRDPT:
Sets boundary that Internal
Write Pointer cannot advance
beyond. Prevents Internal
Write Pointer from moving
into Packet 1s data space.
ERDPT:
Data being read
out to application.
ERXND
PB
Unused Buffer
(may contain old data)
Packet 1
(being processed
by application)
PB
Packet 4
(currently being
received)
Packet 2
ERXWRPT:
Shows the end of
the last complete
received packet.
Packet 3
PB
PB
Direction of reading and writing data
(lower to higher buffer addresses)
DS39762B-page 210
Preliminary
PIC18F97J60 FAMILY
18.2.1.3
Transmit Buffer
18.2.1.4
The Ethernet buffer is clocked at one-half of the microcontroller clock rate. Varying amounts of memory
access bandwidth are available depending on the clock
speed. The total bandwidth available, in bytes per second, is equal to twice the instruction rate (2 * FCY, or
FOSC/2). For example, at a system clock speed of
41.667 MHz, the total available memory bandwidth that
is available is 20.834 Mbyte/s. At an Ethernet signaling
rate of 10 Mbit/s, the Ethernet RX engine requires
1.25 Mbyte/s of buffer memory bandwidth to operate
without causing an overrun. If Full-Duplex mode is
used, an additional 1.25 Mbyte/s is required to allow for
simultaneous RX and TX activity.
Because of the finite available memory bandwidth, a
three-channel arbiter is used to allocate bandwidth
between the RX engine, the TX and DMA engines, and
the microcontrollers CPU (i.e., the application access-
TABLE 18-2:
18.2.1.5
FOSC
(MHz)
FCY
(MHz)
After RX
After TX
Application Restrictions
to Prevent Underrun/Overrun
41.667
10.42
20.83
19.58
18.33
31.250
7.81
15.63
14.38
13.13
25.000
6.25
12.50
11.25
10.00
20.833
5.21
10.42
9.17
7.92
13.889
3.47
6.94
5.69
4.44
12.500
3.13
6.25
5.00
3.75
8.333
2.08
4.17
2.92
1.67
6.250
1.56
3.13
1.88
0.63
4.167
1.04
2.08
0.83
<0
2.778
0.69
1.39
0.14
<0
Preliminary
DS39762B-page 211
PIC18F97J60 FAMILY
18.2.2
ECON1
EDATA
EIR
The Ethernet Buffer Read Pointer pair (ERDPTH
and ERDPTL)
REGISTER 18-1:
18.2.3
R/W-0
R/W-0
R/W-0
R/W-0
R/W-0
R/W-0
U-0
U-0
TXRST
RXRST
DMAST
CSUMEN
TXRTS
RXEN
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
-n = Value at POR
1 = Bit is set
0 = Bit is cleared
x = Bit is unknown
bit 7
bit 6
bit 5
bit 4
bit 3
bit 2
bit 1-0
Unimplemented: Read as 0
DS39762B-page 212
Preliminary
PIC18F97J60 FAMILY
REGISTER 18-2:
R/W-0(1)
R/W-1
AUTOINC
PKTDEC
R/W-0
U-0
U-0
U-0
U-0
U-0
ETHEN
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
-n = Value at POR
1 = Bit is set
0 = Bit is cleared
x = Bit is unknown
bit 7
bit 6
bit 5
bit 4-0
Unimplemented: Read as 0
Note 1:
REGISTER 18-3:
U-0
R/C-0
U-0
R/C-0
U-0
R-0
R/C-0
R-0
BUFER
RXBUSY
TXABRT
PHYRDY
bit 7
bit 0
Legend:
R = Readable bit
C = Clearable bit
-n = Value at POR
1 = Bit is set
0 = Bit is cleared
x = Bit is unknown
bit 7
Unimplemented: Read as 0
bit 6
bit 5
Unimplemented: Read as 0
bit 4
Reserved: Write as 0
bit 3
Unimplemented: Read as 0
bit 2
bit 1
bit 0
Preliminary
DS39762B-page 213
PIC18F97J60 FAMILY
18.2.4
REGISTER 18-4:
U-0
U-0
U-0
R-0
R/W-0
R/W-0
R/W-0
R/W-0
TXPAUS
RXPAUS
PASSALL
MARXEN
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
-n = Value at POR
1 = Bit is set
0 = Bit is cleared
x = Bit is unknown
bit 7-5
Unimplemented: Read as 0
bit 4
bit 3
bit 2
bit 1
bit 0
DS39762B-page 214
Preliminary
PIC18F97J60 FAMILY
REGISTER 18-5:
R/W-0
R/W-0
R/W-0
R/W-0
R/W-0
R/W-0
R/W-0
R/W-0
PADCFG2
PADCFG1
PADCFG0
TXCRCEN
PHDREN
HFRMEN
FRMLNEN
FULDPX
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
-n = Value at POR
1 = Bit is set
0 = Bit is cleared
x = Bit is unknown
bit 7-5
bit 4
bit 3
bit 2
bit 1
bit 0
Preliminary
DS39762B-page 215
PIC18F97J60 FAMILY
REGISTER 18-6:
U-0
R/W-0
R/W-0
R/W-0
U-0
U-0
R-0
R-0
DEFER
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
-n = Value at POR
1 = Bit is set
0 = Bit is cleared
x = Bit is unknown
bit 7
Unimplemented: Read as 0
bit 6
bit 5-4
Reserved: Maintain as 0
bit 3-2
Unimplemented: Read as 0
bit 1-0
Reserved: Maintain as 0
REGISTER 18-7:
U-0
U-0
U-0
U-0
U-0
U-0
R/W-0
R/W-0
MIISCAN
MIIRD
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
-n = Value at POR
1 = Bit is set
0 = Bit is cleared
x = Bit is unknown
bit 7-2
Unimplemented: Read as 0
bit 1
bit 0
DS39762B-page 216
Preliminary
PIC18F97J60 FAMILY
REGISTER 18-8:
U-0
U-0
U-0
U-0
R-0
R-0
R-0
R-0
NVALID
SCAN
BUSY
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
-n = Value at POR
1 = Bit is set
0 = Bit is cleared
x = Bit is unknown
bit 7-4
Unimplemented: Read as 0
bit 3
bit 2
bit 1
bit 0
18.2.5
PHY REGISTERS
18.2.5.1
PHSTAT Registers
18.2.5.2
Preliminary
DS39762B-page 217
PIC18F97J60 FAMILY
To read from a PHY register:
1.
2.
3.
4.
5.
DS39762B-page 218
Preliminary
PHLCON
14h
FRCLNK
Bit 14
Bit 15
Bit 11
r
r
LSTAT
Bit 10
Bit 9
HDLDIS
PDPXMD
Bit 8
Bit 7
Bit 6
Bit 5
PLNKIF
PLNKIE
RXAPDIS
Bit 4
Bit 12
Bit 13
Bit 3
LFRQ1
Legend: x = unknown, u = unchanged, - = unimplemented, read as 0, r = reserved, do not modify. Shaded cells are unimplemented, read as 0.
PHIE
PHIR
PHSTAT2
11h
13h
PHCON2
10h
12h
PHCON1
PHSTAT1
00h
Name
01h
Addr
TABLE 18-3:
LFRQ0
PGIF
LLSTAT
Bit 2
STRCH
PGEIE
Bit 1
Bit 0
Reset Values
PIC18F97J60 FAMILY
Preliminary
DS39762B-page 219
PIC18F97J60 FAMILY
REGISTER 18-9:
R/W-0
R/W-0
U-0
U-0
R/W-0
R/W-0
U-0
R/W-0
PDPXMD
bit 15
bit 8
R/W-0
U-0
U-0
U-0
U-0
U-0
U-0
U-0
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
-n = Value at POR
1 = Bit is set
0 = Bit is cleared
x = Bit is unknown
bit 15-14
Reserved: Write as 0
bit 13-12
Unimplemented: Read as 0
bit 11-10
Reserved: Write as 0
bit 9
Unimplemented: Read as 0
bit 8
bit 7
Reserved: Maintain as 0
bit 6-0
Unimplemented: Read as 0
U-0
U-0
R-1
R-1
U-0
U-0
U-0
bit 15
bit 8
U-0
U-0
U-0
U-0
U-0
R/LL-0
R/LH-0
U-0
LLSTAT
bit 7
bit 0
Legend:
1 = Bit is set
R = Read-only bit
0 = Bit is cleared
-n = Value at POR
bit 15-13
Unimplemented: Read as 0
bit 12-11
Reserved: Read as 1
bit 10-3
Unimplemented: Read as 0
bit 2
bit 1
bit 0
Unimplemented: Read as 0
DS39762B-page 220
Preliminary
PIC18F97J60 FAMILY
REGISTER 18-11: PHCON2: PHY CONTROL REGISTER 2
U-0
R/W-0
R/W-0
R/W-0
R/W-0
R/W-0
R/W-0
R/W-1
FRCLNK
HDLDIS(1)
bit 15
bit 8
R/W-0
R/W-0
R/W-0
R/W-1
(1)
RXAPDIS
R/W-0
R/W-0
R/W-0
R/W-0
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
-n = Value at POR
1 = Bit is set
0 = Bit is cleared
x = Bit is unknown
bit 15
Unimplemented: Read as 0
bit 14
bit 13-9
Reserved: Write as 0
bit 8
bit 7-5
Reserved: Write as 0
bit 4
bit 3-0
Reserved: Write as 0
Note 1:
Improper Ethernet operation may result if HDLDIS or RXAPDIS are cleared. Always maintain these bits
set.
Preliminary
DS39762B-page 221
PIC18F97J60 FAMILY
REGISTER 18-12: PHSTAT2: PHYSICAL LAYER STATUS REGISTER 2
U-0
U-0
R-0
R-0
R-0
R-0
R-x
U-0
TXSTAT
RXSTAT
COLSTAT
LSTAT
bit 15
bit 8
U-0
U-0
R-0
U-0
U-0
U-0
U-0
U-0
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
-n = Value at POR
1 = Bit is set
0 = Bit is cleared
x = Bit is unknown
bit 15-14
Unimplemented: Read as 0
bit 13
bit 12
bit 11
bit 10
bit 9
bit 8-6
Unimplemented: Read as 0
bit 5
bit 4-0
Unimplemented: Read as 0
DS39762B-page 222
Preliminary
PIC18F97J60 FAMILY
REGISTER 18-13: PHLCON: PHY MODULE LED CONTROL REGISTER
R/W-0
R/W-0
R/W-1
R/W-1
R/W-0
R/W-1
R/W-0
R/W-0
LACFG3
LACFG2
LACFG1
LACFG0
bit 15
bit 8
R/W-0
R/W-0
R/W-1
R/W-0
R/W-0
R/W-0
R/W-1
R/W-x
LBCFG3
LBCFG2
LBCFG1
LBCFG0
LFRQ1
LFRQ0
STRCH
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
-n = Value at POR
1 = Bit is set
0 = Bit is cleared
bit 15-14
x = Bit is unknown
Reserved: Write as 0
bit 13-12
Reserved: Write as 1
bit 11-8
bit 7-4
bit 3-2
LFRQ1:LFRQ0: LED Pulse Stretch Time Configuration bits (see Table 18-1)
11 = Reserved
10 = Stretch LED events by TLSTRCH
01 = Stretch LED events by TMSTRCH
00 = Stretch LED events by TNSTRCH
bit 1
bit 0
Reserved: Write as 0
Preliminary
DS39762B-page 223
PIC18F97J60 FAMILY
18.3
Ethernet Interrupts
Note:
FIGURE 18-6:
18.3.1
PLNKIF
PGIF
PLNKIE
PGEIE
DMAIE
LINKIF
LINKIE
Set ETHIF
TXIF
TXIE
ETHIE
TXERIF
TXERIE
RXERIF
RXERIE
DS39762B-page 224
Preliminary
PIC18F97J60 FAMILY
REGISTER 18-14: EIE: ETHERNET INTERRUPT ENABLE REGISTER
U-0
R/W-0
R/W-0
R/W-0
R/W-0
U-0
R/W-0
R/W-0
PKTIE
DMAIE
LINKIE
TXIE
TXERIE
RXERIE
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
-n = Value at POR
1 = Bit is set
0 = Bit is cleared
bit 7
Unimplemented: Read as 0
bit 6
bit 5
bit 4
bit 3
bit 2
Unimplemented: Read as 0
bit 1
bit 0
Preliminary
x = Bit is unknown
DS39762B-page 225
PIC18F97J60 FAMILY
REGISTER 18-15: EIR: ETHERNET INTERRUPT REQUEST (FLAG) REGISTER
U-0
R-0
R/C-0
R-0
R/C-0
U-0
R/C-0
R/C-0
PKTIF
DMAIF
LINKIF
TXIF
TXERIF
RXERIF
bit 7
bit 0
Legend:
R = Readable bit
C = Clearable bit
-n = Value at POR
1 = Bit is set
0 = Bit is cleared
x = Bit is unknown
bit 7
Unimplemented: Read as 0
bit 6
bit 5
bit 4
bit 3
bit 2
Unimplemented: Read as 0
bit 1
bit 0
DS39762B-page 226
Preliminary
PIC18F97J60 FAMILY
REGISTER 18-16: PHIE: PHY INTERRUPT ENABLE REGISTER
R-0
R-0
R-0
R-0
R-0
R-0
R-0
R-0
bit 15
bit 8
R-0
R-0
R/W-0
R/W-0
R-0
R-0
R/W-0
R/W-0
PLNKIE
PGEIE
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
-n = Value at POR
1 = Bit is set
0 = Bit is cleared
bit 15-6
bit 5
Reserved: Maintain as 0
bit 4
bit 3-2
bit 1
bit 0
Reserved: Maintain as 0
x = Bit is unknown
R-x
R-x
R-x
R-x
R-x
R-x
R-x
bit 15
bit 8
R-x
R-x
R-0
R/SC-0
R-0
R/SC-0
R-x
R-0
PLNKIF
PGIF
bit 7
bit 0
Legend:
R = Readable bit
SC = Self-clearing bit
-n = Value at POR
1 = Bit is set
0 = Bit is cleared
x = Bit is unknown
bit 15-6
bit 5
Reserved: Read as 0
bit 4
bit 3
Reserved: Read as 0
bit 2
bit 1
bit 0
Reserved: Read as 0
Preliminary
DS39762B-page 227
PIC18F97J60 FAMILY
18.3.1.1
4.
3.
18.3.1.2
DS39762B-page 228
5.
18.3.1.3
Preliminary
PIC18F97J60 FAMILY
18.3.1.4
18.3.1.5
18.3.2
18.3.1.6
2.
3.
4.
Preliminary
DS39762B-page 229
PIC18F97J60 FAMILY
18.4
18.4.4
Module Initialization
18.4.1
RECEIVE BUFFER
If the initialization procedure is being executed immediately after enabling the module (setting the ETHEN bit
to 1), the PHYRDY bit should be polled to make certain that enough time (1 ms) has elapsed before
proceeding to modify the PHY registers. For more
information on the PHY start-up timer, see
Section 18.1.3.1 Start-up Timer.
18.4.5
18.4.2
1.
2.
18.4.3
3.
4.
5.
TRANSMISSION BUFFER
6.
7.
8.
RECEIVE FILTERS
DS39762B-page 230
Preliminary
PIC18F97J60 FAMILY
REGISTER 18-18: MABBIPG: MAC BACK-TO-BACK INTER-PACKET GAP REGISTER
U-0
R/W-0
R/W-0
R/W-0
R/W-0
R/W-0
R/W-0
R/W-0
BBIPG6
BBIPG5
BBIPG4
BBIPG3
BBIPG2
BBIPG1
BBIPG0
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
-n = Value at POR
1 = Bit is set
0 = Bit is cleared
x = Bit is unknown
bit 7
Unimplemented: Read as 0
bit 6-0
18.4.6
18.4.7
3.
4.
Preliminary
DS39762B-page 231
PIC18F97J60 FAMILY
18.5
18.5.1
PACKET FORMAT
FIGURE 18-7:
18.5.1.1
Preamble/Start-of-Frame Delimiter
Field
Comments
Preamble
SFD
Start-of-Frame Delimiter
(filtered out by the module)
DA
Destination Address,
such as Multicast, Broadcast or Unicast
SA
Source Address
Type/Length
Used in the
Calculation
of the FCS
Data
Packet Payload
(with optional padding)
46-1500
Padding
Note 1:
FCS(1)
The FCS is transmitted starting with bit 31 and ending with bit 0.
DS39762B-page 232
Preliminary
PIC18F97J60 FAMILY
18.5.1.2
Destination Address
18.5.1.5
18.5.1.3
Source Address
18.5.1.4
Type/Length
Data
18.5.1.6
Padding
18.5.1.7
CRC
Preliminary
DS39762B-page 233
PIC18F97J60 FAMILY
18.5.2
TRANSMITTING PACKETS
FIGURE 18-8:
PHUGEEN
PPADN
PCRCEN
bit 7
POVERRIDE
bit 0
bit 7-4
Unimplemented: Read as 0
bit 3
bit 2
bit 1
bit 0
DS39762B-page 234
Preliminary
PIC18F97J60 FAMILY
An example of how the entire assembled transmit
packet looks in memory is shown in Figure 18-9. To
construct and transmit a packet in this fashion:
1.
2.
3.
4.
5.
FIGURE 18-9:
Buffer Pointers
Address
Memory
ETXST = 0120h
0120h
0Eh
0121h
data[1]
data[2]
0122h
ETXND = 0156h
0156h
0157h
0158h
0159h
016Ah
016Bh
016Ch
016Dh
016Eh
Description
Control
PHUGEEN, PPADN,
PCRCEN and POVERRIDE
Data Packet
Destination Address,
Source Address,
Type/Length and Data
Status Vector
Status Vector
Written by the Hardware
data[m]
tsv[7:0]
tsv[15:8]
tsv[23:16]
tsv[31:24]
tsv[39:32]
tsv[47:40]
tsv[55:48]
Preliminary
DS39762B-page 235
PIC18F97J60 FAMILY
TABLE 18-4:
Bit
55-52
Field
Description
Zero
51
50
Backpressure Applied
49
The frame transmitted was a control frame with a valid pause opcode.
48
Total bytes transmitted on the wire for the current packet, including all
bytes from collided attempts.
31
Transmit Underrun
30
Transmit Giant
Byte count for frame was greater than the MAMXFL registers.
29
28
Packet was aborted after the number of collisions exceeded 15, the
retransmission maximum.
27
Packet was deferred in excess of 24,287 bit times (2.4287 ms), due to a
continuously-occupied medium.
26
Packet was deferred for at least one attempt but less than an excessive
defer.
25
Transmit Broadcast
24
Transmit Multicast
23
Transmit Done
22
Indicates that frame type/length field was larger than 1500 bytes (type
field).
21
Indicates that frame length field value in the packet does not match the
actual data byte length and is not a type field. The FRMLNEN bit
(MACON3<1>) must be set to get this error.
20
The attached CRC in the packet did not match the internally generated
CRC.
19-16
15-0
47-32
DS39762B-page 236
Preliminary
PIC18F97J60 FAMILY
18.5.3
RECEIVING PACKETS
2.
3.
FIGURE 18-10:
18.5.3.1
Memory
Description
Packet N 1
6Eh
10h
rsv[7:0]
rsv[15:8]
rsv[23:16]
rsv[30:24]
data[1]
data[2]
Low Byte
High Byte
status[7:0]
status[15:8]
status[23:16]
status[31:24]
Packet N
1059h
106Ah
106Bh
106Ch
106Dh
106Eh
data[m-3]
data[m-2]
data[m-1]
data[m]
crc[31:24]
crc[23:16]
crc[15:8]
crc[7:0]
Packet N + 1
Preliminary
DS39762B-page 237
PIC18F97J60 FAMILY
TABLE 18-5:
Bit
Field
Description
31
Zero
30
29
28
27
26
Dribble Nibble
Indicates that after the end of this packet, an additional 1 to 7 bits were
received. The extra bits were thrown away.
25
24
23
Received OK
Indicates that the packet had a valid CRC and no symbol errors.
22
Indicates that frame type/length field was larger than 1500 bytes
(type field).
21
Indicates that frame length field value in the packet does not match the
actual data byte length.
20
CRC Error
Indicates that the frame CRC field value does not match the CRC
calculated by the MAC.
19
Reserved
18
17
Reserved
16
Indicates a packet over 50,000 bit times occurred or that a packet was
dropped since the last receive.
15-0
18.5.3.2
Indicates that at some time since the last receive, a carrier event was
detected. The carrier event is not associated with this packet. A carrier
event is activity on the receive channel that does not result in a packet
receive attempt being made.
EQUATION 18-1:
DS39762B-page 238
Preliminary
PIC18F97J60 FAMILY
18.5.3.3
18.5.3.4
EQUATION 18-2:
Preliminary
DS39762B-page 239
PIC18F97J60 FAMILY
TABLE 18-6:
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Reset
Values on
Page:
EIE
PKTIE
DMAIE
LINKIE
TXIE
TXERIE
RXERIE
63
EIR
PKTIF
DMAIF
LINKIF
TXIF
TXERIF
RXERIF
63
63
Register
Name
ESTAT
BUFER
RXBUSY
TXABRT
PHYRDY
ECON1
TXRST
RXRST
DMAST
CSUMEN
TXRTS
RXEN
ETXSTL
ETXSTH
ETXNDL
64
ETXNDH
MACON1
MACON3
64
60
64
64
TXPAUS
RXPAUS
PASSALL
MARXEN
65
PHDREN
HFRMEN
FRMLNEN
FULDPX
65
MACON4
DEFER
65
MABBIPG
BBIPG6
BBIPG5
BBIPG4
BBIPG3
BBIPG2
BBIPG1
BBIPG0
65
MAIPGL
MAIPGH
65
65
MAMXFLL
64
MAMXFLH
64
Legend:
TABLE 18-7:
Register
Name
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
EIE
PKTIE
DMAIE
LINKIE
TXIE
TXERIE
RXERIE
63
EIR
PKTIF
DMAIF
LINKIF
TXIF
TXERIF
RXERIF
63
ESTAT
BUFER
RXBUSY
TXABRT
PHYRDY
63
ECON2
AUTOINC
PKTDEC
ETHEN
63
ECON1
TXRST
RXRST
DMAST
CSUMEN
TXRTS
RXEN
60
ERXSTL
ERXSTH
ERXNDL
64
64
ERXNDH
64
64
ERXFCON
UCEN
ANDOR
CRCEN
EPKTCNT
MACON1
63
MPEN
HTEN
MCEN
BCEN
63
64
64
TXPAUS
RXPAUS
PASSALL
MARXEN
PHDREN
HFRMEN FRMLNEN
FULDPX
65
MACON3
MAMXFLL
64
64
MAMXFLH
Legend:
65
DS39762B-page 240
Preliminary
PIC18F97J60 FAMILY
18.6
18.6.1
HALF-DUPLEX OPERATION
18.6.2
FULL-DUPLEX OPERATION
Preliminary
DS39762B-page 241
PIC18F97J60 FAMILY
18.7
Flow Control
The Ethernet module implements hardware flow control for both Full and Half-Duplex modes. The operation
of this feature differs depending on which mode is
being used.
18.7.1
HALF-DUPLEX MODE
FIGURE 18-11:
SAMPLE FULL-DUPLEX
NETWORK
18.7.2
FULL-DUPLEX MODE
DS39762B-page 242
Preliminary
PIC18F97J60 FAMILY
To enable flow control in Full-Duplex mode, set the
TXPAUS and RXPAUS bits in the MACON1 register.
Then, at any time that the receiver buffer is running out
of space, set the Flow Control Enable bits,
FCEN1:FCEN0 (EFLOCON<1:0>). The module will
automatically finish transmitting anything that was in
progress and then send a valid pause frame loaded
with the selected pause timer value. Depending on the
mode selected, the application may need to eventually
clear Flow Control mode by again writing to the FCEN
bits.
U-0
U-0
U-0
U-0
R-0
R/W-0
R/W-0
FCEN1
FCEN0
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
-n = Value at POR
1 = Bit is set
0 = Bit is cleared
x = Bit is unknown
bit 7-3
Unimplemented: Read as 0
bit 2
bit 1-0
TABLE 18-8:
Register
Name
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Reset
Values on
Page:
60
TXRST
RXRST
DMAST
CSUMEN
TXRTS
RXEN
MACON1
TXPAUS
RXPAUS
MABBIPG
BBIPG6
BBIPG5
BBIPG4
BBIPG3
BBIPG2
BBIPG1
BBIPG0
65
EFLOCON
FCEN1
FCEN0
65
ECON1
PASSALL MARXEN
65
EPAUSL
65
EPAUSH
65
Preliminary
DS39762B-page 243
PIC18F97J60 FAMILY
18.8
18.8.4
Receive Filters
The filter performs a 32-bit CRC over the six destination address bytes in the packet, using the polynomial
4C11DB7h. From the resulting 32-bit binary number, a
6-bit value is derived from bits 28:23. This value in turn
points to location in a table formed by the Ethernet
Hash Table registers, ETH0 through ETH7. If the bit in
that location is set, the packet meets the Hash Table filter criteria and is accepted. The specific pointer values
for each bit location in the table are shown in
Table 18-9.
Unicast
Multicast
Broadcast
Pattern Match
Magic Packet
Hash Table
18.8.1
UNICAST FILTER
18.8.2
MULTICAST FILTER
18.8.3
BROADCAST FILTER
TABLE 18-9:
Register
EHT0
EHT1
EHT2
EHT3
EHT4
EHT5
EHT6
EHT7
07
0F
17
1F
27
2F
37
3F
06
0E
16
1E
26
2E
36
3E
05
0D
15
1D
25
2D
35
3D
04
0C
14
1C
24
2C
34
3C
03
0B
13
1B
23
2B
33
3B
02
0A
12
1A
22
2A
32
3A
01
09
11
19
21
29
31
39
00
08
10
18
20
28
30
38
EXAMPLE 18-1:
DS39762B-page 244
Preliminary
PIC18F97J60 FAMILY
REGISTER 18-20: ERXFCON: ETHERNET RECEIVE FILTER CONTROL REGISTER
R/W-1
R/W-0
R/W-1
R/W-0
R/W-0
R/W-0
R/W-0
R/W-1
UCEN
ANDOR
CRCEN
PMEN
MPEN
HTEN
MCEN
BCEN
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
-n = Value at POR
1 = Bit is set
0 = Bit is cleared
x = Bit is unknown
bit 7
bit 6
bit 5
bit 4
bit 3
bit 2
bit 1
bit 0
Preliminary
DS39762B-page 245
PIC18F97J60 FAMILY
FIGURE 18-12:
UCEN, PMEN,
MPEN, HTEN,
MCEN and BCEN
all clear?
Yes
No
UCEN set?
Yes
Unicast
packet?
Yes
CRCEN set?
No
Yes
No
PMEN set?
No
Yes
No
Pattern
matches?
Yes
CRCEN valid?
Yes
Accept Packet
No
No
Reject Packet
MPEN set?
Yes
No
HTEN set?
Yes
No
DS39762B-page 246
Hash table
bit set?
Yes
No
Yes
Multicast
destination?
Yes
No
No
BCEN set?
Yes
No
No
MCEN set?
Magic Packet
for us?
Yes
Broadcast
destination?
Yes
No
Preliminary
PIC18F97J60 FAMILY
FIGURE 18-13:
UCEN set?
Yes
No
Unicast
packet?
No
Yes
PMEN set?
Yes
No
Pattern
Matches?
No
Yes
MPEN set?
Yes
Magic Packet
for us?
No
No
Yes
HTEN set?
Yes
No
Hash Table
bit set?
No
Yes
MCEN set?
Yes
Multicast
destination?
No
No
Yes
BCEN set?
Yes
Broadcast
destination?
No
No
Yes
No
CRCEN set?
Yes
CRC valid?
No
Yes
Accept Packet
Preliminary
Reject Packet
DS39762B-page 247
PIC18F97J60 FAMILY
18.8.5
FIGURE 18-14:
Input Configuration:
EMPOH:EPMOL = 0006h
EPMM7:EPMM0 = 0000000000001F0Ah
EPMCSH:EPMCSL = 563Fh
Field
DA
SA
Type/Length
Data
FCS
Received
Data
11 22 33 44 55 66 77 88 99 AA BB CC 00 5A
09 0A 0B 0C 0D . . . 40 . . . FE 45 23 01
Byte #
0 1 2 3 4 5
14 15 16 17 18 . . . 70 . . .
6 7 8 9 10 11
12 13
Values Used for Checksum Computation = {88h, AAh, 09h, 0Ah, 0Bh, 0Ch, 0Dh, 00h}
(00h padding byte added by hardware)
Note:
Received data is shown in hexadecimal. Byte numbers are shown in decimal format.
DS39762B-page 248
Preliminary
PIC18F97J60 FAMILY
18.8.6
FIGURE 18-15:
Received
Data
00 11 22 33 44 55
77 88 99 AA BB CC
00 FE
09 0A 0B 0C 0D 0E
Field
Comments
DA
SA
Type/Length
Header
FF FF FF FF FF 00
Sync Pattern
FF FF FF FF FF FF
00 11 22 33 44 55
00 11 22 33 44 55
00 11 22 33 44 55
00 11 22 33 44 55
00 11 22 33 44 55
00 11 22 33 44 55
00 11 22 33 44 55
00 11 22 33 44 55
00 11 22 33 44 55
Magic
Packet
Pattern
16 Repeats of the
Destination MAC Address
Footer
00 11 22 33 44 55
00 11 22 33 44 55
00 11 22 33 44 55
00 11 22 33 44 55
00 11 22 33 44 55
00 11 22 33 44 55
00 11 22 33 44 55
19 1A 1B 1C 1D 1E
EF 54 32 10
FCS
Preliminary
DS39762B-page 249
PIC18F97J60 FAMILY
18.9
DS39762B-page 250
18.9.1
COPYING MEMORY
Preliminary
PIC18F97J60 FAMILY
18.9.2
CHECKSUM CALCULATIONS
To calculate a checksum:
1.
2.
3.
Reset
Values on
Page
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
EIE
PKTIE
DMAIE
LINKIE
TXIE
TXERIE
RXERIE
63
EIR
PKTIF
DMAIF
LINKIF
TXIF
TXERIF
RXERIF
63
TXRST
RXRST
DMAST
CSUMEN
TXRTS
RXEN
60
ECON1
ERXNDL
ERXNDH
EDMASTL
EDMASTH
EDMANDL
EDMANDH
EDMADSTL
EDMADSTH
63
63
63
63
63
63
63
63
EDMACSL
63
EDMACSH
63
Preliminary
DS39762B-page 251
PIC18F97J60 FAMILY
18.10 Module Resets
18.10.2
18.10.1
MICROCONTROLLER RESETS
DS39762B-page 252
18.10.3
Preliminary
PIC18F97J60 FAMILY
19.0
19.1
MASTER SYNCHRONOUS
SERIAL PORT (MSSP)
MODULE
19.3
SPI Mode
FIGURE 19-1:
Master mode
Multi-Master mode
Slave mode
Internal
Data Bus
19.2
Read
SDIx
SSPxSR reg
SDOx
SSx
Control Registers
SSx Control
Enable
2
Clock Select
SSPM3:SSPM0
SCKx
Shift
Clock
bit 0
Edge
Select
Note:
Write
SSPxBUF reg
Preliminary
SMP:CKE 4
2
Edge
Select
(TMR22Output)
Prescaler TOSC
4, 16, 64
DS39762B-page 253
PIC18F97J60 FAMILY
19.3.1
REGISTERS
REGISTER 19-1:
R/W-0
SMP
R-0
R-0
R-0
R-0
R-0
R-0
(1)
D/A
R/W
UA
BF
CKE
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
-n = Value at POR
1 = Bit is set
0 = Bit is cleared
x = Bit is unknown
bit 7
bit 6
bit 5
bit 4
P: Stop bit
Used in I2C mode only. This bit is cleared when the MSSP module is disabled, SSPEN is cleared.
bit 3
S: Start bit
Used in I2C mode only.
bit 2
bit 1
bit 0
Note 1:
DS39762B-page 254
Preliminary
PIC18F97J60 FAMILY
REGISTER 19-2:
R/W-0
WCOL
SSPOV
(1)
R/W-0
(2)
SSPEN
R/W-0
CKP
R/W-0
SSPM3
(3)
R/W-0
SSPM2
(3)
R/W-0
SSPM1
(3)
R/W-0
SSPM0(3)
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
-n = Value at POR
1 = Bit is set
0 = Bit is cleared
x = Bit is unknown
bit 7
bit 6
bit 5
bit 4
bit 3-0
Note 1:
2:
3:
In Master mode, the overflow bit is not set since each new reception (and transmission) is initiated by
writing to the SSPxBUF register.
When this bit is enabled, these pins must be properly configured as input or output.
Bit combinations not specifically listed here are either reserved or implemented in I2C mode only.
Preliminary
DS39762B-page 255
PIC18F97J60 FAMILY
19.3.2
OPERATION
EXAMPLE 19-1:
LOOP
BTFSS
BRA
MOVF
SSP1STAT, BF
LOOP
SSP1BUF, W
MOVWF
RXDATA
MOVF
MOVWF
TXDATA, W
SSP1BUF
DS39762B-page 256
Preliminary
PIC18F97J60 FAMILY
19.3.3
FIGURE 19-2:
19.3.4
TYPICAL CONNECTION
SDIx
SDIx
Shift Register
(SSPxSR)
MSb
SDOx
LSb
MSb
SCKx
Serial Clock
PROCESSOR 1
Shift Register
(SSPxSR)
LSb
SCKx
PROCESSOR 2
Preliminary
DS39762B-page 257
PIC18F97J60 FAMILY
19.3.5
MASTER MODE
FIGURE 19-3:
Write to
SSPxBUF
SCKx
(CKP = 0
CKE = 0)
SCKx
(CKP = 1
CKE = 0)
4 Clock
Modes
SCKx
(CKP = 0
CKE = 1)
SCKx
(CKP = 1
CKE = 1)
SDOx
(CKE = 0)
bit 7
bit 6
bit 5
bit 4
bit 3
bit 2
bit 1
bit 0
SDOx
(CKE = 1)
bit 7
bit 6
bit 5
bit 4
bit 3
bit 2
bit 1
bit 0
SDIx
(SMP = 0)
bit 0
bit 7
Input
Sample
(SMP = 0)
SDIx
(SMP = 1)
bit 0
bit 7
Input
Sample
(SMP = 1)
SSPxIF
Next Q4 Cycle
after Q2
SSPxSR to
SSPxBUF
DS39762B-page 258
Preliminary
PIC18F97J60 FAMILY
19.3.6
SLAVE MODE
19.3.7
SLAVE SELECT
SYNCHRONIZATION
FIGURE 19-4:
SDOx pin is driven. When the SSx pin goes high, the
SDOx pin is no longer driven, even if in the middle of a
transmitted byte, and becomes a floating output.
External pull-up/pull-down resistors may be desirable
depending on the application.
Note 1: When the SPI is in Slave mode with SSx pin
control enabled (SSPxCON1<3:0> = 0100),
the SPI module will reset if the SSx pin is set
to VDD.
2: If the SPI is used in Slave mode with CKE
set, then the SSx pin control must be
enabled.
When the SPI module resets, the bit counter is forced
to 0. This can be done by either forcing the SSx pin to
a high level or clearing the SSPEN bit.
To emulate two-wire communication, the SDOx pin can
be connected to the SDIx pin. When the SPI needs to
operate as a receiver, the SDOx pin can be configured
as an input. This disables transmissions from the
SDOx. The SDIx can always be left as an input (SDIx
function) since it cannot create a bus conflict.
SSx
SCKx
(CKP = 0
CKE = 0)
SCKx
(CKP = 1
CKE = 0)
Write to
SSPxBUF
SDOx
SDIx
(SMP = 0)
bit 7
bit 6
bit 7
bit 0
bit 0
bit 7
bit 7
Input
Sample
(SMP = 0)
SSPxIF
Interrupt
Flag
Next Q4 Cycle
after Q2
SSPxSR to
SSPxBUF
Preliminary
DS39762B-page 259
PIC18F97J60 FAMILY
FIGURE 19-5:
SSx
Optional
SCKx
(CKP = 0
CKE = 0)
SCKx
(CKP = 1
CKE = 0)
Write to
SSPxBUF
SDOx
SDIx
(SMP = 0)
bit 7
bit 6
bit 5
bit 4
bit 3
bit 2
bit 1
bit 0
bit 0
bit 7
Input
Sample
(SMP = 0)
SSPxIF
Interrupt
Flag
Next Q4 Cycle
after Q2
SSPxSR to
SSPxBUF
FIGURE 19-6:
SSx
Not Optional
SCKx
(CKP = 0
CKE = 1)
SCKx
(CKP = 1
CKE = 1)
Write to
SSPxBUF
SDOx
bit 7
bit 6
bit 5
bit 4
SDIx
(SMP = 0)
bit 3
bit 2
bit 1
bit 0
bit 0
bit 7
Input
Sample
(SMP = 0)
SSPxIF
Interrupt
Flag
Next Q4 Cycle
after Q2
SSPxSR to
SSPxBUF
DS39762B-page 260
Preliminary
PIC18F97J60 FAMILY
19.3.8
OPERATION IN POWER-MANAGED
MODES
19.3.10
TABLE 19-1:
19.3.9
CKP
CKE
0, 0
0, 1
1, 0
1, 1
19.3.11
EFFECTS OF A RESET
Preliminary
DS39762B-page 261
PIC18F97J60 FAMILY
TABLE 19-2:
Name
INTCON
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Reset
Values
on Page:
INT0IE
RBIE
TMR0IF
INT0IF
RBIF
59
PIR1
PSPIF
ADIF
RC1IF
TX1IF
SSP1IF
CCP1IF
TMR2IF
TMR1IF
61
PIE1
PSPIE
ADIE
RC1IE
TX1IE
SSP1IE
CCP1IE
TMR2IE
TMR1IE
61
IPR1
PSPIP
ADIP
RC1IP
TX1IP
SSP1IP
CCP1IP
TMR2IP
TMR1IP
61
PIR3
SSP2IF(1)
BCL2IF
RC2IF
TX2IF
TMR4IF
CCP5IF
CCP4IF
CCP3IF
61
PIE3
SSP2IE(1)
BCL2IE
RC2IE
TX2IE
TMR4IE
CCP5IE
CCP4IE
CCP3IE
61
IPR3
SSP2IP(1)
BCL2IP
RC2IP
TX2IP
TMR4IP
CCP5IP
CCP4IP
CCP3IP
61
TRISC
TRISC7
TRISC6
TRISC5
TRISC4
TRISC3
TRISC2
TRISC1
TRISC0
61
TRISD
TRISD7(1)
TRISD3
TRISD2
TRISD1
TRISD0
61
TRISF3
TRISF2
TRISF1
TRISF0
61
TRISF
SSP1BUF
TRISF7
(1)
TRISD6
TRISF6
TRISD5
(1)
TRISF5
TRISD4
(1)
TRISF4
60
SSP1CON1
WCOL
SSPOV
SSPEN
CKP
SSPM3
SSPM2
SSPM1
SSPM0
60
SSP1STAT
SMP
CKE
D/A
R/W
UA
BF
60
SSP2BUF
63
SSP2CON1
WCOL
SSPOV
SSPEN
CKP
SSPM3
SSPM2
SSPM1
SSPM0
63
SSP2STAT
SMP
CKE
D/A
R/W
UA
BF
63
Legend: Shaded cells are not used by the MSSP module in SPI mode.
Note 1: These bits are only available in 100-pin devices; otherwise, they are unimplemented and read as 0.
DS39762B-page 262
Preliminary
PIC18F97J60 FAMILY
19.4
I2C Mode
19.4.1
FIGURE 19-7:
Read
Write
SSPxBUF reg
SCLx
SDAx
LSb
Addr Match
SSPxADD reg
Address Mask
Start and
Stop bit Detect
SSPxSR reg
Match Detect
Shift
Clock
MSb
REGISTERS
Set, Reset
S, P bits
(SSPxSTAT reg)
Preliminary
DS39762B-page 263
PIC18F97J60 FAMILY
REGISTER 19-3:
R/W-0
SMP
CKE
R-0
R-0
R-0
D/A
(1)
(1)
R-0
R/W
(2,3)
R-0
R-0
UA
BF
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
-n = Value at POR
1 = Bit is set
0 = Bit is cleared
x = Bit is unknown
bit 7
bit 6
bit 5
bit 4
P: Stop bit(1)
1 = Indicates that a Stop bit has been detected last
0 = Stop bit was not detected last
bit 3
S: Start bit(1)
1 = Indicates that a Start bit has been detected last
0 = Start bit was not detected last
bit 2
bit 1
bit 0
Note 1:
2:
3:
DS39762B-page 264
Preliminary
PIC18F97J60 FAMILY
REGISTER 19-4:
R/W-0
R/W-0
R/W-0
R/W-0
R/W-0
R/W-0
R/W-0
R/W-0
WCOL
SSPOV
SSPEN
CKP
SSPM3
SSPM2
SSPM1
SSPM0
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
-n = Value at POR
1 = Bit is set
0 = Bit is cleared
x = Bit is unknown
bit 7
bit 6
bit 5
bit 4
bit 3-0
Note 1:
2:
When enabled, the SDAx and SCLx pins must be configured as inputs.
Bit combinations not specifically listed here are either reserved or implemented in SPI mode only.
Preliminary
DS39762B-page 265
PIC18F97J60 FAMILY
REGISTER 19-5:
R/W-0
R/W-0
R/W-0
R/W-0
R/W-0
R/W-0
R/W-0
R/W-0
GCEN
ACKSTAT
ACKDT(1)
ACKEN(2)
RCEN(2)
PEN(2)
RSEN(2)
SEN(2)
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
-n = Value at POR
1 = Bit is set
0 = Bit is cleared
x = Bit is unknown
bit 7
bit 6
bit 5
bit 4
bit 3
bit 2
bit 1
bit 0
Note 1:
2:
Value that will be transmitted when the user initiates an Acknowledge sequence at the end of a receive.
If the I2C module is active, these bits may not be set (no spooling) and the SSPxBUF may not be written
(or writes to the SSPxBUF are disabled).
DS39762B-page 266
Preliminary
PIC18F97J60 FAMILY
REGISTER 19-6:
R/W-0
R/W-0
R/W-0
R/W-0
R/W-0
R/W-0
R/W-0
R/W-0
GCEN
ACKSTAT
ADMSK5
ADMSK4
ADMSK3
ADMSK2
ADMSK1
SEN(1)
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
-n = Value at POR
1 = Bit is set
0 = Bit is cleared
x = Bit is unknown
bit 7
bit 6
bit 5-2
bit 1
bit 0
Note 1:
If the I2C module is active, this bit may not be set (no spooling) and the SSPxBUF may not be written (or
writes to the SSPxBUF are disabled).
Preliminary
DS39762B-page 267
PIC18F97J60 FAMILY
19.4.2
OPERATION
I C Master mode,
clock = (FOSC/4) x (SSPxADD + 1)
I 2C Slave mode (7-bit addressing)
I 2C Slave mode (10-bit addressing)
I 2C Slave mode (7-bit addressing) with Start and
Stop bit interrupts enabled
I 2C Slave mode (10-bit addressing) with Start and
Stop bit interrupts enabled
I 2C Firmware Controlled Master mode,
slave is Idle
Selection of any I 2C mode, with the SSPEN bit set,
forces the SCLx and SDAx pins to be open-drain,
provided these pins are programmed to inputs by
setting the appropriate TRISC or TRISD bits. To ensure
proper operation of the module, pull-up resistors must
be provided externally to the SCLx and SDAx pins.
19.4.3
SLAVE MODE
19.4.3.1
1.
2.
3.
5.
6.
DS39762B-page 268
Addressing
4.
7.
8.
9.
Preliminary
PIC18F97J60 FAMILY
19.4.3.2
Address Masking
EXAMPLE 19-2:
7-Bit Addressing:
SSPxADD<7:1> = A0h (1010000) (SSPxADD<0> is assumed to be 0)
ADMSK<5:1>
= 00111
Addresses Acknowledged: A0h, A2h, A4h, A6h, A8h, AAh, ACh, AEh
10-Bit Addressing:
SSPxADD<7:0> = A0h (10100000) (the two MSb of the address are ignored in this example since they are
not affected by masking)
ADMSK<5:1>
= 00111
Addresses Acknowledged: A0h, A1h, A2h, A3h, A4h, A5h, A6h, A7h, A8h, A9h, AAh, ABh, ACh, ADh, AEh, AFh
Preliminary
DS39762B-page 269
PIC18F97J60 FAMILY
19.4.3.3
Reception
19.4.3.4
Transmission
When the R/W bit of the incoming address byte is set and
an address match occurs, the R/W bit of the SSPxSTAT
register is set. The received address is loaded into the
SSPxBUF register. The ACK pulse will be sent on the
ninth bit and pin RC3 or RD6 is held low, regardless of
SEN (see Section 19.4.4 Clock Stretching for more
details). By stretching the clock, the master will be unable
to assert another clock pulse until the slave is done
preparing the transmit data. The transmit data must be
loaded into the SSPxBUF register which also loads the
SSPxSR register. Then, pin RC3 or RD6 should be
enabled by setting bit, CKP (SSPxCON1<4>). The eight
data bits are shifted out on the falling edge of the SCLx
input. This ensures that the SDAx signal is valid during
the SCLx high time (Figure 19-10).
The ACK pulse from the master-receiver is latched on
the rising edge of the ninth SCLx input pulse. If the SDAx
line is high (not ACK), then the data transfer is complete.
In this case, when the ACK is latched by the slave, the
slave logic is reset (resets SSPxSTAT register) and the
slave monitors for another occurrence of the Start bit. If
the SDAx line was low (ACK), the next transmit data
must be loaded into the SSPxBUF register. Again, pin
RC3 or RD6 must be enabled by setting bit CKP.
An MSSP interrupt is generated for each data transfer
byte. The SSPxIF bit must be cleared in software and
the SSPxSTAT register is used to determine the status
of the byte. The SSPxIF bit is set on the falling edge of
the ninth clock pulse.
DS39762B-page 270
Preliminary
Preliminary
CKP
A4
A3
Receiving Address
A5
A2
SSPOV (SSPxCON1<6>)
BF (SSPxSTAT<0>)
SCLx
SDAx
A6
A1
ACK
R/W = 0
D7
D4
D3
Receiving Data
D5
Cleared in software
SSPxBUF is read
D6
D2
D1
D0
ACK
D7
D6
D4
D3
Receiving Data
D5
D2
D1
D0
Bus master
terminates
transfer
SSPOV is set
because SSPxBUF is
still full. ACK is not sent.
ACK
FIGURE 19-8:
A7
PIC18F97J60 FAMILY
DS39762B-page 271
DS39762B-page 272
A6
Preliminary
Note
CKP
A3
Receiving Address
A5
D4
D3
Receiving Data
D5
Cleared in software
SSPxBUF is read
D6
D2
D1
D0
In this example, an address equal to A7.A6.A5.X.A3.X.X will be Acknowledged and cause an interrupt.
D7
ACK
R/W = 0
2:
1:
SSPOV (SSPxCON1<6>)
BF (SSPxSTAT<0>)
SCLx
A7
ACK
D7
D6
D4
D3
Receiving Data
D5
D2
D1
D0
Bus master
terminates
transfer
SSPOV is set
because SSPxBUF is
still full. ACK is not sent.
ACK
FIGURE 19-9:
SDAx
PIC18F97J60 FAMILY
I2C SLAVE MODE TIMING WITH SEN = 0 AND ADMSK<5:1> = 01011
(RECEPTION, 7-BIT ADDRESS)
Data in
sampled
A6
Preliminary
CKP
BF (SSPxSTAT<0>)
A4
A3
A2
Receiving Address
A5
A7
A1
R/W = 0
ACK
D3
D2
Transmitting Data
D4
Cleared in software
D5
D6
D7
D1
D0
ACK
D7
D4
D3
Cleared in software
D5
D2
D6
D0
ACK
D1
Transmitting Data
FIGURE 19-10:
SCLx
SDAx
PIC18F97J60 FAMILY
DS39762B-page 273
DS39762B-page 274
Preliminary
A8
UA (SSPxSTAT<1>)
SSPOV (SSPxCON1<6>)
A9
Cleared in software
BF (SSPxSTAT<0>)
CKP
SCLx
ACK
R/W = 0
A7
A4
A3
A2
A0 ACK
Cleared by hardware
when SSPxADD is updated
with low byte of address
A1
Cleared in software
A5
A6
D7
6
7
D1
Cleared in software
D3 D2
D6 D5 D4
9
1
D3
D2
Cleared in software
D0 ACK D7 D6 D5 D4
D1 D0
P
Bus master
terminates
transfer
SSPOV is set
because SSPxBUF is
still full. ACK is not sent.
ACK
FIGURE 19-11:
SDAx
PIC18F97J60 FAMILY
I2C SLAVE MODE TIMING WITH SEN = 0 (RECEPTION, 10-BIT ADDRESS)
Preliminary
Note
A8
A9
A3
A2
Cleared in software
A5
5
6
Cleared in software
9
1
D3 D2
Cleared in software
D5 D4
D3 D2
Note that the Most Significant bits of the address are not affected by the bit masking.
D6 D5 D4
3:
D7
In this example, an address equal to A9.A8.A7.A6.A5.X.A3.A2.X.X will be Acknowledged and cause an interrupt.
Cleared by hardware
when SSPxADD is updated
with low byte of address
A6
ACK
1:
A7
2:
UA (SSPxSTAT<1>)
SSPOV (SSPxCON1<6>)
BF (SSPxSTAT<0>)
CKP
Cleared in software
SCLx
ACK
R/W = 0
D1 D0
P
Bus master
terminates
transfer
SSPOV is set
because SSPxBUF is
still full. ACK is not sent.
ACK
FIGURE 19-12:
SDAx
PIC18F97J60 FAMILY
DS39762B-page 275
DS39762B-page 276
Preliminary
CKP (SSPxCON1<4>)
UA (SSPxSTAT<1>)
BF (SSPxSTAT<0>)
A9 A8
SCLx
ACK
R/W = 0
Cleared in software
A6 A5 A4 A3 A2 A1 A0
A7
ACK
Cleared in software
ACK
R/W = 1
Cleared in software
Completion of
data transmission
clears BF flag
ACK
D7 D6 D5 D4 D3 D2 D1 D0
Write of SSPxBUF
BF flag is clear
initiates transmit
at the end of the
third address sequence
A9 A8
Sr
FIGURE 19-13:
SDAx
Bus master
terminates
transfer
PIC18F97J60 FAMILY
I2C SLAVE MODE TIMING (TRANSMISSION, 10-BIT ADDRESS)
PIC18F97J60 FAMILY
19.4.4
CLOCK STRETCHING
19.4.4.3
19.4.4.1
19.4.4.2
19.4.4.4
Preliminary
DS39762B-page 277
PIC18F97J60 FAMILY
19.4.4.5
FIGURE 19-14:
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
SDAx
DX 1
DX
SCLx
CKP
Master device
asserts clock
Master device
deasserts clock
WR
SSPxCON1
DS39762B-page 278
Preliminary
A6
Preliminary
CKP
SSPOV (SSPxCON1<6>)
BF (SSPxSTAT<0>)
SCLx
A7
A4
A3
A2
Receiving Address
A5
A1
ACK
R/W = 0
D4
D3
Receiving Data
D5
Cleared in software
D6
If BF is cleared
prior to the falling
edge of the 9th clock,
CKP will not be reset
to 0 and no clock
stretching will occur
SSPxBUF is read
D7
D2
D1
ACK
D7
D0
D4
D3
Receiving Data
D5
CKP
written
to 1 in
software
D6
D2
D1
D0
Bus master
terminates
transfer
SSPOV is set
because SSPxBUF is
still full. ACK is not sent.
ACK
FIGURE 19-15:
SDAx
PIC18F97J60 FAMILY
DS39762B-page 279
DS39762B-page 280
Preliminary
UA (SSPxSTAT<1>)
SSPOV (SSPxCON1<6>)
BF (SSPxSTAT<0>)
CKP
A9 A8
Cleared in software
SCLx
ACK
R/W = 0
A7
A4
A3
A2
Cleared in software
A5
A1
A0
A6
ACK
Cleared in software
D3 D2
8
1
D2
Cleared in software
CKP written to 1
in software
D3
ACK
D1 D0
D7 D6 D5 D4
ACK
Bus master
terminates
transfer
SSPOV is set
because SSPxBUF is
still full. ACK is not sent.
D1 D0
FIGURE 19-16:
SDAx
PIC18F97J60 FAMILY
I2C SLAVE MODE TIMING WITH SEN = 1 (RECEPTION, 10-BIT ADDRESS)
PIC18F97J60 FAMILY
19.4.5
FIGURE 19-17:
R/W = 0
General Call Address
SDAx
ACK D7
ACK
D6
D5
D4
D3
D2
D1
D0
SCLx
S
SSPxIF
BF (SSPxSTAT<0>)
Cleared in software
SSPxBUF is read
SSPOV (SSPxCON1<6>)
GCEN (SSPxCON2<7>)
1
Preliminary
DS39762B-page 281
PIC18F97J60 FAMILY
MASTER MODE
Note:
FIGURE 19-18:
Start Condition
Stop Condition
Data Transfer Byte Transmitted/Received
Acknowledge Transmit
Repeated Start
SSPM3:SSPM0
SSPxADD<6:0>
Write
SSPxBUF
Baud
Rate
Generator
SDAx
Shift
Clock
SDAx In
SCLx In
Bus Collision
DS39762B-page 282
LSb
Preliminary
Clock Cntl
SCLx
Receive Enable
SSPxSR
MSb
19.4.6
PIC18F97J60 FAMILY
19.4.6.1
1.
Preliminary
DS39762B-page 283
PIC18F97J60 FAMILY
19.4.7
BAUD RATE
19.4.7.1
Once the given operation is complete (i.e., transmission of the last data bit is followed by ACK), the internal
clock will automatically stop counting and the SCLx pin
will remain in its last state.
Table 19-3 demonstrates clock rates based on
instruction cycles and the BRG value loaded into
SSPxADD.
FIGURE 19-19:
SSPM3:SSPM0
SCLx
SSPxADD<6:0>
Reload
Reload
Control
CLKO
TABLE 19-3:
Note 1:
FOSC/4
BRG Value
FSCL
(2 Rollovers of BRG)
41.667 MHz
19h
400 kHz(1)
41.667 MHz
67h
100 kHz
31.25 MHz
13h
400 kHz(1)
31.25 MHz
4Dh
100 kHz
20.833 MHz
09h
400 kHz(1)
20.833 MHz
33h
100 kHz
The I2C interface does not conform to the 400 kHz I2C specification (which applies to rates greater than
100 kHz) in all details, but may be used with care where higher rates are required by the application.
DS39762B-page 284
Preliminary
PIC18F97J60 FAMILY
19.4.7.2
Clock Arbitration
FIGURE 19-20:
SDAx
DX
SCLx deasserted but slave holds
SCLx low (clock arbitration)
SCLx
BRG decrements on
Q2 and Q4 cycles
BRG
Value
03h
BRG
Reload
02h
01h
03h
02h
Preliminary
DS39762B-page 285
PIC18F97J60 FAMILY
19.4.8
Note:
FIGURE 19-21:
19.4.8.1
TBRG
SDAx
2nd bit
TBRG
SCLx
TBRG
S
DS39762B-page 286
Preliminary
PIC18F97J60 FAMILY
19.4.9
19.4.9.1
FIGURE 19-22:
SDAx = 1,
SCLx = 1
Write to SSPxCON2 occurs here: SDAx = 1,
SCLx (no change)
TBRG
TBRG
1st bit
SDAx
RSEN bit set by hardware
on falling edge of ninth clock,
end of Xmit
SCLx
TBRG
Sr = Repeated Start
Preliminary
DS39762B-page 287
PIC18F97J60 FAMILY
19.4.10
19.4.10.1
BF Status Flag
19.4.10.3
19.4.11
19.4.11.1
BF Status Flag
19.4.11.2
19.4.11.3
19.4.10.2
DS39762B-page 288
Preliminary
Preliminary
R/W
PEN
SEN
BF (SSPxSTAT<0>)
SSPxIF
SCLx
SDAx
A6
A5
A4
A3
A2
A1
Cleared in software
SSPxBUF written
D7
1
SCLx held low
while CPU
responds to SSPxIF
ACK = 0
R/W = 0
A7
D5
D4
D3
D2
D1
D0
D6
ACKSTAT in
SSPxCON2 = 1
Cleared in software
ACK
FIGURE 19-23:
SEN = 0
PIC18F97J60 FAMILY
DS39762B-page 289
DS39762B-page 290
Preliminary
ACKEN
SSPOV
BF
(SSPxSTAT<0>)
SDAx = 0, SCLx = 1
while CPU
responds to SSPxIF
SSPxIF
SCLx
SDAx
A7
4
5
Cleared in software
A6 A5 A4 A3 A2
A1
R/W = 0
ACK
D0
ACK
5
6
Cleared in software
D7 D6 D5 D4 D3 D2 D1
Cleared in
software
ACK
P
Set SSPxIF interrupt
at end of Acknowledge sequence
Bus master
terminates
transfer
Set P bit
(SSPxSTAT<4>)
and SSPxIF
PEN bit = 1
written here
D0
RCEN cleared
automatically
RCEN = 1, start
next receive
Cleared in software
Cleared in software
D7 D6 D5 D4 D3 D2 D1
RCEN cleared
automatically
FIGURE 19-24:
SEN = 0
Write to SSPxBUF occurs here,
ACK from Slave
start XMIT
Write to SSPxCON2<4>
to start Acknowledge sequence
SDAx = ACKDT (SSPxCON2<5>) = 0
PIC18F97J60 FAMILY
I 2C MASTER MODE WAVEFORM (RECEPTION, 7-BIT ADDRESS)
PIC18F97J60 FAMILY
19.4.12
ACKNOWLEDGE SEQUENCE
TIMING
19.4.13
19.4.12.1
19.4.13.1
FIGURE 19-25:
D0
SCLx
TBRG
SSPxIF
Cleared in
software
SSPxIF set at
the end of receive
Cleared in
software
SSPxIF set at the end
of Acknowledge sequence
FIGURE 19-26:
Write to SSPxCON2,
set PEN
Falling edge of
9th clock
SCLx
SDAx
ACK
P
TBRG
TBRG
TBRG
Preliminary
DS39762B-page 291
PIC18F97J60 FAMILY
19.4.14
SLEEP OPERATION
19.4.17
19.4.15
EFFECTS OF A RESET
19.4.16
MULTI-MASTER MODE
Address Transfer
Data Transfer
A Start Condition
A Repeated Start Condition
An Acknowledge Condition
Multi-Master mode support is achieved by bus arbitration. When the master outputs address/data bits onto
the SDAx pin, arbitration takes place when the master
outputs a 1 on SDAx, by letting SDAx float high and
another master asserts a 0. When the SCLx pin floats
high, data should be stable. If the expected data on
SDAx is a 1 and the data sampled on the SDAx
pin = 0, then a bus collision has taken place. The
master will set the Bus Collision Interrupt Flag, BCLxIF
and reset the I2C port to its Idle state (Figure 19-27).
If a transmit was in progress when the bus collision
occurred, the transmission is halted, the BF flag is
cleared, the SDAx and SCLx lines are deasserted and
the SSPxBUF can be written to. When the user services
the bus collision Interrupt Service Routine and if the I2C
bus is free, the user can resume communication by
asserting a Start condition.
If a Start, Repeated Start, Stop or Acknowledge condition
was in progress when the bus collision occurred, the
condition is aborted, the SDAx and SCLx lines are
deasserted and the respective control bits in the
SSPxCON2 register are cleared. When the user services
the bus collision Interrupt Service Routine and if the I2C
bus is free, the user can resume communication by
asserting a Start condition.
The master will continue to monitor the SDAx and SCLx
pins. If a Stop condition occurs, the SSPxIF bit will be set.
A write to the SSPxBUF will start the transmission of
data at the first data bit regardless of where the
transmitter left off when the bus collision occurred.
In Multi-Master mode, the interrupt generation on the
detection of Start and Stop conditions allows the determination of when the bus is free. Control of the I2C bus
can be taken when the P bit is set in the SSPxSTAT
register, or the bus is Idle and the S and P bits are
cleared.
FIGURE 19-27:
SDAx
SCLx
BCLxIF
DS39762B-page 292
Preliminary
PIC18F97J60 FAMILY
19.4.17.1
FIGURE 19-28:
SDAx
SCLx
Set SEN, enable Start
condition if SDAx = 1, SCLx = 1
SEN
BCLxIF
SSPxIF
SSPxIF and BCLxIF are
cleared in software
Preliminary
DS39762B-page 293
PIC18F97J60 FAMILY
FIGURE 19-29:
TBRG
SDAx
SCLx
SEN
SCLx = 0 before BRG time-out,
bus collision occurs. Set BCLxIF.
BCLxIF
Interrupt cleared
in software
S
SSPxIF
FIGURE 19-30:
SDAx
SCLx
Set SSPxIF
TBRG
S
SCLx pulled low after BRG
time-out
SEN
BCLxIF
SSPxIF
SDAx = 0, SCLx = 1,
set SSPxIF
DS39762B-page 294
Preliminary
Interrupts cleared
in software
PIC18F97J60 FAMILY
19.4.17.2
If, at the end of the BRG time-out, both SCLx and SDAx
are still high, the SDAx pin is driven low and the BRG
is reloaded and begins counting. At the end of the
count, regardless of the status of the SCLx pin, the
SCLx pin is driven low and the Repeated Start
condition is complete.
FIGURE 19-31:
SDAx
SCLx
BCLxIF
Cleared in software
S
SSPxIF
FIGURE 19-32:
TBRG
SDAx
SCLx
BCLxIF
RSEN
0
S
SSPxIF
Preliminary
DS39762B-page 295
PIC18F97J60 FAMILY
19.4.17.3
b)
FIGURE 19-33:
TBRG
SDAx sampled
low after TBRG,
set BCLxIF
TBRG
SDAx
SDAx asserted low
SCLx
PEN
BCLxIF
P
SSPxIF
FIGURE 19-34:
TBRG
TBRG
SDAx
SCLx goes low before SDAx goes high,
set BCLxIF
Assert SDAx
SCLx
PEN
BCLxIF
P
SSPxIF
DS39762B-page 296
Preliminary
PIC18F97J60 FAMILY
TABLE 19-4:
Name
INTCON
Bit 6
GIE/GIEH PEIE/GIEL
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Reset
Values
on Page:
TMR0IE
INT0IE
RBIE
TMR0IF
INT0IF
RBIF
59
PIR1
PSPIF
ADIF
RC1IF
TX1IF
SSP1IF
CCP1IF
TMR2IF
TMR1IF
61
PIE1
PSPIE
ADIE
RC1IE
TX1IE
SSP1IE
CCP1IE
TMR2IE
TMR1IE
61
61
IPR1
PSPIP
ADIP
RC1IP
TX1IP
SSP1IP
CCP1IP
TMR2IP
TMR1IP
PIR2
OSCFIF
CMIF
ETHIF
BCL1IF
TMR3IF
CCP2IF
61
PIE2
OSCFIE
CMIE
ETHIE
BCL1IE
TMR3IE
CCP2IE
61
IPR2
OSCFIP
CMIP
ETHIP
BCL1IP
TMR3IP
CCP2IP
61
PIR3
SSP2IF(1)
BCL2IF(1)
RC2IF
TX2IF
TMR4IF
CCP5IF
CCP4IF
CCP3IF
61
PIE3
SSP2IE(1)
BCL2IE
(1)
RC2IE
TX2IE
TMR4IE
CCP5IE
CCP4IE
CCP3IE
61
IPR3
SSP2IP(1)
BCL2IP(1)
RC2IP
TX2IP
TMR4IP
CCP5IP
CCP4IP
CCP3IP
61
TRISC
TRISC7
TRISC6
TRISC5
TRISC4
TRISC3
TRISC2
TRISC1
TRISC0
61
TRISD
TRISD7
TRISD6(1)
TRISD5(1)
TRISD4
TRISD3
TRISD2
TRISD1
TRISD0
61
SSP1BUF
60
SSP1ADD
MSSP1 Address Register (I2C Slave mode), MSSP1 Baud Rate Reload Register (I2C Master mode)
63
SSP1CON1
WCOL
SSPOV
SSPEN
CKP
SSPM3
SSPM2
SSPM1
SSPM0
60
SSP1CON2
GCEN
ACKSTAT
ACKDT
ACKEN
RCEN
PEN
RSEN
SEN
60
GCEN
SSP1STAT
SMP
CKE
D/A
R/W
UA
SEN
BF
SSP2BUF
SSP2ADD
MSSP2 Address Register (I2C Slave mode), MSSP2 Baud Rate Reload Register (I2C Master mode)
60
60
63
SSP2CON1
WCOL
SSPOV
SSPEN
CKP
SSPM3
SSPM2
SSPM1
SSPM0
63
SSP2CON2
GCEN
ACKSTAT
ACKDT
ACKEN
RCEN
PEN
RSEN
SEN
63
GCEN
SSP2STAT
Legend:
Note 1:
2:
SMP
CKE
D/A
R/W
UA
SEN
BF
63
= unimplemented, read as 0, r = reserved. Shaded cells are not used by the MSSP module in I2C mode.
These bits are only available in 100-pin devices; otherwise, they are unimplemented and read as 0.
Alternate bit definitions in I2C Slave mode.
Preliminary
DS39762B-page 297
PIC18F97J60 FAMILY
NOTES:
DS39762B-page 298
Preliminary
PIC18F97J60 FAMILY
20.0
ENHANCED UNIVERSAL
SYNCHRONOUS
ASYNCHRONOUS RECEIVER
TRANSMITTER (EUSART)
Preliminary
DS39762B-page 299
PIC18F97J60 FAMILY
REGISTER 20-1:
R/W-0
CSRC
R/W-0
R/W-0
R/W-0
R/W-0
R-1
R/W-0
TX9
TXEN(1)
SYNC
SENDB
BRGH
TRMT
TX9D
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
-n = Value at POR
1 = Bit is set
0 = Bit is cleared
x = Bit is unknown
bit 7
bit 6
bit 5
bit 4
bit 3
bit 2
bit 1
bit 0
Note 1:
DS39762B-page 300
Preliminary
PIC18F97J60 FAMILY
REGISTER 20-2:
R/W-0
R/W-0
R/W-0
R/W-0
R/W-0
R-0
R-0
R-x
SPEN
RX9
SREN
CREN
ADDEN
FERR
OERR
RX9D
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
-n = Value at POR
1 = Bit is set
0 = Bit is cleared
x = Bit is unknown
bit 7
bit 6
bit 5
bit 4
bit 3
bit 2
bit 1
bit 0
Preliminary
DS39762B-page 301
PIC18F97J60 FAMILY
REGISTER 20-3:
R/W-0
R-1
R/W-0
R/W-0
R/W-0
U-0
R/W-0
R/W-0
ABDOVF
RCIDL
RXDTP
TXCKP
BRG16
WUE
ABDEN
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
-n = Value at POR
1 = Bit is set
0 = Bit is cleared
x = Bit is unknown
bit 7
bit 6
bit 5
bit 4
bit 3
bit 2
Unimplemented: Read as 0
bit 1
bit 0
DS39762B-page 302
Preliminary
PIC18F97J60 FAMILY
20.1
TABLE 20-1:
20.1.1
OPERATION IN POWER-MANAGED
MODES
20.1.2
SAMPLING
Configuration Bits
BRG/EUSARTx Mode
8-bit/Asynchronous
FOSC/[64 (n + 1)]
SYNC
BRG16
BRGH
8-bit/Asynchronous
16-bit/Asynchronous
16-bit/Asynchronous
8-bit/Synchronous
16-bit/Synchronous
FOSC/[16 (n + 1)]
FOSC/[4 (n + 1)]
Preliminary
DS39762B-page 303
PIC18F97J60 FAMILY
EXAMPLE 20-1:
For a device with FOSC of 16 MHz, desired baud rate of 9600, Asynchronous mode, 8-bit BRG:
Desired Baud Rate
= FOSC/(64 ([SPBRGHx:SPBRGx] + 1))
Solving for SPBRGHx:SPBRGx:
X
= ((FOSC/Desired Baud Rate)/64) 1
= ((16000000/9600)/64) 1
= [25.042] = 25
Calculated Baud Rate = 16000000/(64 (25 + 1))
= 9615
Error
= (Calculated Baud Rate Desired Baud Rate)/Desired Baud Rate
= (9615 9600)/9600 = 0.16%
TABLE 20-2:
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Reset Values
on Page:
TXSTAx
CSRC
TX9
TXEN
SYNC
SENDB
BRGH
TRMT
TX9D
61
RCSTAx
SPEN
Name
BAUDCONx ABDOVF
RX9
SREN
CREN
ADDEN
FERR
OERR
RX9D
61
RCIDL
RXDTP
TXCKP
BRG16
WUE
ABDEN
62
SPBRGHx
62
SPBRGx
62
Legend: = unimplemented, read as 0. Shaded cells are not used by the BRG.
DS39762B-page 304
Preliminary
PIC18F97J60 FAMILY
TABLE 20-3:
BAUD
RATE
(K)
SPBRG
Actual
Value
Rate (K)
(decimal)
SPBRG
Actual
Value
Rate (K)
(decimal)
SPBRG
Actual
Value
Rate (K)
(decimal)
SPBRG
Value
(decimal)
Actual
Rate (K)
%
Error
0.3
1.2
1.271
5.96
255
135
%
Error
%
Error
%
Error
2.4
2.543
5.96
255
2.405
0.22
202
2.396
-0.15
162
2.393
-0.27
9.6
9.574
-0.27
67
9.574
-0.27
50
9.527
-0.76
40
9.574
-0.27
33
19.2
19.148
-0.27
33
19.531
1.73
24
19.531
1.73
19
19.147
-0.27
16
57.6
59.186
2.75
10
61.035
5.96
55.804
-3.12
54.253
-5.81
115.2
108.508
-5.81
122.070
5.96
130.208
13.03
108.505
-5.81
%
Error
SPBRG
Actual
Value
Rate (K)
(decimal)
%
Error
SPBRG
Actual
Value
Rate (K)
(decimal)
%
Error
SPBRG
Value
(decimal)
0.3
0.300
0.01
216
1.2
1.198
-0.08
180
1.206
0.47
80
1.206
0.48
53
2.4
2.411
0.47
89
2.382
-0.76
40
2.411
0.48
26
9.6
9.435
-1.71
22
9.766
1.73
9.301
-3.11
6
2
19.2
19.279
2.75
10
19.531
1.73
21.703
13.04
57.6
54.254
-5.81
48.828
-15.23
65.109
13.04
115.2
108.508
-5.81
97.656
-15.23
65.109
-43.48
0.3
1.2
%
Error
SPBRG
Actual
Value
Rate (K)
(decimal)
%
Error
SPBRG
Actual
Value
Rate (K)
(decimal)
%
Error
SPBRG
Actual
Value
Rate (K)
(decimal)
%
Error
SPBRG
Value
(decimal)
2.4
9.6
10.172
5.96
255
9.621
0.22
202
9.586
-0.15
162
9.573
-0.27
135
19.2
19.148
-0.27
135
19.148
-0.27
101
19.290
0.47
80
19.147
-0.27
67
57.6
57.871
0.47
44
57.445
-0.27
33
57.870
0.47
26
56.611
-1.72
22
115.2
113.226
-1.71
22
114.890
-0.27
16
111.607
-3.12
13
118.369
2.75
10
0.3
1.2
%
Error
SPBRG
Actual
Value
Rate (K)
(decimal)
%
Error
SPBRG
Actual
Value
Rate (K)
(decimal)
%
Error
SPBRG
Value
(decimal)
1.200
0.01
216
108
2.4
2.396
-0.15
162
2.389
-0.44
9.6
9.645
0.47
89
9.527
-0.76
40
9.645
0.48
26
19.2
19.290
0.47
44
19.531
1.73
19
18.603
-3.11
13
57.6
57.871
0.47
14
55.804
-3.12
52.088
-9.57
115.2
108.508
-5.81
130.208.
13.03
130.219
13.04
Preliminary
DS39762B-page 305
PIC18F97J60 FAMILY
TABLE 20-3:
BAUD
RATE
(K)
%
Error
SPBRG
Actual
Value
Rate (K)
(decimal)
%
Error
SPBRG
Actual
Value
Rate (K)
(decimal)
%
Error
SPBRG
Actual
Value
Rate (K)
(decimal)
%
Error
SPBRG
Value
(decimal)
0.3
0.300
0.00
8680
0.300
0.00
6509
0.300
0.01
5207
0.300
0.00
4339
1.2
1.200
0.01
2169
1.200
-0.02
1627
1.200
0.01
1301
1.200
0.00
1084
2.4
2.400
0.01
1084
2.399
-0.02
813
2.400
0.01
650
2.398
-0.09
542
9.6
9.609
0.10
270
9.621
0.22
202
9.586
-0.15
162
9.574
-0.27
135
19.2
19.148
-0.27
135
19.148
-0.27
101
19.290
0.47
80
19.148
-0.27
67
57.6
57.871
0.47
44
57.444
-0.27
33
57.870
0.47
26
56.611
-1.72
22
115.2
113.226
-1.71
22
114.890
-0.27
16
111.607
-3.12
13
118.369
2.75
10
SPBRG
Actual
Value
Rate (K)
(decimal)
SPBRG
Actual
Value
Rate (K)
(decimal)
SPBRG
Value
(decimal)
Actual
Rate (K)
%
Error
0.3
0.300
-0.02
2893
0.300
0.01
1301
0.300
0.01
867
1.2
1.201
0.05
722
1.198
-0.15
325
1.200
0.01
216
2.4
2.398
-0.08
361
2.396
-0.15
162
2.389
-0.44
108
9.6
9.645
0.47
89
9.527
-0.76
40
9.646
0.48
26
19.2
19.290
0.47
44
19.531
1.73
19
18.603
-3.11
13
57.6
57.871
0.47
14
55.804
-3.12
52.088
-9.57
115.2
108.508
-5.81
130.208
13.03
130.218
13.04
%
Error
%
Error
SPBRG
Actual
Value
Rate (K)
(decimal)
SPBRG
Actual
Value
Rate (K)
(decimal)
SPBRG
Actual
Value
Rate (K)
(decimal)
Actual
Rate (K)
%
Error
0.3
0.300
0.00
34722
0.300
0.00
26041
0.300
0.00
20832
1.2
1.200
0.00
8680
1.200
0.01
6509
1.200
0.01
5207
%
Error
%
Error
%
Error
SPBRG
Value
(decimal)
0.300
0.00
17360
1.200
0.00
4339
2169
2.4
2.400
0.01
4339
2.400
0.01
3254
2.400
0.01
2603
2.400
0.00
9.6
9.601
0.01
1084
9.598
-0.02
813
9.601
0.01
650
9.592
-0.09
542
19.2
19.184
-0.08
542
19.195
-0.02
406
19.172
-0.15
325
19.219
0.10
270
57.6
57.551
-0.08
180
57.445
-0.27
135
57.339
-0.45
108
57.869
0.47
89
115.2
115.742
0.47
89
114.890
-0.27
67
115.741
0.47
53
115.739
0.47
44
%
Error
SPBRG
Actual
Value
Rate (K)
(decimal)
%
Error
SPBRG
Actual
Value
Rate (K)
(decimal)
%
Error
SPBRG
Value
(decimal)
0.3
0.300
0.00
11573
0.300
0.01
5207
0.300
-0.01
3472
1.2
1.200
-0.02
2893
1.200
0.01
1301
1.200
0.01
867
2.4
2.400
-0.02
1446
2.400
0.01
650
2.400
0.01
433
9.6
9.592
-0.08
361
9.586
-0.15
162
9.557
-0.44
108
19.2
19.184
-0.08
180
19.290
0.47
80
19.292
0.48
53
57.6
57.870
0.47
59
57.870
0.47
26
57.875
0.48
17
115.2
115.742
0.47
29
111.607
-3.12
13
115.750
0.48
DS39762B-page 306
Preliminary
PIC18F97J60 FAMILY
20.1.3
TABLE 20-4:
BRG COUNTER
CLOCK RATES
BRG16
BRGH
FOSC/512
FOSC/128
FOSC/128
FOSC/32
Note:
20.1.3.1
Preliminary
DS39762B-page 307
PIC18F97J60 FAMILY
FIGURE 20-1:
BRG Value
0000h
001Ch
Start
RXx pin
Edge #1
Bit 1
Bit 0
Edge #2
Bit 3
Bit 2
Edge #3
Bit 5
Bit 4
Edge #4
Bit 7
Bit 6
Edge #5
Stop Bit
BRG Clock
Auto-Cleared
Set by User
ABDEN bit
RCxIF bit
(Interrupt)
Read
RCREGx
SPBRGx
XXXXh
1Ch
SPBRGHx
XXXXh
00h
Note: The ABD sequence requires the EUSARTx module to be configured in Asynchronous mode and WUE = 0.
FIGURE 20-2:
BRG Clock
ABDEN bit
RXx pin
Start
Bit 0
ABDOVF bit
FFFFh
BRG Value
DS39762B-page 308
XXXXh
0000h
0000h
Preliminary
PIC18F97J60 FAMILY
20.2
20.2.1
While TXxIF indicates the status of the TXREGx register, another bit, TRMT (TXSTAx<1>), shows the status
of the TSR register. TRMT is a read-only bit which is set
when the TSR register is empty. No interrupt logic is
tied to this bit so the user has to poll this bit in order to
determine if the TSR register is empty.
Note 1: The TSR register is not mapped in data
memory, so it is not available to the user.
2: Flag bit, TXxIF, is set when enable bit
TXEN is set.
To set up an Asynchronous Transmission:
1.
2.
3.
4.
5.
6.
EUSARTx ASYNCHRONOUS
TRANSMITTER
7.
8.
9.
Preliminary
DS39762B-page 309
PIC18F97J60 FAMILY
FIGURE 20-3:
TXREGx Register
TXxIE
8
MSb
LSb
(8)
Pin Buffer
and Control
TSR Register
TXx pin
Interrupt
TXEN
BRG16
SPBRGHx
SPBRGx
TX9
FIGURE 20-4:
TX9D
Write to TXREGx
BRG Output
(Shift Clock)
Word 1
TXx (pin)
Start bit
bit 0
bit 1
bit 7/8
Stop bit
Word 1
TXxIF bit
(Transmit Buffer
Reg. Empty Flag)
TRMT bit
(Transmit Shift
Reg. Empty Flag)
FIGURE 20-5:
1 TCY
Word 1
Transmit Shift Reg
Write to TXREGx
Word 1
Word 2
BRG Output
(Shift Clock)
TXx (pin)
TXxIF bit
(Interrupt Reg. Flag)
Start bit
bit 0
1 TCY
bit 1
bit 7/8
Stop bit
Start bit
bit 0
Word 2
Word 1
1 TCY
TRMT bit
(Transmit Shift
Reg. Empty Flag)
Word 1
Transmit Shift Reg.
Word 2
Transmit Shift Reg.
DS39762B-page 310
Preliminary
PIC18F97J60 FAMILY
TABLE 20-5:
Name
INTCON
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Reset
Values
on Page:
INT0IE
RBIE
TMR0IF
INT0IF
RBIF
59
PIR1
PSPIF
ADIF
RC1IF
TX1IF
SSP1IF
CCP1IF
TMR2IF
TMR1IF
61
PIE1
PSPIE
ADIE
RC1IE
TX1IE
SSP1IE
CCP1IE
TMR2IE
TMR1IE
61
IPR1
PSPIP
ADIP
RC1IP
TX1IP
SSP1IP
CCP1IP
TMR2IP
TMR1IP
61
PIR3
SSP2IF
BCL2IF
RC2IF
TX2IF(1)
TMR4IF
CCP5IF
CCP4IF
CCP3IF
61
PIE3
SSP2IE
BCL2IE
RC2IE
TX2IE(1)
TMR4IE
CCP5IE
CCP4IE
CCP3IE
61
IPR3
SSP2IP
BCL2IP
RC2IP
TX2IP(1)
TMR4IP
CCP5IP
CCP4IP
CCP3IP
61
SPEN
RX9
SREN
CREN
ADDEN
FERR
OERR
RX9D
61
RCSTAx
TXREGx
TXSTAx
61
CSRC
TX9
TXEN
SYNC
SENDB
BRGH
TRMT
TX9D
61
BAUDCONx
ABDOVF
RCIDL
RXDTP
TXCKP
BRG16
WUE
ABDEN
62
SPBRGHx
62
SPBRGx
62
Legend: = unimplemented locations read as 0. Shaded cells are not used for asynchronous transmission.
Note 1: These bits are only available in 80-pin and 100-pin devices; otherwise, they are unimplemented and read
as 0.
Preliminary
DS39762B-page 311
PIC18F97J60 FAMILY
20.2.2
EUSARTx ASYNCHRONOUS
RECEIVER
20.2.3
DS39762B-page 312
Preliminary
PIC18F97J60 FAMILY
FIGURE 20-6:
FERR
OERR
SPBRGHx
64
or
16
or
4
SPBRGx
RSR Register
MSb
Stop
(8)
LSb
1
Start
RX9
Pin Buffer
and Control
Data
Recovery
RXx
RX9D
RCREGx Register
FIFO
RXDTP SPEN
8
Interrupt
FIGURE 20-7:
Data Bus
RCxIF
RCxIE
RXx (pin)
bit 0
bit 1
Start
bit
bit 0
Word 1
RCREGx
Read Rcv
Buffer Reg
RCREGx
bit 7/8
Stop
bit
Start
bit
bit 7/8
Stop
bit
Word 2
RCREGx
RCxIF
(Interrupt Flag)
OERR bit
CREN
Note:
This timing diagram shows three words appearing on the RXx input. The RCREGx (Receive Buffer) is read after the third word
causing the OERR (Overrun Error) bit to be set.
TABLE 20-6:
Name
INTCON
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Reset Values
on Page:
INT0IE
RBIE
TMR0IF
INT0IF
RBIF
59
PIR1
PSPIF
ADIF
RC1IF
TX1IF
SSP1IF
CCP1IF
TMR2IF
TMR1IF
61
PIE1
PSPIE
ADIE
RC1IE
TX1IE
SSP1IE
CCP1IE
TMR2IE
TMR1IE
61
IPR1
PSPIP
ADIP
RC1IP
TX1IP
SSP1IP
CCP1IP
TMR2IP
TMR1IP
61
PIR3
SSP2IF
BCL2IF
RC2IF(1)
TX2IF
TMR4IF
CCP5IF
CCP4IF
CCP3IF
61
PIE3
SSP2IE
BCL2IE
RC2IE(1)
TX2IE
TMR4IE
CCP5IE
CCP4IE
CCP3IE
61
IPR3
SSP2IP
BCL2IP
RC2IP(1)
TX2IP
TMR4IP
CCP5IP
CCP4IP
CCP3IP
61
SPEN
RX9
SREN
CREN
ADDEN
FERR
OERR
RX9D
RCSTAx
RCREGx
TXSTAx
61
BAUDCONx ABDOVF
61
TX9
TXEN
SYNC
SENDB
BRGH
TRMT
TX9D
61
RCIDL
RXDTP
TXCKP
BRG16
WUE
ABDEN
62
SPBRGHx
62
SPBRGx
62
Legend: = unimplemented locations read as 0. Shaded cells are not used for asynchronous reception.
Note 1: These bits are only available in 80-pin and 100-pin devices; otherwise, they are unimplemented and read as 0.
Preliminary
DS39762B-page 313
PIC18F97J60 FAMILY
20.2.4
20.2.4.1
20.2.4.2
DS39762B-page 314
Preliminary
PIC18F97J60 FAMILY
FIGURE 20-8:
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 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4
OSC1
Bit set by user
Auto-Cleared
WUE bit(1)
RXx/DTx Line
RCxIF
FIGURE 20-9:
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
OSC1
WUE bit(2)
Auto-Cleared
RXx/DTx Line
Note 1
RCxIF
Sleep Ends
Note 1:
2:
If the wake-up event requires long oscillator warm-up time, the auto-clear of the WUE bit can occur before the oscillator is ready. This
sequence should not depend on the presence of Q clocks.
The EUSARTx remains in Idle while the WUE bit is set.
Preliminary
DS39762B-page 315
PIC18F97J60 FAMILY
20.2.5
20.2.5.1
FIGURE 20-10:
1.
2.
3.
4.
5.
20.2.6
Write to TXREGx
Dummy Write
BRG Output
(Shift Clock)
TXx (pin)
Start bit
bit 0
bit 1
bit 11
Stop bit
Break
TXxIF bit
(Transmit Buffer
Reg. Empty Flag)
TRMT bit
(Transmit Shift
Reg. Empty Flag)
SENDB sampled here
Auto-Cleared
SENDB bit
(Transmit Shift
Reg. Empty Flag)
DS39762B-page 316
Preliminary
PIC18F97J60 FAMILY
20.3
EUSARTx Synchronous
Master Mode
20.3.1
2.
3.
EUSARTx SYNCHRONOUS
MASTER TRANSMISSION
FIGURE 20-11:
4.
5.
6.
7.
8.
9.
SYNCHRONOUS TRANSMISSION
Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4
RC7/RX1/DT1
bit 0
bit 1
bit 2
Q3 Q4 Q1 Q2 Q3 Q4 Q1Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4
bit 7
Word 1
bit 0
bit 1
bit 7
Word 2
RC6/TX1/CK1 pin
(TXCKP = 0)
RC6/TX1/CK1 pin
(TXCKP = 1)
Write to
TXREG1 Reg
Write Word 1
Write Word 2
TX1IF bit
(Interrupt Flag)
TRMT bit
TXEN bit
Note:
Sync Master mode, SPBRG1 = 0, continuous transmission of two 8-bit words. This example is equally applicable to EUSART2
(RG1/TX2/CK2 and RG2/RX2/DT2).
Preliminary
DS39762B-page 317
PIC18F97J60 FAMILY
FIGURE 20-12:
RC7/RX1/DT1 pin
bit 0
bit 1
bit 2
bit 6
bit 7
RC6/TX1/CK1 pin
Write to
TXREG1 reg
TX1IF bit
TRMT bit
TXEN bit
Note: This example is equally applicable to EUSART2 (RG1/TX2/CK2 and RG2/RX2/DT2).
TABLE 20-7:
Name
INTCON
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Reset
Values
on Page:
INT0IE
RBIE
TMR0IF
INT0IF
RBIF
59
PIR1
PSPIF
ADIF
RC1IF
TX1IF
SSP1IF
CCP1IF
TMR2IF
TMR1IF
61
PIE1
PSPIE
ADIE
RC1IE
TX1IE
SSP1IE
CCP1IE
TMR2IE
TMR1IE
61
IPR1
PSPIP
ADIP
RC1IP
TX1IP
SSP1IP
CCP1IP
TMR2IP
TMR1IP
61
PIR3
SSP2IF
BCL2IF
RC2IF
TX2IF(1)
TMR4IF
CCP5IF
CCP4IF
CCP3IF
61
PIE3
SSP2IE
BCL2IE
RC2IE
TX2IE(1)
TMR4IE
CCP5IE
CCP4IE
CCP3IE
61
IPR3
SSP2IP
BCL2IP
RC2IP
TX2IP(1)
TMR4IP
CCP5IP
CCP4IP
CCP3IP
61
SPEN
RX9
SREN
CREN
ADDEN
FERR
OERR
RX9D
61
RCSTAx
TXREGx
TXSTAx
BAUDCONx ABDOVF
61
TX9
TXEN
SYNC
SENDB
BRGH
TRMT
TX9D
61
RCIDL
RXDTP
TXCKP
BRG16
WUE
ABDEN
62
SPBRGHx
62
SPBRGx
62
Legend: = unimplemented, read as 0. Shaded cells are not used for synchronous master transmission.
Note 1: These bits are only available in 80-pin and 100-pin devices; otherwise, they are unimplemented and read as 0.
DS39762B-page 318
Preliminary
PIC18F97J60 FAMILY
20.3.2
EUSARTx SYNCHRONOUS
MASTER RECEPTION
4.
2.
3.
FIGURE 20-13:
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 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4
RC7/RX1/DT1
pin
bit 0
bit 1
bit 2
bit 3
bit 4
bit 5
bit 6
bit 7
RC6/TX1/CK1 pin
(TXCKP = 0)
RC6/TX1/CK1 pin
(TXCKP = 1)
Write to
bit SREN
SREN bit
CREN bit 0
RC1IF bit
(Interrupt)
Read
RCREG1
Note:
Timing diagram demonstrates Sync Master mode with bit SREN = 1 and bit BRGH = 0. This example is equally applicable to EUSART2
(RG1/TX2/CK2 and RG2/RX2/DT2).
Preliminary
DS39762B-page 319
PIC18F97J60 FAMILY
TABLE 20-8:
Name
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Reset
Values
on Page:
TMR0IE
INT0IE
RBIE
TMR0IF
INT0IF
RBIF
59
PIR1
PSPIF
ADIF
RC1IF
TX1IF
SSP1IF
CCP1IF
TMR2IF
TMR1IF
61
PIE1
PSPIE
ADIE
RC1IE
TX1IE
SSP1IE
CCP1IE
TMR2IE
TMR1IE
61
INTCON
GIE/GIEH PEIE/GIEL
IPR1
PSPIP
ADIP
RC1IP
TX1IP
SSP1IP
CCP1IP
TMR2IP
TMR1IP
61
PIR3
SSP2IF
BCL2IF
RC2IF(1)
TX2IF
TMR4IF
CCP5IF
CCP4IF
CCP3IF
61
PIE3
SSP2IE
BCL2IE
RC2IE(1)
TX2IE
TMR4IE
CCP5IE
CCP4IE
CCP3IE
61
IPR3
SSP2IP
BCL2IP
RC2IP(1)
TX2IP
TMR4IP
CCP5IP
CCP4IP
CCP3IP
61
CREN
ADDEN
FERR
OERR
RX9D
61
RCSTAx
RCREGx
TXSTAx
SPEN
RX9
SREN
BAUDCONx ABDOVF
61
TX9
TXEN
SYNC
SENDB
BRGH
TRMT
TX9D
61
RCIDL
RXDTP
TXCKP
BRG16
WUE
ABDEN
62
SPBRGHx
62
SPBRGx
62
Legend: = unimplemented, read as 0. Shaded cells are not used for synchronous master reception.
Note 1: These bits are only available in 80-pin and 100-pin devices; otherwise, they are unimplemented and read as 0.
20.4
EUSARTx Synchronous
Slave Mode
2.
3.
20.4.1
EUSARTx SYNCHRONOUS
SLAVE TRANSMISSION
4.
5.
6.
7.
8.
a)
b)
c)
d)
e)
DS39762B-page 320
9.
Preliminary
PIC18F97J60 FAMILY
TABLE 20-9:
Name
Bit 6
Bit 5
Bit 3
Bit 2
Bit 1
Bit 0
Reset
Values
on Page:
INT0IE
RBIE
TMR0IF
INT0IF
RBIF
59
PIR1
PSPIF
ADIF
RC1IF
TX1IF
SSP1IF
CCP1IF
TMR2IF
TMR1IF
61
PIE1
PSPIE
ADIE
RC1IE
TX1IE
SSP1IE
CCP1IE
TMR2IE
TMR1IE
61
INTCON
Bit 4
IPR1
PSPIP
ADIP
RC1IP
TX1IP
SSP1IP
CCP1IP
TMR2IP
TMR1IP
61
PIR3
SSP2IF
BCL2IF
RC2IF
TX2IF(1)
TMR4IF
CCP5IF
CCP4IF
CCP3IF
61
PIE3
SSP2IE
BCL2IE
RC2IE
TX2IE(1)
TMR4IE
CCP5IE
CCP4IE
CCP3IE
61
IPR3
SSP2IP
BCL2IP
RC2IP
TX2IP(1)
TMR4IP
CCP5IP
CCP4IP
CCP3IP
61
CREN
ADDEN
FERR
OERR
RX9D
61
RCSTAx
TXREGx
TXSTAx
SPEN
RX9
SREN
BAUDCONx ABDOVF
61
TX9
TXEN
SYNC
SENDB
BRGH
TRMT
TX9D
61
RCIDL
RXDTP
TXCKP
BRG16
WUE
ABDEN
62
SPBRGHx
62
SPBRGx
62
Legend: = unimplemented, read as 0. Shaded cells are not used for synchronous slave transmission.
Note 1: These bits are only available in 80-pin and 100-pin devices; otherwise, they are unimplemented and read as 0.
20.4.2
Preliminary
DS39762B-page 321
PIC18F97J60 FAMILY
TABLE 20-10: REGISTERS ASSOCIATED WITH SYNCHRONOUS SLAVE RECEPTION
Name
INTCON
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Reset
Values
on Page:
INT0IE
RBIE
TMR0IF
INT0IF
RBIF
59
PIR1
PSPIF
ADIF
RC1IF
TX1IF
SSP1IF
CCP1IF
TMR2IF
TMR1IF
61
PIE1
PSPIE
ADIE
RC1IE
TX1IE
SSP1IE
CCP1IE
TMR2IE
TMR1IE
61
IPR1
PSPIP
ADIP
RC1IP
TX1IP
SSP1IP
CCP1IP
TMR2IP
TMR1IP
61
PIR3
SSP2IF
BCL2IF
RC2IF(1)
TX2IF
TMR4IF
CCP5IF
CCP4IF
CCP3IF
61
PIE3
SSP2IE
BCL2IE
RC2IE(1)
TX2IE
TMR4IE
CCP5IE
CCP4IE
CCP3IE
61
IPR3
SSP2IP
BCL2IP
RC2IP(1)
TX2IP
TMR4IP
CCP5IP
CCP4IP
CCP3IP
61
CREN
ADDEN
FERR
OERR
RX9D
61
RCSTAx
RCREGx
TXSTAx
SPEN
RX9
SREN
BAUDCONx ABDOVF
61
TX9
TXEN
SYNC
SENDB
BRGH
TRMT
TX9D
61
RCIDL
RXDTP
TXCKP
BRG16
WUE
ABDEN
62
SPBRGHx
62
SPBRGx
62
Legend: = unimplemented, read as 0. Shaded cells are not used for synchronous slave reception.
Note 1: These bits are only available in 80-pin and 100-pin devices; otherwise, they are unimplemented and read as 0.
DS39762B-page 322
Preliminary
PIC18F97J60 FAMILY
21.0
10-BIT ANALOG-TO-DIGITAL
CONVERTER (A/D) MODULE
REGISTER 21-1:
R/W-0
U-0
R/W-0
R/W-0
R/W-0
R/W-0
R/W-0
R/W-0
ADCAL
CHS3
CHS2
CHS1
CHS0
GO/DONE
ADON
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
-n = Value at POR
1 = Bit is set
0 = Bit is cleared
bit 7
bit 6
Unimplemented: Read as 0
bit 5-2
bit 1
bit 0
Note 1:
2:
3:
x = Bit is unknown
Preliminary
DS39762B-page 323
PIC18F97J60 FAMILY
REGISTER 21-2:
U-0
U-0
R/W-0
R/W-0
R/W-0
R/W-0
R/W-0
R/W-0
VCFG1
VCFG0
PCFG3
PCFG2
PCFG1
PCFG0
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
-n = Value at POR
1 = Bit is set
0 = Bit is cleared
PCFG3:
PCFG0
AN8
AN7
AN6
AN5(2)
AN4
AN3
AN2
AN1(3)
AN0(3)
bit 3-0
AN10
AN11
bit 4
AN12(1)
AN13(1)
bit 5
AN14(1)
Unimplemented: Read as 0
AN15(1)
bit 7-6
0000
0001
0010
0011
0100
0101
0110
0111
1000
1001
1010
1011
1100
1101
1110
1111
A
D
D
D
D
D
D
D
D
D
D
D
D
D
D
D
A
D
D
D
D
D
D
D
D
D
D
D
D
D
D
D
A
A
D
D
D
D
D
D
D
D
D
D
D
D
D
D
A
A
A
D
D
D
D
D
D
D
D
D
D
D
D
D
A
A
A
A
D
D
D
D
D
D
D
D
D
D
D
D
A
A
A
A
A
D
D
D
D
D
D
D
D
D
D
D
A
A
A
A
A
A
D
D
D
D
D
D
D
D
D
D
A
A
A
A
A
A
A
D
D
D
D
D
D
D
D
D
A
A
A
A
A
A
A
A
D
D
D
D
D
D
D
D
A
A
A
A
A
A
A
A
A
D
D
D
D
D
D
D
A
A
A
A
A
A
A
A
A
A
D
D
D
D
D
D
A
A
A
A
A
A
A
A
A
A
A
D
D
D
D
D
A
A
A
A
A
A
A
A
A
A
A
A
D
D
D
D
A
A
A
A
A
A
A
A
A
A
A
A
A
D
D
D
A
A
A
A
A
A
A
A
A
A
A
A
A
A
D
D
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
D
A = Analog input
Note 1:
2:
3:
x = Bit is unknown
D = Digital I/O
AN12 through AN15 are available in 80-pin and 100-pin devices only.
AN5 is available in 100-pin devices only.
AN0 and AN1 can also operate as Ethernet LED outputs in either Analog or Digital I/O modes.
DS39762B-page 324
Preliminary
PIC18F97J60 FAMILY
REGISTER 21-3:
R/W-0
U-0
R/W-0
R/W-0
R/W-0
R/W-0
R/W-0
R/W-0
ADFM
ACQT2
ACQT1
ACQT0
ADCS2
ADCS1
ADCS0
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
-n = Value at POR
1 = Bit is set
0 = Bit is cleared
bit 7
bit 6
Unimplemented: Read as 0
bit 5-3
bit 2-0
Note 1:
x = Bit is unknown
If the A/D FRC clock source is selected, a delay of one TCY (instruction cycle) is added before the A/D
clock starts. This allows the SLEEP instruction to be executed before starting a conversion.
Preliminary
DS39762B-page 325
PIC18F97J60 FAMILY
The analog reference voltage is software selectable to
either the devices positive and negative supply voltage
(AVDD and AVSS), or the voltage level on the
RA3/AN3/VREF+ and RA2/AN2/VREF- pins.
the A/D conversion. When the A/D conversion is complete, the result is loaded into the ADRESH:ADRESL
register pair, the GO/DONE bit (ADCON0<1>) is
cleared and A/D Interrupt Flag bit, ADIF, is set.
The output of the sample and hold is the input into the
converter, which generates the result via successive
approximation.
FIGURE 21-1:
AN14(1)
1101
AN13(1)
1100
AN12(1)
1011
1010
1001
1000
0111
0110
0101
0100
VAIN
0011
(Input Voltage)
10-Bit
A/D
Converter
0010
0001
VCFG1:VCFG0
AN15(1)
0000
VDD(3)
AN11
AN10
AN9
AN8
AN7
AN6
AN5(2)
AN4
AN3
AN2
AN1
AN0
VREF+
Reference
Voltage
VREFVSS(3)
Note 1:
2:
3:
DS39762B-page 326
Preliminary
PIC18F97J60 FAMILY
After the A/D module has been configured as desired,
the selected channel must be acquired before the
conversion is started. The analog input channels must
have their corresponding TRIS bits selected as inputs.
To determine acquisition time, see Section 21.1 A/D
Acquisition Requirements. After this acquisition
time has elapsed, the A/D conversion can be started.
An acquisition time can be programmed to occur
between setting the GO/DONE bit and the actual start
of the conversion.
2.
3.
4.
5.
FIGURE 21-2:
OR
Waiting for the A/D interrupt
Read A/D Result registers (ADRESH:ADRESL);
clear bit, ADIF, if required.
For next conversion, go to step 1 or step 2, as
required. The A/D conversion time per bit is
defined as TAD. A minimum wait of 2 TAD is
required before next acquisition starts.
6.
7.
VT = 0.6V
RS
RIC 1k
ANx
CPIN
5 pF
VAIN
VT = 0.6V
SS
RSS
ILEAKAGE
100 nA
CHOLD = 25 pF
VSS
Legend:
CPIN
VT
ILEAKAGE
RIC
SS
CHOLD
RSS
= Input Capacitance
= Threshold Voltage
= Leakage Current at the pin due to
various junctions
= Interconnect Resistance
= Sampling Switch
= Sample/Hold Capacitance (from DAC)
= Sampling Switch Resistance
Preliminary
VDD
1
2
3
4
Sampling Switch (k)
DS39762B-page 327
PIC18F97J60 FAMILY
21.1
CHOLD
Rs
Conversion Error
VDD
Temperature
=
=
=
=
25 pF
2.5 k
1/2 LSb
3V Rss = 2 k
85C (system max.)
ACQUISITION TIME
TAMP + TC + TCOFF
EQUATION 21-2:
VHOLD
or
TC
EQUATION 21-1:
TACQ
EQUATION 21-3:
TACQ
TAMP + TC + TCOFF
TAMP
0.2 s
TCOFF
Temperature coefficient is only required for temperatures > 25C. Below 25C, TCOFF = 0 ms.
TC
TACQ
0.2 s + 1 s + 1.2 s
2.4 s
DS39762B-page 328
Preliminary
PIC18F97J60 FAMILY
21.2
TABLE 21-1:
21.3
2 TOSC
4 TOSC
8 TOSC
16 TOSC
32 TOSC
64 TOSC
Internal RC Oscillator
ADCS2:ADCS0
Maximum
Device
Frequency
2 TOSC
000
2.68 MHz
4 TOSC
100
5.71 MHz
8 TOSC
001
11.43 MHz
16 TOSC
101
22.86 MHz
32 TOSC
010
41.67 MHz
64 TOSC
110
41.67 MHz
RC(2)
x11
1.00 MHz(1)
Note 1:
2:
21.4
Preliminary
DS39762B-page 329
PIC18F97J60 FAMILY
21.5
A/D Conversions
21.6
FIGURE 21-3:
TCY TAD TAD1 TAD2 TAD3 TAD4 TAD5 TAD6 TAD7 TAD8 TAD9 TAD10 TAD11
b4
b1
b0
b6
b7
b2
b9
b8
b3
b5
Conversion starts
Holding capacitor is disconnected from analog input (typically 100 ns)
Set GO/DONE bit
Next Q4: ADRESH/ADRESL is loaded, GO/DONE bit is cleared,
ADIF bit is set, holding capacitor is connected to analog input.
FIGURE 21-4:
TACQT Cycles
1
Automatic
Acquisition
Time
TAD Cycles
4
10
11
b9
b8
b7
b6
b5
b4
b3
b2
b1
b0
Conversion starts
(Holding capacitor is disconnected)
DS39762B-page 330
Preliminary
PIC18F97J60 FAMILY
21.7
21.8
Operation in Power-Managed
Modes
TABLE 21-2:
Name
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Reset
Values
on Page:
TMR0IE
INT0IE
RBIE
TMR0IF
INT0IF
RBIF
59
PIR1
PSPIF
ADIF
RC1IF
TX1IF
SSP1IF
CCP1IF
TMR2IF
TMR1IF
61
PIE1
PSPIE
ADIE
RC1IE
TX1IE
SSP1IE
CCP1IE
TMR2IE
TMR1IE
61
IPR1
PSPIP
ADIP
RC1IP
TX1IP
SSP1IP
CCP1IP
TMR2IP
TMR1IP
61
INTCON
GIE/GIEH PEIE/GIEL
PIR2
OSCFIF
CMIF
ETHIF
BCL1IF
TMR3IF
CCP2IF
61
PIE2
OSCFIE
CMIE
ETHIE
BCL1IE
TMR3IE
CCP2IE
61
IPR2
OSCFIP
CMIP
ETHIP
BCL1IP
TMR3IP
CCP2IP
61
ADRESH
60
ADRESL
60
ADCON0
ADCAL
CHS3
CHS3
CHS1
CHS0
GO/DONE
ADON
60
ADCON1
VCFG1
VCFG0
PCFG3
PCFG2
PCFG1
PCFG0
60
ADCON2
ADFM
ACQT2
ACQT1
ACQT0
ADCS2
ADCS1
ADCS0
60
CCP2CON
P2M1
P2M0
DC2B1
DC2B0
CCP2M3
CCP2M2
CCP2M1
CCP2M0
60
PORTA
RJPU
RA5
RA4
RA3
RA2
RA1
RA0
62
TRISA
TRISA5
TRISA4
TRISA3
TRISA2
TRISA1
TRISA0
61
PORTF
RF7
RF6
RF5
RF4
RF3
RF2
RF1
TRISF
TRISF7
TRISF6
TRISF5
TRISF4
TRISF3
TRISF2
TRISF1
RF0
(1)
62
TRISF0(1)
61
PORTH(2)
RH7
RH6
RH5
RH4
RH3
RH2
RH1
RH0
62
TRISH(2)
TRISH7
TRISH6
TRISH5
TRISH4
TRISH3
TRISH2
TRISH1
TRISH0
61
Legend: = unimplemented, read as 0, r = reserved. Shaded cells are not used for A/D conversion.
Note 1: Implemented in 100-pin devices only.
2: This register is not implemented on 64-pin devices.
Preliminary
DS39762B-page 331
PIC18F97J60 FAMILY
NOTES:
DS39762B-page 332
Preliminary
PIC18F97J60 FAMILY
22.0
COMPARATOR MODULE
REGISTER 22-1:
R-0
R-0
R/W-0
R/W-0
R/W-0
R/W-1
R/W-1
R/W-1
C2OUT
C1OUT
C2INV
C1INV
CIS
CM2
CM1
CM0
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
-n = Value at POR
1 = Bit is set
0 = Bit is cleared
x = Bit is unknown
bit 7
bit 6
bit 5
bit 4
bit 3
bit 2-0
Preliminary
DS39762B-page 333
PIC18F97J60 FAMILY
22.1
Comparator Configuration
There are eight modes of operation for the comparators, shown in Figure 22-1. Bits CM2:CM0 of the
CMCON register are used to select these modes. The
TRISF register controls the data direction of the
comparator pins for each mode. If the Comparator
FIGURE 22-1:
RF5/AN10/ A
CVREF
RF4/AN9
RF3/AN8
VINVIN+
VIN-
VIN+
C1
Off (Read as 0)
C2
Off (Read as 0)
VIN+
VIN-
VIN+
RF3/AN8
RF6/AN11
VIN-
RF5/AN10/
CVREF
VIN+
RF4/AN9
VIN-
VIN+
RF3/AN8
C1
Off (Read as 0)
C2
Off (Read as 0)
VIN-
RF5/AN10/ A
CVREF
RF4/AN9
Note:
RF6/AN11
VIN-
C1
C1OUT
VIN+
RF5/AN10/ A
CVREF
RF2/AN7/C1OUT*
C2
C2OUT
RF4/AN9
VIN-
RF3/AN8
VIN+
C1
C1OUT
C2
C2OUT
RF1/AN6/C2OUT*
Two Common Reference Comparators
CM2:CM0 = 100
RF6/AN11
VIN-
RF5/AN10/ A
CVREF
VIN+
VIN-
VIN+
RF4/AN9
RF3/AN8
C1
C1OUT
C2
C2OUT
A
RF5/AN10/
CVREF
RF2/AN7/C1OUT*
RF4/AN9
RF3/AN8
VINVIN+
VIN-
VIN+
C1
C1OUT
C2
C2OUT
RF1/AN6/C2OUT*
Four Inputs Multiplexed to Two Comparators
CM2:CM0 = 110
VIN-
RF5/AN10/ A
CVREF
VIN+
RF6/AN11
C1
C1OUT
RF2/AN7/C1OUT*
RF4/AN9
VIN-
RF3/AN8
VIN+
C2
RF6/AN11
RF5/AN10/
CVREF
RF4/AN9
RF3/AN8
Off (Read as 0)
CIS = 0
CIS = 1
VINVIN+
CIS = 0
CIS = 1
C1
C1OUT
C2
C2OUT
VINVIN+
CVREF
DS39762B-page 334
Preliminary
PIC18F97J60 FAMILY
22.2
22.3.2
Comparator Operation
22.3
Comparator Reference
FIGURE 22-2:
SINGLE COMPARATOR
VIN+
VIN-
22.4
Comparator Outputs
VINVIN+
Output
22.3.1
22.5
Output
Preliminary
DS39762B-page 335
PIC18F97J60 FAMILY
To RF1 or
RF2 pin
Port pins
MULTIPLEX
FIGURE 22-3:
Bus
Data
CxINV
EN
Read CMCON
EN
CL
From
Other
Comparator
Reset
22.6
Comparator Interrupts
22.7
Set
CMIF
bit
Comparator Operation
During Sleep
22.8
Effects of a Reset
DS39762B-page 336
Preliminary
PIC18F97J60 FAMILY
22.9
FIGURE 22-4:
RS < 10k
RIC
Comparator
Input
AIN
CPIN
5 pF
VA
VT = 0.6V
ILEAKAGE
500 nA
VSS
Legend:
TABLE 22-1:
Name
INTCON
CPIN
VT
ILEAKAGE
RIC
RS
VA
=
=
=
=
=
=
Input Capacitance
Threshold Voltage
Leakage Current at the pin due to various junctions
Interconnect Resistance
Source Impedance
Analog Voltage
Bit 6
GIE/GIEH PEIE/GIEL
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Reset
Values
on Page:
TMR0IE
INT0IE
RBIE
TMR0IF
INT0IF
RBIF
59
PIR2
OSCFIF
CMIF
ETHIF
BCL1IF
TMR3IF
CCP2IF
61
PIE2
OSCFIE
CMIE
ETHIE
BCL1IE
TMR3IE
CCP2IE
61
IPR2
OSCFIP
CMIP
ETHIP
BCL1IP
TMR3IP
CCP2IP
61
CMCON
C2OUT
C1OUT
C2INV
C1INV
CIS
CM2
CM1
CM0
60
CVRCON
CVREN
CVROE
CVRR
CVRSS
CVR3
CVR2
CVR1
CVR0
60
PORTF
RF7
RF6
RF5
RF4
RF3
RF2
RF1
RF0
62
TRISF
TRISF7
TRISF6
TRISF5
TRISF4
TRISF3
TRISF2
TRISF1
TRISF0
61
Legend: = unimplemented, read as 0, r = reserved. Shaded cells are not used by the comparator module.
Preliminary
DS39762B-page 337
PIC18F97J60 FAMILY
NOTES:
DS39762B-page 338
Preliminary
PIC18F97J60 FAMILY
23.0
COMPARATOR VOLTAGE
REFERENCE MODULE
23.1
REGISTER 23-1:
R/W-0
R/W-0
R/W-0
R/W-0
R/W-0
R/W-0
R/W-0
R/W-0
CVREN
CVROE(1)
CVRR
CVRSS
CVR3
CVR2
CVR1
CVR0
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
-n = Value at POR
1 = Bit is set
0 = Bit is cleared
x = Bit is unknown
bit 7
bit 6
bit 5
bit 4
bit 3-0
Note 1:
Preliminary
DS39762B-page 339
PIC18F97J60 FAMILY
FIGURE 23-1:
CVRSS = 1
8R
CVRSS = 0
CVR3:CVR0
R
CVREN
R
R
16-to-1 MUX
R
16 Steps
CVREF
R
R
CVRR
VREF-
8R
CVRSS = 1
CVRSS = 0
23.2
23.4
23.3
DS39762B-page 340
Effects of a Reset
23.5
Connection Considerations
Preliminary
PIC18F97J60 FAMILY
FIGURE 23-2:
Note 1:
TABLE 23-1:
Name
R(1)
Voltage
Reference
Output
Impedance
RF5
CVREF Output
R is dependent upon the comparator voltage reference configuration bits, CVRCON<5> and CVRCON<3:0>.
Bit 6
CVRCON
CVREN
CMCON
C2OUT
TRISF
TRISF7
Reset
Values
on Page:
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
CVROE
CVRR
CVRSS
CVR3
CVR2
CVR1
CVR0
60
C1OUT
C2INV
C1INV
CIS
CM2
CM1
CM0
60
TRISF6
TRISF5
TRISF4
TRISF3
TRISF2
TRISF1
TRISF0
61
Legend: = unimplemented, read as 0. Shaded cells are not used with the comparator voltage reference module.
Preliminary
DS39762B-page 341
PIC18F97J60 FAMILY
NOTES:
DS39762B-page 342
Preliminary
PIC18F97J60 FAMILY
24.0
CONSIDERATIONS FOR
CONFIGURING THE PIC18F97J60
FAMILY DEVICES
Devices of the PIC18F97J60 family do not use persistent memory registers to store configuration information.
The configuration bytes are implemented as volatile
memory which means that configuration data must be
programmed each time the device is powered up.
Configuration data is stored in the four words at the top
of the on-chip program memory space, known as the
Flash Configuration Words, which are located in the
program memory space as shown in Table 5-1. The
Configuration Words are stored in the same order
shown in Table 24-1, with CONFIG1L at the lowest
address and CONFIG3H at the highest. The data is
automatically loaded in the proper Configuration
registers during device power-up.
24.1
24.1.1
Configuration Bits
Preliminary
DS39762B-page 343
PIC18F97J60 FAMILY
TABLE 24-1:
File Name
300000h
CONFIG1L
Default/
Unprogrammed
Value(1)
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
DEBUG
XINST
STVREN
WDTEN
110- ---1
(2)
(2)
(2)
(2)
(3)
300001h
CONFIG1H
CP0
---- 01--
300002h
CONFIG2L
IESO
FCMEN
FOSC2
FOSC1
FOSC0
11-- -111
300003h
CONFIG2H
(2)
(2)
(2)
(2)
WDTPS3
WDTPS2
WDTPS1
WDTPS0
---- 1111
300004h
CONFIG3L
WAIT(4)
BW(4)
EMB1(4)
1111 1---
300005h
CONFIG3H
(2)
(2)
(2)
(2)
3FFFFEh DEVID1
DEV2
DEV1
DEV0
REV4
REV3
REV2
REV1
REV0
xxxx xxxx(6)
3FFFFFh DEVID2
DEV10
DEV9
DEV8
DEV7
DEV6
DEV5
DEV4
DEV3
xxxx xxxx(6)
Legend:
Note 1:
2:
3:
4:
5:
6:
EMB0(4) EASHFT(4)
DS39762B-page 344
Preliminary
PIC18F97J60 FAMILY
REGISTER 24-1:
R/WO-1
R/WO-1
R/WO-0
U-0
U-0
U-0
U-0
R/WO-1
DEBUG
XINST
STVREN
WDTEN
bit 7
bit 0
Legend:
R = Readable bit
WO = Write-Once bit
0 = Bit is cleared
bit 7
bit 6
bit 5
bit 4-1
Unimplemented: Read as 0
bit 0
REGISTER 24-2:
U-0
U-0
U-0
U-0
U-0(1)
R/WO-1
U-0
U-0
(2)
(2)
(2)
(2)
CP0
bit 7
bit 0
Legend:
R = Readable bit
WO = Write-Once bit
1 = Bit is set
bit 7-3
Unimplemented: Read as 0
bit 2
bit 1-0
Unimplemented: Read as 0
Note 1:
2:
Preliminary
DS39762B-page 345
PIC18F97J60 FAMILY
REGISTER 24-3:
R/WO-1
R/WO-1
U-0
U-0
U-0
R/WO-1
R/WO-1
R/WO-1
IESO
FCMEN
FOSC2
FOSC1
FOSC0
bit 7
bit 0
Legend:
R = Readable bit
WO = Write-Once bit
0 = Bit is cleared
bit 7
bit 6
bit 5-3
Unimplemented: Read as 0
bit 2
bit 1-0
DS39762B-page 346
Preliminary
PIC18F97J60 FAMILY
REGISTER 24-4:
U-0
U-0
U-0
U-0
R/WO-1
R/WO-1
R/WO-1
R/WO-1
(1)
(1)
(1)
(1)
WDTPS3
WDTPS2
WDTPS1
WDTPS0
bit 7
bit 0
Legend:
R = Readable bit
WO = Write-Once bit
bit 7-4
Unimplemented: Read as 0
bit 3-0
Note 1:
0 = Bit is cleared
The value of these bits in program memory should always be 1. This ensures that the location is
executed as a NOP if it is accidentally executed.
Preliminary
DS39762B-page 347
PIC18F97J60 FAMILY
REGISTER 24-5:
R/WO-1
R/WO-1
(1)
BW
WAIT
(1)
R/WO-1
R/WO-1
(1)
(1)
EMB1
EMB0
R/WO-1
EASHFT
(1)
U-0
U-0
U-0
bit 7
bit 0
Legend:
R = Readable bit
WO = Write-Once bit
0 = Bit is cleared
bit 7
bit 6
bit 5-4
bit 3
bit 2-0
Unimplemented: Read as 0
Note 1:
DS39762B-page 348
Preliminary
PIC18F97J60 FAMILY
REGISTER 24-6:
U-0
U-0
U-0
U-0
(1)
(1)
(1)
(1)
U-0
R/WO-1
ETHLED
R/WO-1
ECCPMX
(2)
R/WO-1
CCP2MX(2)
bit 7
bit 0
Legend:
R = Readable bit
WO = Write-Once bit
0 = Bit is cleared
bit 7-3
Unimplemented: Read as 0
bit 2
bit 1
bit 0
Note 1:
2:
The value of these bits in program memory should always be 1. This ensures that the location is
executed as a NOP if it is accidentally executed.
Implemented on 80-pin and 100-pin devices only.
Preliminary
DS39762B-page 349
PIC18F97J60 FAMILY
REGISTER 24-7:
DEV2
DEV1
DEV0
REV4
REV3
REV2
REV1
REV0
bit 7
bit 0
Legend:
R = Read-only bit
P = Programmable bit
bit 7-5
bit 4-0
REGISTER 24-8:
DEV10
DEV9
DEV8
DEV7
DEV6
DEV5
DEV4
DEV3
bit 7
bit 0
Legend:
R = Read-only bit
P = Programmable bit
DS39762B-page 350
DEV10:DEV3
(DEVID2<7:0>)
DEV2:DEV0
(DEVID1<7:5>)
Device
0001 1000
000
PIC18F66J60
0001 1111
000
PIC18F66J65
0001 1111
001
PIC18F67J60
0001 1000
001
PIC18F86J60
0001 1111
010
PIC18F86J65
0001 1111
011
PIC18F87J60
0001 1000
010
PIC18F96J60
0001 1111
100
PIC18F96J65
0001 1111
101
PIC18F97J60
Preliminary
PIC18F97J60 FAMILY
24.2
FIGURE 24-1:
24.2.1
CONTROL REGISTER
SWDTEN
INTRC Control
WDT Counter
Wake-up from
Power-Managed
Modes
128
INTRC Oscillator
CLRWDT
All Device Resets
Programmable Postscaler
1:1 to 1:32,768
WDT
Reset
Reset
WDT
4
WDTPS3:WDTPS0
Sleep
REGISTER 24-9:
U-0
U-0
U-0
U-0
U-0
U-0
U-0
R/W-0
SWDTEN(1)
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
-n = Value at POR
1 = Bit is set
0 = Bit is cleared
bit 7-1
Unimplemented: Read as 0
bit 0
Note 1:
TABLE 24-2:
Name
RCON
WDTCON
x = Bit is unknown
Reset Values
on Page:
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
IPEN
CM
RI
TO
PD
POR
BOR
60
SWDTEN
60
Legend: = unimplemented, read as 0. Shaded cells are not used by the Watchdog Timer.
Preliminary
DS39762B-page 351
PIC18F97J60 FAMILY
24.3
FIGURE 24-2:
24.3.1
(VDD = VDDCORE)
2.5V(1)
PIC18FXXJ6X
VDD
24.3.2
POWER-UP REQUIREMENTS
ENVREG
VDDCORE/VCAP
VSS
Note 1:
DS39762B-page 352
VSS
Preliminary
PIC18F97J60 FAMILY
24.4
Two-Speed Start-up
24.4.1
FIGURE 24-3:
Q2
Q3
Q4
Q2 Q3 Q4 Q1 Q2 Q3
Q1
INTRC
OSC1
TOST(1)
TPLL(1)
1
PLL Clock
Output
n-1 n
Clock
Transition
CPU Clock
Peripheral
Clock
Program
Counter
PC
PC + 2
PC + 4
PC + 6
TOST = 1024 TOSC; TPLL = 2 ms (approx). These intervals are not shown to scale.
Preliminary
DS39762B-page 353
PIC18F97J60 FAMILY
24.5
FIGURE 24-4:
Peripheral
Clock
INTRC
Source
(32 s)
64
488 Hz
(2.048 ms)
24.5.1
24.5.2
Clock
Failure
Detected
DS39762B-page 354
Preliminary
PIC18F97J60 FAMILY
FIGURE 24-5:
Sample Clock
Oscillator
Failure
Device
Clock
Output
CM Output
(Q)
Failure
Detected
OSCFIF
CM Test
CM Test
Note:
24.5.3
The device clock is normally at a much higher frequency than the sample clock. The relative frequencies in
this example have been chosen for clarity.
FSCM INTERRUPTS IN
POWER-MANAGED MODES
24.5.4
CM Test
The same logic that prevents false oscillator failure interrupts on POR, or wake from
Sleep, will also prevent the detection of
the oscillators failure to start at all following these events. This can be avoided by
monitoring the OSTS bit and using a
timing routine to determine if the oscillator
is taking too long to start. Even so, no
oscillator failure interrupt will be flagged.
Preliminary
DS39762B-page 355
PIC18F97J60 FAMILY
24.6
24.7
24.6.1
CONFIGURATION REGISTER
PROTECTION
DS39762B-page 356
24.8
In-Circuit Debugger
TABLE 24-3:
DEBUGGER RESOURCES
I/O pins:
RB6, RB7
Stack:
2 levels
Program Memory:
512 bytes
Data Memory:
10 bytes
Preliminary
PIC18F97J60 FAMILY
25.0
25.1
Byte-oriented operations
Bit-oriented operations
Literal operations
Control operations
The file register designator f specifies which file register is to be used by the instruction. The destination
designator d specifies where the result of the
operation is to be placed. If d is zero, the result is
placed in the WREG register. If d is one, the result is
placed in the file register specified in the instruction.
All bit-oriented instructions have three operands:
1.
2.
3.
Preliminary
DS39762B-page 357
PIC18F97J60 FAMILY
TABLE 25-1:
Field
Description
bbb
BSR
C, DC, Z, OV, N
dest
Destination: either the WREG register or the specified register file location.
8-bit Register file address (00h to FFh), or 2-bit FSR designator (0h to 3h).
fs
12-bit Register file address (000h to FFFh). This is the source address.
fd
12-bit Register file address (000h to FFFh). This is the destination address.
GIE
Literal field, constant data or label (may be either an 8-bit, 12-bit or a 20-bit value).
label
Label name.
mm
The mode of the TBLPTR register for the table read and table write instructions.
Only used with table read and table write instructions:
*+
*-
+*
n
The relative address (2s complement number) for relative branch instructions or the direct address for
Call/Branch and Return instructions.
PC
Program Counter.
PCL
PCH
PCLATH
PCLATU
PD
Power-Down bit.
PRODH
PRODL
TBLPTR
TABLAT
TO
Time-out bit.
TOS
Top-of-Stack.
Unused or Unchanged.
WDT
Watchdog Timer.
WREG
Dont care (0 or 1). The assembler will generate code with x = 0. It is the recommended form of use for
compatibility with all Microchip software tools.
zs
zd
{
Optional argument.
[text]
(text)
[expr]<n>
Assigned to.
< >
italics
DS39762B-page 358
Preliminary
PIC18F97J60 FAMILY
FIGURE 25-1:
10
OPCODE
Example Instruction
8 7
ADDWF MYREG, W, B
f (FILE #)
12 11
OPCODE
15
f (Source FILE #)
12 11
f (Destination FILE #)
1111
12 11
9 8 7
OPCODE b (BIT #) a
f (FILE #)
OPCODE
MOVLW 7Fh
k (literal)
8 7
OPCODE
15
GOTO Label
n<7:0> (literal)
12 11
0
n<19:8> (literal)
1111
8 7
S
OPCODE
15
0
CALL MYFUNC
n<7:0> (literal)
12 11
0
n<19:8> (literal)
1111
S = Fast bit
15
11 10
OPCODE
15
8 7
OPCODE
BRA MYFUNC
n<10:0> (literal)
0
n<7:0> (literal)
Preliminary
BC MYFUNC
DS39762B-page 359
PIC18F97J60 FAMILY
TABLE 25-2:
Mnemonic,
Operands
Cycles
MSb
LSb
Status
Affected
Notes
BYTE-ORIENTED OPERATIONS
ADDWF
ADDWFC
ANDWF
CLRF
COMF
CPFSEQ
CPFSGT
CPFSLT
DECF
DECFSZ
DCFSNZ
INCF
INCFSZ
INFSNZ
IORWF
MOVF
MOVFF
f, d, a
f, d, a
f, d, a
f, a
f, d, a
f, a
f, a
f, a
f, d, a
f, d, a
f, d, a
f, d, a
f, d, a
f, d, a
f, d, a
f, d, a
fs, fd
MOVWF
MULWF
NEGF
RLCF
RLNCF
RRCF
RRNCF
SETF
SUBFWB
f, a
f, a
f, a
f, d, a
f, d, a
f, d, a
f, d, a
f, a
f, d, a
f, d, a
SUBWF
SUBWFB f, d, a
1
1
1
1
1
1 (2 or 3)
1 (2 or 3)
1 (2 or 3)
1
1 (2 or 3)
1 (2 or 3)
1
1 (2 or 3)
1 (2 or 3)
1
1
2
C, DC, Z, OV, N
C, DC, Z, OV, N
Z, N
Z
Z, N
None
None
None
C, DC, Z, OV, N
None
None
C, DC, Z, OV, N
None
None
Z, N
Z, N
None
1, 2
1, 2
1,2
2
1, 2
4
4
1, 2
1, 2, 3, 4
1, 2, 3, 4
1, 2
1, 2, 3, 4
4
1, 2
1, 2
1
1
1
1
1
1
1
1
1
1
0010
0010
0001
0110
0001
0110
0110
0110
0000
0010
0100
0010
0011
0100
0001
0101
1100
1111
0110
0000
0110
0011
0100
0011
0100
0110
0101
01da
00da
01da
101a
11da
001a
010a
000a
01da
11da
11da
10da
11da
10da
00da
00da
ffff
ffff
111a
001a
110a
01da
01da
00da
00da
100a
01da
ffff
ffff
ffff
ffff
ffff
ffff
ffff
ffff
ffff
ffff
ffff
ffff
ffff
ffff
ffff
ffff
ffff
ffff
ffff
ffff
ffff
ffff
ffff
ffff
ffff
ffff
ffff
ffff
ffff
ffff
ffff
ffff
ffff
ffff
ffff
ffff
ffff
ffff
ffff
ffff
ffff
ffff
ffff
ffff
ffff
ffff
ffff
ffff
ffff
ffff
ffff
ffff
ffff
ffff
1
1
0101 11da
0101 10da
ffff
ffff
1
1 (2 or 3)
1
0011 10da
0110 011a
0001 10da
ffff
ffff
ffff
ffff None
ffff None
ffff Z, N
None
None
1, 2
C, DC, Z, OV, N
C, Z, N
1, 2
Z, N
C, Z, N
Z, N
None
1, 2
C, DC, Z, OV, N
4
1, 2
SWAPF
TSTFSZ
XORWF
f, d, a
f, a
f, d, a
Note 1:
When a PORT register is modified as a function of itself (e.g., MOVF PORTB, 1, 0), 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.
If Program Counter (PC) is modified or a conditional test is true, the instruction requires two cycles. The second
cycle is executed as a NOP.
Some instructions are two-word instructions. The second word of these instructions will be executed as a NOP
unless the first word of the instruction retrieves the information embedded in these 16 bits. This ensures that all
program memory locations have a valid instruction.
2:
3:
4:
DS39762B-page 360
Preliminary
PIC18F97J60 FAMILY
TABLE 25-2:
Mnemonic,
Operands
Description
Cycles
MSb
LSb
Status
Affected
Notes
BIT-ORIENTED OPERATIONS
BCF
BSF
BTFSC
BTFSS
BTG
f, b, a
f, b, a
f, b, a
f, b, a
f, b, a
Bit Clear f
Bit Set f
Bit Test f, Skip if Clear
Bit Test f, Skip if Set
Bit Toggle f
1
1
1 (2 or 3)
1 (2 or 3)
1
1001
1000
1011
1010
0111
bbba
bbba
bbba
bbba
bbba
ffff
ffff
ffff
ffff
ffff
ffff
ffff
ffff
ffff
ffff
None
None
None
None
None
1 (2)
1 (2)
1 (2)
1 (2)
1 (2)
1 (2)
1 (2)
2
1 (2)
2
0010
0110
0011
0111
0101
0001
0100
0nnn
0000
110s
kkkk
0000
0000
1111
kkkk
0000
xxxx
0000
0000
1nnn
0000
0000
nnnn
nnnn
nnnn
nnnn
nnnn
nnnn
nnnn
nnnn
nnnn
kkkk
kkkk
0000
0000
kkkk
kkkk
0000
xxxx
0000
0000
nnnn
1111
0001
nnnn
nnnn
nnnn
nnnn
nnnn
nnnn
nnnn
nnnn
nnnn
kkkk
kkkk
0100
0111
kkkk
kkkk
0000
xxxx
0110
0101
nnnn
1111
000s
None
None
None
None
None
None
None
None
None
None
1
1
1
1
2
1
2
1110
1110
1110
1110
1110
1110
1110
1101
1110
1110
1111
0000
0000
1110
1111
0000
1111
0000
0000
1101
0000
0000
2
2
1
0000 1100
0000 0000
0000 0000
kkkk
0001
0000
1, 2
1, 2
3, 4
3, 4
1, 2
CONTROL OPERATIONS
BC
BN
BNC
BNN
BNOV
BNZ
BOV
BRA
BZ
CALL
n
n
n
n
n
n
n
n
n
n, s
NOP
NOP
POP
PUSH
RCALL
RESET
RETFIE
n
s
Branch if Carry
Branch if Negative
Branch if Not Carry
Branch if Not Negative
Branch if Not Overflow
Branch if Not Zero
Branch if Overflow
Branch Unconditionally
Branch if Zero
Call subroutine 1st word
2nd word
Clear Watchdog Timer
Decimal Adjust WREG
Go to address 1st word
2nd word
No Operation
No Operation
Pop top of return stack (TOS)
Push top of return stack (TOS)
Relative Call
Software device Reset
Return from interrupt enable
RETLW
RETURN
SLEEP
k
s
Note 1:
When a PORT register is modified as a function of itself (e.g., MOVF PORTB, 1, 0), 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.
If Program Counter (PC) is modified or a conditional test is true, the instruction requires two cycles. The second
cycle is executed as a NOP.
Some instructions are two-word instructions. The second word of these instructions will be executed as a NOP
unless the first word of the instruction retrieves the information embedded in these 16 bits. This ensures that all
program memory locations have a valid instruction.
CLRWDT
DAW
GOTO
n
2:
3:
4:
1
1
2
Preliminary
TO, PD
C
None
None
None
None
None
None
All
GIE/GIEH,
PEIE/GIEL
kkkk None
001s None
0011 TO, PD
DS39762B-page 361
PIC18F97J60 FAMILY
TABLE 25-2:
Mnemonic,
Operands
Description
Cycles
MSb
LSb
Status
Affected
Notes
LITERAL OPERATIONS
ADDLW
ANDLW
IORLW
LFSR
k
k
k
f, k
MOVLB
MOVLW
MULLW
RETLW
SUBLW
XORLW
k
k
k
k
k
k
1
1
1
2
1
1
1
2
1
1
0000
0000
0000
1110
1111
0000
0000
0000
0000
0000
0000
1111
1011
1001
1110
0000
0001
1110
1101
1100
1000
1010
kkkk
kkkk
kkkk
00ff
kkkk
0000
kkkk
kkkk
kkkk
kkkk
kkkk
kkkk
kkkk
kkkk
kkkk
kkkk
kkkk
kkkk
kkkk
kkkk
kkkk
kkkk
C, DC, Z, OV, N
Z, N
Z, N
None
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
1000
1001
1010
1011
1100
1101
1110
1111
None
None
None
None
None
None
None
None
None
None
None
None
C, DC, Z, OV, N
Z, N
2:
3:
4:
Table Read
Table Read with post-increment
Table Read with post-decrement
Table Read with pre-increment
Table Write
Table Write with post-increment
Table Write with post-decrement
Table Write with pre-increment
When a PORT register is modified as a function of itself (e.g., MOVF PORTB, 1, 0), 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.
If Program Counter (PC) is modified or a conditional test is true, the instruction requires two cycles. The second
cycle is executed as a NOP.
Some instructions are two-word instructions. The second word of these instructions will be executed as a NOP
unless the first word of the instruction retrieves the information embedded in these 16 bits. This ensures that all
program memory locations have a valid instruction.
DS39762B-page 362
Preliminary
PIC18F97J60 FAMILY
25.1.1
ADDLW
ADD Literal to W
ADDWF
ADD W to f
Syntax:
ADDLW
Syntax:
ADDWF
Operands:
0 f 255
d [0,1]
a [0,1]
Operation:
Status Affected:
N, OV, C, DC, Z
Operands:
0 k 255
Operation:
(W) + k W
Status Affected:
N, OV, C, DC, Z
Encoding:
0000
1111
kkkk
kkkk
Description:
Words:
Cycles:
Encoding:
0010
Description:
Q Cycle Activity:
Q1
Q2
Q3
Q4
Decode
Read
literal k
Process
Data
Write to
W
Example:
ADDLW
01da
ffff
ffff
15h
Before Instruction
W
= 10h
After Instruction
W =
25h
f {,d {,a}}
Words:
Cycles:
Q Cycle Activity:
Q1
Q2
Q3
Q4
Decode
Read
register f
Process
Data
Write to
destination
Example:
ADDWF
Before Instruction
W
=
REG
=
After Instruction
W
=
REG
=
Note:
REG, 0, 0
17h
0C2h
0D9h
0C2h
All PIC18 instructions may take an optional label argument preceding the instruction mnemonic for use in
symbolic addressing. If a label is used, the instruction format then becomes: {label} instruction argument(s).
Preliminary
DS39762B-page 363
PIC18F97J60 FAMILY
ADDWFC
ANDLW
Syntax:
ADDWFC
Syntax:
ANDLW
Operands:
0 f 255
d [0,1]
a [0,1]
f {,d {,a}}
Operation:
Status Affected:
Encoding:
0010
Description:
00da
Operands:
0 k 255
Operation:
(W) .AND. k W
Status Affected:
N, Z
Encoding:
N,OV, C, DC, Z
ffff
ffff
Words:
Cycles:
0000
1011
kkkk
kkkk
Description:
Words:
Cycles:
Q Cycle Activity:
Q1
Q2
Q3
Q4
Decode
Read literal
k
Process
Data
Write to
W
Example:
ANDLW
Before Instruction
W
=
After Instruction
W
=
05Fh
A3h
03h
Q Cycle Activity:
Q1
Q2
Q3
Q4
Decode
Read
register f
Process
Data
Write to
destination
Example:
ADDWFC
Before Instruction
Carry bit =
REG
=
W
=
After Instruction
Carry bit =
REG
=
W
=
DS39762B-page 364
REG, 0, 1
1
02h
4Dh
0
02h
50h
Preliminary
PIC18F97J60 FAMILY
ANDWF
AND W with f
BC
Branch if Carry
Syntax:
ANDWF
Syntax:
BC
Operands:
0 f 255
d [0,1]
a [0,1]
f {,d {,a}}
Operation:
Status Affected:
N, Z
Encoding:
0001
Description:
Operands:
-128 n 127
Operation:
if Carry bit is 1,
(PC) + 2 + 2n PC
Status Affected:
None
Encoding:
01da
ffff
ffff
1110
Description:
Words:
Cycles:
Q Cycle Activity:
nnnn
nnnn
Words:
Cycles:
1(2)
Q Cycle Activity:
If Jump:
Q1
Q2
Q3
Q4
Decode
Read literal
n
Process
Data
Write to
PC
No
operation
No
operation
No
operation
No
operation
If No Jump:
Q1
Q2
Q3
Q4
Decode
Read
register f
Process
Data
Write to
destination
Example:
0010
ANDWF
Before Instruction
W
=
REG
=
After Instruction
W
=
REG
=
REG, 0, 0
Q2
Q3
Q4
Read literal
n
Process
Data
No
operation
Example:
HERE
Before Instruction
PC
After Instruction
If Carry
PC
If Carry
PC
17h
C2h
02h
C2h
Q1
Decode
Preliminary
BC
address (HERE)
=
=
=
=
1;
address (HERE + 12)
0;
address (HERE + 2)
DS39762B-page 365
PIC18F97J60 FAMILY
BCF
Bit Clear f
BN
Branch if Negative
Syntax:
BCF
Syntax:
BN
Operands:
0 f 255
0b7
a [0,1]
f, b {,a}
Operation:
0 f<b>
Status Affected:
None
Encoding:
1001
Description:
Operands:
-128 n 127
Operation:
if Negative bit is 1,
(PC) + 2 + 2n PC
Status Affected:
None
Encoding:
bbba
ffff
ffff
1110
Description:
Words:
Cycles:
1
Q1
Q2
Q3
Q4
Read
register f
Process
Data
Write
register f
Example:
BCF
Before Instruction
FLAG_REG = C7h
After Instruction
FLAG_REG = 47h
DS39762B-page 366
FLAG_REG,
0110
nnnn
nnnn
Words:
Cycles:
1(2)
Q Cycle Activity:
If Jump:
Q1
Q2
Q3
Q4
Decode
Read literal
n
Process
Data
Write to
PC
No
operation
No
operation
No
operation
No
operation
Q Cycle Activity:
Decode
If No Jump:
7, 0
Q1
Q2
Q3
Q4
Decode
Read literal
n
Process
Data
No
operation
Example:
HERE
Before Instruction
PC
After Instruction
If Negative
PC
If Negative
PC
Preliminary
BN
Jump
address (HERE)
=
=
=
=
1;
address (Jump)
0;
address (HERE + 2)
PIC18F97J60 FAMILY
BNC
BNN
Syntax:
BNC
Syntax:
BNN
Operands:
-128 n 127
Operands:
-128 n 127
Operation:
if Carry bit is 0,
(PC) + 2 + 2n PC
Operation:
if Negative bit is 0,
(PC) + 2 + 2n PC
Status Affected:
None
Status Affected:
None
Encoding:
1110
Description:
0011
nnnn
nnnn
Encoding:
1110
Description:
nnnn
nnnn
Words:
Words:
Cycles:
1(2)
Cycles:
1(2)
Q Cycle Activity:
If Jump:
0111
Q Cycle Activity:
If Jump:
Q1
Q2
Q3
Q4
Q1
Q2
Q3
Q4
Decode
Read literal
n
Process
Data
Write to
PC
Decode
Read literal
n
Process
Data
Write to
PC
No
operation
No
operation
No
operation
No
operation
No
operation
No
operation
No
operation
No
operation
Q1
Q2
Q3
Q4
Q1
Q2
Q3
Q4
Decode
Read literal
n
Process
Data
No
operation
Decode
Read literal
n
Process
Data
No
operation
If No Jump:
Example:
If No Jump:
HERE
Before Instruction
PC
After Instruction
If Carry
PC
If Carry
PC
BNC
Jump
address (HERE)
=
=
=
=
0;
address (Jump)
1;
address (HERE + 2)
Example:
HERE
Before Instruction
PC
After Instruction
If Negative
PC
If Negative
PC
Preliminary
BNN
Jump
address (HERE)
=
=
=
=
0;
address (Jump)
1;
address (HERE + 2)
DS39762B-page 367
PIC18F97J60 FAMILY
BNOV
BNZ
Syntax:
BNOV
Syntax:
BNZ
Operands:
-128 n 127
Operands:
-128 n 127
Operation:
if Overflow bit is 0,
(PC) + 2 + 2n PC
Operation:
if Zero bit is 0,
(PC) + 2 + 2n PC
Status Affected:
None
Status Affected:
None
Encoding:
1110
Description:
0101
nnnn
nnnn
Encoding:
1110
Description:
nnnn
nnnn
Words:
Words:
Cycles:
1(2)
Cycles:
1(2)
Q Cycle Activity:
If Jump:
0001
Q Cycle Activity:
If Jump:
Q1
Q2
Q3
Q4
Q1
Q2
Q3
Q4
Decode
Read literal
n
Process
Data
Write to
PC
Decode
Read literal
n
Process
Data
Write to
PC
No
operation
No
operation
No
operation
No
operation
No
operation
No
operation
No
operation
No
operation
Q1
Q2
Q3
Q4
Q1
Q2
Q3
Q4
Decode
Read literal
n
Process
Data
No
operation
Decode
Read literal
n
Process
Data
No
operation
If No Jump:
If No Jump:
Example:
HERE
Before Instruction
PC
After Instruction
If Overflow
PC
If Overflow
PC
DS39762B-page 368
BNOV Jump
address (HERE)
=
=
=
=
0;
address (Jump)
1;
address (HERE + 2)
Example:
HERE
Before Instruction
PC
After Instruction
If Zero
PC
If Zero
PC
Preliminary
BNZ
Jump
address (HERE)
=
=
=
=
0;
address (Jump)
1;
address (HERE + 2)
PIC18F97J60 FAMILY
BRA
Unconditional Branch
BSF
Bit Set f
Syntax:
BRA
Syntax:
BSF
Operands:
0 f 255
0b7
a [0,1]
Operation:
1 f<b>
Status Affected:
None
Operands:
-1024 n 1023
Operation:
(PC) + 2 + 2n PC
Status Affected:
None
Encoding:
1101
Description:
0nnn
nnnn
nnnn
Words:
Cycles:
Encoding:
1000
Description:
Q1
Q2
Q3
Q4
Read literal
n
Process
Data
Write to
PC
No
operation
No
operation
No
operation
No
operation
bbba
ffff
ffff
Q Cycle Activity:
Decode
f, b {,a}
Words:
Cycles:
Q Cycle Activity:
Example:
HERE
Before Instruction
PC
After Instruction
PC
BRA
Jump
address (HERE)
address (Jump)
Q1
Q2
Q3
Q4
Decode
Read
register f
Process
Data
Write
register f
Example:
BSF
Before Instruction
FLAG_REG
After Instruction
FLAG_REG
Preliminary
FLAG_REG, 7, 1
0Ah
8Ah
DS39762B-page 369
PIC18F97J60 FAMILY
BTFSC
BTFSS
Syntax:
BTFSC f, b {,a}
Syntax:
BTFSS f, b {,a}
Operands:
0 f 255
0b7
a [0,1]
Operands:
0 f 255
0b<7
a [0,1]
Operation:
skip if (f<b>) = 0
Operation:
skip if (f<b>) = 1
Status Affected:
None
Status Affected:
None
Encoding:
1011
Description:
bbba
ffff
ffff
Encoding:
1010
Description:
bbba
ffff
ffff
Words:
Words:
Cycles:
1(2)
Note:
Cycles:
1(2)
Note:
Q Cycle Activity:
Q Cycle Activity:
Q1
Q2
Q3
Q4
Q1
Q2
Q3
Q4
Decode
Read
register f
Process
Data
No
operation
Decode
Read
register f
Process
Data
No
operation
Q1
Q2
Q3
Q4
Q1
Q2
Q3
Q4
No
operation
No
operation
No
operation
No
operation
No
operation
No
operation
No
operation
No
operation
If skip:
If skip:
Q1
Q2
Q3
Q4
Q1
Q2
Q3
Q4
No
operation
No
operation
No
operation
No
operation
No
operation
No
operation
No
operation
No
operation
No
operation
No
operation
No
operation
No
operation
No
operation
No
operation
No
operation
No
operation
Example:
HERE
FALSE
TRUE
Before Instruction
PC
After Instruction
If FLAG<1>
PC
If FLAG<1>
PC
DS39762B-page 370
BTFSC
:
:
FLAG, 1, 0
address (HERE)
=
=
=
=
0;
address (TRUE)
1;
address (FALSE)
Example:
HERE
FALSE
TRUE
Before Instruction
PC
After Instruction
If FLAG<1>
PC
If FLAG<1>
PC
Preliminary
BTFSS
:
:
FLAG, 1, 0
address (HERE)
=
=
=
=
0;
address (FALSE)
1;
address (TRUE)
PIC18F97J60 FAMILY
BTG
Bit Toggle f
BOV
Branch if Overflow
Syntax:
BTG f, b {,a}
Syntax:
BOV
Operands:
0 f 255
0b<7
a [0,1]
Operands:
-128 n 127
Operation:
if Overflow bit is 1,
(PC) + 2 + 2n PC
Status Affected:
None
Operation:
(f<b>) f<b>
Status Affected:
None
Encoding:
0111
Description:
Encoding:
bbba
ffff
ffff
1110
Description:
Words:
Words:
Cycles:
1(2)
Q Cycle Activity:
Q1
Q2
Q3
Q4
Decode
Read
register f
Process
Data
Write
register f
Example:
BTG
PORTC,
nnnn
Q1
Q2
Q3
Q4
Decode
Read literal
n
Process
Data
Write to PC
No
operation
No
operation
No
operation
No
operation
If No Jump:
Q1
Q2
Q3
Q4
Decode
Read literal
n
Process
Data
No
operation
4, 0
Before Instruction:
PORTC =
0111 0101 [75h]
After Instruction:
PORTC =
0110 0101 [65h]
nnnn
Q Cycle Activity:
If Jump:
Cycles:
0100
Example:
HERE
Before Instruction
PC
After Instruction
If Overflow
PC
If Overflow
PC
Preliminary
BOV
Jump
address (HERE)
=
=
=
=
1;
address (Jump)
0;
address (HERE + 2)
DS39762B-page 371
PIC18F97J60 FAMILY
BZ
Branch if Zero
CALL
Subroutine Call
Syntax:
BZ
Syntax:
CALL k {,s}
Operands:
-128 n 127
Operands:
Operation:
if Zero bit is 1,
(PC) + 2 + 2n PC
0 k 1048575
s [0,1]
Operation:
Status Affected:
None
(PC) + 4 TOS,
k PC<20:1>;
if s = 1,
(W) WS,
(STATUS) STATUSS,
(BSR) BSRS
Status Affected:
None
Encoding:
1110
Description:
0000
nnnn
nnnn
Words:
Cycles:
1(2)
Encoding:
1st word (k<7:0>)
2nd word(k<19:8>)
Q1
Q2
Q3
Q4
Read literal
n
Process
Data
Write to
PC
No
operation
No
operation
No
operation
No
operation
Q1
Q2
Q3
Q4
Decode
Read literal
n
Process
Data
No
operation
If No Jump:
Example:
HERE
Before Instruction
PC
After Instruction
If Zero
PC
If Zero
PC
DS39762B-page 372
BZ
address (HERE)
=
=
=
=
1;
address (Jump)
0;
address (HERE + 2)
k7kkk
kkkk
kkkk0
kkkk8
Words:
Cycles:
Q Cycle Activity:
Jump
110s
k19kkk
Description:
Q Cycle Activity:
If Jump:
Decode
1110
1111
Q1
Q2
Q3
Q4
Decode
Read literal
k<7:0>,
Push PC to
stack
Read literal
k<19:8>,
Write to PC
No
operation
No
operation
No
operation
No
operation
Example:
HERE
Before Instruction
PC
=
After Instruction
PC
=
TOS
=
WS
=
BSRS
=
STATUSS =
Preliminary
CALL
THERE,1
address (HERE)
address (THERE)
address (HERE + 4)
W
BSR
STATUS
PIC18F97J60 FAMILY
CLRF
Clear f
Syntax:
CLRF
Operands:
0 f 255
a [0,1]
f {,a}
Operation:
000h f,
1Z
Status Affected:
Encoding:
0110
Description:
101a
ffff
ffff
CLRWDT
Syntax:
CLRWDT
Operands:
None
Operation:
000h WDT,
000h WDT postscaler,
1 TO,
1 PD
Status Affected:
TO, PD
Encoding:
0000
Words:
Cycles:
Cycles:
Q Cycle Activity:
Q Cycle Activity:
Q2
Q3
Q4
Decode
Read
register f
Process
Data
Write
register f
Example:
CLRF
Before Instruction
FLAG_REG
After Instruction
FLAG_REG
FLAG_REG,1
5Ah
00h
0100
Words:
Q1
Q2
Q3
Q4
Decode
No
operation
Process
Data
No
operation
Example:
Q1
0000
0000
Description:
Preliminary
CLRWDT
Before Instruction
WDT Counter
After Instruction
WDT Counter
WDT Postscaler
TO
PD
=
=
=
=
00h
0
1
1
DS39762B-page 373
PIC18F97J60 FAMILY
COMF
Complement f
CPFSEQ
Syntax:
COMF
Syntax:
CPFSEQ
Operands:
0 f 255
a [0,1]
Operation:
(f) (W),
skip if (f) = (W)
(unsigned comparison)
Status Affected:
None
f {,d {,a}}
Operands:
0 f 255
d [0,1]
a [0,1]
Operation:
(f) dest
Status Affected:
N, Z
Encoding:
0001
Description:
11da
ffff
ffff
Encoding:
Description:
Cycles:
Decode
Q2
Read
register f
Example:
COMF
Before Instruction
REG
=
After Instruction
REG
=
W
=
13h
13h
ECh
Q3
Process
Data
REG, 0, 0
ffff
Q4
Words:
Write to
destination
Cycles:
1(2)
Note: 3 cycles if skip and followed
by a 2-word instruction.
Q Cycle Activity:
Q1
Decode
Q2
Read
register f
Q3
Process
Data
Q4
No
operation
If skip:
Q1
Q2
Q3
No
No
No
operation
operation
operation
If skip and followed by 2-word instruction:
Q1
Q2
Q3
No
No
No
operation
operation
operation
No
No
No
operation
operation
operation
Example:
HERE
NEQUAL
EQUAL
Before Instruction
PC Address
W
REG
After Instruction
If REG
PC
If REG
PC
DS39762B-page 374
ffff
Q Cycle Activity:
Q1
001a
Words:
0110
f {,a}
Preliminary
Q4
No
operation
Q4
No
operation
No
operation
CPFSEQ REG, 0
:
:
=
=
=
HERE
?
?
=
=
W;
Address (EQUAL)
W;
Address (NEQUAL)
PIC18F97J60 FAMILY
CPFSGT
CPFSLT
Syntax:
CPFSGT
Syntax:
CPFSLT
Operands:
0 f 255
a [0,1]
Operands:
Operation:
(f) (W),
skip if (f) > (W)
(unsigned comparison)
0 f 255
a [0,1]
Operation:
(f) (W),
skip if (f) < (W)
(unsigned comparison)
Status Affected:
None
Status Affected:
None
Encoding:
Description:
0110
f {,a}
010a
ffff
ffff
Encoding:
0110
Description:
Words:
Cycles:
1(2)
Note:
Q Cycle Activity:
Q1
Decode
Q2
Read
register f
Q3
Process
Data
Q4
No
operation
Example:
HERE
NGREATER
GREATER
Before Instruction
PC
W
After Instruction
If REG
PC
If REG
PC
Address (HERE)
?
>
=
W;
Address (GREATER)
W;
Address (NGREATER)
Cycles:
1(2)
Note: 3 cycles if skip and followed
by a 2-word instruction.
Q Cycle Activity:
Q1
Q2
Q3
Q4
Decode
Read
register f
Process
Data
No
operation
If skip:
Q1
Q2
Q3
Q4
No
operation
No
operation
No
operation
No
operation
Q2
Q3
Q4
No
operation
No
operation
No
operation
No
operation
No
operation
No
operation
No
operation
No
operation
Example:
CPFSGT REG, 0
:
:
=
=
ffff
Words:
Q4
No
operation
Q4
No
operation
No
operation
ffff
If skip:
Q1
Q2
Q3
No
No
No
operation
operation
operation
If skip and followed by 2-word instruction:
Q1
Q2
Q3
No
No
No
operation
operation
operation
No
No
No
operation
operation
operation
000a
f {,a}
Preliminary
HERE
NLESS
LESS
Before Instruction
PC
W
After Instruction
If REG
PC
If REG
PC
CPFSLT REG, 1
:
:
=
=
Address (HERE)
?
<
=
W;
Address (LESS)
W;
Address (NLESS)
DS39762B-page 375
PIC18F97J60 FAMILY
DAW
DECF
Decrement f
Syntax:
DAW
Syntax:
Operands:
None
Operands:
Operation:
0 f 255
d [0,1]
a [0,1]
Operation:
(f) 1 dest
Status Affected:
C, DC, N, OV, Z
Encoding:
0000
Description:
Encoding:
0000
Description:
0000
0000
Cycles:
Q Cycle Activity:
Q1
Q2
Q3
Q4
Decode
Read
register W
Process
Data
Write
W
Example 1:
A5h
0
0
DS39762B-page 376
Words:
Cycles:
Q Cycle Activity:
Q1
Q2
Q3
Q4
Decode
Read
register f
Process
Data
Write to
destination
Example:
DECF
Before Instruction
CNT
=
Z
=
After Instruction
CNT
=
Z
=
05h
1
0
Example 2:
Before Instruction
W
=
C
=
DC
=
After Instruction
W
=
C
=
DC
=
ffff
DAW
Before Instruction
W
=
C
=
DC
=
After Instruction
W
=
C
=
DC
=
ffff
0111
Words:
01da
CNT,
1, 0
01h
0
00h
1
CEh
0
0
34h
1
0
Preliminary
PIC18F97J60 FAMILY
DECFSZ
Decrement f, Skip if 0
DCFSNZ
Syntax:
Syntax:
DCFSNZ
Operands:
0 f 255
d [0,1]
a [0,1]
Operands:
0 f 255
d [0,1]
a [0,1]
Operation:
(f) 1 dest,
skip if result = 0
Operation:
(f) 1 dest,
skip if result 0
Status Affected:
None
Status Affected:
None
Encoding:
0010
Description:
11da
ffff
ffff
Encoding:
0100
Description:
Cycles:
1(2)
Note: 3 cycles if skip and followed
by a 2-word instruction.
Words:
Cycles:
1(2)
Note:
Q2
Q3
Q4
Read
register f
Process
Data
Write to
destination
Q1
Q2
Q3
Q4
No
operation
No
operation
No
operation
No
operation
Q1
Q2
Q3
Q4
Decode
Read
register f
Process
Data
Write to
destination
If skip:
If skip:
Q3
Q4
No
operation
No
operation
No
operation
No
operation
No
operation
No
operation
No
operation
DECFSZ
GOTO
CNT, 1, 1
LOOP
Q2
Q3
Q4
No
operation
No
operation
No
operation
Q1
Q2
Q3
Q4
No
operation
No
operation
No
operation
No
operation
No
operation
No
operation
No
operation
No
operation
Example:
CONTINUE
HERE
ZERO
NZERO
Before Instruction
TEMP
After Instruction
TEMP
If TEMP
PC
If TEMP
PC
Address (HERE)
CNT 1
0;
Address (CONTINUE)
0;
Address (HERE + 2)
Q1
No
operation
Q1
No
operation
Before Instruction
PC
=
After Instruction
CNT
=
If CNT
=
PC =
If CNT
PC =
Q Cycle Activity:
Q1
Decode
HERE
ffff
Q Cycle Activity:
Example:
ffff
11da
Words:
f {,d {,a}}
Preliminary
DCFSNZ
:
:
TEMP, 1, 0
=
=
=
TEMP 1,
0;
Address (ZERO)
0;
Address (NZERO)
DS39762B-page 377
PIC18F97J60 FAMILY
GOTO
Unconditional Branch
INCF
Increment f
Syntax:
GOTO k
Syntax:
INCF
Operands:
0 k 1048575
Operands:
Operation:
k PC<20:1>
Status Affected:
None
0 f 255
d [0,1]
a [0,1]
Operation:
(f) + 1 dest
Status Affected:
C, DC, N, OV, Z
Encoding:
1st word (k<7:0>)
2nd word(k<19:8>)
1110
1111
1111
k19kkk
k7kkk
kkkk
kkkk0
kkkk8
Description:
Words:
Cycles:
Encoding:
0010
Description:
Q1
Q2
Q3
Q4
Read literal
k<7:0>,
No
operation
Read literal
k<19:8>,
Write to PC
No
operation
No
operation
No
operation
No
operation
Example:
ffff
ffff
Cycles:
GOTO THERE
After Instruction
PC =
Address (THERE)
Q Cycle Activity:
Q1
Q2
Q3
Q4
Decode
Read
register f
Process
Data
Write to
destination
Example:
INCF
Before Instruction
CNT
=
Z
=
C
=
DC
=
After Instruction
CNT
=
Z
=
C
=
DC
=
DS39762B-page 378
10da
Q Cycle Activity:
Decode
f {,d {,a}}
Preliminary
CNT, 1, 0
FFh
0
?
?
00h
1
1
1
PIC18F97J60 FAMILY
INCFSZ
Increment f, Skip if 0
INFSNZ
Syntax:
INCFSZ
Syntax:
INFSNZ
0 f 255
d [0,1]
a [0,1]
f {,d {,a}}
Operands:
0 f 255
d [0,1]
a [0,1]
Operands:
Operation:
(f) + 1 dest,
skip if result = 0
Operation:
(f) + 1 dest,
skip if result 0
Status Affected:
None
Status Affected:
None
Encoding:
0011
Description:
11da
ffff
ffff
Encoding:
0100
Description:
10da
ffff
ffff
Words:
Words:
Cycles:
1(2)
Note:
Cycles:
1(2)
Note: 3 cycles if skip and followed
by a 2-word instruction.
Q Cycle Activity:
Q Cycle Activity:
Q1
Q2
Q3
Q4
Q1
Q2
Q3
Q4
Decode
Read
register f
Process
Data
Write to
destination
Decode
Read
register f
Process
Data
Write to
destination
Q1
Q2
Q3
Q4
Q1
Q2
Q3
Q4
No
operation
No
operation
No
operation
No
operation
No
operation
No
operation
No
operation
No
operation
If skip:
If skip:
Q1
Q2
Q3
Q4
Q1
Q2
Q3
Q4
No
operation
No
operation
No
operation
No
operation
No
operation
No
operation
No
operation
No
operation
No
operation
No
operation
No
operation
No
operation
No
operation
No
operation
No
operation
No
operation
Example:
HERE
NZERO
ZERO
Before Instruction
PC
=
After Instruction
CNT
=
If CNT
=
PC
=
If CNT
PC
=
INCFSZ
:
:
CNT, 1, 0
Example:
Before Instruction
PC
=
After Instruction
REG
=
If REG
PC
=
If REG
=
PC
=
Address (HERE)
CNT + 1
0;
Address (ZERO)
0;
Address (NZERO)
HERE
ZERO
NZERO
Preliminary
INFSNZ
REG, 1, 0
Address (HERE)
REG + 1
0;
Address (NZERO)
0;
Address (ZERO)
DS39762B-page 379
PIC18F97J60 FAMILY
IORLW
IORWF
Inclusive OR W with f
Syntax:
IORLW k
Syntax:
IORWF
Operands:
0 k 255
Operands:
Operation:
(W) .OR. k W
Status Affected:
N, Z
0 f 255
d [0,1]
a [0,1]
Operation:
Status Affected:
N, Z
Encoding:
0000
1001
kkkk
kkkk
Description:
Words:
Cycles:
Encoding:
0001
Description:
Q Cycle Activity:
Q1
Q2
Q3
Q4
Decode
Read
literal k
Process
Data
Write to
W
Example:
IORLW
Before Instruction
W
=
After Instruction
W
=
00da
ffff
ffff
35h
9Ah
BFh
f {,d {,a}}
Words:
Cycles:
Q Cycle Activity:
Q1
Q2
Q3
Q4
Decode
Read
register f
Process
Data
Write to
destination
Example:
IORWF
Before Instruction
RESULT =
W
=
After Instruction
RESULT =
W
=
DS39762B-page 380
Preliminary
RESULT, 0, 1
13h
91h
13h
93h
PIC18F97J60 FAMILY
LFSR
Load FSR
MOVF
Move f
Syntax:
LFSR f, k
Syntax:
MOVF
Operands:
0f2
0 k 4095
Operands:
Operation:
k FSRf
0 f 255
d [0,1]
a [0,1]
Status Affected:
None
Operation:
f dest
Status Affected:
N, Z
Encoding:
1110
1111
1110
0000
00ff
k7kkk
k11kkk
kkkk
Description:
Words:
Cycles:
Encoding:
0101
Description:
Q Cycle Activity:
Q1
Q2
Q3
Q4
Decode
Read literal
k MSB
Process
Data
Write
literal k
MSB to
FSRfH
Decode
Read literal
k LSB
Process
Data
Write literal
k to FSRfL
Example:
After Instruction
FSR2H
FSR2L
03h
ABh
00da
ffff
ffff
LFSR 2, 3ABh
=
=
f {,d {,a}}
Words:
Cycles:
Q Cycle Activity:
Q1
Q2
Q3
Q4
Decode
Read
register f
Process
Data
Write
W
Example:
MOVF
Before Instruction
REG
W
After Instruction
REG
W
Preliminary
REG, 0, 0
=
=
22h
FFh
=
=
22h
22h
DS39762B-page 381
PIC18F97J60 FAMILY
MOVFF
Move f to f
MOVLB
Syntax:
MOVFF fs,fd
Syntax:
MOVLW k
Operands:
0 fs 4095
0 fd 4095
Operands:
0 k 255
Operation:
k BSR
Status Affected:
None
Operation:
(fs) fd
Status Affected:
None
Encoding:
1st word (source)
2nd word (destin.)
Encoding:
1100
1111
Description:
ffff
ffff
ffff
ffff
ffffs
ffffd
Cycles:
kkkk
kkkk
Words:
Cycles:
Q Cycle Activity:
Q1
Q2
Q3
Q4
Decode
Read
literal k
Process
Data
Write literal
k to BSR
MOVLB
Example:
0001
Description:
0000
Before Instruction
BSR Register =
After Instruction
BSR Register =
02h
05h
Q Cycle Activity:
Q1
Q2
Q3
Q4
Decode
Read
register f
(src)
Process
Data
No
operation
Decode
No
operation
No
operation
Write
register f
(dest)
No dummy
read
Example:
MOVFF
Before Instruction
REG1
REG2
After Instruction
REG1
REG2
DS39762B-page 382
REG1, REG2
=
=
33h
11h
=
=
33h
33h
Preliminary
PIC18F97J60 FAMILY
MOVLW
Move Literal to W
MOVWF
Move W to f
Syntax:
MOVLW k
Syntax:
MOVWF
Operands:
0 k 255
Operands:
Operation:
kW
0 f 255
a [0,1]
Status Affected:
None
Encoding:
0000
Description:
1110
kkkk
kkkk
Words:
Cycles:
Operation:
(W) f
Status Affected:
None
Encoding:
0110
Description:
Q Cycle Activity:
Q1
Q2
Q3
Q4
Decode
Read
literal k
Process
Data
Write to
W
Example:
After Instruction
W
=
MOVLW
f {,a}
111a
ffff
ffff
5Ah
5Ah
Words:
Cycles:
Q Cycle Activity:
Q1
Q2
Q3
Q4
Decode
Read
register f
Process
Data
Write
register f
Example:
MOVWF
Before Instruction
W
=
REG
=
After Instruction
W
=
REG
=
Preliminary
REG, 0
4Fh
FFh
4Fh
4Fh
DS39762B-page 383
PIC18F97J60 FAMILY
MULLW
MULWF
Syntax:
MULLW
Syntax:
MULWF
Operands:
0 k 255
Operands:
Operation:
(W) x k PRODH:PRODL
0 f 255
a [0,1]
Status Affected:
None
Operation:
Status Affected:
None
Encoding:
0000
Description:
1101
kkkk
kkkk
Multiply W with f
Encoding:
0000
Description:
W is unchanged.
None of the Status flags are affected.
Cycles:
1
Q1
Q2
Q3
Q4
Read
literal k
Process
Data
Write
registers
PRODH:
PRODL
MULLW
0C4h
=
=
=
E2h
?
?
=
=
=
E2h
ADh
08h
Words:
Cycles:
Q Cycle Activity:
Q1
Q2
Q3
Q4
Decode
Read
register f
Process
Data
Write
registers
PRODH:
PRODL
Example:
Before Instruction
W
REG
PRODH
PRODL
After Instruction
W
REG
PRODH
PRODL
DS39762B-page 384
ffff
Decode
Before Instruction
W
PRODH
PRODL
After Instruction
W
PRODH
PRODL
ffff
Q Cycle Activity:
Example:
001a
f {,a}
Preliminary
MULWF
REG, 1
=
=
=
=
C4h
B5h
?
?
=
=
=
=
C4h
B5h
8Ah
94h
PIC18F97J60 FAMILY
NEGF
Negate f
Syntax:
NEGF
Operands:
0 f 255
a [0,1]
f {,a}
Operation:
(f) + 1 f
Status Affected:
N, OV, C, DC, Z
Encoding:
0110
Description:
110a
ffff
Syntax:
NOP
Operands:
None
Operation:
No operation
Status Affected:
None
0000
1111
ffff
Cycles:
No Operation
Encoding:
Words:
NOP
0000
xxxx
Description:
No operation.
Words:
Cycles:
0000
xxxx
0000
xxxx
Q Cycle Activity:
Q1
Q2
Q3
Q4
Decode
No
operation
No
operation
No
operation
Example:
None.
Q Cycle Activity:
Q1
Q2
Q3
Q4
Decode
Read
register f
Process
Data
Write
register f
Example:
NEGF
Before Instruction
REG
=
After Instruction
REG
=
REG, 1
Preliminary
DS39762B-page 385
PIC18F97J60 FAMILY
POP
PUSH
Syntax:
POP
Syntax:
PUSH
Operands:
None
Operands:
None
Operation:
Operation:
(PC + 2) TOS
Status Affected:
None
Status Affected:
None
Encoding:
0000
0000
0000
0110
Description:
Words:
Cycles:
Encoding:
Q2
Q3
Q4
Decode
No
operation
POP TOS
value
No
operation
POP
GOTO
NEW
Before Instruction
TOS
Stack (1 level down)
DS39762B-page 386
0000
0101
Words:
Cycles:
Q Cycle Activity:
Q1
After Instruction
TOS
PC
0000
Description:
Q Cycle Activity:
Example:
0000
Q1
Q2
Q3
Q4
Decode
PUSH
PC + 2 onto
return stack
No
operation
No
operation
Example:
=
=
=
=
0031A2h
014332h
014332h
NEW
Preliminary
PUSH
Before Instruction
TOS
PC
=
=
345Ah
0124h
After Instruction
PC
TOS
Stack (1 level down)
=
=
=
0126h
0126h
345Ah
PIC18F97J60 FAMILY
RCALL
Relative Call
RESET
Reset
Syntax:
RCALL
Syntax:
RESET
Operands:
-1024 n 1023
Operands:
None
Operation:
(PC) + 2 TOS,
(PC) + 2 + 2n PC
Operation:
Status Affected:
None
Status Affected:
All
Encoding:
1101
Description:
1nnn
nnnn
nnnn
Words:
Cycles:
Encoding:
0000
Q2
Q3
Q4
Read literal
n
Process
Data
Write to PC
No
operation
No
operation
1111
Words:
Cycles:
Q Cycle Activity:
Q1
Q2
Q3
Q4
Decode
Start
reset
No
operation
No
operation
Example:
Q1
1111
Q Cycle Activity:
Decode
0000
Description:
After Instruction
Registers =
Flags*
=
RESET
Reset Value
Reset Value
PUSH PC
to stack
No
operation
Example:
No
operation
HERE
RCALL Jump
Before Instruction
PC =
Address (HERE)
After Instruction
PC =
Address (Jump)
TOS =
Address (HERE + 2)
Preliminary
DS39762B-page 387
PIC18F97J60 FAMILY
RETFIE
RETLW
Return Literal to W
Syntax:
RETFIE {s}
Syntax:
RETLW k
Operands:
s [0,1]
Operands:
0 k 255
Operation:
(TOS) PC,
1 GIE/GIEH or PEIE/GIEL;
if s = 1,
(WS) W,
(STATUSS) STATUS,
(BSRS) BSR,
PCLATU, PCLATH are unchanged
Operation:
k W,
(TOS) PC,
PCLATU, PCLATH are unchanged
Status Affected:
None
Status Affected:
Encoding:
0000
Description:
0000
0001
Words:
Cycles:
Q Cycle Activity:
kkkk
kkkk
Words:
Cycles:
000s
1100
Description:
GIE/GIEH, PEIE/GIEL.
Encoding:
Q Cycle Activity:
Q1
Q2
Q3
Q4
Decode
Read
literal k
Process
Data
POP PC
from stack,
write to W
No
operation
No
operation
No
operation
No
operation
Example:
Q1
Q2
Q3
Q4
Decode
No
operation
No
operation
POP PC
from stack
Set GIEH or
GIEL
No
operation
0000
No
operation
Example:
RETFIE
After Interrupt
PC
W
BSR
STATUS
GIE/GIEH, PEIE/GIEL
DS39762B-page 388
No
operation
No
operation
1
=
=
=
=
=
TOS
WS
BSRS
STATUSS
1
CALL TABLE ;
;
;
;
:
TABLE
ADDWF PCL ;
RETLW k0
;
RETLW k1
;
:
:
RETLW kn
;
Before Instruction
W
=
After Instruction
W
=
Preliminary
W contains table
offset value
W now has
table value
W = offset
Begin table
End of table
07h
value of kn
PIC18F97J60 FAMILY
RETURN
RLCF
Syntax:
RETURN {s}
Syntax:
RLCF
Operands:
s [0,1]
Operands:
Operation:
(TOS) PC;
if s = 1,
(WS) W,
(STATUSS) STATUS,
(BSRS) BSR,
PCLATU, PCLATH are unchanged
0 f 255
d [0,1]
a [0,1]
Operation:
Status Affected:
C, N, Z
Status Affected:
None
Encoding:
0000
Description:
Encoding:
0000
0001
001s
0011
Description:
Words:
Cycles:
2
Q1
Q2
Q3
Q4
No
operation
Process
Data
POP PC
from stack
No
operation
No
operation
No
operation
No
operation
01da
ffff
ffff
Q Cycle Activity:
Decode
f {,d {,a}}
register f
C
Words:
Cycles:
Q Cycle Activity:
Example:
Q1
Q2
Q3
Q4
Decode
Read
register f
Process
Data
Write to
destination
RETURN
After Instruction:
PC = TOS
Example:
Before Instruction
REG
=
C
=
After Instruction
REG
=
W
=
C
=
Preliminary
RLCF
REG, 0, 0
1110 0110
0
1110 0110
1100 1100
1
DS39762B-page 389
PIC18F97J60 FAMILY
RLNCF
RRCF
Syntax:
RLNCF
Syntax:
RRCF
Operands:
0 f 255
d [0,1]
a [0,1]
Operands:
0 f 255
d [0,1]
a [0,1]
Operation:
Operation:
Status Affected:
N, Z
Status Affected:
C, N, Z
Encoding:
0100
Description:
f {,d {,a}}
01da
ffff
ffff
Encoding:
0011
Description:
1
1
Q1
Decode
Q2
Read
register f
Example:
Before Instruction
REG
=
After Instruction
REG
=
DS39762B-page 390
RLNCF
Q3
Process
Data
Q4
Write to
destination
Words:
Cycles:
register f
Q Cycle Activity:
Q1
Q2
Q3
Q4
Decode
Read
register f
Process
Data
Write to
destination
REG, 1, 0
1010 1011
ffff
Q Cycle Activity:
ffff
register f
Cycles:
00da
Words:
f {,d {,a}}
Example:
RRCF
Before Instruction
REG
=
C
=
After Instruction
REG
=
W
=
C
=
0101 0111
Preliminary
REG, 0, 0
1110 0110
0
1110 0110
0111 0011
0
PIC18F97J60 FAMILY
RRNCF
SETF
Set f
Syntax:
RRNCF
Syntax:
SETF
Operands:
0 f 255
d [0,1]
a [0,1]
Operands:
0 f 255
a [0,1]
Operation:
Status Affected:
N, Z
Encoding:
0100
Description:
f {,d {,a}}
00da
Operation:
FFh f
Status Affected:
None
Encoding:
ffff
ffff
0110
Description:
Cycles:
Words:
Cycles:
Q Cycle Activity:
Q2
Q3
Q4
Decode
Read
register f
Process
Data
Write to
destination
Example 1:
RRNCF
Before Instruction
REG
=
After Instruction
REG
=
Example 2:
Q1
Q2
Q3
Q4
Decode
Read
register f
Process
Data
Write
register f
SETF
Before Instruction
REG
After Instruction
REG
REG,1
5Ah
FFh
REG, 1, 0
1101 0111
1110 1011
RRNCF
Before Instruction
W
=
REG
=
After Instruction
W
=
REG
=
ffff
Q Cycle Activity:
Example:
Q1
ffff
register f
Words:
100a
f {,a}
REG, 0, 0
?
1101 0111
1110 1011
1101 0111
Preliminary
DS39762B-page 391
PIC18F97J60 FAMILY
SLEEP
SUBFWB
Syntax:
SLEEP
Syntax:
SUBFWB
Operands:
None
Operands:
Operation:
00h WDT,
0 WDT postscaler,
1 TO,
0 PD
0 f 255
d [0,1]
a [0,1]
Operation:
Status Affected:
N, OV, C, DC, Z
Status Affected:
TO, PD
Encoding:
0000
Description:
Encoding:
0000
0000
0011
0101
Description:
Words:
Cycles:
1
Q1
Q2
Q3
Q4
No
operation
Process
Data
Go to
Sleep
Example:
SLEEP
Before Instruction
TO =
?
?
PD =
DS39762B-page 392
ffff
ffff
Cycles:
Q Cycle Activity:
After Instruction
1
TO =
PD =
0
If WDT causes wake-up, this bit is cleared.
01da
Q Cycle Activity:
Decode
f {,d {,a}}
Q1
Q2
Q3
Q4
Decode
Read
register f
Process
Data
Write to
destination
SUBFWB
REG, 1, 0
Example 1:
Before Instruction
REG
=
3
W
=
2
C
=
1
After Instruction
REG
=
FF
W
=
2
C
=
0
Z
=
0
N
=
1 ; result is negative
SUBFWB
REG, 0, 0
Example 2:
Before Instruction
REG
=
2
W
=
5
C
=
1
After Instruction
REG
=
2
W
=
3
C
=
1
Z
=
0
N
=
0 ; result is positive
SUBFWB
REG, 1, 0
Example 3:
Before Instruction
REG
=
1
W
=
2
C
=
0
After Instruction
REG
=
0
W
=
2
C
=
1
Z
=
1 ; result is zero
N
=
0
Preliminary
PIC18F97J60 FAMILY
SUBLW
SUBWF
Subtract W from f
Syntax:
SUBLW k
Syntax:
SUBWF
Operands:
0 k 255
Operands:
Operation:
k (W) W
Status Affected:
N, OV, C, DC, Z
0 f 255
d [0,1]
a [0,1]
Operation:
Status Affected:
N, OV, C, DC, Z
Encoding:
0000
1000
kkkk
kkkk
Description:
Words:
Cycles:
Encoding:
0101
Description:
Q Cycle Activity:
Q1
Q2
Q3
Q4
Decode
Read
literal k
Process
Data
Write to
W
Example 1:
Before Instruction
W
=
C
=
After Instruction
W
=
C
=
Z
=
N
=
Example 2:
Before Instruction
W
=
C
=
After Instruction
W
=
C
=
Z
=
N
=
Example 3:
Before Instruction
W
=
C
=
After Instruction
W
=
C
=
Z
=
N
=
SUBLW
SUBLW
11da
ffff
ffff
02h
01h
?
01h
1
0
0
f {,d {,a}}
; result is positive
Words:
Cycles:
02h
Q Cycle Activity:
02h
?
00h
1
1
0
SUBLW
; result is zero
Q2
Q3
Q4
Read
register f
Process
Data
Write to
destination
SUBWF
REG, 1, 0
Example 1:
Before Instruction
REG
=
W
=
C
=
After Instruction
REG
=
W
=
C
=
Z
=
N
=
02h
03h
?
FFh
0
0
1
Q1
Decode
; (2s complement)
; result is negative
Example 2:
Before Instruction
REG
=
W
=
C
=
After Instruction
REG
=
W
=
C
=
Z
=
N
=
Example 3:
Before Instruction
REG
=
W
=
C
=
After Instruction
REG
=
W
=
C
=
Z
=
N
=
Preliminary
3
2
?
1
2
1
0
0
; result is positive
SUBWF
REG, 0, 0
2
2
?
2
0
1
1
0
SUBWF
; result is zero
REG, 1, 0
1
2
?
FFh ;(2s complement)
2
0
; result is negative
0
1
DS39762B-page 393
PIC18F97J60 FAMILY
SUBWFB
SWAPF
Swap f
Syntax:
SUBWFB
Syntax:
Operands:
0 f 255
d [0,1]
a [0,1]
Operands:
Operation:
0 f 255
d [0,1]
a [0,1]
Operation:
Status Affected:
N, OV, C, DC, Z
(f<3:0>) dest<7:4>,
(f<7:4>) dest<3:0>
Status Affected:
None
Encoding:
0101
Description:
f {,d {,a}}
10da
ffff
ffff
Encoding:
0011
Description:
Cycles:
Q Cycle Activity:
Q1
Decode
Q2
Read
register f
Example 1:
SUBWFB
Before Instruction
REG
=
W
=
C
=
After Instruction
REG
=
W
=
C
=
Z
=
N
=
Example 2:
Q4
Write to
destination
Cycles:
Q Cycle Activity:
Q1
Q2
Q3
Q4
Decode
Read
register f
Process
Data
Write to
destination
REG, 1, 0
19h
0Dh
1
(0001 1001)
(0000 1101)
0Ch
0Dh
1
0
0
(0000 1011)
(0000 1101)
ffff
Example:
SWAPF
Before Instruction
REG
=
After Instruction
REG
=
REG, 1, 0
53h
35h
; result is positive
SUBWFB REG, 0, 0
Before Instruction
REG
=
W
=
C
=
After Instruction
REG
=
W
=
C
=
Z
=
N
=
Example 3:
1Bh
1Ah
0
(0001 1011)
(0001 1010)
1Bh
00h
1
1
0
(0001 1011)
SUBWFB
Before Instruction
REG
=
W
=
C
=
After Instruction
REG
=
W
C
Z
N
Q3
Process
Data
ffff
10da
=
=
=
=
DS39762B-page 394
; result is zero
REG, 1, 0
03h
0Eh
1
(0000 0011)
(0000 1101)
F5h
(1111 0100)
; [2s comp]
(0000 1101)
0Eh
0
0
1
; result is negative
Preliminary
PIC18F97J60 FAMILY
TBLRD
Table Read
TBLRD
Syntax:
Example 1:
TBLRD
Operands:
None
Operation:
if TBLRD*,
(Prog Mem (TBLPTR)) TABLAT;
TBLPTR No Change
if TBLRD*+,
(Prog Mem (TBLPTR)) TABLAT;
(TBLPTR) + 1 TBLPTR
if TBLRD*-,
(Prog Mem (TBLPTR)) TABLAT;
(TBLPTR) 1 TBLPTR
if TBLRD +*,
(TBLPTR) + 1 TBLPTR;
(Prog Mem (TBLPTR)) TABLAT
Before Instruction
TABLAT
TBLPTR
MEMORY(00A356h)
After Instruction
TABLAT
TBLPTR
Example 2:
Description:
0000
0000
0000
TBLRD
Before Instruction
TABLAT
TBLPTR
MEMORY(01A357h)
MEMORY(01A358h)
After Instruction
TABLAT
TBLPTR
*+ ;
=
=
=
55h
00A356h
34h
=
=
34h
00A357h
+* ;
=
=
=
=
AAh
01A357h
12h
34h
=
=
34h
01A358h
10nn
nn=0 *
=1 *+
=2 *=3 +*
Words:
Cycles:
Q Cycle Activity:
Q1
Q2
Q3
Q4
Decode
No
operation
No
operation
No
operation
No
operation
No operation
(Read Program
Memory)
No
operation
No operation
(Write
TABLAT)
Preliminary
DS39762B-page 395
PIC18F97J60 FAMILY
TBLWT
Table Write
TBLWT
Syntax:
Example 1:
TBLWT*+;
Operands:
None
Operation:
if TBLWT*,
(TABLAT) Holding Register;
TBLPTR No Change
if TBLWT*+,
(TABLAT) Holding Register;
(TBLPTR) + 1 TBLPTR
if TBLWT*-,
(TABLAT) Holding Register;
(TBLPTR) 1 TBLPTR
if TBLWT+*,
(TBLPTR) + 1 TBLPTR;
(TABLAT) Holding Register
Status Affected:
Example 2:
None
Encoding:
Description:
Before Instruction
TABLAT
=
55h
TBLPTR
=
00A356h
HOLDING REGISTER
(00A356h)
=
FFh
After Instructions (table write completion)
TABLAT
=
55h
TBLPTR
=
00A357h
HOLDING REGISTER
(00A356h)
=
55h
0000
0000
0000
11nn
nn=0 *
=1 *+
=2 *=3 +*
TBLWT +*;
Before Instruction
TABLAT
=
34h
TBLPTR
=
01389Ah
HOLDING REGISTER
(01389Ah)
=
FFh
HOLDING REGISTER
(01389Bh)
=
FFh
After Instruction (table write completion)
TABLAT
=
34h
TBLPTR
=
01389Bh
HOLDING REGISTER
(01389Ah)
=
FFh
HOLDING REGISTER
(01389Bh)
=
34h
no change
post-increment
post-decrement
pre-increment
Words:
Cycles:
Q Cycle Activity:
Q1
Decode
Q2
Q3
Q4
No
No
No
operation operation operation
No
No
No
No
operation operation operation operation
(Read
(Write to
TABLAT)
Holding
Register)
DS39762B-page 396
Preliminary
PIC18F97J60 FAMILY
TSTFSZ
Test f, Skip if 0
XORLW
Syntax:
TSTFSZ f {,a}
Syntax:
XORLW k
Operands:
0 f 255
a [0,1]
Operands:
0 k 255
Operation:
(W) .XOR. k W
Operation:
skip if f = 0
Status Affected:
N, Z
Status Affected:
None
Encoding:
Encoding:
0110
Description:
011a
ffff
ffff
Words:
Cycles:
1(2)
Note: 3 cycles if skip and followed
by a 2-word instruction.
0000
1010
kkkk
kkkk
Description:
Words:
Cycles:
Q Cycle Activity:
Q1
Q2
Q3
Q4
Decode
Read
literal k
Process
Data
Write to
W
Example:
Before Instruction
W
=
After Instruction
W
=
XORLW
0AFh
B5h
1Ah
Q Cycle Activity:
Q1
Q2
Q3
Q4
Decode
Read
register f
Process
Data
No
operation
If skip:
Q1
Q2
Q3
Q4
No
operation
No
operation
No
operation
No
operation
Q2
Q3
Q4
No
operation
No
operation
No
operation
No
operation
No
operation
No
operation
No
operation
No
operation
Example:
HERE
NZERO
ZERO
Before Instruction
PC
After Instruction
If CNT
PC
If CNT
PC
TSTFSZ
:
:
CNT, 1
Address (HERE)
=
=
00h,
Address (ZERO)
00h,
Address (NZERO)
Preliminary
DS39762B-page 397
PIC18F97J60 FAMILY
XORWF
Exclusive OR W with f
Syntax:
XORWF
Operands:
0 f 255
d [0,1]
a [0,1]
Operation:
Status Affected:
N, Z
Encoding:
0001
Description:
f {,d {,a}}
10da
ffff
ffff
Words:
Cycles:
Q Cycle Activity:
Q1
Q2
Q3
Q4
Decode
Read
register f
Process
Data
Write to
destination
Example:
XORWF
Before Instruction
REG
=
W
=
After Instruction
REG
=
W
=
DS39762B-page 398
REG, 1, 0
AFh
B5h
1Ah
B5h
Preliminary
PIC18F97J60 FAMILY
25.2
A summary of the instructions in the extended instruction set is provided in Table 25-3. Detailed descriptions
are provided in Section 25.2.2 Extended Instruction
Set. The opcode field descriptions in Table 25-1 (page
358) apply to both the standard and extended PIC18
instruction sets.
Note:
25.2.1
Most of the extended instructions use indexed arguments, using one of the File Select Registers and some
offset to specify a source or destination register. When
an argument for an instruction serves as part of
Indexed Addressing, it is enclosed in square brackets
([ ]). This is done to indicate that the argument is used
as an index or offset. The MPASM Assembler will
flag an error if it determines that an index or offset value
is not bracketed.
TABLE 25-3:
Note:
Mnemonic,
Operands
ADDFSR
ADDULNK
CALLW
MOVSF
f, k
k
MOVSS
zs, zd
PUSHL
SUBFSR
SUBULNK
f, k
k
zs, fd
Description
Cycles
MSb
1
2
2
2
LSb
Status
Affected
1000
1000
0000
1011
ffff
1011
xxxx
1010
ffkk
11kk
0001
0zzz
ffff
1zzz
xzzz
kkkk
kkkk
kkkk
0100
zzzz
ffff
zzzz
zzzz
kkkk
None
None
None
None
1110
1110
0000
1110
1111
1110
1111
1110
1
2
1110
1110
1001
1001
ffkk
11kk
kkkk
kkkk
None
None
Preliminary
None
None
DS39762B-page 399
PIC18F97J60 FAMILY
25.2.2
ADDFSR
ADDULNK
Syntax:
ADDFSR f, k
Syntax:
ADDULNK k
Operands:
0 k 63
f [ 0, 1, 2 ]
Operands:
0 k 63
Operation:
FSR(f) + k FSR(f)
Status Affected:
None
Encoding:
1110
FSR2 + k FSR2,
Operation:
(TOS) PC
Status Affected:
1000
ffkk
kkkk
Description:
Words:
Cycles:
None
Encoding:
1110
Description:
Q2
Q3
Q4
Decode
Read
literal k
Process
Data
Write to
FSR
Example:
After Instruction
FSR2
=
03FFh
Words:
Cycles:
Q Cycle Activity:
0422h
Q1
Q2
Q3
Q4
Decode
Read
literal k
Process
Data
Write to
FSR
No
Operation
No
Operation
No
Operation
No
Operation
Example:
Note:
kkkk
ADDFSR 2, 23h
Before Instruction
FSR2
=
11kk
Q Cycle Activity:
Q1
1000
ADDULNK 23h
Before Instruction
FSR2
=
PC
=
03FFh
0100h
After Instruction
FSR2
=
PC
=
0422h
(TOS)
All PIC18 instructions may take an optional label argument preceding the instruction mnemonic for use in
symbolic addressing. If a label is used, the instruction format then becomes: {label} instruction argument(s).
DS39762B-page 400
Preliminary
PIC18F97J60 FAMILY
CALLW
MOVSF
Move Indexed to f
Syntax:
CALLW
Syntax:
MOVSF [zs], fd
Operands:
None
Operands:
Operation:
(PC + 2) TOS,
(W) PCL,
(PCLATH) PCH,
(PCLATU) PCU
0 zs 127
0 fd 4095
Operation:
((FSR2) + zs) fd
Status Affected:
None
Status Affected:
None
Encoding:
0000
Description
0000
0001
0100
Encoding:
1st word (source)
2nd word (destin.)
Description:
Cycles:
1110
1111
Q1
Q2
Q3
Q4
Read
WREG
Push PC to
stack
No
operation
No
operation
No
operation
No
operation
No
operation
Words:
Cycles:
Q Cycle Activity:
Q1
Decode
Before Instruction
PC
=
PCLATH =
PCLATU =
W
=
After Instruction
PC
=
TOS
=
PCLATH =
PCLATU =
W
=
CALLW
Decode
address (HERE)
10h
00h
06h
001006h
address (HERE + 2)
10h
00h
06h
zzzzs
ffffd
Decode
HERE
0zzz
ffff
Q Cycle Activity:
Example:
1011
ffff
Q2
Q3
Determine
Determine
source addr source addr
No
operation
No
operation
No dummy
read
Example:
MOVSF
Before Instruction
FSR2
Contents
of 85h
REG2
After Instruction
FSR2
Contents
of 85h
REG2
Preliminary
Q4
Read
source reg
Write
register f
(dest)
[05h], REG2
80h
=
=
33h
11h
80h
=
=
33h
33h
DS39762B-page 401
PIC18F97J60 FAMILY
MOVSS
PUSHL
Syntax:
Syntax:
PUSHL k
Operands:
0 zs 127
0 zd 127
Operands:
0 k 255
Operation:
k (FSR2),
FSR2 1 FSR2
Status Affected:
None
Operation:
Status Affected:
None
Encoding:
1st word (source)
2nd word (dest.)
1110
1111
Description
1011
xxxx
1zzz
xzzz
zzzzs
zzzzd
Encoding:
Words:
Cycles:
Words:
Cycles:
Q1
Decode
Q2
Q3
Determine
Determine
source addr source addr
Determine
dest addr
Example:
kkkk
1
Q1
Q2
Q3
Q4
Decode
Read k
Process
data
Write to
destination
Example:
PUSHL 08h
Before Instruction
FSR2H:FSR2L
Memory (01ECh)
=
=
01ECh
00h
After Instruction
FSR2H:FSR2L
Memory (01ECh)
=
=
01EBh
08h
Q4
Read
source reg
Write
to dest reg
Before Instruction
FSR2
Contents
of 85h
Contents
of 86h
After Instruction
FSR2
Contents
of 85h
Contents
of 86h
DS39762B-page 402
Determine
dest addr
kkkk
Q Cycle Activity:
Q Cycle Activity:
Decode
1010
1111
Description:
80h
33h
11h
80h
33h
33h
Preliminary
PIC18F97J60 FAMILY
SUBFSR
SUBULNK
Syntax:
SUBFSR f, k
Syntax:
SUBULNK k
Operands:
0 k 63
Operands:
0 k 63
f [ 0, 1, 2 ]
Operation:
Operation:
FSRf k FSRf
FSR2 k FSR2,
(TOS) PC
Status Affected:
None
Status Affected:
None
Encoding:
1110
1001
ffkk
kkkk
Description:
Words:
Cycles:
Encoding:
1110
Description:
Q1
Q2
Q3
Q4
Decode
Read
register f
Process
Data
Write to
destination
Before Instruction
FSR2
=
After Instruction
FSR2
=
SUBFSR 2, 23h
1001
11kk
kkkk
Q Cycle Activity:
Example:
Cycles:
Q Cycle Activity:
03FFh
Q1
Q2
Q3
Q4
Decode
Read
register f
Process
Data
Write to
destination
No
Operation
No
Operation
No
Operation
No
Operation
03DCh
Example:
Preliminary
SUBULNK 23h
Before Instruction
FSR2
=
PC
=
03FFh
0100h
After Instruction
FSR2
=
PC
=
03DCh
(TOS)
DS39762B-page 403
PIC18F97J60 FAMILY
25.2.3
Note:
BYTE-ORIENTED AND
BIT-ORIENTED INSTRUCTIONS IN
INDEXED LITERAL OFFSET MODE
Enabling the PIC18 instruction set extension may cause legacy applications to
behave erratically or fail entirely.
DS39762B-page 404
25.2.3.1
25.2.4
CONSIDERATIONS WHEN
ENABLING THE EXTENDED
INSTRUCTION SET
It is important to note that the extensions to the instruction set may not be beneficial to all users. In particular,
users who are not writing code that uses a software
stack may not benefit from using the extensions to the
instruction set.
Additionally, the Indexed Literal Offset Addressing
mode may create issues with legacy applications
written to the PIC18 assembler. This is because
instructions in the legacy code may attempt to address
registers in the Access Bank below 5Fh. Since these
addresses are interpreted as literal offsets to FSR2
when the instruction set extension is enabled, the
application may read or write to the wrong data
addresses.
When porting an application to the PIC18F97J60 family, it is very important to consider the type of code. A
large, reentrant application that is written in C and
would benefit from efficient compilation will do well
when using the instruction set extensions. Legacy
applications that heavily use the Access Bank will most
likely not benefit from using the extended instruction
set.
Preliminary
PIC18F97J60 FAMILY
ADD W to Indexed
(Indexed Literal Offset mode)
BSF
Syntax:
ADDWF
Syntax:
BSF [k], b
Operands:
0 k 95
d [0,1]
Operands:
0 f 95
0b7
Operation:
Operation:
1 ((FSR2) + k)<b>
Status Affected:
N, OV, C, DC, Z
Status Affected:
None
ADDWF
Encoding:
[k] {,d}
0010
Description:
01d0
kkkk
kkkk
Words:
Encoding:
bbb0
kkkk
kkkk
Description:
Words:
Cycles:
Q Cycle Activity:
Q1
Q2
Q3
Q4
Decode
Read
register f
Process
Data
Write to
destination
Cycles:
1000
Q Cycle Activity:
Example:
Q1
Q2
Q3
Q4
Decode
Read k
Process
Data
Write to
destination
Example:
ADDWF
Before Instruction
W
OFST
FSR2
Contents
of 0A2Ch
After Instruction
W
Contents
of 0A2Ch
Before Instruction
FLAG_OFST
FSR2
Contents
of 0A0Ah
After Instruction
Contents
of 0A0Ah
[OFST] ,0
=
=
=
17h
2Ch
0A00h
20h
37h
20h
BSF
[FLAG_OFST], 7
=
=
0Ah
0A00h
55h
D5h
SETF
Set Indexed
(Indexed Literal Offset mode)
Syntax:
SETF [k]
Operands:
0 k 95
Operation:
FFh ((FSR2) + k)
Status Affected:
None
Encoding:
0110
1000
kkkk
kkkk
Description:
Words:
Cycles:
Q Cycle Activity:
Q1
Q2
Q3
Q4
Decode
Read k
Process
Data
Write
register
Example:
SETF
Before Instruction
OFST
FSR2
Contents
of 0A2Ch
After Instruction
Contents
of 0A2Ch
Preliminary
[OFST]
=
=
2Ch
0A00h
00h
FFh
DS39762B-page 405
PIC18F97J60 FAMILY
25.2.5
DS39762B-page 406
Preliminary
PIC18F97J60 FAMILY
26.0
DEVELOPMENT SUPPORT
26.1
Preliminary
DS39762B-page 407
PIC18F97J60 FAMILY
26.2
MPASM Assembler
26.5
26.6
26.3
26.4
DS39762B-page 408
Preliminary
PIC18F97J60 FAMILY
26.7
26.9
26.8
Preliminary
DS39762B-page 409
PIC18F97J60 FAMILY
26.11 PICSTART Plus Development
Programmer
DS39762B-page 410
Preliminary
PIC18F97J60 FAMILY
27.0
ELECTRICAL CHARACTERISTICS
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 to maximum rating conditions for
extended periods may affect device reliability.
Preliminary
DS39762B-page 411
PIC18F97J60 FAMILY
FIGURE 27-1:
4.0V
3.6V
3.5V
Voltage (VDD)(1)
PIC18F6XJ6X/8XJ6X/9XJ6X
3.0V
2.7V
2.5V
2.0V
Note 1:
Frequency
41.6667 MHz
When the on-chip regulator is enabled, its BOR circuit will automatically trigger a device Reset
before VDD reaches a level at which full-speed operation is not possible.
FIGURE 27-2:
3.00V
Voltage (VDDCORE)(1)
2.75V
2.7V
2.50V
PIC18F6XJ6X/8XJ6X/9XJ6X
2.35V
2.25V
2.00V
41.6667 MHz
4 MHz
Frequency
For frequencies between 4 MHz and 41.6667 MHz, FMAX = (107.619 MHz/V) * (VDDCORE 2V) + 4 MHz
Note 1:
When the on-chip voltage regulator is disabled, VDD and VDDCORE must be maintained so that
VDDCORE VDD 3.6V.
DS39762B-page 412
Preliminary
PIC18F97J60 FAMILY
27.1
DC Characteristics:
PIC18F97J60 Family
(Industrial)
Param
No.
Symbol
Supply Voltage
D001
VDD
D001B
Min
Typ
Max
Units
VDDCORE
2.7
3.1
3.6
3.6
3.6
V
V
V
2.0
2.7
D001C
AVDD
VDD 0.3
VDD + 0.3
D002
VDR
1.5
D003
VPOR
0.7
D004
SVDD
0.05
Note 1:
Conditions
ENVREG tied to VSS
ENVREG tied to VDD
Ethernet module enabled
(ECON2<5> = 1)
This is the limit to which VDD can be lowered in Sleep mode, or during a device Reset, without losing RAM
data.
Preliminary
DS39762B-page 413
PIC18F97J60 FAMILY
27.2
DC Characteristics:
PIC18F97J60 Family
(Industrial)
Param
No.
Device
Typ
Max
Units
Conditions
19.0
69.0
-40C
21.0
69.0
+25C
45.0
149.0
+85C
26.0
104.0
-40C
29.0
104.0
+25C
60.0
184.0
+85C
40.0
203.0
-40C
44.0
203.0
+25C
105.0
209.0
+85C
All devices
All devices
Note 1:
2:
3:
4:
5:
6:
VDD = 2.0V,
VDDCORE = 2.0V(4)
(Sleep mode)
VDD = 2.5V,
VDDCORE = 2.5V(4)
(Sleep mode)
VDD = 3.3V(5)
(Sleep mode)
The power-down current in Sleep mode does not depend on the oscillator type. Power-down current is measured with
the part in Sleep mode, with all I/O pins in high-impedance state and tied to VDD or VSS and all features that add delta
current disabled (such as WDT, Timer1 oscillator, etc.).
The supply current is mainly a function of operating voltage, frequency and mode. Other factors, such as I/O pin loading
and switching rate, oscillator type and circuit, internal code execution pattern and temperature, also have an impact on
the current consumption.
The test conditions for all IDD measurements in active operation mode are:
OSC1 = external square wave, from rail-to-rail; all I/O pins tri-stated, pulled to VDD;
MCLR = VDD; WDT enabled/disabled as specified.
Standard, low-cost 32 kHz crystals have an operating temperature range of -10C to +70C. Extended temperature
crystals are available at a much higher cost.
Voltage regulator disabled (ENVREG = 0, tied to VSS).
Voltage regulator enabled (ENVREG = 1, tied to VDD).
For IETH, the specified current includes current sunk through TPOUT+ and TPOUT-. LEDA and LEDB are disabled for
all testing.
DS39762B-page 414
Preliminary
PIC18F97J60 FAMILY
27.2
DC Characteristics:
PIC18F97J60 Family
(Industrial)
Param
No.
Device
Typ
Max
Units
Conditions
12.0
34.0
-40C
12.0
34.0
+25C
74.0
108.0
+85C
20.0
45.0
-40C
20.0
45.0
+25C
+85C
All devices
82.0
126.0
168.0
-40C
105.0
168.0
+25C
182.0
246.0
+85C
All devices
All devices
All devices
Note 1:
2:
3:
4:
5:
6:
8.0
32.0
-40C
8.0
32.0
+25C
62.0
98.0
+85C
12.0
35.0
-40C
12.0
35.0
+25C
70.0
95.0
+85C
90.0
152.0
-40C
90.0
152.0
+25C
170.0
225.0
+85C
VDD = 2.0V,
VDDCORE = 2.0V(4)
VDD = 2.5V,
VDDCORE = 2.5V(4)
FOSC = 31 kHz
(RC_RUN mode,
Internal Oscillator Source)
VDD = 3.3V(5)
VDD = 2.0V,
VDDCORE = 2.0V(4)
VDD = 2.5V,
VDDCORE = 2.5V(4)
FOSC = 31 kHz
(RC_IDLE mode,
Internal Oscillator Source)
VDD = 3.3V(5)
The power-down current in Sleep mode does not depend on the oscillator type. Power-down current is measured with
the part in Sleep mode, with all I/O pins in high-impedance state and tied to VDD or VSS and all features that add delta
current disabled (such as WDT, Timer1 oscillator, etc.).
The supply current is mainly a function of operating voltage, frequency and mode. Other factors, such as I/O pin loading
and switching rate, oscillator type and circuit, internal code execution pattern and temperature, also have an impact on
the current consumption.
The test conditions for all IDD measurements in active operation mode are:
OSC1 = external square wave, from rail-to-rail; all I/O pins tri-stated, pulled to VDD;
MCLR = VDD; WDT enabled/disabled as specified.
Standard, low-cost 32 kHz crystals have an operating temperature range of -10C to +70C. Extended temperature
crystals are available at a much higher cost.
Voltage regulator disabled (ENVREG = 0, tied to VSS).
Voltage regulator enabled (ENVREG = 1, tied to VDD).
For IETH, the specified current includes current sunk through TPOUT+ and TPOUT-. LEDA and LEDB are disabled for
all testing.
Preliminary
DS39762B-page 415
PIC18F97J60 FAMILY
27.2
DC Characteristics:
PIC18F97J60 Family
(Industrial)
Param
No.
Device
Typ
Max
Units
Conditions
0.8
1.5
mA
-40C
0.8
1.5
mA
+25C
0.9
1.7
mA
+85C
1.1
1.8
mA
-40C
1.1
1.8
mA
+25C
1.2
2.0
mA
+85C
2.1
3.4
mA
-40C
2.0
3.4
mA
+25C
2.1
3.4
mA
+85C
All devices
All devices
All devices
All devices
All devices
All devices
Note 1:
2:
3:
4:
5:
6:
9.2
14.5
mA
-40C
9.0
14.5
mA
+25C
9.2
14.5
mA
+85C
13.0
18.4
mA
-40C
12.4
18.4
mA
+25C
13.0
18.4
mA
+85C
13.4
19.8
mA
-40C
13.0
19.8
mA
+25C
13.4
19.8
mA
+85C
14.5
21.6
mA
-40C
14.4
21.6
mA
+25C
14.5
21.6
mA
+85C
VDD = 2.0V,
VDDCORE = 2.0V(4)
VDD = 2.5V,
VDDCORE = 2.5V(4)
FOSC = 1 MHZ
(PRI_RUN mode,
EC oscillator)
VDD = 3.3V(5)
VDD = 2.5V,
VDDCORE = 2.5V(4)
VDD = 3.3V(5)
VDD = 2.5V,
VDDCORE = 2.5V(4)
FOSC = 25 MHz
(PRI_RUN mode,
EC oscillator)
VDD = 3.3V(5)
The power-down current in Sleep mode does not depend on the oscillator type. Power-down current is measured with
the part in Sleep mode, with all I/O pins in high-impedance state and tied to VDD or VSS and all features that add delta
current disabled (such as WDT, Timer1 oscillator, etc.).
The supply current is mainly a function of operating voltage, frequency and mode. Other factors, such as I/O pin loading
and switching rate, oscillator type and circuit, internal code execution pattern and temperature, also have an impact on
the current consumption.
The test conditions for all IDD measurements in active operation mode are:
OSC1 = external square wave, from rail-to-rail; all I/O pins tri-stated, pulled to VDD;
MCLR = VDD; WDT enabled/disabled as specified.
Standard, low-cost 32 kHz crystals have an operating temperature range of -10C to +70C. Extended temperature
crystals are available at a much higher cost.
Voltage regulator disabled (ENVREG = 0, tied to VSS).
Voltage regulator enabled (ENVREG = 1, tied to VDD).
For IETH, the specified current includes current sunk through TPOUT+ and TPOUT-. LEDA and LEDB are disabled for
all testing.
DS39762B-page 416
Preliminary
PIC18F97J60 FAMILY
27.2
DC Characteristics:
PIC18F97J60 Family
(Industrial)
Param
No.
Device
Typ
Max
Units
Conditions
2.8
5.2
mA
-40C
2.5
5.2
mA
+25C
2.8
5.2
mA
+85C
All devices
All devices
All devices
All devices
All devices
All devices
All devices
Note 1:
2:
3:
4:
5:
6:
3.6
6.4
mA
-40C
3.3
6.4
mA
+25C
3.6
6.4
mA
+85C
6.4
11.0
mA
-40C
6.0
11.0
mA
+25C
6.4
11.0
mA
+85C
7.8
12.5
mA
-40C
7.4
12.5
mA
+25C
7.8
12.5
mA
+85C
9.2
14.5
mA
-40C
9.0
14.5
mA
+25C
9.2
14.5
mA
+85C
13.0
18.4
mA
-40C
12.4
18.4
mA
+25C
13.0
18.4
mA
+85C
13.4
19.8
mA
-40C
13.0
19.8
mA
+25C
13.4
19.8
mA
+85C
14.5
21.6
mA
-40C
14.4
21.6
mA
+25C
14.5
21.6
mA
+85C
VDD = 2.5V,
VDDCORE = 2.5V(4)
FOSC = 25 MHZ,
2.7778 MHz internal
(PRI_RUN HS mode)
VDD = 3.3V(5)
VDD = 2.5V,
VDDCORE = 2.5V(4)
FOSC = 25 MHZ,
13.8889 MHz internal
(PRI_RUN HSPLL mode)
VDD = 3.3V(5)
VDD = 2.5V,
VDDCORE = 2.5V(4)
FOSC = 25 MHZ,
25 MHz internal
(PRI_RUN HS mode)
VDD = 3.3V(5)
VDD = 2.5V,
VDDCORE = 2.5V(4)
FOSC = 25 MHZ,
41.6667 MHz internal
(PRI_RUN HSPLL mode)
VDD = 3.3V(5)
The power-down current in Sleep mode does not depend on the oscillator type. Power-down current is measured with
the part in Sleep mode, with all I/O pins in high-impedance state and tied to VDD or VSS and all features that add delta
current disabled (such as WDT, Timer1 oscillator, etc.).
The supply current is mainly a function of operating voltage, frequency and mode. Other factors, such as I/O pin loading
and switching rate, oscillator type and circuit, internal code execution pattern and temperature, also have an impact on
the current consumption.
The test conditions for all IDD measurements in active operation mode are:
OSC1 = external square wave, from rail-to-rail; all I/O pins tri-stated, pulled to VDD;
MCLR = VDD; WDT enabled/disabled as specified.
Standard, low-cost 32 kHz crystals have an operating temperature range of -10C to +70C. Extended temperature
crystals are available at a much higher cost.
Voltage regulator disabled (ENVREG = 0, tied to VSS).
Voltage regulator enabled (ENVREG = 1, tied to VDD).
For IETH, the specified current includes current sunk through TPOUT+ and TPOUT-. LEDA and LEDB are disabled for
all testing.
Preliminary
DS39762B-page 417
PIC18F97J60 FAMILY
27.2
DC Characteristics:
PIC18F97J60 Family
(Industrial)
Param
No.
Device
Typ
Max
Units
Conditions
0.5
1.1
mA
-40C
0.5
1.1
mA
+25C
0.6
1.2
mA
+85C
0.9
1.4
mA
-40C
0.9
1.4
mA
+25C
1.0
1.5
mA
+85C
1.9
2.6
mA
-40C
1.8
2.6
mA
+25C
1.9
2.6
mA
+85C
All devices
All devices
All devices
All devices
All devices
All devices
Note 1:
2:
3:
4:
5:
6:
5.9
9.5
mA
-40C
5.6
9.5
mA
+25C
5.9
9.5
mA
+85C
7.5
13.2
mA
-40C
7.2
13.2
mA
+25C
7.5
13.2
mA
+85C
8.6
14.0
mA
-40C
8.0
14.0
mA
+25C
8.6
14.0
mA
+85C
9.8
16.0
mA
-40C
9.4
16.0
mA
+25C
9.8
16.0
mA
+85C
VDD = 2.0V,
VDDCORE = 2.0V(4)
VDD = 2.5V,
VDDCORE = 2.5V(4)
FOSC = 1 MHz
(PRI_IDLE mode,
EC oscillator)
VDD = 3.3V(5)
VDD = 2.5V,
VDDCORE = 2.5V(4)
FOSC = 25 MHZ
(PRI_IDLE mode,
EC oscillator)
VDD = 3.3V(5)
VDD = 2.5V,
VDDCORE = 2.5V(4)
VDD = 3.3V(5)
The power-down current in Sleep mode does not depend on the oscillator type. Power-down current is measured with
the part in Sleep mode, with all I/O pins in high-impedance state and tied to VDD or VSS and all features that add delta
current disabled (such as WDT, Timer1 oscillator, etc.).
The supply current is mainly a function of operating voltage, frequency and mode. Other factors, such as I/O pin loading
and switching rate, oscillator type and circuit, internal code execution pattern and temperature, also have an impact on
the current consumption.
The test conditions for all IDD measurements in active operation mode are:
OSC1 = external square wave, from rail-to-rail; all I/O pins tri-stated, pulled to VDD;
MCLR = VDD; WDT enabled/disabled as specified.
Standard, low-cost 32 kHz crystals have an operating temperature range of -10C to +70C. Extended temperature
crystals are available at a much higher cost.
Voltage regulator disabled (ENVREG = 0, tied to VSS).
Voltage regulator enabled (ENVREG = 1, tied to VDD).
For IETH, the specified current includes current sunk through TPOUT+ and TPOUT-. LEDA and LEDB are disabled for
all testing.
DS39762B-page 418
Preliminary
PIC18F97J60 FAMILY
27.2
DC Characteristics:
PIC18F97J60 Family
(Industrial)
Param
No.
Device
Typ
Max
Units
Conditions
22.0
45.0
-10C
22.0
45.0
+25C
78.0
114.0
+70C
27.0
52.0
-10C
27.0
52.0
+25C
+70C
All devices
92.0
135.0
168.0
-10C
106.0
168.0
+25C
188.0
246.0
+70C
All devices
All devices
All devices
Note 1:
2:
3:
4:
5:
6:
18.0
37.0
-10C
18.0
37.0
+25C
75.0
105.0
+70C
21.0
40.0
-10C
21.0
40.0
+25C
84.0
98.0
+70C
94.0
152.0
-10C
94.0
152.0
+25C
182.0
225.0
+70C
VDD = 2.0V,
VDDCORE = 2.0V(4)
VDD = 2.5V,
VDDCORE = 2.5V(4)
FOSC = 32 kHz(3)
(SEC_RUN mode,
Timer1 as clock)
VDD = 3.3V(5)
VDD = 2.0V,
VDDCORE = 2.0V(4)
VDD = 2.5V,
VDDCORE = 2.5V(4)
FOSC = 32 kHz(3)
(SEC_IDLE mode,
Timer1 as clock)
VDD = 3.3V(5)
The power-down current in Sleep mode does not depend on the oscillator type. Power-down current is measured with
the part in Sleep mode, with all I/O pins in high-impedance state and tied to VDD or VSS and all features that add delta
current disabled (such as WDT, Timer1 oscillator, etc.).
The supply current is mainly a function of operating voltage, frequency and mode. Other factors, such as I/O pin loading
and switching rate, oscillator type and circuit, internal code execution pattern and temperature, also have an impact on
the current consumption.
The test conditions for all IDD measurements in active operation mode are:
OSC1 = external square wave, from rail-to-rail; all I/O pins tri-stated, pulled to VDD;
MCLR = VDD; WDT enabled/disabled as specified.
Standard, low-cost 32 kHz crystals have an operating temperature range of -10C to +70C. Extended temperature
crystals are available at a much higher cost.
Voltage regulator disabled (ENVREG = 0, tied to VSS).
Voltage regulator enabled (ENVREG = 1, tied to VDD).
For IETH, the specified current includes current sunk through TPOUT+ and TPOUT-. LEDA and LEDB are disabled for
all testing.
Preliminary
DS39762B-page 419
PIC18F97J60 FAMILY
27.2
DC Characteristics:
PIC18F97J60 Family
(Industrial)
Param
No.
D022
(IWDT)
Device
D027
IETH(6)
4:
5:
6:
Units
Conditions
VDD = 2.0V,
VDDCORE = 2.0V(4)
7.0
19.0
8.0
A
A
A
+25C
+85C
-40C
3.0
14.0
5.0
5.0
19.0
12.0
8.0
22.0
12.0
12.0
30.0
20.0
A
A
A
A
A
A
+25C
+85C
-40C
+25C
+85C
-40C
12.0
24.0
13.0
20.0
36.0
21.0
A
A
A
+25C
+85C
-40C
13.0
26.0
14.0
14.0
29.0
21.0
38.0
25.0
25.0
40.0
A
A
A
A
A
+25C
+85C
-40C
+25C
+85C
1.2
10.0
-40C to +85C
VDD = 2.0V,
VDDCORE = 2.0V(4)
1.2
10.0
-40C to +85C
1.2
Ethernet Module 130.0
11.0
156.0
A
mA
-40C to +85C
-40C to +85C
180.0
214.0
mA
-40C to +85C
A/D Converter
3:
Max
2.4
12.0
3.0
Timer1 Oscillator
D026
(IAD)
2:
Typ
D025
(IOSCB)
Note 1:
VDD = 2.5V,
VDDCORE = 2.5V(4)
VDD = 3.3V(5)
VDD = 2.0V,
32 kHz on Timer1(3)
VDDCORE = 2.0V(4)
VDD = 2.5V,
32 kHz on Timer1(3)
VDDCORE = 2.5V(4)
VDD = 3.3V(5)
32 kHz on Timer1(3)
VDD = 3.3V(5)
VDD = 3.3V(5)
No transmit activity
Transmission in progress
The power-down current in Sleep mode does not depend on the oscillator type. Power-down current is measured with
the part in Sleep mode, with all I/O pins in high-impedance state and tied to VDD or VSS and all features that add delta
current disabled (such as WDT, Timer1 oscillator, etc.).
The supply current is mainly a function of operating voltage, frequency and mode. Other factors, such as I/O pin loading
and switching rate, oscillator type and circuit, internal code execution pattern and temperature, also have an impact on
the current consumption.
The test conditions for all IDD measurements in active operation mode are:
OSC1 = external square wave, from rail-to-rail; all I/O pins tri-stated, pulled to VDD;
MCLR = VDD; WDT enabled/disabled as specified.
Standard, low-cost 32 kHz crystals have an operating temperature range of -10C to +70C. Extended temperature
crystals are available at a much higher cost.
Voltage regulator disabled (ENVREG = 0, tied to VSS).
Voltage regulator enabled (ENVREG = 1, tied to VDD).
For IETH, the specified current includes current sunk through TPOUT+ and TPOUT-. LEDA and LEDB are disabled for
all testing.
DS39762B-page 420
Preliminary
PIC18F97J60 FAMILY
27.3
DC CHARACTERISTICS
Param
Symbol
No.
VIL
Characteristic
Min
Max
Units
Conditions
D030
D031
VSS
0.15VDD
VDD <2.7V
VSS
0.8
VSS
0.2 VDD
D032
MCLR
VSS
0.2 VDD
D033
OSC1
VSS
0.3 VDD
D033A
OSC1
VSS
0.2 VDD
EC mode
D034
T13CKI
VSS
0.3
VDD
0.8 VDD
VDD
5.5
VIH
D040
D041
0.8 VDD
5.5
D042
MCLR
0.8 VDD
VDD
D043
OSC1
0.7 VDD
VDD
D043A
OSC1
0.8 VDD
VDD
EC mode
1.6
VDD
D044
T13CKI
IIL
D060
I/O ports
D061
MCLR
OSC1
80
400
D063
D070
Note 1:
IPU
IPURB
Preliminary
DS39762B-page 421
PIC18F97J60 FAMILY
27.3
DC CHARACTERISTICS
Param
Symbol
No.
VOL
D080
Characteristic
Min
Max
Units
Conditions
PORTA<1:0>, PORTD,
PORTE, PORTJ
0.4
PORTA<5:2>, PORTF,
PORTG, PORTH
0.4
PORTB, PORTC
0.4
OSC2/CLKO
(EC, ECPLL modes)
0.4
PORTA<1:0>, PORTD,
PORTE, PORTJ
2.4
PORTA<5:2>, PORTF,
PORTG, PORTH
2.4
PORTB, PORTC
2.4
OSC2/CLKO
(EC, ECPLL modes)
2.4
15
pF
In HS mode when
external clock is used to
drive OSC1
D083
VOH
D090
D092
D101
CIO
50
pF
D102
CB
SCLx, SDAx
400
pF
I2C specification
Note 1:
DS39762B-page 422
Preliminary
PIC18F97J60 FAMILY
TABLE 27-1:
DC CHARACTERISTICS
Param
No.
Sym
Characteristic
Min
Typ
Max
Units
Conditions
EP
Cell Endurance
100
1K
D131
VPR
VMIN
3.6
D132B VPEW
VMIN
3.6
D133A TIW
D134
D135
IDDP
2.8
20
ms
10
mA
Data in Typ column is at 3.3V, 25C unless otherwise stated. These parameters are for design guidance
only and are not tested.
Preliminary
DS39762B-page 423
PIC18F97J60 FAMILY
TABLE 27-2:
COMPARATOR SPECIFICATIONS
Operating Conditions: 3.0V VDD 3.6V, -40C TA +85C (unless otherwise stated)
Param
No.
Sym
Characteristics
Min
Typ
Max
Units
D300
VIOFF
5.0
10
mV
D301
VICM
AVDD 1.5
D302
CMRR
55
dB
300
TRESP
Response Time(1)*
150
400
ns
301
TMC2OV
10
*
Note 1:
Comments
TABLE 27-3:
Operating Conditions: 3.0V VDD 3.6V, -40C TA +85C (unless otherwise stated)
Param
No.
Sym
Characteristics
Min
Typ
Max
Units
D310
VRES
Resolution
VDD/24
VDD/32
LSb
D311
VRAA
Absolute Accuracy
1/2
LSb
D312
VRUR
2k
TSET
Time(1)
10
310
Note 1:
Settling
Comments
Settling time measured while CVRR = 1 and CVR3:CVR0 transitions from 0000 to 1111.
TABLE 27-4:
Sym
Characteristics
Min
Typ
Max
Units
VRGOUT
2.5
CF
10
DS39762B-page 424
Preliminary
Comments
PIC18F97J60 FAMILY
27.4
27.4.1
AC (Timing) Characteristics
TIMING PARAMETER SYMBOLOGY
3. TCC:ST
4. Ts
Time
osc
rd
rw
sc
ss
t0
t1
wr
OSC1
RD
RD or WR
SCKx
SSx
T0CKI
T13CKI
WR
P
R
V
Z
Period
Rise
Valid
High-Impedance
High
Low
High
Low
SU
Setup
STO
Stop condition
Preliminary
DS39762B-page 425
PIC18F97J60 FAMILY
27.4.2
TIMING CONDITIONS
TABLE 27-5:
AC CHARACTERISTICS
FIGURE 27-3:
Load Condition 2
VDD/2
RL
CL
Pin
CL
Pin
VSS
VSS
RL = 464
DS39762B-page 426
CL = 50 pF
CL = 15 pF
for OSC2/CLKO
Preliminary
PIC18F97J60 FAMILY
27.4.3
FIGURE 27-4:
Q1
Q2
Q3
Q4
Q1
OSC1
1
CLKO
TABLE 27-6:
Param.
No.
1A
1
Symbol
FOSC
TOSC
Characteristic
Min
Max
Units
Conditions
DC
41.6667
MHz
EC Oscillator mode
Oscillator Frequency(1)
25
MHz
HS Oscillator mode
24
ns
EC Oscillator mode
Oscillator Period(1)
40
167
ns
HS Oscillator mode
Time(1)
TCY
Instruction Cycle
96
ns
TOSL,
TOSH
10
ns
EC Oscillator mode
TOSR,
TOSF
7.5
ns
EC Oscillator mode
50
ppm
5
Note 1:
Instruction cycle period (TCY) equals four times the input oscillator time base period for all configurations
except PLL. All specified values are based on characterization data for that particular oscillator type under
standard operating conditions with the device executing code. Exceeding these specified limits may result
in an unstable oscillator operation and/or higher than expected current consumption. All devices are tested
to operate at min. values with an external clock applied to the OSC1/CLKI pin. When an external clock
input is used, the max. cycle time limit is DC (no clock) for all devices.
Preliminary
DS39762B-page 427
PIC18F97J60 FAMILY
TABLE 27-7:
Param
No.
Sym
Characteristic
Min
Typ
Max
Units
Conditions
F10
8
8
25
37.5
F11
FSYS
20
62.5
MHz
F12
trc
ms
F13
CLK
-2
+2
Data in Typ column is at 3.3V, 25C, unless otherwise stated. These parameters are for design guidance
only and are not tested.
TABLE 27-8:
Param
No.
Note 1:
Characteristic
Min
Typ
Max
Units
21.7
40.3
kHz
Conditions
DS39762B-page 428
Preliminary
PIC18F97J60 FAMILY
FIGURE 27-5:
Q4
Q2
Q3
OSC1
11
10
CLKO
13
12
18
19
14
16
I/O pin
(Input)
15
17
I/O pin
(Output)
New Value
Old Value
20, 21
Note:
TABLE 27-9:
Param
No.
Symbol
Characteristic
Min
Typ
Max
Units Conditions
10
75
200
ns
11
75
200
ns
12
TCKR
15
30
ns
13
TCKF
15
30
ns
0.5 TCY + 20
ns
0.25 TCY + 25
ns
14
15
16
TCKH2IOI
17
ns
50
150
ns
18
TOSH2IOI
100
ns
19
ns
20
TIOR
ns
21
TIOF
ns
22
TINP
TCY
ns
TRBP
TCY
ns
23
These parameters are asynchronous events not related to any internal clock edges.
Preliminary
DS39762B-page 429
PIC18F97J60 FAMILY
FIGURE 27-6:
Q2
Q3
Q4
Q1
Q2
OSC1
A<19:16>
BA0
AD<15:0>
Address
Address
Address
150
151
Address
163
160
162
161
155
166
167
168
ALE
164
169
171
CE
171A
OE
165
Operating Conditions: 2.0V < VCC < 3.6V, -40C < TA < +125C unless otherwise stated.
Symbol
Characteristics
Min
Typ
Max
Units
0.25 TCY 10
ns
150
TadV2alL
151
TalL2adl
ns
155
TalL2oeL
ALE to OE
10
0.125 TCY
ns
160
TadZ2oeL
ns
161
ToeH2adD OE to AD Driven
162
0.125 TCY 5
ns
20
ns
163
ToeH2adl
ns
164
TalH2alL
TCY
ns
165
0.5 TCY 5
0.5 TCY
ns
166
TalH2alH
0.25 TCY
ns
167
Tacc
0.75 TCY 25
ns
168
Toe
OE to Data Valid
0.5 TCY 25
ns
169
TalL2oeH
ALE to OE
0.625 TCY 10
0.625 TCY + 10
ns
171
TalH2csL
0.25 TCY 20
ns
171A
10
ns
DS39762B-page 430
Preliminary
PIC18F97J60 FAMILY
FIGURE 27-7:
Q2
Q3
Q4
Q1
Q2
OSC1
A<19:16>
BA0
Address
Address
166
Data
Address
AD<15:0>
Address
153
150
156
151
ALE
171
CE
171A
154
WRH or
WRL
157A
157
UB or
LB
Operating Conditions: 2.0V < VCC < 3.6V, -40C < TA < +125C unless otherwise stated.
Symbol
Characteristics
Min
Typ
Max
Units
0.25 TCY 10
ns
150
TadV2alL
151
TalL2adl
ns
153
TwrH2adl
ns
154
TwrL
0.5 TCY 5
0.5 TCY
ns
156
0.5 TCY 10
ns
157
0.25 TCY
ns
157A
TwrH2bsI
0.125 TCY 5
ns
166
TalH2alH
0.25 TCY
ns
171
TalH2csL
0.25 TCY 20
ns
171A
10
ns
Preliminary
DS39762B-page 431
PIC18F97J60 FAMILY
FIGURE 27-8:
VDD
MCLR
30
Internal
POR
33
PWRT
Time-out
32
Oscillator
Time-out
Internal
Reset
Watchdog
Timer
Reset
31
34
34
I/O pins
Note:
TABLE 27-12: RESET, WATCHDOG TIMER, OSCILLATOR START-UP TIMER, POWER-UP TIMER
AND BROWN-OUT RESET REQUIREMENTS
Param.
Symbol
No.
Characteristic
Min
Typ
Max
Units
4.1
5.4
ms
30
TMCL
31
TWDT
2.8
1024 TOSC
1024 TOSC
46.2
66
85.8
ms
Conditions
32
TOST
33
TPWRT
34
TIOZ
3TCY + 2
415
200
38
TCSD
DS39762B-page 432
Preliminary
PIC18F97J60 FAMILY
FIGURE 27-9:
41
40
42
T1OSO/T13CKI
46
45
47
48
TMR0 or
TMR1
Note:
Symbol
Characteristic
40
TT0H
41
TT0L
42
TT0P
T0CKI Period
No prescaler
With prescaler
No prescaler
With prescaler
No prescaler
With prescaler
45
46
47
TT1H
TT1L
Max
Units
0.5 TCY + 20
ns
10
ns
0.5 TCY + 20
ns
10
ns
TCY + 10
ns
Greater of:
20 ns or
(TCY + 40)/N
ns
0.5 TCY + 20
ns
10
ns
Asynchronous
30
ns
0.5 TCY + 5
ns
10
ns
Asynchronous
30
ns
Greater of:
20 ns or
(TCY + 40)/N
ns
TT1P
FT 1
Asynchronous
48
Min
Preliminary
60
ns
DC
50
kHz
2 TOSC
7 TOSC
Conditions
N = prescale
value
(1, 2, 4,..., 256)
N = prescale
value
(1, 2, 4, 8)
DS39762B-page 433
PIC18F97J60 FAMILY
FIGURE 27-10:
50
51
52
CCPx
(Compare or PWM Mode)
53
Note:
54
TCCL
TCCH
Characteristic
Min
Max
Units
0.5 TCY + 20
ns
10
ns
CCPx Input
High Time
0.5 TCY + 20
ns
10
ns
3 TCY + 40
N
ns
No prescaler
With prescaler
52
TCCP
53
TCCR
25
ns
54
TCCF
25
ns
Conditions
N = prescale
value (1, 4 or 16)
Symbol
TdtV2wrH
Characteristic
Min
Max
Units
20
ns
63
TwrH2dtI
20
ns
64
TrdL2dtV
80
ns
65
TrdH2dtI
RD or CS to DataOut Invalid
10
30
ns
66
TibfINH
3 TCY
DS39762B-page 434
Preliminary
Conditions
PIC18F97J60 FAMILY
FIGURE 27-11:
SCKx
(CKP = 0)
78
79
79
78
SCKx
(CKP = 1)
80
bit 6 - - - - - - 1
MSb
SDOx
LSb
75, 76
SDIx
MSb In
bit 6 - - - - 1
LSb In
74
73
Note:
Symbol
Characteristic
Min
Max Units
73
TDIV2SCH,
TDIV2SCL
100
ns
74
TSCH2DIL,
TSCL2DIL
100
ns
75
TDOR
25
ns
76
TDOF
25
ns
78
TSCR
25
ns
79
TSCF
25
ns
80
50
ns
Preliminary
Conditions
DS39762B-page 435
PIC18F97J60 FAMILY
FIGURE 27-12:
SCKx
(CKP = 0)
79
73
SCKx
(CKP = 1)
80
78
MSb
SDOx
bit 6 - - - - - - 1
LSb
bit 6 - - - - 1
LSb In
75, 76
SDIx
MSb In
74
Note:
Symbol
Characteristic
Min
Max Units
73
TDIV2SCH,
TDIV2SCL
100
ns
74
TSCH2DIL,
TSCL2DIL
100
ns
75
TDOR
25
ns
76
TDOF
25
ns
78
TSCR
25
ns
79
TSCF
25
ns
80
50
ns
81
TCY
ns
DS39762B-page 436
Preliminary
Conditions
PIC18F97J60 FAMILY
FIGURE 27-13:
SSx
70
SCKx
(CKP = 0)
83
71
72
SCKx
(CKP = 1)
80
MSb
SDOx
bit 6 - - - - - - 1
LSb
75, 76
MSb In
SDIx
SDI
77
bit 6 - - - - 1
LSb In
74
73
Note:
TABLE 27-18: EXAMPLE SPI MODE REQUIREMENTS (SLAVE MODE TIMING, CKE = 0)
Param
No.
Symbol
Characteristic
70
71
TSCH
TSCL
Continuous
71A
72
Min
72A
TCY
ns
1.25 TCY + 30
ns
Single Byte
40
ns
Continuous
1.25 TCY + 30
ns
Single Byte
40
ns
100
ns
73
73A
TB2B
74
75
TDOR
76
TDOF
Last Clock Edge of Byte 1 to the First Clock Edge of Byte 2 1.5 TCY + 40
ns
100
ns
25
ns
25
ns
77
10
50
ns
80
50
ns
83
1.5 TCY + 40
ns
Note 1:
2:
(Note 1)
(Note 1)
(Note 2)
Preliminary
DS39762B-page 437
PIC18F97J60 FAMILY
FIGURE 27-14:
SSx
SCKx
(CKP = 0)
70
83
71
72
SCKx
(CKP = 1)
80
MSb
SDOx
bit 6 - - - - - - 1
LSb
75, 76
SDI
SDIx
MSb In
77
bit 6 - - - - 1
LSb In
74
Note:
Symbol
Characteristic
Min
70
71
TSCH
TSCL
73A
TB2B
Last Clock Edge of Byte 1 to the First Clock Edge of Byte 2 1.5 TCY + 40
74
75
TDOR
76
TDOF
25
ns
77
10
50
ns
80
50
ns
82
50
ns
83
1.5 TCY + 40
ns
72A
Note 1:
2:
ns
1.25 TCY + 30
ns
Single Byte
40
ns
Continuous
1.25 TCY + 30
ns
Single Byte
40
ns
(Note 1)
ns
(Note 2)
100
ns
25
ns
Continuous
71A
72
TCY
(Note 1)
DS39762B-page 438
Preliminary
PIC18F97J60 FAMILY
FIGURE 27-15:
SCLx
91
93
90
92
SDAx
Stop
Condition
Start
Condition
Note:
TSU:STA
THD:STA
TSU:STO
Characteristic
Max
Units
Conditions
ns
ns
Start Condition
4700
Setup Time
600
Start Condition
4000
Hold Time
600
Stop Condition
4700
Setup Time
600
4000
600
FIGURE 27-16:
Min
ns
ns
102
100
101
SCLx
90
106
107
91
92
SDAx
In
110
109
109
SDAx
Out
Note:
Preliminary
DS39762B-page 439
PIC18F97J60 FAMILY
TABLE 27-21: I2C BUS DATA REQUIREMENTS (SLAVE MODE)
Param.
Symbol
No.
100
THIGH
101
TLOW
102
TR
103
TF
90
91
106
Characteristic
Clock High Time
110
2:
0.6
MSSP module
1.5 TCY
4.7
1.3
1.5 TCY
1000
ns
300
ns
300
ns
300
ns
CB is specified to be from
10 to 400 pF
Only relevant for Repeated
Start condition
0.6
4.0
0.6
CB
Note 1:
4.0
TBUF
D102
TAA
Conditions
MSSP module
ns
0.9
250
ns
100
ns
4.7
0.6
3500
ns
ns
109
Units
92
Max
107
Min
4.7
1.3
400
pF
CB is specified to be from
10 to 400 pF
(Note 2)
(Note 1)
Time the bus must be free
before a new transmission
can start
As a transmitter, the device must provide this internal minimum delay time to bridge the undefined region
(min. 300 ns) of the falling edge of SCLx to avoid unintended generation of Start or Stop conditions.
A Fast mode I2C bus device can be used in a Standard mode I2C bus system, but the requirement,
TSU:DAT 250 ns, must then be met. This will automatically be the case if the device does not stretch the
LOW period of the SCLx signal. If such a device does stretch the LOW period of the SCLx signal, it must
output the next data bit to the SDAx line,
TR max. + TSU:DAT = 1000 + 250 = 1250 ns (according to the Standard mode I2C bus specification), before
the SCLx line is released.
DS39762B-page 440
Preliminary
PIC18F97J60 FAMILY
FIGURE 27-17:
SCLx
93
91
90
92
SDAx
Stop
Condition
Start
Condition
Note:
TSU:STA
Characteristic
2(TOSC)(BRG + 1)
mode(1)
2(TOSC)(BRG + 1)
2(TOSC)(BRG + 1)
2(TOSC)(BRG + 1)
1 MHz mode(1)
2(TOSC)(BRG + 1)
Stop Condition
2(TOSC)(BRG + 1)
Setup Time
2(TOSC)(BRG + 1)
mode(1)
2(TOSC)(BRG + 1)
2(TOSC)(BRG + 1)
2(TOSC)(BRG + 1)
1 MHz mode(1)
2(TOSC)(BRG + 1)
2C
FIGURE 27-18:
ns
Setup Time
Hold Time
Note 1:
1 MHz
93
ns
2(TOSC)(BRG + 1)
Hold Time
92
Units
TSU:STO
Max
Start Condition
1 MHz
91
Min
Conditions
ns
ns
pins.
102
100
101
SCLx
90
106
91
107
92
SDAx
In
109
109
110
SDAx
Out
Note:
Preliminary
DS39762B-page 441
PIC18F97J60 FAMILY
TABLE 27-23: MASTER SSP I2C BUS DATA REQUIREMENTS
Param.
Symbol
No.
100
101
THIGH
TLOW
Characteristic
Min
Max
Units
2(TOSC)(BRG + 1)
ms
2(TOSC)(BRG + 1)
ms
1 MHz mode(1)
2(TOSC)(BRG + 1)
ms
2(TOSC)(BRG + 1)
ms
2(TOSC)(BRG + 1)
ms
(1)
2(TOSC)(BRG + 1)
ms
1000
ns
20 + 0.1 CB
300
ns
300
ns
1 MHz mode
102
TR
103
90
91
106
107
92
109
110
D102
TF
TSU:STA
TSU:DAT
Data Input
Setup Time
TAA
TBUF
CB
Output Valid
from Clock
300
ns
20 + 0.1 CB
300
ns
1 MHz mode(1)
100
ns
2(TOSC)(BRG + 1)
ms
2(TOSC)(BRG + 1)
ms
1 MHz mode(1)
2(TOSC)(BRG + 1)
ms
2(TOSC)(BRG + 1)
ms
2(TOSC)(BRG + 1)
ms
1 MHz mode(1)
2(TOSC)(BRG + 1)
ms
ns
0.9
ms
1 MHz mode(1)
TBD
ns
250
ns
100
ns
1 MHz mode(1)
TBD
ns
2(TOSC)(BRG + 1)
ms
2(TOSC)(BRG + 1)
ms
1 MHz mode(1)
2(TOSC)(BRG + 1)
ms
3500
ns
1000
ns
(1)
1 MHz mode
ns
4.7
ms
1.3
ms
1 MHz mode(1)
TBD
ms
400
pF
Conditions
CB is specified to be from
10 to 400 pF
CB is specified to be from
10 to 400 pF
(Note 2)
DS39762B-page 442
Preliminary
PIC18F97J60 FAMILY
FIGURE 27-19:
TXx/CKx
pin
121
121
RXx/DTx
pin
120
Note:
122
Symbol
Characteristic
Min
Max
Units
40
ns
121
TCKRF
20
ns
122
TDTRF
20
ns
FIGURE 27-20:
Conditions
TXx/CKx
pin
125
RXx/DTx
pin
126
Note:
Symbol
Characteristic
125
126
TCKL2DTL
Preliminary
Min
Max
Units
10
ns
15
ns
Conditions
DS39762B-page 443
PIC18F97J60 FAMILY
TABLE 27-26: A/D CONVERTER CHARACTERISTICS: PIC18F97J60 FAMILY (INDUSTRIAL)
Param
Symbol
No.
Characteristic
Min
Typ
Max
Units
10
bit
Conditions
VREF 2.0V
A01
NR
Resolution
A03
EIL
<1
A04
EDL
<1
A06
EOFF
Offset Error
<3
A07
EGN
Gain Error
<3
A10
Monotonicity
A20
VREF
Guaranteed(1)
1.8
3
V
V
AVDD + 0.5
A21
VREFH
VREFL
AVDD
A22
VREFL
AVSS
VREFH
A25
VAIN
VREFL
VREFH
A30
ZAIN
Recommended Impedance of
Analog Voltage Source
2.5
A50
IREF
5
1000
A
A
Note 1:
2:
The A/D conversion result never decreases with an increase in the input voltage and has no missing
codes.
VREFH current is from RA3/AN3/VREF+ pin or AVDD, whichever is selected as the VREFH source.
VREFL current is from RA2/AN2/VREF- pin or AVSS, whichever is selected as the VREFL source.
FIGURE 27-21:
BSF ADCON0, GO
(Note 2)
131
Q4
130
A/D CLK(1)
132
A/D DATA
...
...
OLD_DATA
ADRES
NEW_DATA
TCY
ADIF
GO
DONE
SAMPLING STOPPED
SAMPLE
Note
1:
If the A/D clock source is selected as RC, a time of TCY is added before the A/D clock starts. This allows the SLEEP instruction
to be executed.
2:
This is a minimal RC delay (typically 100 ns), which also disconnects the holding capacitor from the analog input.
DS39762B-page 444
Preliminary
PIC18F97J60 FAMILY
TABLE 27-27: A/D CONVERSION REQUIREMENTS
Param
Symbol
No.
Characteristic
Min
Max
Units
0.7
25.0(1)
130
TAD
TBD
131
TCNV
Conversion Time
(not including acquisition time) (Note 2)
11
12
TAD
s
132
TACQ
1.4
135
TSWC
(Note 4)
TBD
TDIS
Discharge Time
0.2
Legend:
Note 1:
2:
3:
4:
27.5
Conditions
-40C to +85C
TBD = To Be Determined
The time of the A/D clock period is dependent on the device frequency and the TAD clock divider.
ADRES registers may be read on the following TCY cycle.
The time for the holding capacitor to acquire the New input voltage when the voltage changes full scale
after the conversion (VDD to VSS or VSS to VDD). The source impedance (RS) on the input channels is 50.
On the following cycle of the device clock.
Min
Norm
Max
Units
1:1
1:1
Insertion Loss
-1.1
dB
Primary Inductance
350
Transformer Isolation
1.5
Differential to Common-Mode
Rejection
40
dB
Return Loss
-16
dB
Conditions
Preliminary
0.1 to 10 MHz
DS39762B-page 445
PIC18F97J60 FAMILY
NOTES:
DS39762B-page 446
Preliminary
PIC18F97J60 FAMILY
29.0
PACKAGING INFORMATION
29.1
64-Lead TQFP
Example
XXXXXXXXXX
XXXXXXXXXX
XXXXXXXXXX
YYWWNNN
18F67J60I/PT e3
0610017
80-Lead TQFP
Example
XXXXXXXXXXXX
XXXXXXXXXXXX
YYWWNNN
PIC18F87J60I/PT e3
0610017
100-Lead TQFP
Example
XXXXXXXXXXXX
XXXXXXXXXXXX
YYWWNNN
Legend: XX...X
Y
YY
WW
NNN
e3
Note:
PIC18F97J60I/PF e3
0610017
Customer-specific information
Year code (last digit of calendar year)
Year code (last 2 digits of calendar year)
Week code (week of January 1 is week 01)
Alphanumeric traceability code
Pb-free JEDEC designator for Matte Tin (Sn)
This package is Pb-free. The Pb-free JEDEC designator ( e3 )
can be found on the outer packaging for this package.
In the event the full Microchip part number cannot be marked on one line, it will
be carried over to the next line, thus limiting the number of available
characters for customer-specific information.
Preliminary
DS39762B-page 449
PIC18F97J60 FAMILY
29.2
Package Details
64-Lead Plastic Thin Quad Flatpack (PT) 10x10x1 mm Body, 1.0/0.10 mm Lead Form (TQFP)
Note:
For the most current package drawings, please see the Microchip Packaging Specification located at
http://www.microchip.com/packaging
E
E1
#leads=n1
D1
2
1
B
n
CH x 45
A2
A1
F
Units
Dimension Limits
n
p
INCHES
NOM
64
.020
16
.043
.039
.006
.024
.039 REF.
3.5
.472
.472
.394
.394
.007
.009
.035
10
10
Preliminary
MAX
MILLIMETERS*
NOM
64
0.50
16
1.00
1.10
0.95
1.00
0.05
0.15
0.45
0.60
1.00 REF.
0
3.5
11.75
12.00
11.75
12.00
9.90
10.00
9.90
10.00
0.13
0.18
0.17
0.22
0.64
0.89
5
10
5
10
MAX
Number of Pins
Pitch
Pins per Side
n1
Overall Height
A
.039
.047
1.20
Molded Package Thickness
A2
.037
.041
1.05
Standoff
A1
.002
.010
0.25
Foot Length
L
.018
.030
0.75
Footprint
F
0
7
7
Foot Angle
Overall Width
E
.463
.482
12.25
Overall Length
D
.463
.482
12.25
Molded Package Width
E1
.390
.398
10.10
Molded Package Length
D1
.390
.398
10.10
c
Lead Thickness
.005
.009
0.23
Lead Width
B
.007
.011
0.27
Pin 1 Corner Chamfer
CH
.025
.045
1.14
DS39762B-page 450
MIN
MIN
PIC18F97J60 FAMILY
80-Lead Plastic Thin Quad Flatpack (PT) 12x12x1 mm Body, 1.0/0.10 mm Lead Form (TQFP)
Note:
For the most current package drawings, please see the Microchip Packaging Specification located at
http://www.microchip.com/packaging
E
E1
#leads=n1
p
D1
2
1
B
n
CH x 45
A
L
Units
Dimension Limits
n
p
Number of Pins
Pitch
Pins per Side
Overall Height
Molded Package Thickness
Standoff
Foot Length
Footprint
Foot Angle
Overall Width
Overall Length
Molded Package Width
n1
A
A2
A1
L
F
E
D
E1
A2
A1
INCHES
NOM
80
.020 BSC
20
.039
.043
.037
.039
.002
.004
.018
.024
.039 REF.
0
3.5
.551 BSC
.551 BSC
.472 BSC
MIN
MAX
MILLIMETERS*
NOM
80
0.50 BSC
20
1.00
1.10
0.95
1.00
0.05
0.10
0.45
0.60
1.00 REF.
0
3.5
14.00 BSC
14.00 BSC
12.00 BSC
MIN
.047
.041
.006
.030
7
MAX
1.20
1.05
0.15
0.75
7
5
10
15
5
10
15
Mold Draft Angle Top
5
10
15
5
10
15
Mold Draft Angle Bottom
* Controlling Parameter
Notes:
Dimensions D1 and E1 do not include mold flash or protrusions. Mold flash or protrusions shall not exceed .010" (0.254mm) per side.
BSC: Basic Dimension. Theoretically exact value shown without tolerances.
See ASME Y14.5M
REF: Reference Dimension, usually without tolerance, for information purposes only.
See ASME Y14.5M
Revised 07-22-05
JEDEC Equivalent: MS-026
Drawing No. C04-092
Preliminary
DS39762B-page 451
PIC18F97J60 FAMILY
100-Lead Plastic Thin Quad Flatpack (PF) 14x14x1 mm Body, 1.0/0.10 mm Lead Form (TQFP)
Note:
For the most current package drawings, please see the Microchip Packaging Specification located at
http://www.microchip.com/packaging
E
E1
#leads=n1
D1
D
B
2
1
A2
F
MILLIMETERS*
INCHES
Units
Dimension Limits
A1
NOM
MIN
MAX
MIN
MAX
NOM
Pitch
n
p
100
.020 BSC
n1
A
25
A2
A1
.037
Foot Length
.018
Footprint
Foot Angle
.039 REF
3.5
0
Overall Width
.630 BSC
16.00 BSC
Overall Length
.630 BSC
16.00 BSC
E1
.551 BSC
14.00 BSC
D1
c
.551 BSC
Lead Width
Number of Pins
Standoff
100
0.50 BSC
25
1.20
.047
.039
.041
.006
0.95
0.05
.024
.030
0.45
.002
.004
.007
.009
1.05
0.15
0.60
0.75
1.00 REF
7
3.5
14.00 BSC
.008
0.09
.011
0.17
11
0.20
0.22
0.27
12
13
DS39762B-page 452
11
12
1.00
Preliminary
13
PIC18F97J60 FAMILY
28.0
DC AND AC
CHARACTERISTICS GRAPHS
AND TABLES
Preliminary
DS39762B-page 447
PIC18F97J60 FAMILY
NOTES:
DS39762B-page 448
Preliminary
PIC18F97J60 FAMILY
APPENDIX A:
REVISION HISTORY
APPENDIX B:
DEVICE
DIFFERENCES
Interrupt Sources
I/O Ports (Pins)
Enhanced USART Modules
PIC18F86J65
PIC18F87J60
PIC18F96J60
PIC18F96J65
PIC18F97J60
Program Memory
(Instructions)
PIC18F86J60
PIC18F67J60
Features
PIC18F66J65
TABLE B-1:
64K
96K
128K
64K
96K
128K
64K
96K
128K
32764
49148
65532
32764
49148
65532
32764
49148
65532
26
27
Ports A, B, C, D, E, F, G
(39)
29
Ports A, B, C, D, E, F, G, H, J Ports A, B, C, D, E, F, G, H, J
(55)
(70)
MSSP Modules
No
Yes
No
Yes
10-Bit Analog-to-Digital
Module
Packages
11 input channels
15 input channels
16 input channels
64-pin TQFP
80-pin TQFP
100-pin TQFP
Preliminary
DS39762B-page 453
PIC18F97J60 FAMILY
NOTES:
DS39762B-page 454
Preliminary
PIC18F97J60 FAMILY
INDEX
A
A/D ................................................................................... 323
A/D Converter Interrupt, Configuring ....................... 327
Acquisition Requirements ........................................ 328
ADCAL Bit ................................................................ 331
ADCON0 Register .................................................... 323
ADCON1 Register .................................................... 323
ADCON2 Register .................................................... 323
ADRESH Register ............................................ 323, 326
ADRESL Register .................................................... 323
Analog Port Pins, Configuring .................................. 329
Associated Registers ............................................... 331
Automatic Acquisition Time ...................................... 329
Configuring the Module ............................................ 327
Conversion Clock (TAD) ........................................... 329
Conversion Requirements ....................................... 445
Conversion Status
(GO/DONE Bit) ................................................ 326
Conversions ............................................................. 330
Converter Calibration ............................................... 331
Converter Characteristics ........................................ 444
Operation in Power-Managed Modes ...................... 331
Special Event Trigger (ECCP) ......................... 192, 330
Use of the ECCP2 Trigger ....................................... 330
Absolute Maximum Ratings ............................................. 411
AC (Timing) Characteristics ............................................. 425
Load Conditions for Device
Timing Specifications ....................................... 426
Parameter Symbology ............................................. 425
Temperature and Voltage
Specifications ................................................... 426
Timing Conditions .................................................... 426
Access Bank ...................................................................... 93
ACKSTAT ........................................................................ 288
ACKSTAT Status Flag ..................................................... 288
ADCAL Bit ........................................................................ 331
ADCON0 Register ............................................................ 323
GO/DONE Bit ........................................................... 326
ADCON1 Register ............................................................ 323
ADCON2 Register ............................................................ 323
ADDFSR .......................................................................... 400
ADDLW ............................................................................ 363
ADDULNK ........................................................................ 400
ADDWF ............................................................................ 363
ADDWFC ......................................................................... 364
ADRESH Register ............................................................ 323
ADRESL Register .................................................... 323, 326
Affected Instructions .......................................................... 91
Analog-to-Digital Converter. See A/D.
ANDLW ............................................................................ 364
ANDWF ............................................................................ 365
Assembler
MPASM Assembler .................................................. 408
B
Baud Rate Generator ....................................................... 284
BC .................................................................................... 365
BCF .................................................................................. 366
BF .................................................................................... 288
BF Status Flag ................................................................. 288
Block Diagrams
16-Bit Byte Select Mode .......................................... 111
16-Bit Byte Write Mode ............................................ 109
16-Bit Word Write Mode .......................................... 110
8-Bit Multiplexed Mode ............................................ 113
A/D ........................................................................... 326
Analog Input Model .................................................. 327
Baud Rate Generator .............................................. 284
Capture Mode Operation ......................................... 183
Comparator Analog Input Model .............................. 337
Comparator I/O Operating Modes ........................... 334
Comparator Output .................................................. 336
Comparator Voltage Reference ............................... 340
Comparator Voltage Reference
Output Buffer Example .................................... 341
Compare Mode Operation ....................................... 184
Connections for On-Chip Voltage Regulator ........... 352
Device Clock .............................................................. 39
Enhanced PWM ....................................................... 193
Ethernet Interrupt Logic ........................................... 224
Ethernet Module ...................................................... 205
EUSARTx Receive .................................................. 313
EUSARTx Transmit ................................................. 310
External Power-on Reset Circuit
(Slow VDD Power-up) ........................................ 55
Fail-Safe Clock Monitor ........................................... 354
Generic I/O Port Operation ...................................... 135
Interrupt Logic .......................................................... 120
MSSP (I2C Master Mode) ........................................ 282
MSSP (I2C Mode) .................................................... 263
MSSP (SPI Mode) ................................................... 253
On-Chip Reset Circuit ................................................ 53
PIC18F66J60/66J65/67J60 ....................................... 11
PIC18F86J60/86J65/87J60 ....................................... 12
PIC18F96J60/96J65/97J60 ....................................... 13
PORTD and PORTE (Parallel Slave Port) ............... 159
PWM Operation (Simplified) .................................... 186
Reads from Flash Program Memory ......................... 99
Required External Components for
Ethernet ........................................................... 207
Single Comparator ................................................... 335
Table Read Operation ............................................... 95
Table Write Operation ............................................... 96
Table Writes to Flash Program Memory .................. 101
Timer0 in 16-Bit Mode ............................................. 164
Timer0 in 8-Bit Mode ............................................... 164
Timer1 ..................................................................... 168
Timer1 (16-Bit Read/Write Mode) ............................ 168
Timer2 ..................................................................... 174
Timer3 ..................................................................... 176
Timer3 (16-Bit Read/Write Mode) ............................ 176
Timer4 ..................................................................... 180
Watchdog Timer ...................................................... 351
BN .................................................................................... 366
BNC ................................................................................. 367
BNN ................................................................................. 367
BNOV .............................................................................. 368
BNZ ................................................................................. 368
BOR. See Brown-out Reset.
BOV ................................................................................. 371
BRA ................................................................................. 369
BRG. See Baud Rate Generator.
Preliminary
DS39762B-page 455
PIC18F97J60 FAMILY
Brown-out Reset (BOR) ..................................................... 55
and On-Chip Voltage Regulator ............................... 352
Detecting .................................................................... 55
BSF .................................................................................. 369
BTFSC ............................................................................. 370
BTFSS .............................................................................. 370
BTG .................................................................................. 371
BZ ..................................................................................... 372
C
C Compilers
MPLAB C18 ............................................................. 408
MPLAB C30 ............................................................. 408
CALL ................................................................................ 372
CALLW ............................................................................. 401
Capture (CCP Module) ..................................................... 183
Associated Registers ............................................... 185
CCPRxH:CCPRxL Registers ................................... 183
CCPx Pin Configuration ........................................... 183
Prescaler .................................................................. 183
Software Interrupt .................................................... 183
Timer1/Timer3 Mode Selection ................................ 183
Capture (ECCP Module) .................................................. 192
Capture/Compare/PWM (CCP) ........................................ 181
Capture Mode. See Capture.
CCPRxH Register .................................................... 182
CCPRxL Register ..................................................... 182
CCPx/ECCPx Interconnect Configurations .............. 182
CCPx/ECCPx Mode and Timer Resources ............. 182
Compare Mode. See Compare.
Module Configuration ............................................... 182
Clock Sources
Default System Clock on Reset ................................. 44
Effects of Power-Managed Modes ............................. 44
Oscillator Switching .................................................... 42
CLRF ................................................................................ 373
CLRWDT .......................................................................... 373
Code Examples
16 x 16 Signed Multiply Routine .............................. 118
16 x 16 Unsigned Multiply Routine .......................... 118
8 x 8 Signed Multiply Routine .................................. 117
8 x 8 Unsigned Multiply Routine .............................. 117
Changing Between Capture Prescalers ................... 183
Computed GOTO Using an Offset Value ................... 73
Erasing a Flash Program Memory Row ................... 100
Fast Register Stack .................................................... 73
How to Clear RAM (Bank 1) Using
Indirect Addressing ............................................ 88
Implementing a Real-Time Clock
Using a Timer1 Interrupt Service ..................... 171
Initializing PORTA .................................................... 136
Initializing PORTB .................................................... 138
Initializing PORTC .................................................... 141
Initializing PORTD .................................................... 144
Initializing PORTE .................................................... 147
Initializing PORTF .................................................... 150
Initializing PORTG ................................................... 152
Initializing PORTH .................................................... 155
Initializing PORTJ .................................................... 157
Loading the SSP1BUF (SSP1SR) Register ............. 256
Reading a Flash Program Memory Word .................. 99
Saving STATUS, WREG and
BSR Registers in RAM ..................................... 134
Writing to Flash Program Memory ........................... 102
DS39762B-page 456
D
Data Addressing Modes .................................................... 88
Comparing Addressing Modes with the
Extended Instruction Set Enabled ..................... 92
Direct ......................................................................... 88
Indexed Literal Offset ................................................ 91
Indirect ....................................................................... 88
Inherent and Literal .................................................... 88
Preliminary
PIC18F97J60 FAMILY
Data Memory ..................................................................... 76
Access Bank .............................................................. 78
Bank Select Register (BSR) ....................................... 76
Ethernet SFRs ........................................................... 80
Extended Instruction Set ............................................ 90
General Purpose Register File ................................... 78
Memory Maps
PIC18F97J60 Family ......................................... 77
Special Function Registers ................................ 79
Special Function Registers ........................................ 79
Data Memory
Memory Maps
Ethernet Special Function Registers ................. 80
DAW ................................................................................. 376
DC and AC Characteristics
Graphs and Tables .................................................. 447
DC Characteristics ........................................................... 421
Power-Down and Supply Current ............................ 414
Supply Voltage ......................................................... 413
DCFSNZ .......................................................................... 377
DECF ............................................................................... 376
DECFSZ ........................................................................... 377
Default System Clock ......................................................... 44
Development Support ...................................................... 407
Device Differences ........................................................... 453
Device Overview .................................................................. 7
Details on Individual Family Members ......................... 8
Features (100-Pin Devices) ....................................... 10
Features (64-Pin Devices) ........................................... 9
Features (80-Pin Devices) ........................................... 9
Direct Addressing ............................................................... 89
E
ECCP2
Pin Assignment ........................................................ 182
Effect on Standard PIC Instructions ................................. 404
Electrical Characteristics .................................................. 411
Requirements for Ethernet Transceiver
External Magnetics .......................................... 445
Enhanced Capture/Compare/PWM (ECCP) .................... 189
Associated Registers ............................................... 204
Capture and Compare Modes .................................. 192
Capture Mode. See Capture (ECCP Module).
ECCP1/ECCP3 Outputs and
Program Memory Mode ................................... 190
ECCP2 Outputs and
Program Memory Modes ................................. 190
Enhanced PWM Mode ............................................. 193
Outputs and Configuration ....................................... 190
Pin Configurations for ECCP1 ................................. 191
Pin Configurations for ECCP2 ................................. 191
Pin Configurations for ECCP3 ................................. 192
PWM Mode. See PWM (ECCP Module).
Standard PWM Mode ............................................... 192
Timer Resources ...................................................... 190
Use of CCP4/CCP5 with ECCP1/ECCP3 ................ 190
Enhanced Universal Synchronous Asynchronous
Receiver Transmitter (EUSART). See EUSART.
ENVREG pin .................................................................... 352
Equations
A/D Acquisition Time ................................................ 328
A/D Minimum Charging Time ................................... 328
Calculating the A/D Minimum Required
Acquisition Time .............................................. 328
Random Access Address Calculation ...................... 238
Receive Buffer Free Space Calculation ................... 239
Errata ................................................................................... 6
Ethernet Module .............................................................. 205
Associated Registers, Direct Memory
Access Controller ............................................ 251
Associated Registers, Flow Control ......................... 243
Associated Registers, Reception ............................. 240
Associated Registers, Transmission ....................... 240
Buffer and Buffer Pointers ....................................... 209
Buffer Arbiter ................................................... 211
DMA Access .................................................... 211
Receive Buffer ................................................. 210
Transmit Buffer ................................................ 211
Buffer and Register Spaces ..................................... 208
Buffer Organization .................................................. 209
CRC ......................................................................... 233
Direct Memory Access Controller ............................ 250
Checksum Calculations ................................... 251
Copying Memory ............................................. 250
Disabling .................................................................. 231
Duplex Mode Configuration and
Negotiation ...................................................... 241
Ethernet and Microcontroller Memory
Relationship ..................................................... 208
Ethernet Control Registers ...................................... 212
Flow Control ............................................................ 242
Initializing ................................................................. 230
Interrupts ................................................................. 224
Interrupts and Wake-on-LAN ................................... 229
LED Configuration ................................................... 206
MAC and MII Registers ........................................... 214
Magnetics, Termination and Other
External Components ...................................... 207
Oscillator Requirements .......................................... 206
Packet Format ......................................................... 232
Per-Packet Control Bytes ........................................ 234
PHSTAT Registers .................................................. 217
PHY Register Summary .......................................... 219
PHY Registers ......................................................... 217
PHY Start-up Timer ................................................. 206
Receive Filters ......................................................... 244
Broadcast ........................................................ 244
Hash Table ...................................................... 244
Magic Packet ................................................... 244
Multicast .......................................................... 244
Pattern Match .................................................. 244
Unicast ............................................................ 244
Resets ..................................................................... 252
Microcontroller Reset ....................................... 252
Receive Only ................................................... 252
Transmit Only .................................................. 252
Signal and Power Interfaces .................................... 206
Special Function Registers (SFRs) ......................... 212
Transmitting and Receiving Data ............................ 232
Packet Field Definitions ........................... 232233
Reading Received Packets ............................. 238
Receive Buffer Space ...................................... 239
Receive Packet Layout .................................... 237
Receive Status Vectors ................................... 238
Receiving Packets ........................................... 237
Transmit Packet Layout ................................... 235
Transmit Status Vectors .................................. 236
Transmitting Packets ....................................... 234
Ethernet Operation, Microcontroller Clock ......................... 41
Preliminary
DS39762B-page 457
PIC18F97J60 FAMILY
EUSARTx
Asynchronous Mode ................................................ 309
Associated Registers, Receive ........................ 313
Associated Registers, Transmit ....................... 311
Auto-Wake-up on Sync Break
Character ................................................. 314
Break Character Sequence .............................. 316
Receiving ................................................. 316
Receiver ........................................................... 312
Setting Up 9-Bit Mode with
Address Detect ........................................ 312
Transmitter ....................................................... 309
Baud Rate Generator
Operation in Power-Managed Modes .............. 303
Baud Rate Generator (BRG) .................................... 303
Associated Registers ....................................... 304
Auto-Baud Rate Detect .................................... 307
Baud Rate Error, Calculating ........................... 304
Baud Rates, Asynchronous Modes .................. 305
High Baud Rate Select (BRGH Bit) .................. 303
Sampling .......................................................... 303
Synchronous Master Mode ...................................... 317
Associated Registers, Receive ........................ 320
Associated Registers, Transmit ....................... 318
Reception ......................................................... 319
Transmission .................................................... 317
Synchronous Slave Mode ........................................ 320
Associated Registers, Receive ........................ 322
Associated Registers, Transmit ....................... 321
Reception ......................................................... 321
Transmission .................................................... 320
Extended Instruction Set
ADDFSR .................................................................. 400
ADDULNK ................................................................ 400
CALLW ..................................................................... 401
MOVSF .................................................................... 401
MOVSS .................................................................... 402
PUSHL ..................................................................... 402
SUBFSR .................................................................. 403
SUBULNK ................................................................ 403
External Clock Input (EC Modes) ....................................... 40
External Memory Bus ....................................................... 105
16-Bit Byte Select Mode .......................................... 111
16-Bit Byte Write Mode ............................................ 109
16-Bit Data Width Modes ......................................... 108
16-Bit Mode Timing .................................................. 112
16-Bit Word Write Mode ........................................... 110
21-Bit Addressing ..................................................... 107
8-Bit Data Width Mode ............................................. 113
8-Bit Mode Timing .................................................... 114
Address and Data Line Usage (table) ...................... 107
Address and Data Width .......................................... 107
Address Shifting ....................................................... 107
Control ..................................................................... 106
I/O Port Functions .................................................... 105
Operation in Power-Managed Modes ...................... 115
Program Memory Modes ......................................... 108
Extended Microcontroller ................................. 108
Microcontroller ................................................. 108
Wait States ............................................................... 108
Weak Pull-ups on Port Pins ..................................... 108
DS39762B-page 458
F
Fail-Safe Clock Monitor ........................................... 343, 354
and the Watchdog Timer ......................................... 354
Exiting Operation ..................................................... 354
Interrupts in Power-Managed Modes ....................... 355
POR or Wake-up From Sleep .................................. 355
Fast Register Stack ........................................................... 73
Firmware Instructions ...................................................... 357
Flash Configuration Words ........................................ 68, 343
Flash Program Memory ..................................................... 95
Associated Registers ............................................... 103
Control Registers ....................................................... 96
EECON1 and EECON2 ..................................... 96
TABLAT (Table Latch) Register ........................ 98
TBLPTR (Table Pointer) Register ...................... 98
Erase Sequence ...................................................... 100
Erasing .................................................................... 100
Operation During Code-Protect ............................... 103
Reading ..................................................................... 99
Table Pointer
Boundaries Based on Operation ....................... 98
Table Pointer Boundaries .......................................... 98
Table Reads and Table Writes .................................. 95
Write Sequence ....................................................... 101
Writing ..................................................................... 101
Protection Against Spurious Writes ................. 103
Unexpected Termination ................................. 103
Write Verify ...................................................... 103
FSCM. See Fail-Safe Clock Monitor.
G
GOTO .............................................................................. 378
H
Hardware Multiplier .......................................................... 117
Introduction .............................................................. 117
Operation ................................................................. 117
Performance Comparison ........................................ 117
I
I/O Ports ........................................................................... 135
Pin Capabilities ........................................................ 135
I2C Mode (MSSP) ............................................................ 263
Acknowledge Sequence Timing .............................. 291
Associated Registers ............................................... 297
Baud Rate Generator .............................................. 284
Bus Collision
During a Repeated Start Condition .................. 295
During a Stop Condition .................................. 296
Clock Arbitration ...................................................... 285
Clock Rate w/BRG ................................................... 284
Clock Stretching ....................................................... 277
10-Bit Slave Receive Mode (SEN = 1) ............ 277
10-Bit Slave Transmit Mode ............................ 277
7-Bit Slave Receive Mode (SEN = 1) .............. 277
7-Bit Slave Transmit Mode .............................. 277
Clock Synchronization and the CKP Bit ................... 278
Effects of a Reset .................................................... 292
General Call Address Support ................................. 281
Preliminary
PIC18F97J60 FAMILY
Master Mode ............................................................ 282
Baud Rate Generator ....................................... 284
Operation ......................................................... 283
Reception ......................................................... 288
Repeated Start Condition Timing ..................... 287
Start Condition Timing ..................................... 286
Transmission ................................................... 288
Multi-Master Communication, Bus Collision
and Arbitration ................................................. 292
Multi-Master Mode ................................................... 292
Operation ................................................................. 268
Read/Write Bit Information (R/W Bit) ............... 268, 270
Registers .................................................................. 263
Serial Clock (SCKx/SCLx) ....................................... 270
Slave Mode .............................................................. 268
Address Masking ............................................. 269
Addressing ....................................................... 268
Reception ......................................................... 270
Transmission ................................................... 270
Sleep Operation ....................................................... 292
Stop Condition Timing .............................................. 291
INCF ................................................................................. 378
INCFSZ ............................................................................ 379
In-Circuit Debugger .......................................................... 356
In-Circuit Serial Programming (ICSP) ...................... 343, 356
Indexed Literal Offset Addressing
and Standard PIC18 Instructions ............................. 404
Indexed Literal Offset Mode ................................. 91, 93, 404
BSR ............................................................................ 93
Indirect Addressing ............................................................ 89
INFSNZ ............................................................................ 379
Initialization Conditions for All Registers ...................... 5965
Instruction Cycle ................................................................ 74
Clocking Scheme ....................................................... 74
Flow/Pipelining ........................................................... 74
Instruction Set .................................................................. 357
ADDLW .................................................................... 363
ADDWF .................................................................... 363
ADDWF (Indexed Literal Offset Mode) .................... 405
ADDWFC ................................................................. 364
ANDLW .................................................................... 364
ANDWF .................................................................... 365
BC ............................................................................ 365
BCF .......................................................................... 366
BN ............................................................................ 366
BNC ......................................................................... 367
BNN ......................................................................... 367
BNOV ....................................................................... 368
BNZ .......................................................................... 368
BOV ......................................................................... 371
BRA .......................................................................... 369
BSF .......................................................................... 369
BSF (Indexed Literal Offset Mode) .......................... 405
BTFSC ..................................................................... 370
BTFSS ..................................................................... 370
BTG .......................................................................... 371
BZ ............................................................................ 372
CALL ........................................................................ 372
CLRF ........................................................................ 373
CLRWDT .................................................................. 373
COMF ...................................................................... 374
CPFSEQ .................................................................. 374
Preliminary
DS39762B-page 459
PIC18F97J60 FAMILY
Interrupt Sources .............................................................. 343
A/D Conversion Complete ....................................... 327
Capture Complete (CCP) ......................................... 183
Compare Complete (CCP) ....................................... 184
Interrupt-on-Change (RB7:RB4) .............................. 138
INTx Pin ................................................................... 134
PORTB, Interrupt-on-Change .................................. 134
TMR0 ....................................................................... 134
TMR0 Overflow ........................................................ 165
TMR1 Overflow ........................................................ 167
TMR2 to PR2 Match (PWM) .................................... 193
TMR3 Overflow ................................................ 175, 177
TMR4 to PR4 Match ................................................ 180
TMR4 to PR4 Match (PWM) .................................... 179
Interrupts .......................................................................... 119
Context Saving ......................................................... 134
Interrupts, Flag Bits
Interrupt-on-Change (RB7:RB4)
Flag (RBIF Bit) ................................................. 138
INTRC. See Internal Oscillator Block.
IORLW ............................................................................. 380
IORWF ............................................................................. 380
IPR Registers ................................................................... 130
L
LFSR ................................................................................ 381
M
Master Clear (MCLR) ......................................................... 55
Master Synchronous Serial Port (MSSP). See MSSP.
Memory Organization ......................................................... 67
Data Memory ............................................................. 76
Program Memory ....................................................... 67
Memory Programming Requirements .............................. 423
Microchip Internet Web Site ............................................. 467
MOVF ............................................................................... 381
MOVFF ............................................................................. 382
MOVLB ............................................................................. 382
MOVLW ............................................................................ 383
MOVSF ............................................................................ 401
MOVSS ............................................................................ 402
MOVWF ........................................................................... 383
MPLAB ASM30 Assembler, Linker, Librarian .................. 408
MPLAB ICD 2 In-Circuit Debugger ................................... 409
MPLAB ICE 2000 High-Performance
Universal In-Circuit Emulator ................................... 409
MPLAB ICE 4000 High-Performance
Universal In-Circuit Emulator ................................... 409
MPLAB Integrated Development
Environment Software .............................................. 407
MPLAB PM3 Device Programmer .................................... 409
MPLINK Object Linker/MPLIB Object Librarian ............... 408
MSSP
ACK Pulse ........................................................ 268, 270
Control Registers (general) ...................................... 253
Module Overview ..................................................... 253
SPI Master/Slave Connection .................................. 257
SSPxBUF Register .................................................. 258
SSPxSR Register ..................................................... 258
MULLW ............................................................................ 384
MULWF ............................................................................ 384
N
NEGF ............................................................................... 385
NOP ................................................................................. 385
DS39762B-page 460
O
Opcode Field Descriptions ............................................... 358
Organizationally Unique Identifier (OUI) .......................... 233
Oscillator Configuration ..................................................... 39
EC .............................................................................. 39
ECPLL ....................................................................... 39
HS .............................................................................. 39
HSPLL ....................................................................... 39
Internal Oscillator Block ............................................. 41
INTRC ........................................................................ 39
Oscillator Selection .......................................................... 343
Oscillator Start-up Timer (OST) ......................................... 44
Oscillator Transitions ......................................................... 44
Oscillator, Timer1 ..................................................... 167, 177
Oscillator, Timer3 ............................................................. 175
OUI. See Organizationally Unique Identifier.
P
Packaging ........................................................................ 449
Details ...................................................................... 450
Marking .................................................................... 449
Parallel Slave Port (PSP) ................................................. 159
Associated Registers ............................................... 161
PORTD .................................................................... 159
Select (PSPMODE Bit) ............................................ 159
PICSTART Plus Development Programmer .................... 410
PIE Registers ................................................................... 127
Pin Functions
AVDD .............................................................. 20, 28, 38
AVSS .............................................................. 20, 28, 38
ENVREG ....................................................... 20, 28, 38
MCLR ............................................................ 14, 21, 29
OSC1/CLKI .................................................... 14, 21, 29
OSC2/CLKO .................................................. 14, 21, 29
RA0/LEDA/AN0 ............................................. 14, 21, 29
RA1/LEDB/AN1 ............................................. 14, 21, 29
RA2/AN2/VREF- ............................................. 14, 21, 29
RA3/AN3/VREF+ ............................................ 14, 21, 29
RA4/T0CKI .................................................... 14, 21, 29
RA5/AN4 ........................................................ 14, 21, 29
RB0/INT0/FLT0 .............................................. 15, 22, 30
RB1/INT1 ....................................................... 15, 22, 30
RB2/INT2 ....................................................... 15, 22, 30
RB3/INT3 ............................................................. 15, 22
RB3/INT3/ECCP2/P2A .............................................. 30
RB4/KBI0 ....................................................... 15, 22, 30
RB5/KBI1 ....................................................... 15, 22, 30
RB6/KBI2/PGC .............................................. 15, 22, 30
RB7/KBI3/PGD .............................................. 15, 22, 30
RBIAS ............................................................ 20, 28, 38
RC0/T1OSO/T13CKI ..................................... 16, 23, 31
RC1/T1OSI/ECCP2/P2A ............................... 16, 23, 31
RC2/ECCP1/P1A ........................................... 16, 23, 31
RC3/SCK1/SCL1 ........................................... 16, 23, 31
RC4/SDI1/SDA1 ............................................ 16, 23, 31
RC5/SDO1 ..................................................... 16, 23, 31
RC6/TX1/CK1 ................................................ 16, 23, 31
RC7/RX1/DT1 ................................................ 16, 23, 31
RD0 ........................................................................... 24
RD0/AD0/PSP0 ......................................................... 32
RD0/P1B .................................................................... 17
RD1 ........................................................................... 24
RD1/AD1/PSP1 ......................................................... 32
RD1/ECCP3/P3A ....................................................... 17
Preliminary
PIC18F97J60 FAMILY
RD2 ............................................................................ 24
RD2/AD2/PSP2 .......................................................... 32
RD2/CCP4/P3D ......................................................... 17
RD3/AD3/PSP3 .......................................................... 32
RD4/AD4/PSP4/SDO2 ............................................... 32
RD5/AD5/PSP5/SDI2/SDA2 ...................................... 32
RD6/AD6/PSP6/SCK2/SCL2 ..................................... 32
RD7/AD7/PSP7/SS2 .................................................. 32
RE0/AD8/RD/P2D ...................................................... 33
RE0/P2D .............................................................. 18, 24
RE1/AD9/WR/P2C ..................................................... 33
RE1/P2C .............................................................. 18, 24
RE2/AD10/CS/P2B .................................................... 33
RE2/P2B .............................................................. 18, 24
RE3/AD11/P3C .......................................................... 33
RE3/P3C .............................................................. 18, 24
RE4/AD12/P3B .......................................................... 33
RE4/P3B .............................................................. 18, 24
RE5/AD13/P1C .......................................................... 33
RE5/P1C .............................................................. 18, 24
RE6/AD14/P1B .......................................................... 33
RE6/P1B .................................................................... 24
RE7/AD15/ECCP2/P2A ............................................. 33
RE7/ECCP2/P2A ....................................................... 24
RF0/AN5 .................................................................... 34
RF1/AN6/C2OUT ........................................... 19, 25, 34
RF2/AN7/C1OUT ........................................... 19, 25, 34
RF3/AN8 ........................................................ 19, 25, 34
RF4/AN9 ........................................................ 19, 25, 34
RF5/AN10/CVREF .......................................... 19, 25, 34
RF6/AN11 ...................................................... 19, 25, 34
RF7/SS1 ........................................................ 19, 25, 34
RG0/ECCP3/P3A ................................................. 26, 35
RG1/TX2/CK2 ...................................................... 26, 35
RG2/RX2/DT2 ...................................................... 26, 35
RG3/CCP4/P3D ................................................... 26, 35
RG4/CCP5/P1D ............................................. 20, 26, 35
RG5 ............................................................................ 35
RG6 ............................................................................ 35
RG7 ............................................................................ 35
RH0 ............................................................................ 27
RH0/A16 .................................................................... 36
RH1 ............................................................................ 27
RH1/A17 .................................................................... 36
RH2 ............................................................................ 27
RH2/A18 .................................................................... 36
RH3 ............................................................................ 27
RH3/A19 .................................................................... 36
RH4/AN12/P3C .................................................... 27, 36
RH5/AN13/P3B .................................................... 27, 36
RH6/AN14/P1C .................................................... 27, 36
RH7/AN15/P1B .................................................... 27, 36
RJ0/ALE ..................................................................... 37
RJ1/OE ...................................................................... 37
RJ2/WRL .................................................................... 37
RJ3/WRH ................................................................... 37
RJ4 ............................................................................. 28
RJ4/BA0 ..................................................................... 37
RJ5 ............................................................................. 28
RJ5/CE ....................................................................... 37
RJ6/LB ....................................................................... 37
RJ7/UB ....................................................................... 37
TPIN- .............................................................. 20, 28, 38
TPIN+ ............................................................. 20, 28, 38
Preliminary
DS39762B-page 461
PIC18F97J60 FAMILY
PORTH
Associated Registers ............................................... 156
LATH Register ......................................................... 155
PORTH Register ...................................................... 155
TRISH Register ........................................................ 155
PORTJ
Associated Registers ............................................... 158
LATJ Register .......................................................... 157
PORTJ Register ....................................................... 157
TRISJ Register ......................................................... 157
Power-Managed Modes ..................................................... 45
and SPI Operation ................................................... 261
Clock Sources ............................................................ 45
Clock Transitions and Status Indicators ..................... 46
Entering ...................................................................... 45
Exiting Idle and Sleep Modes .................................... 51
By Interrupt ........................................................ 51
By Reset ............................................................ 51
By WDT Time-out .............................................. 51
Without an Oscillator Start-up
Timer Delay ............................................... 51
Idle Modes ................................................................. 49
PRI_IDLE ........................................................... 50
RC_IDLE ............................................................ 51
SEC_IDLE .......................................................... 50
Multiple Sleep Commands ......................................... 46
Run Modes ................................................................. 46
PRI_RUN ........................................................... 46
RC_RUN ............................................................ 48
SEC_RUN .......................................................... 46
Selecting .................................................................... 45
Sleep Mode ................................................................ 49
Summary (table) ........................................................ 45
Power-on Reset (POR) ...................................................... 55
Power-up Timer (PWRT) ........................................... 56
Time-out Sequence .................................................... 56
Power-up Delays ................................................................ 44
Power-up Timer (PWRT) .............................................. 44, 56
Prescaler
Timer2 ...................................................................... 194
Prescaler, Timer0 ............................................................. 165
Prescaler, Timer2 ............................................................. 187
PRI_IDLE Mode ................................................................. 50
PRI_RUN Mode ................................................................. 46
Program Counter ................................................................ 71
PCL, PCH and PCU Registers ................................... 71
PCLATH and PCLATU Registers .............................. 71
Program Memory
Extended Instruction Set ............................................ 90
Instructions ................................................................. 75
Two-Word .......................................................... 75
Interrupt Vector .......................................................... 68
Look-up Tables .......................................................... 73
Memory Maps ............................................................ 67
Hard Vectors and
Configuration Words .................................. 68
Memory Maps, Modes ............................................... 70
Modes
Memory Access (table) ...................................... 70
Reset Vector .............................................................. 68
Program Memory Modes .................................................... 69
Address Shifting (Extended Microcontroller) .............. 70
Extended Microcontroller ........................................... 69
Microcontroller ........................................................... 69
Program Verification and Code Protection ....................... 356
DS39762B-page 462
Q
Q Clock .................................................................... 187, 194
R
RAM. See Data Memory.
RC_IDLE Mode .................................................................. 51
RC_RUN Mode .................................................................. 48
RCALL ............................................................................. 387
RCON Register
Bit Status During Initialization .................................... 58
Reader Response ............................................................ 468
Receive Filters
AND Logic Flow ....................................................... 247
Magic Packet Format ............................................... 249
OR Logic Flow ......................................................... 246
Pattern Match Filter Format ..................................... 248
Register File Summary ................................................ 8186
Registers
ADCON0 (A/D Control 0) ......................................... 323
ADCON1 (A/D Control 1) ......................................... 324
ADCON2 (A/D Control 2) ......................................... 325
BAUDCONx (Baud Rate Control x) ......................... 302
CCPxCON (Capture/Compare/PWM Control,
CCP4 and CCP5) ............................................ 181
CCPxCON (Enhanced Capture/Compare/PWM Control,
ECCP1/ECCP2/ECCP3) ................................. 189
CMCON (Comparator Control) ................................ 333
CONFIG1H (Configuration 1 High) .......................... 345
CONFIG1L (Configuration 1 Low) ........................... 345
Preliminary
PIC18F97J60 FAMILY
CONFIG2H (Configuration 2 High) .......................... 347
CONFIG2L (Configuration 2 Low) ............................ 346
CONFIG3H (Configuration 3 High) .......................... 349
CONFIG3L (Configuration 3 Low) ...................... 69, 348
CVRCON (Comparator Voltage
Reference Control) .......................................... 339
DEVID1 (Device ID 1) .............................................. 350
DEVID2 (Device ID 2) .............................................. 350
ECCPxAS (ECCPx Auto-Shutdown
Configuration) .................................................. 201
ECCPxDEL (ECCPx Dead-Band Delay) .................. 200
ECON1 (Ethernet Control 1) .................................... 212
ECON2 (Ethernet Control 2) .................................... 213
EECON1 (EEPROM Control 1) .................................. 97
EFLOCON (Ethernet Flow Control) ......................... 243
EIE (Ethernet Interrupt Enable) ................................ 225
EIR (Ethernet Interrupt Request, Flag) .................... 226
ERXFCON (Ethernet Receive
Filter Control) ................................................... 245
ESTAT (Ethernet Status) ......................................... 213
INTCON (Interrupt Control) ...................................... 121
INTCON2 (Interrupt Control 2) ................................. 122
INTCON3 (Interrupt Control 3) ................................. 123
IPR1 (Peripheral Interrupt Priority 1) ........................ 130
IPR2 (Peripheral Interrupt Priority 2) ........................ 131
IPR3 (Peripheral Interrupt Priority 3) ........................ 132
MABBIPG (MAC Back-to-Back
Inter-Packet Gap) ............................................ 231
MACON1 (MAC Control 1) ....................................... 214
MACON3 (MAC Control 3) ....................................... 215
MACON4 (MAC Control 4) ....................................... 216
MEMCON (External Memory Bus Control) .............. 106
MICMD (MII Command) ........................................... 216
MISTAT (MII Status) ................................................ 217
OSCCON (Oscillator Control) .................................... 43
OSCTUNE (PLL Block Control) ................................. 41
PHCON1 (PHY Control 1) ........................................ 220
PHCON2 (PHY Control 2) ........................................ 221
PHIE (PHY Interrupt Enable) ................................... 227
PHIR (PHY Interrupt Request, Flag) ........................ 227
PHLCON (PHY Module LED Control) ...................... 223
PHSTAT1 (Physical Layer Status 1) ........................ 220
PHSTAT2 (Physical Layer Status 2) ........................ 222
PIE1 (Peripheral Interrupt Enable 1) ........................ 127
PIE2 (Peripheral Interrupt Enable 2) ........................ 128
PIE3 (Peripheral Interrupt Enable 3) ........................ 129
PIR1 (Peripheral Interrupt
Request (Flag) 1) ............................................. 124
PIR2 (Peripheral Interrupt
Request (Flag) 2) ............................................. 125
PIR3 (Peripheral Interrupt
Request (Flag) 3) ............................................. 126
PSPCON (Parallel Slave Port Control) .................... 160
RCON (Reset Control) ....................................... 54, 133
RCSTAx (Receive Status and Control x) ................. 301
SSPxCON1 (MSSPx Control 1, I2C Mode) .............. 265
SSPxCON1 (MSSPx Control 1, SPI Mode) ............. 255
SSPxCON2 (MSSPx Control 2,
I2C Master Mode) ............................................ 266
SSPxCON2 (MSSPx Control 2,
I2C Slave Mode) .............................................. 267
SSPxSTAT (MSSPx Status, I2C Mode) ................... 264
SSPxSTAT (MSSPx Status, SPI Mode) .................. 254
STATUS .................................................................... 87
STKPTR (Stack Pointer) ............................................ 72
T0CON (Timer0 Control) ......................................... 163
T1CON (Timer1 Control) ......................................... 167
T2CON (Timer2 Control) ......................................... 173
T3CON (Timer3 Control) ......................................... 175
T4CON (Timer4 Control) ......................................... 179
TXSTAx (Transmit Status
and Control x) .................................................. 300
WDTCON (Watchdog Timer
Control) ............................................................ 351
RESET ............................................................................. 387
Reset ................................................................................. 53
Brown-out Reset (BOR) ............................................. 53
Configuration Mismatch (CM) .................................... 53
MCLR Reset, During
Power-Managed Modes .................................... 53
MCLR Reset, Normal Operation ................................ 53
Power-on Reset (POR) .............................................. 53
Reset Instruction ........................................................ 53
Stack Full Reset ........................................................ 53
Stack Underflow Reset .............................................. 53
State of Registers ...................................................... 58
Watchdog Timer (WDT) Reset .................................. 53
Resets ............................................................................. 343
Brown-out Reset (BOR) ........................................... 343
Oscillator Start-up Timer (OST) ............................... 343
Power-on Reset (POR) ............................................ 343
Power-up Timer (PWRT) ......................................... 343
Stack Full/Underflow .................................................. 73
RETFIE ............................................................................ 388
RETLW ............................................................................ 388
RETURN .......................................................................... 389
Return Address Stack ........................................................ 71
Return Stack Pointer (STKPTR) ........................................ 72
Revision History ............................................................... 453
RLCF ............................................................................... 389
RLNCF ............................................................................. 390
RRCF ............................................................................... 390
RRNCF ............................................................................ 391
S
SCKx ............................................................................... 253
SDIx ................................................................................. 253
SDOx ............................................................................... 253
SEC_IDLE Mode ............................................................... 50
SEC_RUN Mode ................................................................ 46
Serial Clock, SCKx .......................................................... 253
Serial Data In (SDIx) ........................................................ 253
Serial Data Out (SDOx) ................................................... 253
Serial Peripheral Interface. See SPI Mode.
SETF ............................................................................... 391
Slave Select (SSx) ........................................................... 253
SLEEP ............................................................................. 392
Sleep
OSC1 and OSC2 Pin States ...................................... 44
Software Simulator (MPLAB SIM) ................................... 408
Special Event Trigger. See Compare (ECCP Module).
Special Features of the CPU ........................................... 343
Special Function Registers
Ethernet SFRs ........................................................... 80
Preliminary
DS39762B-page 463
PIC18F97J60 FAMILY
SPI Mode (MSSP)
Associated Registers ............................................... 262
Bus Mode Compatibility ........................................... 261
Clock Speed and Module Interactions ..................... 261
Effects of a Reset ..................................................... 261
Enabling SPI I/O ...................................................... 257
Master Mode ............................................................ 258
Master/Slave Connection ......................................... 257
Operation ................................................................. 256
Operation in Power-Managed Modes ...................... 261
Serial Clock .............................................................. 253
Serial Data In ........................................................... 253
Serial Data Out ........................................................ 253
Slave Mode .............................................................. 259
Slave Select ............................................................. 253
Slave Select Synchronization .................................. 259
SPI Clock ................................................................. 258
Typical Connection .................................................. 257
SSPOV ............................................................................. 288
SSPOV Status Flag .......................................................... 288
SSPSTAT Register
R/W Bit ..................................................................... 270
SSPxSTAT Register
R/W Bit ..................................................................... 268
SSx ................................................................................... 253
SUBFSR ........................................................................... 403
SUBFWB .......................................................................... 392
SUBLW ............................................................................ 393
SUBULNK ........................................................................ 403
SUBWF ............................................................................ 393
SUBWFB .......................................................................... 394
SWAPF ............................................................................ 394
T
Table Pointer Operations (table) ........................................ 98
Table Reads/Table Writes .................................................. 73
TBLRD ............................................................................. 395
TBLWT ............................................................................. 396
Timer0 .............................................................................. 163
Associated Registers ............................................... 165
Clock Source Select (T0CS Bit) ............................... 164
Operation ................................................................. 164
Overflow Interrupt .................................................... 165
Prescaler .................................................................. 165
Prescaler Assignment (PSA Bit) .............................. 165
Prescaler Select (T0PS2:T0PS0 Bits) ..................... 165
Prescaler, Switching Assignment ............................. 165
Prescaler. See Prescaler, Timer0.
Reads and Writes in 16-Bit Mode ............................ 164
Source Edge Select (T0SE Bit) ................................ 164
Timer1 .............................................................................. 167
16-Bit Read/Write Mode ........................................... 169
Associated Registers ............................................... 171
Considerations in Asynchronous Counter Mode ...... 170
Interrupt .................................................................... 170
Operation ................................................................. 168
Oscillator .......................................................... 167, 169
Layout Considerations ..................................... 169
Overflow Interrupt .................................................... 167
Resetting, Using the ECCPx
Special Event Trigger ....................................... 170
Special Event Trigger (ECCP) ................................. 192
TMR1H Register ...................................................... 167
TMR1L Register ....................................................... 167
Use as a Clock Source ............................................ 169
Use as a Real-Time Clock ....................................... 170
DS39762B-page 464
Preliminary
PIC18F97J60 FAMILY
I2C Bus Collision During a Repeated
Start Condition (Case 1) .................................. 295
I2C Bus Collision During a Repeated
Start Condition (Case 2) .................................. 295
I2C Bus Collision During a Stop
Condition (Case 1) ........................................... 296
I2C Bus Collision During a Stop
Condition (Case 2) ........................................... 296
I2C Bus Collision During Start
Condition (SCLx = 0) ....................................... 294
I2C Bus Collision During Start
Condition (SDAx Only) ..................................... 293
I2C Bus Collision for Transmit and
Acknowledge ................................................... 292
I2C Bus Data ............................................................ 439
I2C Bus Start/Stop Bits ............................................. 439
I2C Master Mode (7 or 10-Bit Transmission) ........... 289
I2C Master Mode (7-Bit Reception) .......................... 290
I2C Slave Mode (10-Bit Reception, SEN = 0) .......... 274
I2C Slave Mode (10-Bit Reception, SEN = 0,
ADMSK = 01001) ............................................. 275
I2C Slave Mode (10-Bit Reception, SEN = 1) .......... 280
I2C Slave Mode (10-Bit Transmission) ..................... 276
I2C Slave Mode (7-Bit Reception, SEN = 0) ............ 271
I2C Slave Mode (7-Bit Reception,
SEN = 0, ADMSK = 01011) ............................. 272
I2C Slave Mode (7-Bit Reception, SEN = 1) ............ 279
I2C Slave Mode (7-Bit Transmission) ....................... 273
I2C Slave Mode General Call Address Sequence
(7 or 10-Bit Addressing Mode) ......................... 281
I2C Stop Condition Receive or Transmit Mode ........ 291
Master SSP I2C Bus Data ........................................ 441
Master SSP I2C Bus Start/Stop Bits ........................ 441
Parallel Slave Port (PSP) Read ............................... 161
Parallel Slave Port (PSP) Write ............................... 160
Program Memory Read ............................................ 430
Program Memory Write ............................................ 431
PWM Auto-Shutdown (P1RSEN = 0,
Auto-Restart Disabled) .................................... 202
PWM Auto-Shutdown (P1RSEN = 1,
Auto-Restart Enabled) ..................................... 202
PWM Direction Change ........................................... 199
PWM Direction Change at Near
100% Duty Cycle ............................................. 199
PWM Output ............................................................ 186
Repeated Start Condition ......................................... 287
Reset, Watchdog Timer (WDT),
Oscillator Start-up Timer (OST) and
Power-up Timer (PWRT) ................................. 432
Send Break Character Sequence ............................ 316
Slave Synchronization ............................................. 259
Slow Rise Time (MCLR Tied to VDD,
VDD Rise > TPWRT) ............................................ 57
SPI Mode (Master Mode) ......................................... 258
SPI Mode (Slave Mode, CKE = 0) ........................... 260
SPI Mode (Slave Mode, CKE = 1) ........................... 260
Synchronous Reception
(Master Mode, SREN) ..................................... 319
Synchronous Transmission ...................................... 317
Synchronous Transmission (Through TXEN) .......... 318
Time-out Sequence on Power-up
(MCLR Not Tied to VDD), Case 1 ....................... 56
Time-out Sequence on Power-up
(MCLR Not Tied to VDD), Case 2 ....................... 57
V
VDDCORE/VCAP Pin .......................................................... 352
Voltage Reference Specifications .................................... 424
Voltage Regulator (On-Chip) ........................................... 352
Preliminary
DS39762B-page 465
PIC18F97J60 FAMILY
W
DS39762B-page 466
Preliminary
PIC18F97J60 FAMILY
THE MICROCHIP WEB SITE
CUSTOMER SUPPORT
Distributor or Representative
Local Sales Office
Field Application Engineer (FAE)
Technical Support
Development Systems Information Line
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://support.microchip.com
Preliminary
DS39762B-page 467
PIC18F97J60 FAMILY
READER RESPONSE
It is our intention to provide you with the best documentation possible to ensure successful use of your Microchip product. If you wish to provide your comments on organization, clarity, subject matter, and ways in which our documentation
can better serve you, please FAX your comments to the Technical Publications Manager at (480) 792-4150.
Please list the following information, and use this outline to provide us with your comments about this document.
To:
RE:
Reader Response
From: Name
Company
Address
City / State / ZIP / Country
Telephone: (_______) _________ - _________
Application (optional):
Would you like a reply?
N
Literature Number: DS39762B
Questions:
1. What are the best features of this document?
2. How does this document meet your hardware and software development needs?
3. Do you find the organization of this document easy to follow? If not, why?
4. What additions to the document do you think would enhance the structure and subject?
5. What deletions from the document could be made without affecting the overall usefulness?
DS39762B-page 468
Preliminary
PIC18F97J60 FAMILY
PRODUCT IDENTIFICATION SYSTEM
To order or obtain information, e.g., on pricing or delivery, refer to the factory or the listed sales office.
PART NO.
/XX
XXX
Device
Temperature
Range
Package
Pattern
Examples:
a)
b)
Device
PIC18F66J60/66J65/67J60,
PIC18F86J60/86J65/87J60,
PIC18F96J60/96J65/97J60,
PIC18F66J60/66J65/67J60T(1),
PIC18F86J60/86J65/87J60T(1),
PIC18F96J60/96J65/97J60T(1)
Temperature Range
Package
PT =
PF =
Pattern
Preliminary
DS39762B-page 469
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://support.microchip.com
Web Address:
www.microchip.com
India - Bangalore
Tel: 91-80-4182-8400
Fax: 91-80-4182-8422
India - New Delhi
Tel: 91-11-4160-8631
Fax: 91-11-4160-8632
Austria - Wels
Tel: 43-7242-2244-39
Fax: 43-7242-2244-393
Denmark - Copenhagen
Tel: 45-4450-2828
Fax: 45-4485-2829
India - Pune
Tel: 91-20-2566-1512
Fax: 91-20-2566-1513
France - Paris
Tel: 33-1-69-53-63-20
Fax: 33-1-69-30-90-79
Japan - Yokohama
Tel: 81-45-471- 6166
Fax: 81-45-471-6122
Germany - Munich
Tel: 49-89-627-144-0
Fax: 49-89-627-144-44
Atlanta
Alpharetta, GA
Tel: 770-640-0034
Fax: 770-640-0307
Boston
Westborough, MA
Tel: 774-760-0087
Fax: 774-760-0088
Chicago
Itasca, IL
Tel: 630-285-0071
Fax: 630-285-0075
Dallas
Addison, TX
Tel: 972-818-7423
Fax: 972-818-2924
Detroit
Farmington Hills, MI
Tel: 248-538-2250
Fax: 248-538-2260
Kokomo
Kokomo, IN
Tel: 765-864-8360
Fax: 765-864-8387
Los Angeles
Mission Viejo, CA
Tel: 949-462-9523
Fax: 949-462-9608
Santa Clara
Santa Clara, CA
Tel: 408-961-6444
Fax: 408-961-6445
Toronto
Mississauga, Ontario,
Canada
Tel: 905-673-0699
Fax: 905-673-6509
Australia - Sydney
Tel: 61-2-9868-6733
Fax: 61-2-9868-6755
China - Beijing
Tel: 86-10-8528-2100
Fax: 86-10-8528-2104
Korea - Gumi
Tel: 82-54-473-4301
Fax: 82-54-473-4302
China - Chengdu
Tel: 86-28-8665-5511
Fax: 86-28-8665-7889
China - Fuzhou
Tel: 86-591-8750-3506
Fax: 86-591-8750-3521
Korea - Seoul
Tel: 82-2-554-7200
Fax: 82-2-558-5932 or
82-2-558-5934
Malaysia - Penang
Tel: 60-4-646-8870
Fax: 60-4-646-5086
China - Qingdao
Tel: 86-532-8502-7355
Fax: 86-532-8502-7205
Philippines - Manila
Tel: 63-2-634-9065
Fax: 63-2-634-9069
China - Shanghai
Tel: 86-21-5407-5533
Fax: 86-21-5407-5066
Singapore
Tel: 65-6334-8870
Fax: 65-6334-8850
China - Shenyang
Tel: 86-24-2334-2829
Fax: 86-24-2334-2393
China - Shenzhen
Tel: 86-755-8203-2660
Fax: 86-755-8203-1760
Taiwan - Kaohsiung
Tel: 886-7-536-4818
Fax: 886-7-536-4803
China - Shunde
Tel: 86-757-2839-5507
Fax: 86-757-2839-5571
Taiwan - Taipei
Tel: 886-2-2500-6610
Fax: 886-2-2508-0102
China - Wuhan
Tel: 86-27-5980-5300
Fax: 86-27-5980-5118
Thailand - Bangkok
Tel: 66-2-694-1351
Fax: 66-2-694-1350
Italy - Milan
Tel: 39-0331-742611
Fax: 39-0331-466781
Netherlands - Drunen
Tel: 31-416-690399
Fax: 31-416-690340
Spain - Madrid
Tel: 34-91-708-08-90
Fax: 34-91-708-08-91
UK - Wokingham
Tel: 44-118-921-5869
Fax: 44-118-921-5820
China - Xian
Tel: 86-29-8833-7250
Fax: 86-29-8833-7256
10/19/06
DS39762B-page 470
Preliminary
Mouser Electronics
Authorized Distributor
Microchip:
PIC18F96J60-I/PT PIC18F96J65-I/PT PIC18F96J65T-I/PT PIC18F97J60-I/PF PIC18F97J60T-I/PT