Pic18f66k90t I PTRSL
Pic18f66k90t I PTRSL
Pic18f66k90t I PTRSL
Data Sheet
64/80-Pin, High-Performance
Microcontrollers with LCD Driver and
nanoWatt XLP Technology
• Microchip believes that its family of products is one of the most secure families of its kind on the market today, when used in the
intended manner and under normal conditions.
• There are dishonest and possibly illegal methods used to breach the code protection feature. All of these methods, to our
knowledge, require using the Microchip products in a manner outside the operating specifications contained in Microchip’s Data
Sheets. Most likely, the person doing so is engaged in theft of intellectual property.
• Microchip is willing to work with the customer who is concerned about the integrity of their code.
• Neither Microchip nor any other semiconductor manufacturer can guarantee the security of their code. Code protection does not
mean that we are guaranteeing the product as “unbreakable.”
Code protection is constantly evolving. We at Microchip are committed to continuously improving the code protection features of our
products. Attempts to break Microchip’s code protection feature may be a violation of the Digital Millennium Copyright Act. If such acts
allow unauthorized access to your software or other copyrighted work, you may have a right to sue for relief under that Act.
ISBN: 978-1-61341-351-7
Flash SRAM
EUSART
8/16-Bit
Timers
CTMU
RTCC
RE3/COM0/P3C/CCP9(2)/REFO
RE2/LCDBIAS3/P2B/CCP10(2)
RE7/ECCP2(1)/SEG31/P2A
RD6/SEG6/SCK2/SCL2
RD5/SEG5/SDI2/SDA2
RE5/COM2/P1C/CCP7
RD1/SEG1/T5CKI/T7G
RE4/COM1/P3B/CCP8
RE6/COM3/P1B/CCP6
RD0/SEG0/CTPLS
RD4/SEG4/SDO2
RD7/SEG7/SS2
RD2/SEG2
RD3/SEG3
VDD
VSS
64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49
RE1/LCDBIAS2/P2C 1 48 RB0/INT0/SEG30/FLTO
RE0/LCDBIAS1/P2D 2 47 RB1/INT1/SEG8
RG0/ECCP3/P3A 3 46 RB2/INT2/SEG9/CTED1
RG1/TX2/CK2/AN19/C3OUT 4 45 RB3/INT3/SEG10/CTED2/P2A
RG2/RX2/DT2/AN18/C3INA 5 44 RB4/KBI0/SEG11
RG3/CCP4/AN17/P3D/C3INB 6 PIC18F65K90 43 RB5/KBI1/SEG29/T3CKI/T1G
MCLR/RG5 7 42 RB6/KBI2/PGC
PIC18F66K90
RG4/SEG26/RTCC/T7CKI(2)/T5G/CCP5/AN16/P1D/C3INC 8 41 VSS
VSS 9 PIC18F67K90 40 OSC2/CLKO/RA6
VDDCORE/VCAP 10 39 OSC1/CLKI/RA7
RF7/AN5/SS1/SEG25 11 38 VDD
RF6/AN11/SEG24/C1INA 12 37 RB7/KBI3/PGD
RF5/AN10/CVREF/SEG23/C1INB 13 36 RC5/SDO1/SEG12
RF4/AN9/SEG22/C2INA 14 35 RC4/SDI1/SDA1/SEG16
RF3/AN8/SEG21/C2INB/CTMUI 15 34 RC3/SCK1/SCL1/SEG17
RF2/AN7/C1OUT/SEG20 16 33 RC2/ECCP1/P1A/SEG13
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
ENVREG
RF1/AN6/C2OUT/SEG19/CTDIN
RA2/AN2/VREF-
RC7/RX1/DT1/SEG28
RC1/SOSCI/ECCP2(1)/P2A/SEG32
RC0/SOSCO/SCLKI
RC6/TX1/CK1/SEG27
RA3/AN3/VREF+
RA5/AN4/T1CKI/SEG15/T3G/HLVDIN
AVDD
RA1/AN1/SEG18
VDD
RA4/T0CKI/SEG14
AVSS
RA0/AN0/ULPWU
VSS
Note 1: The ECCP2 pin placement depends on the CCP2MX Configuration bit setting.
2: Not available on the PIC18F65K90 and PIC18F85K90.
3: For the QFN package, it is recommended that the bottom pad be connected to VSS.
80-Pin TQFP
RE3/COM0/P3C/CCP9(2)(3)/REFO
RE2/LCDBIAS3/P2B/CCP10(2)
RD1/SEG1/T5CKI/T7G/PSP1
RE7/ECCP2(1)/P2A/SEG31
RD0/PSP0/SEG0/CTPLS
RE5/COM2/P1C/CCP7(3)
RE4/COM1/P3B/CCP8(3)
RE6/COM3/P1B/CCP6(3)
RD6/SEG6/SCK2/SCL2
RD5/SEG5/SDI2/SDA2
RH1/SEG46/AN22
RH0/SEG47/AN23
RD4/SEG4/SDO2
RD7/SEG7/SS2
RJ1/SEG33
RD2/SEG2
RD3/SEG3
VDD
RJ0
VSS
80 79 78 77 76 75 74 73 72 71 70 69 68 6766 65 64 63 62 61
RH2/SEG45/AN21 1 60 RJ2/SEG34
RH3/SEG44/AN20 2 59 RJ3/SEG35
RE1/LCDBIAS2/P2C 3 58 RB0/INT0/SEG30/FLT0
RE0/LCDBIAS1/P2D 4 57 RB1/INT1/SEG8
RG0/ECCP3/P3A 5 56 RB2/INT2/SEG9/CTED1
RG1/TX2/CK2/AN19/C3OUT 6 55 RB3/INT3/SEG10/CTED2/P2A
RG2/RX2/DT2/AN18/C3INA 7 54 RB4/KBI0/SEG11
RG3/CCP4/AN17/P3D/C3INB 8 53 RB5/KBI1/SEG29/T3CKI/T1G
MCLR/RG5 9 PIC18F85K90 52 RB6/KBI2/PGC
RG4/SEG26/RTCC/T7CKI(2)/T5G/CCP5/AN16/P1D/C3INC 10 PIC18F86K90 51 VSS
VSS 11 50 OSC2/CLKO/RA6
VDDCORE/VCAP 12 PIC18F87K90 49 OSC1/CLKI/RA7
RF7/AN5/SS1/SEG25 13 48 VDD
RF6/AN11/SEG24/C1INA 14 47 RB7/KBI3/PGD
RF5/AN10/CVREF/SEG23/C1INB 15 46 RC5/SDO1/SEG12
RF4/AN9/SEG22/C2INA 16 45 RC4/SDI1/SDA1/SEG16
RF3/AN8/SEG21/C2INB/CTMUI 17 44 RC3/SCK1/SCL1/SEG17
RF2/AN7/C1OUT/SEG20 18 43 RC2/ECCP1/P1A/SEG13
RH7/SEG43/CCP6(3)/P1B/AN15 19 42 RJ7/SEG36
RH6/SEG42/CCP7(3)/P1C/AN14/C1INC 20 41 RJ6/SEG37
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
RA3/AN3/VREF+
RC1/SOSCI/ECCP2(1)I/SEG32/P2A
RA2/AN2/VREF-
RA1/AN1/SEG18
RJ4/SEG39
RJ5/SEG38
RA4/T0CKI/SEG14
ENVREG
AVDD
VDD
RC7/RX1/DT1/SEG28
RF1/AN6/C2OUT/SEG19/CTDIN
RC0/SOSCO/SCKLI
RC6/TX1/CK1/SEG27
RA0/AN0/ULPWU
RA5/AN4/T1CKI/SEG15/T3G/HLVDIN
RH5/SEG41/CCP8(3)/P3B/AN13/C2IND
RH4/SEG40/CCP9(2)(3)/P3C/AN12/C2INC
AVSS
VSS
Note 1: The ECCP2 pin placement depends on the CCP2MX Configuration bit setting.
2: Not available on the PIC18F65K90 and PIC18F85K90.
3: The CCP6, CCP7, CCP8 and CCP9 pin placement depends on the ECCPMX Configuration bit setting
Data Bus<8>
Table Pointer<21>
PORTA
Data Latch
inc/dec logic 8 8 RA0:RA7(1,2)
Data Memory
(2/4 Kbytes)
21 PCLATU PCLATH
20 Address Latch
PCU PCH PCL
Program Counter 12 PORTB
Data Address<12>
RB0:RB7(1)
31-Level Stack
Address Latch 4 12 4
BSR FSR0 Access
Program Memory STKPTR Bank
FSR1
FSR2 12
Data Latch PORTC
inc/dec RC0:RC7(1)
8 logic
Table Latch
8
Instruction State Machine
Decode and Control Signals
Control
PRODH PRODL PORTE
RE0:RE7(1)
8 x 8 Multiply
Timing 3
Power-up 8
OSC2/CLKO Generation
OSC1/CLKI Timer
BITOP W
INTRC Oscillator 8 8
Oscillator 8
Start-up Timer
16 MHz PORTF
Oscillator Power-on 8 8
Reset RF1:RF7(1)
Precision ALU<8>
Band Gap Watchdog
Reference Timer
8
ENVREG BOR and
Voltage LVD
Regulator
PORTG
RG0:RG5(1)
VDDCORE/VCAP VDD, VSS MCLR
Data Bus<8>
Table Pointer<21>
PORTA
Data Latch
inc/dec logic 8 8
RA0:RA7(1,2)
Data Memory
(2/4 Kbytes)
21 PCLATU PCLATH
20 Address Latch
PCU PCH PCL PORTB
Program Counter 12 RB0:RB7(1)
Data Address<12>
31-Level Stack
Address Latch 4 12 4
BSR Access PORTC
Program Memory STKPTR FSR0
Bank
FSR1 RC0:RC7(1)
Data Latch FSR2 12
inc/dec
8 logic PORTD
Table Latch
RD0:RD7(1)
PORTE
IR
RE0:RE7
8
Instruction State Machine
Decode and Control Signals
Control PORTF
PRODH PRODL
RF1:RF7(1)
8 x 8 Multiply
Timing 3
Power-up 8
OSC2/CLKO Generation
OSC1/CLKI Timer
BITOP W PORTG
INTRC Oscillator 8 8
Oscillator 8
Start-up Timer RG0:RG5(1)
16 MHz
Oscillator Power-on 8 8
Reset
Precision ALU<8> PORTH
Band Gap Watchdog
Reference Timer
8 RH0:RH7(1)
ENVREG BOR and
Voltage
Regulator LVD
PORTJ
VSS 9, 25, 41, 56 P — Ground reference for logic and I/O pins.
VDD 26, 38, 57 P — Positive supply for logic and I/O pins.
AVSS 20 P — Ground reference for analog modules.
AVDD 19 P — Positive supply for analog modules.
ENVREG 18 I ST Enable for on-chip voltage regulator.
VDDCORE/VCAP 10 Core logic power or external filter capacitor connection.
VDDCORE
VCAP P — External filter capacitor connection (regulator
enabled/disabled).
Legend: TTL = TTL compatible input CMOS = CMOS compatible input or output
ST = Schmitt Trigger input with CMOS levels Analog = Analog input
I = Input O = Output
P = Power OD = Open-Drain (no P diode to VDD)
I2C™ = I2C/SMBus
Note 1: Default assignment for ECCP2 when the CCP2MX Configuration bit is set.
2: Alternate assignment for ECCP2 when the CCP2MX Configuration bit is cleared.
3: Not available on PIC18F65K90 and PIC18F85K90 devices.
RB6/KBI2/PGC 52
RB6 I/O TTL Digital I/O.
KBI2 I TTL Interrupt-on-change pin.
PGC I/O ST In-Circuit Debugger and ICSP™ programming clock pin.
RB7/KBI3/PGD 47
RB7 I/O TTL Digital I/O.
KBI3 I TTL Interrupt-on-change pin.
PGD I/O ST In-Circuit Debugger and ICSP programming data pin.
Legend: TTL = TTL compatible input CMOS = CMOS compatible input or output
ST = Schmitt Trigger input with CMOS levels Analog = Analog input
I = Input O = Output
P = Power OD = Open-Drain (no P diode to VDD)
I2C™ = I2C/SMBus
Note 1: Default assignment for ECCP2 when the CCP2MX Configuration bit is set.
2: Alternate assignment for ECCP2 when the CCP2MX Configuration bit is cleared.
3: Not available on PIC18F65K90 and PIC18F85K90 devices.
4: The CCP6, CCP7, CCP8 and CCP9 pin placement depends on the ECCPMX Configuration bit setting.
RH7/SEG43/CCP6/P1B/ 19
AN15
RH7 I/O ST Digital I/O.
SEG43 O Analog SEG43 output for LCD.
CCP6(4) I/O ST Capture 6 input/Compare 6 output/PWM6 output.
P1B O — ECCP1 PWM Output B.
AN15 I Analog Analog Input 15.
Legend: TTL = TTL compatible input CMOS = CMOS compatible input or output
ST = Schmitt Trigger input with CMOS levels Analog = Analog input
I = Input O = Output
P = Power OD = Open-Drain (no P diode to VDD)
I2C™ = I2C/SMBus
Note 1: Default assignment for ECCP2 when the CCP2MX Configuration bit is set.
2: Alternate assignment for ECCP2 when the CCP2MX Configuration bit is cleared.
3: Not available on PIC18F65K90 and PIC18F85K90 devices.
4: The CCP6, CCP7, CCP8 and CCP9 pin placement depends on the ECCPMX Configuration bit setting.
VDD
VSS
R1 (1) (1)
8-bit microcontrollers requires attention to a minimal R2
set of device pin connections before proceeding with ENVREG
MCLR
development. VCAP/VDDCORE
C1
The following pins must always be connected: C7(2)
PIC18FXXKXX
• All VDD and VSS pins
VDD
(see Section 2.2 “Power Supply Pins”) VSS
C6(2) C3(2)
• All AVDD and AVSS pins, regardless of whether or VSS
VDD
not the analog device features are used
AVDD
AVSS
VDD
VSS
(see Section 2.2 “Power Supply Pins”)
• MCLR pin
(see Section 2.3 “Master Clear (MCLR) Pin”)
C5(2) C4(2)
• ENVREG (if implemented) and VCAP/VDDCORE pins
(see Section 2.4 “Voltage Regulator Pins
(ENVREG and VCAP/VDDCORE)”)
Key (all values are recommendations):
These pins must also be connected if they are being C1 through C6: 0.1 F, 20V ceramic
used in the end application:
R1: 10 kΩ
• PGC/PGD pins used for In-Circuit Serial R2: 100Ω to 470Ω
Programming™ (ICSP™) and debugging purposes
Note 1: See Section 2.4 “Voltage Regulator Pins
(see Section 2.5 “ICSP Pins”) (ENVREG and VCAP/VDDCORE)” for
• OSCI and OSCO pins when an external oscillator explanation of ENVREG pin connections.
source is used 2: The example shown is for a PIC18F device
(see Section 2.6 “External Oscillator Pins”) with five VDD/VSS and AVDD/AVSS pairs.
Other devices may have more or less pairs;
Additionally, the following pins may be required:
adjust the number of decoupling capacitors
• VREF+/VREF- pins are used when external voltage appropriately.
reference for analog modules is implemented
Note: The AVDD and AVSS pins must always be
connected, regardless of whether any of
the analog modules are being used.
The minimum mandatory connections are shown in
Figure 2-1.
0.001
0.01 0.1 1 10 100 1000 10,000
Frequency (MHz)
Note: Typical data measurement at 25°C, 0V DC bias.
.
TABLE 2-1: SUITABLE CAPACITOR EQUIVALENTS
Nominal
Make Part # Base Tolerance Rated Voltage Temp. Range
Capacitance
TDK C3216X7R1C106K 10 µF ±10% 16V -55 to 125ºC
TDK C3216X5R1C106K 10 µF ±10% 16V -55 to 85ºC
Panasonic ECJ-3YX1C106K 10 µF ±10% 16V -55 to 125ºC
Panasonic ECJ-4YB1C106K 10 µF ±10% 16V -55 to 85ºC
Murata GRM32DR71C106KA01L 10 µF ±10% 16V -55 to 125ºC
Murata GRM31CR61C106KC31L 10 µF ±10% 16V -55 to 85ºC
Ceramic capacitors are suitable for use with the inter- -30
-40
nal voltage regulator of this microcontroller. However, -50
10V Capacitor
some care is needed in selecting the capacitor to -60
-70
6.3V Capacitor
ensure that it maintains sufficient capacitance over the -80
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
intended operating range of the application.
DC Bias Voltage (VDC)
Typical low-cost, 10 F ceramic capacitors are available
in X5R, X7R and Y5V dielectric ratings (other types are
also available, but are less common). The initial toler- When selecting a ceramic capacitor to be used with the
ance specifications for these types of capacitors are internal voltage regulator, it is suggested to select a
often specified as ±10% to ±20% (X5R and X7R), or high-voltage rating, so that the operating voltage is a
-20%/+80% (Y5V). However, the effective capacitance small percentage of the maximum rated capacitor volt-
that these capacitors provide in an application circuit will age. For example, choose a ceramic capacitor rated at
also vary based on additional factors, such as the 16V for the 2.5V core voltage. Suggested capacitors
applied DC bias voltage and the temperature. The total are shown in Table 2-1.
in-circuit tolerance is, therefore, much wider than the
initial tolerance specification. 2.5 ICSP Pins
The X5R and X7R capacitors typically exhibit satisfac- The PGC and PGD pins are used for In-Circuit Serial
tory temperature stability (ex: ±15% over a wide Programming™ (ICSP™) and debugging purposes. It
temperature range, but consult the manufacturer’s data is recommended to keep the trace length between the
sheets for exact specifications). However, Y5V capaci- ICSP connector and the ICSP pins on the device as
tors typically have extreme temperature tolerance short as possible. If the ICSP connector is expected to
specifications of +22%/-82%. Due to the extreme experience an ESD event, a series resistor is recom-
temperature tolerance, a 10 F nominal rated Y5V type mended, with the value in the range of a few tens of
capacitor may not deliver enough total capacitance to ohms, not to exceed 100Ω.
meet minimum internal voltage regulator stability and
transient response requirements. Therefore, Y5V Pull-up resistors, series diodes and capacitors on the
capacitors are not recommended for use with the PGC and PGD pins are not recommended as they will
internal regulator if the application must operate over a interfere with the programmer/debugger communica-
wide temperature range. tions to the device. If such discrete components are an
application requirement, they should be removed from
In addition to temperature tolerance, the effective the circuit during programming and debugging. Alter-
capacitance of large value ceramic capacitors can vary natively, refer to the AC/DC characteristics and timing
substantially, based on the amount of DC voltage requirements information in the respective device
applied to the capacitor. This effect can be very signifi- Flash programming specification for information on
cant, but is often overlooked or is not always capacitive loading limits, and pin input voltage high
documented. (VIH) and input low (VIL) requirements.
A typical DC bias voltage vs. capacitance graph for For device emulation, ensure that the “Communication
X7R type and Y5V type capacitors is shown in Channel Select” (i.e., PGCx/PGDx pins), programmed
Figure 2-4. into the device, matches the physical connections for
the ICSP to the Microchip debugger/emulator tool.
For more information on available Microchip
development tools connection requirements, refer to
Section 30.0 “Development Support”.
SOSCO
SOSCI
4x PLL Peripherals
MUX
MUX
OSC2
MUX
CPU
OSC1 PLLEN
FOSC<3:0> and PLLCFG
IDLEN
101
HF INTOSC 2 MHz 2 MHz
MUX
100 FOSC<3:0>
16 MHz to 1 MHz 1 MHz
011
31 kHz 500 kHz
500 kHz
010
250 kHz 250 kHz
001
31 kHz 31 kHz
000
MUX
500 kHz
Postscaler
IRCF<2:0>
MF INTOSC 250 kHz
MUX
500 kHz to
31 kHz
31 kHz
INTSRC
MFIOSEL
LF INTOSC 31 kHz
31 kHz
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
Note 1: Reset state depends on the state of the IESO Configuration bit (CONFIG1H<7>).
2: Modifying these bits will cause an immediate clock frequency switch if the internal oscillator is providing
the device clocks.
3: Source selected by the INTSRC bit (OSCTUNE<7>).
4: Modifying these bits will cause an immediate clock source switch.
5: INTSRC = OSCTUNE<7> and MFIOSEL = OSCCON2<0>.
Note 1: Reset state depends on the state of the IESO Configuration bit (CONFIG1H<7>).
2: Modifying these bits will cause an immediate clock frequency switch if the internal oscillator is providing
the device clocks.
3: Source selected by the INTSRC bit (OSCTUNE<7>).
4: Modifying these bits will cause an immediate clock source switch.
5: INTSRC = OSCTUNE<7> and MFIOSEL = OSCCON2<0>.
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
3.3 Clock Sources and mode. PIC18F87K90 family devices offer the SOSC
Oscillator Switching (Timer1/3/5/7) oscillator as a secondary oscillator
source. This oscillator, in all power-managed modes, is
Essentially, PIC18F87K90 family devices have these often the time base for functions, such as a Real-Time
independent clock sources: Clock (RTC).
• Primary oscillators The SOSCEN bit in the corresponding timer should be
• Secondary oscillators set correctly for the enabled SOSC. The
• Internal oscillator SOSCEL<1:0> bits (CONFIG1L<4:3>) decide the
The primary oscillators can be thought of as the main SOSC mode of operation:
device oscillators. These are any external oscillators • 11 = High-power SOSC circuit
connected to the OSC1 and OSC2 pins, and include • 10 = Digital (SCLKI) mode
the External Crystal and Resonator modes and the
• 01 = Low-power SOSC circuit
External Clock modes. If selected by the OSC<3:0>
Configuration bits (CONFIG1H<3:0>), the internal In addition to being a primary clock source in some
oscillator block may be considered a primary oscillator. circumstances, the internal oscillator is available as a
The internal oscillator block can be one of the following: power-managed mode clock source. The LF-INTOSC
source is also used as the clock source for several
• 31 kHz LF-INTRC source
special features, such as the WDT and Fail-Safe Clock
• 31 kHz to 500 kHz MF-INTOSC source Monitor. The internal oscillator block is discussed in
• 31 kHz to 16 MHz HF-INTOSC source more detail in Section 3.6 “Internal Oscillator
The particular mode is defined by the OSC Block”.
Configuration bits. The details of these modes are The PIC18F87K90 family includes features that allow
covered in Section 3.4 “External Oscillator Modes”. the device clock source to be switched from the main
The secondary oscillators are external clock oscillator, chosen by device configuration, to one of the
sources that are not connected to the OSC1 or OSC2 alternate clock sources. When an alternate clock
pin. These sources may continue to operate, even source is enabled, various power-managed operating
after the controller is placed in a power-managed modes are available.
Different capacitor values may be required to produce 3: Rs may be required to avoid overdriving
acceptable oscillator operation. The user should test crystals with low drive level specification.
the performance of the oscillator over the expected 4: Always verify oscillator performance over
VDD and temperature range for the application. Refer the VDD and temperature range that is
to the following application notes for oscillator-specific expected for the application.
information:
• AN588, “PIC® Microcontroller Oscillator Design FIGURE 3-2: CRYSTAL/CERAMIC
Guide” RESONATOR OPERATION
• AN826, “Crystal Oscillator Basics and Crystal (HS OR HSPLL
Selection for rfPIC® and PIC® Devices” CONFIGURATION)
• AN849, “Basic PIC® Oscillator Design” C1(1) OSC1
• AN943, “Practical PIC® Oscillator Analysis and
Design” To
Internal
• AN949, “Making Your Oscillator Work” XTAL Logic
RF(3)
See the notes following Table 3-3 for additional
OSC2 Sleep
information.
C2(1) RS(2) PIC18F87K90
TABLE 3-3: CAPACITOR SELECTION FOR Note 1: See Table 3-2 and Table 3-3 for initial values of
CRYSTAL OSCILLATOR C1 and C2.
2: A series resistor (RS) may be required for AT
Typical Capacitor Values
Crystal strip cut crystals.
Osc Type Tested:
Freq. 3: RF varies with the oscillator mode chosen.
C1 C2
HS 4 MHz 27 pF 27 pF 3.5 RC Oscillator
8 MHz 22 pF 22 pF
For timing-insensitive applications, the RC and RCIO
20 MHz 15 pF 15 pF Oscillator modes offer additional cost savings. The
Capacitor values are for design guidance only. actual oscillator frequency is a function of several
factors:
Different capacitor values may be required to produce
acceptable oscillator operation. The user should test • Supply voltage
the performance of the oscillator over the expected • Values of the external resistor (REXT) and
VDD and temperature range for the application. capacitor (CEXT)
Refer to the Microchip application notes cited in • Operating temperature – Given the same device,
Table 3-2 for oscillator-specific information. Also see operating voltage and temperature and
the notes following this table for additional component values, there will also be unit-to-unit
information. frequency variations. These are due to factors,
such as:
- Normal manufacturing variation
- Difference in lead frame capacitance
between package types (especially for low
CEXT values)
- Variations within the tolerance of limits of
REXT and CEXT
REXT
Internal
OSC1
Clock An external clock source may also be connected to the
OSC1 pin in the HS mode, as shown in Figure 3-6. In
CEXT
PIC18FXXXX this configuration, the divide-by-4 output on OSC2 is
VSS not available. Current consumption in this configuration
OSC2/CLKO will be somewhat higher than EC mode, as the internal
FOSC/4
oscillator’s feedback circuitry will be enabled (in EC
Recommended values: 3 k REXT 100 k mode, the feedback circuit is disabled).
20 pF CEXT 300 pF
FIGURE 3-6: EXTERNAL CLOCK INPUT
The RCIO Oscillator mode (Figure 3-4) functions like
OPERATION (HS OSC
the RC mode, except that the OSC2 pin becomes an
CONFIGURATION)
additional general purpose I/O pin. The I/O pin
becomes bit 6 of PORTA (RA6).
Clock from OSC1
FIGURE 3-4: RCIO OSCILLATOR MODE Ext. System PIC18F87K90
VDD (HS Mode)
Open OSC2
REXT
OSC1 Internal
Clock
3.5.2 PLL FREQUENCY MULTIPLIER
CEXT
A Phase Lock Loop (PLL) circuit is provided as an
PIC18FXXXX
VSS option for users who want to use a lower frequency
RA6 I/O (OSC2) oscillator circuit, or to clock the device up to its highest
rated frequency from a crystal oscillator. This may be
Recommended values: 3 k REXT 100 k useful for customers who are concerned with EMI due
20 pF CEXT 300 pF to high-frequency crystals, or users who require higher
clock speeds from an internal oscillator.
3.5.1 EXTERNAL CLOCK INPUT
(EC MODES) 3.5.2.1 HSPLL and ECPLL Modes
The EC and ECPLL Oscillator modes require an The HSPLL and ECPLL modes provide the ability to
external clock source to be connected to the OSC1 pin. selectively run the device at four times the external
There is no oscillator start-up time required after a oscillating source to produce frequencies up to 64 MHz.
Power-on Reset or after an exit from Sleep mode. The PLL is enabled by setting the PLLEN bit
In the EC Oscillator mode, the oscillator frequency, (OSCTUNE<6>) or the PLLCFG bit (CONFIG1H<4>).
divided by 4, is available on the OSC2 pin. This signal The PLLEN bit provides software control for the PLL,
may be used for test purposes or to synchronize other even if PLLCFG is set to ‘0’. The PLL is enabled only
logic. Figure 3-5 shows the pin connections for the EC when the HS or EC oscillator frequency is within the
Oscillator mode. 4 MHz to 16 MHz input range.
This enables additional flexibility for controlling the
application’s clock speed in software. The PLLEN
should be enabled in HS or EC Oscillator mode only if
the input frequency is in the range of 4 MHz-16 MHz.
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
These categories define which portions of the device 4.1.2 ENTERING POWER-MANAGED
are clocked, and sometimes, at what speed. The Run MODES
and Idle modes may use any of the three available
clock sources (primary, secondary or internal oscillator Switching from one power-managed mode to another
block). The Sleep mode does not use a clock source. begins by loading the OSCCON register. The
SCS<1:0> bits select the clock source and determine
The ULPWU mode, on the RA0 pin, enables a slow fall- which Run or Idle mode is used. Changing these bits
ing voltage to generate a wake-up, even from Sleep, causes an immediate switch to the new clock source,
without excess current consumption. (See Section 4.7 assuming that it is running. The switch may also be
“Ultra Low-Power Wake-up”.) subject to clock transition delays. These considerations
The power-managed modes include several power- are discussed in Section 4.1.3 “Clock Transitions
saving features offered on previous PIC® devices. One and Status Indicators” and subsequent sections.
is the clock switching feature, offered in other PIC18 Entering the power-managed Idle or Sleep modes is
devices. This feature allows the controller to use the triggered by the execution of a SLEEP instruction. The
SOSC oscillator instead of the primary one. Another actual mode that results depends on the status of the
power-saving feature is Sleep mode, offered by all PIC IDLEN bit.
devices, where all device clocks are stopped.
Depending on the current and impending mode, a
change to a power-managed mode does not always
4.1 Selecting Power-Managed Modes
require setting all of the previously discussed bits. Many
Selecting a power-managed mode requires two transitions can be done by changing the oscillator select
decisions: bits, or changing the IDLEN bit, prior to issuing a SLEEP
instruction. If the IDLEN bit is already configured as
• Will the CPU be clocked or not
desired, it may only be necessary to perform a SLEEP
• What will be the clock source instruction to switch to the desired mode.
SOSCI 1 2 3 n-1 n
CPU
Clock
Peripheral
Clock
Program
Counter PC PC + 2 PC + 4
FIGURE 4-2: TRANSITION TIMING FROM SEC_RUN MODE TO PRI_RUN MODE (HSPLL)
Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3
SOSC
OSC1
TOST(1) TPLL(1)
1 2 n-1 n
PLL Clock
Output
Clock
Transition(2)
CPU Clock
Peripheral
Clock
Program PC PC + 2 PC + 4
Counter
Note 1: TOST = 1024 TOSC; TPLL = 2 ms (approx). These intervals are not shown to scale.
2: Clock transition typically occurs within 2-4 TOSC.
4.2.3 RC_RUN MODE This mode is entered by setting the SCS1 bit to ‘1’. To
maintain software compatibility with future devices, it is
In RC_RUN mode, the CPU and peripherals are
recommended that the SCS0 bit also be cleared, even
clocked from the internal oscillator block using the
though the bit is ignored. When the clock source is
INTOSC multiplexer. In this mode, the primary clock is
switched to the INTOSC multiplexer (see Figure 4-3),
shut down. When using the LF-INTOSC source, this
the primary oscillator is shut down and the OSTS bit is
mode provides the best power conservation of all the
cleared. The IRCF bits may be modified at any time to
Run modes, while still executing code. It works well for
immediately change the clock speed.
user applications which are not highly timing-sensitive
or do not require high-speed clocks at all times. Note: Caution should be used when modifying a
If the primary clock source is the internal oscillator single IRCF bit. At a lower VDD, it is
block – either LF-INTOSC or INTOSC (MF-INTOSC or possible to select a higher clock speed
HF-INTOSC) – there are no distinguishable differences than is supportable by that VDD. Improper
between the PRI_RUN and RC_RUN modes during device operation may result if the VDD/
execution. Entering or exiting RC_RUN mode, FOSC specifications are violated.
however, causes a clock switch delay. Therefore, if the
primary clock source is the internal oscillator block,
using RC_RUN mode is not recommended.
Clocks to the device continue while the INTOSC source On transitions from RC_RUN mode to PRI_RUN mode,
stabilizes after an interval of TIOBST (Parameter 39, the device continues to be clocked from the INTOSC
Table 31-10). multiplexer while the primary clock is started. When the
If the IRCF bits were previously at a non-zero value, or primary clock becomes ready, a clock switch to the
if INTSRC was set before setting SCS1, and the primary clock occurs (see Figure 4-4). When the clock
INTOSC source was already stable, the HFIOFS or switch is complete, the HFIOFS or MFIOFS bit is
MFIOFS bit will remain set. cleared, the OSTS bit is set and the primary clock is
providing the device clock. The IDLEN and SCS bits
are not affected by the switch. The LF-INTOSC source
will continue to run if either the WDT or the Fail-Safe
Clock Monitor is enabled.
LF-INTOSC 1 2 3 n-1 n
CPU
Clock
Peripheral
Clock
Program
Counter PC PC + 2 PC + 4
Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3
INTOSC
Multiplexer
OSC1
TOST(1) TPLL(1)
1 2 n-1 n
PLL Clock
Output
Clock
Transition(2)
CPU Clock
Peripheral
Clock
Program PC PC + 2 PC + 4
Counter
Note1: TOST = 1024 TOSC; TPLL = 2 ms (approx). These intervals are not shown to scale.
2: Clock transition typically occurs within 2-4 TOSC.
OSC1
CPU
Clock
Peripheral
Clock
Sleep
Program
Counter PC PC + 2
OSC1
TOST(1) TPLL(1)
PLL Clock
Output
CPU Clock
Peripheral
Clock
Program PC PC + 2 PC + 4 PC + 6
Counter
Wake Event OSTS bit Set
Note1: TOST = 1024 TOSC; TPLL = 2 ms (approx). These intervals are not shown to scale.
Q1 Q2 Q3 Q4 Q1
OSC1
CPU Clock
Peripheral
Clock
Program PC PC + 2
Counter
FIGURE 4-8: TRANSITION TIMING FOR WAKE FROM IDLE TO RUN MODE
Q1 Q2 Q3 Q4
OSC1
TCSD
CPU Clock
Peripheral
Clock
Program PC
Counter
Wake Event
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
Note 1: RTCCMD can only be set to ‘1’ after an EECON2 unlock sequence. Refer to Section 17.0 “Real-Time
Clock and Calendar (RTCC)” for the unlock sequence (see Example 17-1).
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
RESET Instruction
External Reset
MCLR
( )_IDLE
Sleep
WDT
Time-out
PWRT
32 s PWRT 66 ms Chip_Reset
R Q
LF-INTOSC 11-Bit Ripple Counter
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
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: 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).
• High-Power BOR
• Medium Power BOR 5.4.1 DETECTING BOR
• Low-Power BOR The BOR bit always resets to ‘0’ on any Brown-out
• Zero-Power BOR Reset or Power-on Reset event. This makes it difficult
Each power mode is selected by the BORPWR<1:0> to determine if a Brown-out Reset event has occurred
bits setting (CONFIG2L<6:5>). For low, medium and just by reading the state of BOR alone. A more reliable
high-power BOR, the module monitors the VDD depend- method is to simultaneously check the state of both
ing on the BORV<1:0> setting (CONFIG1L<3:2>). A POR and BOR. This assumes that the POR bit is reset
BOR event re-arms the Power-on Reset. It also causes to ‘1’ in software immediately after any Power-on Reset
a Reset depending on which of the trip levels has been event. If BOR is ‘0’ while POR is ‘1’, it can be reliably
set: 1.8V, 2V, 2.7V or 3V. The typical (IBOR) trip level for assumed that a Brown-out Reset event has occurred.
the Low and Medium Power BOR will be 0.75 A and LP-BOR cannot be detected with the BOR bit in the
3 A. RCON register. LP-BOR can rearm the POR and can
cause a Power-on Reset.
FIGURE 5-3: TIME-OUT SEQUENCE ON POWER-UP (MCLR TIED TO VDD, VDD RISE < TPWRT)
VDD
MCLR
INTERNAL POR
TPWRT
PWRT TIME-OUT
INTERNAL RESET
VDD
MCLR
INTERNAL POR
TPWRT
PWRT TIME-OUT
INTERNAL RESET
FIGURE 5-5: TIME-OUT SEQUENCE ON POWER-UP (MCLR NOT TIED TO VDD): CASE 2
VDD
MCLR
INTERNAL POR
TPWRT
PWRT TIME-OUT
INTERNAL RESET
FIGURE 5-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
TABLE 5-1: STATUS BITS, THEIR SIGNIFICANCE AND THE INITIALIZATION CONDITION FOR
RCON REGISTER
PC<20:0>
CALL, CALLW, RCALL, 21
RETURN, RETFIE, RETLW,
ADDULNK, SUBULNK
Stack Level 1
Stack Level 31
007FFFh
00FFFFh
1FFFFFh
Note: Sizes of memory areas are not to scale. The sizes of program memory areas are enhanced to show detail.
00011
Top-of-Stack 001A34h 00010
000D58h 00001
00000
Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4
OSC1
Q1
Q2 Internal
Phase
Q3 Clock
Q4
PC PC PC + 2 PC + 4
OSC2/CLKO
(RC mode)
Execute INST (PC – 2)
Fetch INST (PC) Execute INST (PC)
Fetch INST (PC + 2) Execute INST (PC + 2)
Fetch INST (PC + 4)
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.
6.2.4 TWO-WORD INSTRUCTIONS used by the instruction sequence. If the first word is
skipped for some reason, and the second word is
The standard PIC18 instruction set has four two-word
executed by itself, a NOP is executed instead. This is
instructions: CALL, MOVFF, GOTO and LSFR. In all
necessary for cases when the two-word instruction is
cases, the second word of the instructions always has
preceded by a conditional instruction that changes the
‘1111’ as its four Most Significant bits. The other 12 bits
PC. Example 6-4 shows how this works.
are literal data, usually a data memory address.
The use of ‘1111’ in the 4 MSbs of an instruction Note: For information on two-word instructions
specifies a special form of NOP. If the instruction is in the extended instruction set, see
executed in proper sequence, immediately after the Section 6.5 “Program Memory and the
first word, the data in the second word is accessed and Extended Instruction Set”.
Note 1: Addresses, EF4h through F5Fh, are also used by SFRs, but are not part of the Access RAM. Users must
always use the complete address, or load the proper BSR value, to access these registers.
2: These addresses are unused for devices with 32 Kbytes of program memory (PIC18FX5K90). For those
devices, read these addresses at 00h.
Bank 3
through
Bank 13
FFh
E00h
00h
Bank 14
F00h FFh
00h
Bank 15
FFFh FFh
Note 1: 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.
2: The MOVFF instruction embeds the entire 12-bit address in the instruction.
6.3.2 ACCESS BANK Using this “forced” addressing allows the instruction to
operate on a data address in a single cycle without
While the use of the BSR, with an embedded 8-bit
updating the BSR first. For 8-bit addresses of 60h and
address, allows users to address the entire range of data
above, this means that users can evaluate and operate
memory, it also means that the user must ensure that the
on SFRs more efficiently. The Access RAM below 60h
correct bank is selected. If not, data may be read from,
is a good place for data values that the user might need
or written to, the wrong location. This can be disastrous
to access rapidly, such as immediate computational
if a GPR is the intended target of an operation, but an
results or common program variables.
SFR is written to instead. But verifying and/or changing
the BSR for each read or write to data memory can Access RAM also allows for faster and more code
become very inefficient. efficient context saving and switching of variables.
To streamline access for the most commonly used data The mapping of the Access Bank is slightly different
memory locations, the data memory is configured with when the extended instruction set is enabled (XINST
an Access Bank, which allows users to access a Configuration bit = 1). This is discussed in more detail
mapped block of memory without specifying a BSR. in Section 6.6.3 “Mapping the Access Bank in
The Access Bank consists of the first 96 bytes of Indexed Literal Offset Mode”.
memory (00h-5Fh) in Bank 0 and the last 160 bytes of
memory (60h-FFh) in Bank 15. The lower half is known 6.3.3 GENERAL PURPOSE
as the “Access RAM” and is composed of GPRs. The REGISTER FILE
upper half is where the device’s SFRs are mapped. PIC18 devices may have banked memory in the GPR
These two areas are mapped contiguously in the area. This is data RAM which is available for use by all
Access Bank and can be addressed in a linear fashion instructions. GPRs start at the bottom of Bank 0
by an 8-bit address (Figure 6-6). (address 000h) and grow upwards towards the bottom of
The Access Bank is used by core PIC18 instructions the SFR area. GPRs are not initialized by a Power-on
that include the Access RAM bit (the ‘a’ parameter in Reset and are unchanged on all other Resets.
the instruction). When ‘a’ is equal to ‘1’, the instruction
uses the BSR and the 8-bit address included in the
opcode for the data memory address. When ‘a’ is ‘0’,
however, the instruction is forced to use the Access
Bank address map. In that case, the current value of
the BSR is ignored entirely.
Addr. Name Addr. Name Addr. Name Addr. Name Addr. Name Addr. Name
FFFh TOSU FDFh INDF2(1) FBFh ECCP1AS F9Fh IPR1 F7Fh EECON1 F5Fh RTCCFG
FFEh TOSH FDEh POSTINC2(1) FBEh ECCP1DEL F9Eh PIR1 F7Eh EECON2 F5Eh RTCCAL
FFDh TOSL FDDh POSTDEC2(1) FBDh CCPR1H F9Dh PIE1 F7Dh LCDDATA23(3) F5Dh RTCVALH
FFCh STKPTR FDCh PREINC2(1) FBCh CCPR1L F9Ch PSTR1CON F7Ch LCDDATA22(3) F5Ch RTCVALL
(1)
FFBh PCLATU FDBh PLUSW2 FBBh CCP1CON F9Bh OSCTUNE F7Bh LCDDATA21 F5Bh ALRMCFG
FFAh PCLATH FDAh FSR2H FBAh PIR5 F9Ah TRISJ(3) F7Ah LCDDATA20 F5Ah ALRMRPT
(3)
FF9h PCL FD9h FSR2L FB9h PIE5 F99h TRISH F79h LCDDATA19 F59h ALRMVALH
FF8h TBLPTRU FD8h STATUS FB8h IPR4 F98h TRISG F78h LCDDATA18 F58h ALRMVALL
FF7h TBLPTRH FD7h TMR0H FB7h PIR4 F97h TRISF F77h LCDDATA17(3) F57h CTMUCONH
FF6h TBLPTRL FD6h TMR0L FB6h PIE4 F96h TRISE F76h LCDDATA16(3) F56h CTMUCONL
FF5h TABLAT FD5h T0CON FB5h CVRCON F95h TRISD F75h LCDDATA15 F55h CTMUICON
FF4h PRODH FD4h SPBRGH1 FB4h CMSTAT F94h TRISC F74h LCDDATA14 F54h CMCON1
FF3h PRODL FD3h OSCCON FB3h TMR3H F93h TRISB F73h LCDDATA13 F53h PADCFG1
FF2h INTCON FD2h IPR5 FB2h TMR3L F92h TRISA F72h LCDDATA12 F52h ECCP2AS
FF1h INTCON2 FD1h WDTCON FB1h T3CON F91h LATJ(3) F71h LCDDATA11(3) F51h ECCP2DEL
FF0h INTCON3 FD0h RCON FB0h T3GCON F90h LATH(3) F70h LCDDATA10(3) F50h CCPR2H
FEFh INDF0(1) FCFh TMR1H FAFh SPBRG1 F8Fh LATG F6Fh LCDDATA9 F4Fh CCPR2L
FEEh POSTINC0(1) FCEh TMR1L FAEh RCREG1 F8Eh LATF F6Eh LCDDATA8 F4Eh CCP2CON
FEDh POSTDEC0(1) FCDh T1CON FADh TXREG1 F8Dh LATE F6Dh LCDDATA7 F4Dh ECCP3AS
FECh PREINC0(1) FCCh TMR2 FACh TXSTA1 F8Ch LATD F6Ch LCDDATA6 F4Ch ECCP3DEL
FEBh PLUSW0(1) FCBh PR2 FABh RCSTA1 F8Bh LATC F6Bh LCDDATA5(3) F4Bh CCPR3H
FEAh FSR0H FCAh T2CON FAAh T1GCON F8Ah LATB F6Ah LCDDATA4(3) F4Ah CCPR3L
FE9h FSR0L FC9h SSP1BUF FA9h IPR6 F89h LATA F69h LCDDATA3 F49h CCP3CON
FE8h WREG FC8h SSP1ADD FA8h HLVDCON F88h PORTJ(3) F68h LCDDATA2 F48h CCPR8H
(1) (2) (3)
FE7h INDF1 FC7h SSP1STAT FA7h — F87h PORTH F67h LCDDATA1 F47h CCPR8L
FE6h POSTINC1(1) FC6h SSP1CON1 FA6h PIR6 F86h PORTG F66h LCDDATA0 F46h CCP8CON
FE5h POSTDEC1(1) FC5h SSP1CON2 FA5h IPR3 F85h PORTF F65h BAUDCON1 F45h CCPR9H(4)
FE4h PREINC1(1) FC4h ADRESH FA4h PIR3 F84h PORTE F64h OSCCON2 F44h CCPR9L(4)
FE3h PLUSW1(1) FC3h ADRESL FA3h PIE3 F83h PORTD F63h EEADRH F43h CCP9CON(4)
FE2h FSR1H FC2h ADCON0 FA2h IPR2 F82h PORTC F62h EEADR F42h CCPR10H(4)
FE1h FSR1L FC1h ADCON1 FA1h PIR2 F81h PORTB F61h EEDATA F41h CCPR10L(4)
FE0h BSR FC0h ADCON2 FA0h PIE2 F80h PORTA F60h PIE6 F40h CCP10CON(4)
(4) (4)
F3Fh TMR7H F32h TMR12 F25h ANCON0 F18h PMD1 F0Bh CCPR6H EFEh SSP2CON2
Addr. Name Addr. Name Addr. Name Addr. Name Addr. Name Addr. Name
F3Eh TMR7L(4) F31h PR12(4) F24h ANCON1 F17h PMD2 F0Ah CCPR6L EFDh LCDREF
F3Dh T7CON(4) F30h T12CON(4) F23h ANCON2 F16h PMD3 F09h CCP6CON EFCh LCDRL
F3Ch T7GCON(4) F2Fh CM2CON F22h RCSTA2 F15h TMR5H F08h CCPR7H EFBh LCDSE5(3)
F3Bh TMR6 F2Eh CM3CON F21h TXSTA2 F14h TMR5L F07h CCPR7L EFAh LCDSE4
F3Ah PR6 F2Dh CCPTMRS0 F20h BAUDCON2 F13h T5CON F06h CCP7CON EF9h LCDSE3
F39H T6CON F2Ch CCPTMRS1 F1Fh SPBRGH2 F12h T5GCON F05h TMR4 EF8h LCDSE2
F38h TMR8 F2Bh CCPTMRS2 F1Eh SPBRG2 F11h CCPR4H F04h PR4 EF7h LCDSE1
F37h PR8 F2Ah REFOCON F1Dh RCREG2 F10h CCPR4L F03h T4CON EF6h LCDSE0
F36h T8CON F29H ODCON1 F1Ch TXREG2 F0Fh CCP4CON F02h SSP2BUF EF5h LCDPS
F35h TMR10(4) F28h ODCON2 F1Bh PSTR2CON F0Eh CCPR5H F01h SSP2ADD EF4h LCDCON
F34h PR10(4) F27h ODCON3 F1Ah PSTR3CON F0Dh CCPR5L F00h SSP2STAT
F33h T10CON(4) F26h — F19h PMD0 F0Ch CCP5CON EFFh SSP2CON1
EF4h LCDCON LCDEN SLPEN WERR — CS1 CS0 LMUX1 LMUX0 000- 0000
EF5h LCDPS WFT BIASMD LCDA WA LP3 LP2 LP1 LP0 0000 0000
EF6h LCDSE0 SE07 SE06 SE05 SE04 SE03 SE02 SE01 SE00 0000 0000
EF7h LCDSE1 SE15 SE14 SE13 SE12 SE11 SE10 SE09 SE08 0000 0000
EF8h LCDSE2 SE23 SE22 SE21 SE20 SE19 SE18 SE17 SE16 0000 0000
EF9h LCDSE3 SE31 SE30 SE29 SE28 SE27 SE26 SE25 SE24 0000 0000
EFAh LCDSE4 SE39 SE38 S37 SE36 SE35 SE34 SE33 SE32 0000 0000
EFBh LCDSE5(2) SE47 SE46 SE45 SE44 SE43 SE42 SE41 SE40 0000 0000
EFCh LCDRL LRLAP1 LRLAP0 LRLBP1 LRLBP0 — LRLAT2 LRLAT1 LRLAT0 0000 -000
EFDh LCDREF LCDIRE LCDIRS LCDCST2 LCDCST1 LCDCST0 VLCD3PE VLCD2PE VLCD1PE 0000 0000
EFEh SSP2CON2 GCEN ACKSTAT ACKDT ACKEN RCEN PEN RSEN SEN 0000 0000
EFFh SSP2CON1 WCOL SSPOV SSPEN CKP SSPM3 SSPM2 SSPM1 SSPM0 0000 0000
F00h SSP2STAT SMP CKE D/A P S R/W UA BF 0000 0000
F01h SSP2ADD MSSP Address Register in I2C™ Slave Mode. SSP1 Baud Rate Reload Register in I2C Master Mode 0000 0000
F02h SSP2BUF MSSP Receive Buffer/Transmit Register xxxx xxxx
F03h T4CON — T4OUTPS3 T4OUTPS2 T4OUTPS1 T4OUTPS0 TMR4ON T4CKPS1 T4CKPS0 -000 0000
F04h PR4 Timer4 Period Register 0000 0000
F05h TMR4 Timer4 Register 1111 1111
F06h CCP7CON — — DC7B1 DC7B0 CCP7M3 CCP7M2 CCP7M1 CCP7M0 --00 0000
F07h CCPR7L Capture/Compare/PWM Register 7 Low Byte xxxx xxxx
F08h CCPR7H Capture/Compare/PWM Register7 High Byte xxxx xxxx
F09h CCP6CON — — DC6B1 DC6B0 CCP6M3 CCP6M2 CCP6M1 CCP6M0 --00 0000
F0Ah CCPR6L Capture/Compare/PWM Register 6 Low Byte xxxx xxxx
F0Bh CCPR6H Capture/Compare/PWM Register6 High Byte xxxx xxxx
F0Ch CCP5CON — — DC5B1 DC5B0 CCP5M3 CCP5M2 CCP5M1 CCP5M0 --00 0000
F0Dh CCPR5L Capture/Compare/PWM Register 5 Low Byte xxxx xxxx
F0Eh CCPR5H Capture/Compare/PWM Register 5 High Byte xxxx xxxx
F0Fh CCP4CON — — DC4B1 DC4B0 CCP4M3 CCP4M2 CCP4M1 CCP4M0 --00 0000
F10h CCPR4L Capture/Compare/PWM Register 4 Low Byte xxxx xxxx
F11h CCPR4H Capture/Compare/PWM Register 4 High Byte xxxx xxxx
F12h T5GCON TMR5GE T5GPOL T5GTM T5GSPM T5GGO/ T5GVAL T5GSS1 T5GSS0 0000 0000
T5DONE
F13h T5CON TMR5CS1 TMR5CS0 T5CKPS1 T5CKPS0 SOSCEN T5SYNC RD16 TMR5ON 0000 0000
F14h TMR5L Timer5 Register Low Byte 0000 0000
F15h TMR5H Timer5 Register High Byte xxxx xxxx
F16h PMD3 CCP10MD(3) CCP9MD(3) CCP8MD CCP7MD CCP6MD CCP5MD CCP4MD TMR12MD(3) 0000 0000
F17h PMD2 TMR10MD(3) TMR8MD TMR7MD(3) TMR6MD TMR5MD CMP3MD CMP2MD CMP1MD 0000 0000
F18h PMD1 — CTMUMD RTCCMD TMR4MD TMR3MD TMR2MD TMR1MD — -000 000-
F19h PMD0 CCP3MD CCP2MD CCP1MD UART2MD UART1MD SSP2MD SSP1MD ADCMD 0000 0000
F1Ah PSTR3CON CMPL1 CMPL0 — STRSYNC STRD STRC STRB STRA 00-0 0001
F1Bh PSTR2CON CMPL1 CMPL0 — STRSYNC STRD STRC STRB STRA 00-0 0001
F1Ch TXREG2 Transmit Data FIFO xxxx xxxx
F1Dh RCREG2 Receive Data FIFO 0000 0000
F1Eh SPBRG2 USART2 Baud Rate Generator Low Byte 0000 0000
F1Fh SPBRGH2 USART2 Baud Rate Generator High Byte 0000 0000
F20h BAUDCON2 ABDOVF RCIDL RXDTP TXCKP BRG16 — WUE ABDEN 0100 0-00
F21h TXSTA2 CSRC TX9 TXEN SYNC SENDB BRGH TRMT TX9D 0000 0010
F22h RCSTA2 SPEN RX9 SREN CREN ADDEN FERR OERR RX9D 0000 000x
F23h ANCON2 ANSEL23 ANSEL22 ANSEL21 ANSEL20 ANSEL19 ANSEL18 ANSEL17 ANSEL16 1111 1111
Note 1: This bit is available when Master Clear is disabled (MCLRE = 0). When MCLRE is set, the bit is unimplemented.
2: Unimplemented in 64-pin devices (PIC18F6XK90).
3: Unimplemented in devices with a program memory of 32 Kbytes (PIC18FX5K90).
F24h ANCON1 ANSEL15 ANSEL14 ANSEL13 ANSEL12 ANSEL11 ANSEL10 ANSEL9 ANSEL8 1111 1111
F25h ANCON0 ANSEL7 ANSEL6 ANSEL5 ANSEL4 ANSEL3 ANSEL2 ANSEL1 ANSEL0 1111 1111
F26h — — — — — — — — — —
F27h ODCON3 U2OD U1OD — — — — — CTMUDS 00-- ---0
F28h ODCON2 CCP10OD(3) CCP9OD(3) CCP8OD CCP7OD CCP6OD CCP5OD CCP4OD CCP3OD 0000 0000
F29H ODCON1 SSP1OD CCP2OD CCP1OD — — — — SSP2OD 000- ---0
F2Ah REFOCON ROON — ROSSLP ROSEL RODIV3 RODIV2 RODIV1 RODIV0 0-00 0000
F2Bh CCPTMRS2 — — — C10TSEL0 — C9TSEL0 C8TSEL1 C8TSEL0 ---0 -000
F2Ch CCPTMRS1 C7TSEL1 C7TSEL0 — C6TSEL0 — C5TSEL0 C4TSEL1 C4TSEL0 00-0 -000
F2Dh CCPTMRS0 C3TSEL1 C3TSEL0 C2TSEL2 C2TSEL1 C2TSEL0 C1TSEL2 C1TSEL1 C1TSEL0 0000 0000
F2Eh CM3CON CON COE CPOL EVPOL1 EVPOL0 CREF CCH1 CCH0 0001 1111
F2Fh CM2CON CON COE CPOL EVPOL1 EVPOL0 CREF CCH1 CCH0 0001 1111
F30h T12CON — T12OUTPS3 T12OUTPS2 T12OUTPS1 T12OUTPS0 TMR12ON T12CKPS1 T12CKPS0 -000 0000
F31h PR12 Timer12 Period Register 1111 1111
F32h TMR12 TMR12 Register 0000 0000
F33h T10CON(3) — T10OUTPS3 T10OUTPS2 T10OUTPS1 T10OUTPS0 TMR10ON T10CKPS1 T10CKPS0 -000 0000
F34h PR10 Timer10 Period Register 1111 1111
F35h TMR10 TMR10 Register 0000 0000
F36h T8CON — T8OUTPS3 T8OUTPS2 T8OUTPS1 T8OUTPS0 TMR8ON T8CKPS1 T8CKPS0 -000 0000
F37h PR8 Timer8 Period Register 1111 1111
F38h TMR8 Timer8 Register 0000 0000
F39H T6CON — T6OUTPS3 T6OUTPS2 T6OUTPS1 T6OUTPS0 TMR6ON T6CKPS1 T6CKPS0 -000 0000
F3Ah PR6 Timer6 Period Register 1111 1111
F3Bh TMR6 Timer6 Register 0000 0000
F3Ch T7GCON(3) TMR7GE T7GPOL T7GTM T7GSPM T7GGO/ T7GVAL T7GSS1 T7GSS0 0000 0x00
T7DONE
F3Dh T7CON(3) TMR7CS1 TMR7CS0 T7CKPS1 T7CKPS0 — T7SYNC RD16 TMR7ON 0000 0x00
F3Eh TMR7L(3) Timer7 Register Low Byte xxxx xxxx
F3Fh TMR7H(3) Timer7 Register High Byte xxxx xxxx
F40h CCP10CON(3) — — DC10B1 DC10B0 CCP10M3 CCP10M2 CCP10M1 CCP10M0 --00 0000
F41h CCPR10L(3) Capture/Compare/PWM Register 10 Low Byte xxxx xxxx
F42h CCPR10H(3) Capture/Compare/PWM Register 10 High Byte xxxx xxxx
F43h CCP9CON(3) — — DC9B1 DC9B0 CCP9M3 CCP9M2 CCP9M1 CCP9M0 --00 0000
F44h CCPR9L(3) Capture/Compare/PWM Register 9 Low Byte xxxx xxxx
F45h CCPR9H(3) Capture/Compare/PWM Register 9 High Byte xxxx xxxx
F46h CCP8CON — — DC8B1 DC8B0 CCP8M3 CCP8M2 CCP8M1 CCP8M0 --00 0000
F47h CCPR8L Capture/Compare/PWM Register 8 Low Byte xxxx xxxx
F48h CCPR8H Capture/Compare/PWM Register 8 High Byte xxxx xxxx
F49h CCP3CON P3M1 P3M0 DC3B1 DC3B0 CCP3M3 CCP3M2 CCP3M1 CCP3M0 0000 0000
F4Ah CCPR3L Capture/Compare/PWM Register 3 Low Byte xxxx xxxx
F4Bh CCPR3H Capture/Compare/PWM Register 3 High Byte xxxx xxxx
F4Ch ECCP3DEL P3RSEN P3DC6 P3DC5 P3DC4 P3DC3 P3DC2 P3DC1 P3DC0 0000 0000
F4Dh ECCP3AS ECCP3ASE ECCP3AS2 ECCP3AS1 ECCP3AS0 PSS3AC1 PSS3AC0 PSS3BD1 PSS3BD0 0000 0000
F4Eh CCP2CON P2M1 P2M0 DC2B1 DC2B0 CCP2M3 CCP2M2 CCP2M1 CCP2M0 0000 0000
F4Fh CCPR2L Capture/Compare/PWM Register 2 Low Byte xxxx xxxx
Note 1: This bit is available when Master Clear is disabled (MCLRE = 0). When MCLRE is set, the bit is unimplemented.
2: Unimplemented in 64-pin devices (PIC18F6XK90).
3: Unimplemented in devices with a program memory of 32 Kbytes (PIC18FX5K90).
F81h PORTB RB7 RB6 RB5 RB4 RB3 RB2 RB1 RB0 xxxx xxxx
F82h PORTC RC7 RC6 RC5 RC4 RC3 RC2 RC1 RC0 xxxx xxxx
F83h PORTD RD7 RD6 RD5 RD4 RD3 RD2 RD1 RD0 xxxx xxxx
F84h PORTE RE7 RE6 RE5 RE4 RE3 RE2 RE1 RE0 xxxx xxxx
F85h PORTF RF7 RF6 RF5 RF4 RF3 RF2 RF1 — xxxx xxx-
F86h PORTG — — RG5(1) RG4 RG3 RG2 RG1 RG0 --xx xxxx
F87h PORTH(2) RH7 RH6 RH5 RH4 RH3 RH2 RH1 RH0 xxxx xxxx
F88h PORTJ(2) RJ7 RJ6 RJ5 RJ4 RJ3 RJ2 RJ1 RJ0 xxxx xxxx
F89h LATA LATA7 LATA6 LATA5 LATA4 LATA3 LATA2 LATA1 LATA0 xxxx xxxx
F8Ah LATB LATB7 LATB6 LATB5 LATB4 LATB3 LATB2 LATB1 LATB0 xxxx xxxx
F8Bh LATC LATC7 LATC6 LATC5 LATC4 LATC3 LATC2 LATC1 LATC0 xxxx xxxx
F8Ch LATD LATD7 LATD6 LATD5 LATD4 LATD3 LATD2 LATD1 LATD0 xxxx xxxx
F8Dh LATE LATE7 LATE6 LATE5 LATE4 LATE3 LATE2 LATE1 LATE0 xxxx xxxx
F8Eh LATF LATF7 LATF6 LATF5 LATF4 LATF3 LATF2 LATF1 — xxxx xxx-
F8Fh LATG — — — LATG4 LATG3 LATG2 LATG1 LATG0 ---x xxxx
F90h LATH(2) LATH7 LATH6 LATH5 LATH4 LATH3 LATH2 LATH1 LATH0 xxxx xxxx
F91h LATJ(2) LATJ7 LATJ6 LATJ5 LATJ4 LATJ3 LATJ2 LATJ1 LATJ0 xxxx xxxx
F92h TRISA TRISA7 TRISA6 TRISA5 TRISA4 TRISA3 TRISA2 TRISA1 TRISA0 1111 1111
F93h TRISB TRISB7 TRISB6 TRISB5 TRISB4 TRISB3 TRISB2 TRISB1 TRISB0 1111 1111
F94h TRISC TRISC7 TRISC6 TRISC5 TRISC4 TRISC3 TRISC2 TRISC1 TRISC0 1111 1111
F95h TRISD TRISD7 TRISD6 TRISD5 TRISD4 TRISD3 TRISD2 TRISD1 TRISD0 1111 1111
F96h TRISE TRISE7 TRISE6 TRISE5 TRISE4 TRISE3 TRISE2 TRISE1 TRISE0 1111 1111
F97h TRISF TRISF7 TRISF6 TRISF5 TRISF4 TRISF3 TRISF2 TRISF1 — 1111 111-
F98h TRISG — — — TRISG4 TRISG3 TRISG2 TRISG1 TRISG0 ---1 1111
F99h TRISH(2) TRISH7 TRISH6 TRISH5 TRISH4 TRISH3 TRISH2 TRISH1 TRISH0 1111 1111
F9Ah TRISJ(2) TRISJ7 TRISJ6 TRISJ5 TRISJ4 TRISJ3 TRISJ2 TRISJ1 TRISJ0 1111 1111
F9Bh OSCTUNE INTSRC PLLEN TUN5 TUN4 TUN3 TUN2 TUN1 TUN0 0000 0000
F9Ch PSTR1CON CMPL1 CMPL0 — STRSYNC STRD STRC STRB STRA 00-0 0001
F9Dh PIE1 — ADIE RC1IE TX1IE SSP1IE TMR1GIE TMR2IE TMR1IE -000 0000
F9Eh PIR1 — ADIF RC1IF TX1IF SSP1IF TMR1GIF TMR2IF TMR1IF -000 0000
F9Fh IPR1 — ADIP RC1IP TX1IP SSP1IP TMR1GIP TMR2IP TMR1IP -111 1111
FA0h PIE2 OSCFIE — SSP2IE BCL2IE BCL1IE HLVDIE TMR3IE TMR3GIE 0-10 0000
FA1h PIR2 OSCFIF — SSP2IF BCL2IF BCL1IF HLVDIF TMR3IF TMR3GIF 0-10 0000
FA2h IPR2 OSCFIP — SSP2IP BCL2IP BCL1IP HLVDIP TMR3IP TMR3GIP 1-00 1110
FA3h PIE3 TMR5GIE LCDIE RC2IE TX2IE CTMUIE CCP2IE CCP1IE RTCCIE 0000 0000
FA4h PIR3 TMR5GIF LCDIF RC2IF TX2IF CTMUIF CCP2IF CCP1IF RTCCIF 0000 0000
FA5h IPR3 TMR5GIP LCDIP RC2IP TX2IP CTMUIP CCP2IP CCP1IP RTCCIP 1111 1111
FA6h PIR6 — — — EEIF — CMP3IF CMP2IF CMP1IF ---0 -000
FA7h — — — — — — — — — ---- ----
FA8h HLVDCON VDIRMAG BGVST IRVST HLVDEN HLVDL3 HLVDL2 HLVDL1 HLVDL0 0000 0000
FA9h IPR6 — — — EEIP — CMP3IP CMP2IP CMP1IP ---1 -111
FAAh T1GCON TMR1GE T1GPOL T1GTM T1GSPM T1GGO/ T1GVAL T1GSS1 T1GSS0 0000 0x00
T1DONE
FABh RCSTA1 SPEN RX9 SREN CREN ADDEN FERR OERR RX9D 0000 000x
FACh TXSTA1 CSRC TX9 TXEN SYNC SENDB BRGH TRMT TX9D 0000 0010
FADh TXREG1 USART1 Transmit Register xxxx xxxx
FAEh RCREG1 USART1 Receive Register 0000 0000
FAFh SPBRG1 USART1 Baud Rate Generator 0000 0000
Note 1: This bit is available when Master Clear is disabled (MCLRE = 0). When MCLRE is set, the bit is unimplemented.
2: Unimplemented in 64-pin devices (PIC18F6XK90).
3: Unimplemented in devices with a program memory of 32 Kbytes (PIC18FX5K90).
FB0h T3GCON TMR3GE T3GPOL T3GTM T3GSPM T3GGO/ T3GVAL T3GSS1 T3GSS0 0000 0x00
T3DONE
FB1h T3CON TMR3CS1 TMR3CS0 T3CKPS1 T3CKPS0 SOSCEN T3SYNC RD16 TMR3ON 0000 0000
FB2h TMR3L Timer3 Register Low Byte xxxx xxxx
FB3h TMR3H Timer3 Register High Byte xxxx xxxx
FB4h CMSTAT CMP3OUT CMP2OUT CMP1OUT — — — — — 111- ----
FB5h CVRCON CVREN CVROE CVRSS CVR4 CVR3 CVR2 CVR1 CVR0 0000 0000
FB6h PIE4 CCP10IE(3) CCP9IE(3) CCP8IE CCP7IE(3) CCP6IE CCP5IE CCP4IE CCP3IE 0000 0000
FB7h PIR4 CCP10IF(3) CCP9IF(3) CCP8IF CCP7IF(3) CCP6IF CCP5IF CCP4IF CCP3IF 0000 0000
FB8h IPR4 CCP10IP(3) CCP9IP(3) CCP8IP CCP7IP(3) CCP6IP CCP5IP CCP4IP CCP3IP 1111 1111
FB9h PIE5 TMR7GIE(3) TMR12IE(3) TMR10IE(3) TMR8IE TMR7IE(3) TMR6IE TMR5IE TMR4IE 0000 0000
(3) (3) (3)
FBAh PIR5 TMR7GIF TMR12IF TMR10IF TMR8IF TMR7IF(3) TMR6IF TMR5IF TMR4IF 0000 0000
FBBh CCP1CON P1M1 P1M0 DC1B1 DC1B0 CCP1M3 CCP1M2 CCP1M1 CCP1M0 0000 0000
FBCh CCPR1L Capture/Compare/PWM Register 1 Low Byte xxxx xxxx
FBDh CCPR1H Capture/Compare/PWM Register 1 High Byte xxxx xxxx
FBEh ECCP1DEL P1RSEN P1DC6 P1DC5 P1DC4 P1DC3 P1DC2 P1DC1 P1DC0 0000 0000
FBFh ECCP1AS ECCP1ASE ECCP1AS2 ECCP1AS1 ECCP1AS0 PSS1AC1 PSS1AC0 PSS1BD1 PSS1BD0 0000 0000
FC0h ADCON2 ADFM — ACQT2 ACQT1 ACQT0 ADCS2 ADCS1 ADCS0 0—00 0000
FC1h ADCON1 TRIGSEL1 TRIGSEL0 VCFG1 VCFG0 VNCFG CHSN2 CHSN1 CHSN0 0000 0000
FC2h ADCON0 — CHS4 CHS3 CHS2 CHS1 CHS0 GO/DONE ADON -000 0000
FC3h ADRESL A/D Result Register Low Byte xxxx xxxx
FC4h ADRESH A/D Result Register High Byte xxxx xxxx
FC5h SSP1CON2 GCEN ACKSTAT ACKDT ACKEN RCEN PEN RSEN SEN 0000 0000
FC6h SSP1CON1 WCOL SSPOV SSPEN CKP SSPM3 SSPM2 SSPM1 SSPM0 0000 0000
FC7h SSP1STAT SMP CKE D/A P S R/W UA BF 0000 0000
FC8h SSP1ADD MSSP Address Register in I2C™ Slave Mode. SSP1 Baud Rate Reload Register in I2C Master Mode 0000 0000
FC9h SSP1BUF MSSP Receive Buffer/Transmit Register xxxx xxxx
FCAh T2CON — T2OUTPS3 T2OUTPS2 T2OUTPS1 T2OUTPS0 TMR2ON T2CKPS1 T2CKPS0 —000 0000
FCBh PR2 Timer2 Period Register 1111 1111
FCCh TMR2 Timer2 Register 0000 0000
FCDh T1CON TMR1CS1 TMR1CS0 T1CKPS1 T1CKPS0 SOSCEN T1SYNC RD16 TMR1ON 0000 0000
FCEh TMR1L Timer1 Register Low Byte xxxx xxxx
FCFh TMR1H Timer1 Register High Byte xxxx xxxx
FD0h RCON IPEN SBOREN CM RI TO PD POR BOR 0111 11qq
FD1h WDTCON REGSLP — ULPLVL SRETEN — ULPEN ULPSINK SWDTEN 0—x0 —000
FD2h IPR5 TMR7GIP(3) TMR12IP(3) TMR10I(3) P TMR8IP TMR7IP(3) TMR6IP TMR5IP TMR4IP 1111 1111
FD3h OSCCON IDLEN IRCF2 IRCF1 IRCF0 OSTS HFIOFS SCS1 SCS0 0110 q000
FD4h SPBRGH1 USART1 Baud Rate Generator High Byte 0000 0000
FD5h T0CON TMR0ON T08BIT T0CS T0SE PSA TOPS2 TOPS1 TOPS0 1111 1111
FD6h TMR0L Timer0 Register Low Byte xxxx xxxx
FD7h TMR0H Timer0 Register High Byte 0000 0000
FD8h STATUS — — — N OV Z DC C ---x xxxx
FD9h FSR2L Indirect Data Memory Address Pointer 2 Low Byte xxxx xxxx
FDAh FSR2H — — — — Indirect Data Memory Address Pointer 2 High Byte ---- xxxx
FDBh PLUSW2 Uses contents of FSR2 to address data memory – value of FSR2 pre-incremented (not a physical register) – ---- ----
value of FSR2 offset by W
FDCh PREINC2 Uses contents of FSR2 to address data memory – value of FSR2 pre--incremented (not a physical register) ---- ----
FDDh POSTDEC2 Uses contents of FSR2 to address data memory – value of FSR2 post-decremented (not a physical register) ---- ----
FDEh POSTINC2 Uses contents of FSR2 to address data memory – value of FSR2 post-incremented (not a physical register) ---- ----
Note 1: This bit is available when Master Clear is disabled (MCLRE = 0). When MCLRE is set, the bit is unimplemented.
2: Unimplemented in 64-pin devices (PIC18F6XK90).
3: Unimplemented in devices with a program memory of 32 Kbytes (PIC18FX5K90).
FDFh INDF2 Uses contents of FSR2 to address data memory – value of FSR2 not changed (not a physical register) ---- ----
FE0h BSR — — — — Bank Select Register ---- 0000
FE1h FSR1L Indirect Data Memory Address Pointer 1 Low Byte xxxx xxxx
FE2h FSR1H — — — — Indirect Data Memory Address Pointer 1 High Byte ---- xxxx
FE3h PLUSW1 Uses contents of FSR1 to address data memory – value of FSR1 pre-incremented (not a physical register) – ---- ----
value of FSR1 offset by W
FE4h PREINC1 Uses contents of FSR1 to address data memory – value of FSR1 pre-incremented (not a physical register) ---- ----
FE5h POSTDEC1 Uses contents of FSR1 to address data memory – value of FSR1 post-decremented (not a physical register) ---- ----
FE6h POSTINC1 Uses contents of FSR1 to address data memory – value of FSR1 post-incremented (not a physical register) ---- ----
FE7h INDF1 Uses contents of FSR1 to address data memory – value of FSR1 not changed (not a physical register) ---- ----
FE8h WREG Working Register xxxx xxxx
FE9h FSR0L Indirect Data Memory Address Pointer 0 Low Byte xxxx xxxx
FEAh FSR0H — — — — Indirect Data Memory Address Pointer 0 High Byte ---- xxxx
FEBh PLUSW0 Uses contents of FSR0 to address data memory – value of FSR0 pre-incremented (not a physical register) – ---- ----
value of FSR0 offset by W
FECh PREINC0 Uses contents of FSR0 to address data memory – value of FSR0 pre-incremented (not a physical register) ---- ----
FEDh POSTDEC0 Uses contents of FSR0 to address data memory – value of FSR0 post-decremented (not a physical register) ---- ----
FEEh POSTINC0 Uses contents of FSR0 to address data memory – value of FSR0 post-incremented (not a physical register) ---- ----
FEFh INDF0 Uses contents of FSR0 to address data memory – value of FSR0 not changed (not a physical register) ---- ----
FF0h INTCON3 INT2IP INT1IP INT3IE INT2IE INT1IE INT3IF INT2IF INT1IF 1100 0000
FF1h INTCON2 RBPU INTEDG0 INTEDG1 INTEDG2 INTEDG3 TMR0IP INT3IP RBIP 1111 1111
FF2h INTCON GIE/GIEH PEIE/GIEL TMR0IE INT0IE RBIE TMR0IF INT0IF RBIF 0000 000x
FF3h PRODL Product Register Low Byte xxxx xxxx
FF4h PRODH Product Register High Byte xxxxxxxx
FF5h TABLAT Program Memory Table Latch 0000 0000
FF6h TBLPTRL Program Memory Table Pointer Low Byte (TBLPTR<7:0>) 0000 0000
FF7h TBLPTRH Program Memory Table Pointer High Byte (TBLPTR<15:8>) 0000 0000
FF8h TBLPTRU — — bit 21 Program Memory Table Pointer Upper Byte (TBLPTR<20:16>) --00 0000
FF9h PCL PC Low Byte (PC<7:0>) 0000 0000
FFAh PCLATH Holding Register for PC<15:8> 0000 0000
FFBh PCLATU — — — Holding Register for PC<20:16> ---0 0000
FFCh STKPTR STKFUL STKUNF — Return Stack Pointer uu-0 0000
FFDh TOSL Top-of-Stack Low Byte (TOS<7:0>) 0000 0000
FFEh TOSH Top-of-Stack High Byte (TOS<15:8>) 0000 0000
FFFh TOSU — — — Top-of-Stack Upper Byte (TOS<20:16>) ---0 0000
Note 1: This bit is available when Master Clear is disabled (MCLRE = 0). When MCLRE is set, the bit is unimplemented.
2: Unimplemented in 64-pin devices (PIC18F6XK90).
3: Unimplemented in devices with a program memory of 32 Kbytes (PIC18FX5K90).
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
Note 1: For borrow, the polarity is reversed. A subtraction is executed by adding the 2’s complement of the second
operand.
2: For borrow, the polarity is reversed. A subtraction is executed by adding the 2’s complement of the second
operand.
000h
When a = 0 and f 60h:
The instruction executes in 060h
Direct Forced mode. ‘f’ is Bank 0
interpreted as a location in the 100h
Access RAM, between 060h 00h
and FFFh. This is the same as Bank 1 60h
locations, F60h to FFFh through
Bank 14 Valid Range
(Bank 15), of data memory. for ‘f’
Locations below 060h are not FFh
F00h
available in this addressing Access RAM
Bank 15
mode.
F40h
SFRs
FFFh
Data Memory
BSR
When a = 1 (all values of f): 000h 00000000
Bank 0
The instruction executes in
060h
Direct mode (also known as
Direct Long mode). ‘f’ is 100h
interpreted as a location in
one of the 16 banks of the data Bank 1 001001da ffffffff
memory space. The bank is through
Bank 14
designated by the Bank Select
Register (BSR). The address
can be in any implemented F00h
bank in the data memory Bank 15
space. F40h
SFRs
FFFh
Data Memory
Example Situation:
ADDWF f, d, a 000h
Not Accessible
FSR2H:FSR2L = 120h 05Fh
Instruction: TBLRD*
Program Memory
Table Pointer(1)
Table Latch (8-bit)
TBLPTRU TBLPTRH TBLPTRL
TABLAT
Program Memory
(TBLPTR)
Instruction: TBLWT*
Program Memory
Holding Registers
Table Pointer(1) Table Latch (8-bit)
TBLPTRU TBLPTRH TBLPTRL TABLAT
Program Memory
(TBLPTR)
Note 1: The 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 7.5 “Writing to Flash Program Memory”.
7.2 Control Registers The FREE bit, when set, allows a program memory
erase operation. When FREE is set, the erase
Several control registers are used in conjunction with operation is initiated on the next WR command. When
the TBLRD and TBLWT instructions. These include the: FREE is clear, only writes are enabled.
• EECON1 register The WREN bit, when set, allows a write operation. On
• EECON2 register power-up, the WREN bit is clear. The WRERR bit is set
• TABLAT register in hardware when the WR bit is set and cleared when
• TBLPTR registers the internal programming timer expires and the write
operation is complete.
7.2.1 EECON1 AND EECON2 REGISTERS
Note: During normal operation, the WRERR is
The EECON1 register (Register 7-1) is the control read as ‘1’. This can indicate that a write
register for memory accesses. The EECON2 register, operation was prematurely terminated by
not a physical register, is used exclusively in the a Reset, or a write operation was
memory write and erase sequences. Reading attempted improperly.
EECON2 will read all ‘0’s.
The EEPGD control bit determines if the access is a The WR control bit initiates write operations. The bit
program or data EEPROM memory access. When cannot be cleared, only set, in software. It is cleared in
clear, any subsequent operations operate on the data hardware at the completion of the write operation.
EEPROM memory. When set, any subsequent Note: The EEIF interrupt flag bit (PIR6<4>) is
operations operate on the program memory. set when the write is complete. It must be
The CFGS control bit determines if the access is to the cleared in software.
Configuration/Calibration registers or to program
memory/data EEPROM memory. When set,
subsequent operations operate on Configuration
registers regardless of EEPGD (see Section 28.0
“Special Features of the CPU”). When clear, memory
selection access is determined by EEPGD.
Note 1: When a WRERR occurs, the EEPGD and CFGS bits are not cleared. This allows tracing of the error
condition.
TABLE 7-1: TABLE POINTER OPERATIONS WITH TBLRD AND TBLWT INSTRUCTIONS
Example Operation on Table Pointer
TBLRD*
TBLPTR is not modified
TBLWT*
TBLRD*+
TBLPTR is incremented after the read/write
TBLWT*+
TBLRD*-
TBLPTR is decremented after the read/write
TBLWT*-
TBLRD+*
TBLPTR is incremented before the read/write
TBLWT+*
Program Memory
TABLAT
Write Register
8 8 8 8
Program Memory
Note 1: When a WRERR occurs, the EEPGD and CFGS bits are not cleared. This allows tracing of the error
condition.
To write an EEPROM data location, the address must first 8.5 Write Verify
be written to the EEADRH:EEADR register pair and the
data written to the EEDATA register. The sequence in Depending on the application, good programming
Example 8-2 must be followed to initiate the write cycle. practice may dictate that the value written to the
memory should be verified against the original value.
The write will not begin if this sequence is not exactly
This should be used in applications where excessive
followed (write 0x55 to EECON2, write 0xAA to
writes can stress bits near the specification limit.
EECON2, then set WR bit) for each byte. It is strongly
recommended that interrupts be disabled during this Note: Self-write execution to Flash and
code segment. EEPROM memory cannot be done while
Additionally, the WREN bit in EECON1 must be set to running in LP Oscillator mode (Low-Power
enable writes. This mechanism prevents accidental mode). Therefore, executing a self-write
writes to data EEPROM due to unexpected code will put the device into High-Power mode.
9.2 Operation
Example 9-1 shows the instruction sequence for an 8 x 8
unsigned multiplication. Only one instruction is required
when one of the arguments is already loaded in the
WREG register.
Example 9-2 shows the sequence to do an 8 x 8 signed
multiplication. To account for the sign bits of the argu-
ments, each argument’s Most Significant bit (MSb) is
tested and the appropriate subtractions are done.
PIR1<6:0>
PIE1<6:0> TMR0IF Wake-up if in
IPR1<6:0> TMR0IE Idle or Sleep modes
TMR0IP
RBIF
PIR2<7,5:0> RBIE
PIE2<7,5:0> RBIP
IPR2<7:7,5:0> INT0IF
INT0IE
PIR3<6:0> INT1IF
PIE3<6:0> INT1IE Interrupt to CPU
IPR3<6:0> INT1IP Vector to Location
INT2IF
INT2IE 0008h
PIR3<7:0>
PIE3<7:0> INT2IP
IPR3<7:0> INT3IF
INT3IE
INT3IP
GIE/GIEH
PIR5<7:0>
PIE5<7:0>
IPR5<7:0> IPEN
PIR6<4,2:0> IPEN
PIE6<4,2:0> PEIE/GIEL
IPR6<4,2:0>
IPEN
PIR1<6:0>
PIE1<6:0>
IPR1<6:0>
PIR2<7,5:0>
PIE2<7,5:0>
IPR2<7,5:0> Interrupt to CPU
TMR0IF Vector to Location
TMR0IE IPEN
PIR3<7:0> 0018h
PIE3<7:0> TMR0IP
IPR3<7:0>
RBIF
PIR4<7:0> RBIE
PIE4<7:0> RBIP GIE/GIEH
IPR4<7:0> PEIE/GIEL
INT1IF
INT1IE
PIR5<7:0> INT1IP
PIE5<7:0> INT2IF
IPR5<7:0> INT2IE
INT2IP
PIR6<4,2:0> INT3IF
PIE6<4,2:0> INT3IE
IPR6<4,2:0> INT3IP
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
Note 1: A mismatch condition will continue to set this bit. Reading PORTB, and then waiting one additional instruction
cycle, will end the mismatch condition and allow the bit to be cleared.
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
Note: 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.
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
Note: 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.
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
Note 1: This bit is valid when the Type-B waveform with Non-Static mode is selected.
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
Note 1: CCP10IE and CCP9IE are unimplemented in devices with a program memory of 32 Kbytes (PIC18FX5K90).
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
Note 1: CCP10IP and CCP9IP are unimplemented in devices with a program memory of 32 Kbytes (PIC18FX5K90).
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
Reset
Name Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 Values
on Page:
INTCON GIE/GIEH PEIE/GIEL TMR0IE INT0IE RBIE TMR0IF INT0IF RBIF 75
INTCON2 RBPU INTEDG0 INTEDG1 INTEDG2 INTEDG3 TMR0IP INT3IP RBIP 75
INTCON3 INT2IP INT1IP INT3IE INT2IE INT1IE INT3IF INT2IF INT1IF 75
PIR1 — ADIF RC1IF TX1IF SSP1IF TMR1GIF TMR2IF TMR1IF 77
PIR2 OSCFIF — SSP2IF BCL2IF BCL1IF HLVDIF TMR3IF TMR3GIF 77
PIR3 TMR5GIF LCDIF RC2IF TX2IF CTMUIF CCP2IF CCP1IF RTCCIF 77
PIR4 CCP10IF(1) CCP9IF(1) CCP8IF CCP7IF CCP6IF CCP5IF CCP4IF CCP3IF 77
(1) (1) (1) (1)
PIR5 TMR7GIF TMR12IF TMR10IF TMR8IF TMR7IF TMR6IF TMR5IF TMR4IF 77
PIR6 — — — EEIF — CMP3IF CMP2IF CMP1IF 77
PIE1 — ADIE RC1IE TX1IE SSP1IE TMR1GIE TMR2IE TMR1IE 77
PIE2 OSCFIE — SSP2IE BCL2IE BCL1IE HLVDIE TMR3IE TMR3GIE 77
PIE3 TMR5GIE LCDIE RC2IE TX2IE CTMUIE CCP2IE CCP1IE RTCCIE 77
(1) CCP9IE(1)
PIE4 CCP10IE CCP8IE CCP7IE CCP6IE CCP5IE CCP4IE CCP3IE 77
PIE5 TMR7GIE(1) TMR12IE(1) TMR10IE(1) TMR8IE TMR7IE(1) TMR6IE TMR5IE TMR4IE 77
PIE6 — — — EEIE — CMP3IE CMP2IE CMP1IE 80
IPR1 — ADIP RC1IP TX1IP SSP1IP TMR1GIP TMR2IP TMR1IP 77
IPR2 OSCFIP — SSP2IP BCL2IP BCL1IP HLVDIP TMR3IP TMR3GIP 77
IPR3 TMR5GIP LCDIP RC2IP TX2IP CTMUIP CCP2IP CCP1IP RTCCIP 77
(1) CCP9IP(1)
IPR4 CCP10IP CCP8IP CCP7IP CCP6IP CCP5IP CCP4IP CCP3IP 77
IPR5 TMR7GIP(1) TMR12IP(1) TMR10IP(1) TMR8IP TMR7IP(1) TMR6IP TMR5IP TMR4IP 76
IPR6 — — — EEIP — CMP3IP CMP2IP CMP1IP 77
RCON IPEN SBOREN CM RI TO PD POR BOR 76
Legend: Shaded cells are not used by the interrupts.
Note 1: Unimplemented in devices with a program memory of 32 Kbytes (PIC18FX5K90).
RD TRIS
Q D
ENEN
RD PORT
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
11.1.4 ANALOG AND DIGITAL PORTS Setting these registers makes the corresponding pins
analog and clearing the registers makes the ports digi-
Many of the ports multiplex analog and digital function-
tal. For details on these registers, see Section 23.0
ality, providing a lot of flexibility for hardware designers.
“12-Bit Analog-to-Digital Converter (A/D) Module”.
PIC18F87K90 family devices can make any analog pin,
analog or digital, depending on an application’s needs.
The ports’ analog/digital functionality is controlled by
the registers: ANCON0, ANCON1 and ANCON2.
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
FOSC/4 0
1
Sync with Set
1 Internal TMR0L TMR0IF
Programmable Clocks on Overflow
T0CKI Pin 0
Prescaler
T0SE (2 TCY Delay)
T0CS 8
3
T0PS<2:0>
8
PSA Internal Data Bus
Note: Upon Reset, Timer0 is enabled in 8-bit mode with clock input from T0CKI max. prescale.
FOSC/4 0
1
Sync with TMR0 Set
1 Internal TMR0L High Byte TMR0IF
T0CKI Pin Programmable 0 Clocks on Overflow
Prescaler 8
T0SE (2 TCY Delay)
T0CS 3 Read TMR0L
T0PS<2:0>
Write TMR0L
PSA
8
8
TMR0H
8
8
Internal Data Bus
Note: Upon Reset, Timer0 is enabled in 8-bit mode with clock input from T0CKI max. prescale.
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
Note 1: The FOSC clock source should not be selected if the timer will be used with the ECCP capture/compare features.
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
T1GSS<1:0>
T1G 00 T1GSPM
13.8 Timer1 Gate Note: The CCP and ECCP modules use Timers,
Timer1 can be configured to count freely or the count can 1 through 8, for some modes. The assign-
be enabled and disabled using the Timer1 gate circuitry. ment of a particular timer to a CCP/ECCP
This is also referred to as Timer1 gate count enable. module is determined by the Timer to CCP
enable bits in the CCPTMRSx registers.
Timer1 gate can also be driven by multiple selectable
For more details, see Register 18-2,
sources.
Register 18-3 and Register 19-2
TMR1GE
T1GPOL
T1G_IN
T1CKI
T1GVAL
TMR1GE
T1GPOL
T1GTM
T1G_IN
T1CKI
T1GVAL
TMR1GE
T1GPOL
T1GSPM
Cleared by Hardware on
T1GGO/ Set by Software Falling Edge of T1GVAL
T1DONE
Counting Enabled on
Rising Edge of T1G
T1G_IN
T1CKI
T1GVAL
Cleared by
RTCCIF Cleared by Software Set by Hardware on Software
Falling Edge of T1GVAL
TMR1GE
T1GPOL
T1GSPM
T1GTM
Cleared by Hardware on
T1GGO/ Set by Software Falling Edge of T1GVAL
T1DONE Counting Enabled on
Rising Edge of T1G
T1G_IN
T1CKI
T1GVAL
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
4 1:1 to 1:16
T2OUTPS<3:0> Set TMR2IF
Postscaler
2
T2CKPS<1:0> TMR2 Output
(to PWM or MSSPx)
TMR2/PR2
Reset Match
1:1, 1:4, 1:16
FOSC/4 TMR2 Comparator PR2
Prescaler
8 8
8
Internal Data Bus
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
Note 1: The FOSC clock source should not be selected if the timer will be used with the ECCP capture/compare
features.
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
TxGSS<1:0>
TxG 00 TxGSPM
From TMR(x + 1)
01 TxG_IN 0
Match PR(x + 1) Data Bus
0 TxGVAL
D Q
From Comp. 1 Single Pulse RD
Output 10 1
Acq. Control Q1 EN T3GCON
D Q 1
From Comp. 2 11
Output Q TxGGO/TxDONE Interrupt Set
TMRxON CK
det TMRxGIF
R
TxGPOL TxGTM
TMRxGE
Set Flag bit TMRxON
TMRxIF on
Overflow TMRx(2)
EN Synchronized
0 Clock Input
TMRxH TMRxL TxCLK
Q D
1
TMRxCS<1:0> TxSYNC
SOSCO OUT
TMRxGE
TxGPOL
TxG_IN
TxCKI
TxGVAL
TMRxGE
TxGPOL
TxGTM
TxG_IN
TxCKI
TxGVAL
TMRxGE
TxGPOL
TxGSPM
Cleared by Hardware on
TxGGO/ Set by Software Falling Edge of TxGVAL
TxDONE
Counting Enabled on
Rising Edge of TxG
TxG_IN
T1CKI
TxGVAL
Cleared by
Cleared by Software Set by Hardware on Software
TMRxGIF
Falling Edge of TxGVAL
TMRxGE
TxGPOL
TxGSPM
TxGTM
Cleared by Hardware on
TxGGO/ Set by Software Falling Edge of TxGVAL
TxDONE
Counting Enabled on
Rising Edge of TxG
TxG_IN
TxCKI
TxGVAL
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
4 1:1 to 1:16
TxOUTPS<3:0> Set TMRxIF
Postscaler
2
TxCKPS<1:0> TMRx Output
(to PWM)
TMRx/PRx
Reset Match
FOSC/4 1:1, 1:4, 1:16 Comparator
TMRx PRx
Prescaler
8 8
8
Internal Data Bus
ALMTHDY
Compare Registers
ALRMVALx ALWDHR
with Masks
ALMINSEC
Repeat Counter
RTCC Interrupt
RTCC Interrupt Logic
Alarm Pulse
RTCC Pin
RTCOE
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
Note 1: To enable the actual RTCC output, the RTCOE (RTCCFG<2>) bit must be set.
2: Available only in 80-pin parts.
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
bit 7-4 YRTEN<3:0>: Binary Coded Decimal Value of Year’s Tens Digit bits
Contains a value from 0 to 9.
bit 3-0 YRONE<3:0>: Binary Coded Decimal Value of Year’s Ones Digit bits
Contains a value from 0 to 9.
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
Hours
(24-hour format) Minutes Seconds
CONFIG3L<0>
Day
Second Hour:Minute Month Year
Day of Week
Note 1: Writing to the lower half of the MINSEC register resets all counters, allowing fraction of a second
synchronization; clock prescaler is held in Reset when RTCEN = 0.
Whether RTCSYNC = 1 or 0, the user should employ a The Alarm Value register windows (ALRMVALH and
firmware solution to ensure that the data read did not ALRMVALL) use the ALRMPTR bits (ALRMCFG<1:0>)
fall on a rollover boundary, resulting in an invalid or to select the desired alarm register pair.
partial read. This firmware solution would consist of
By reading or writing to the ALRMVALH register, the
reading each register twice and then comparing the two
Alarm Pointer value, ALRMPTR<1:0>, decrements by
values. If the two values matched, then a rollover did
one until it reaches ‘00’. When it reaches ‘00’, the
not occur.
ALRMMIN and ALRMSEC value is accessible through
ALRMVALH and ALRMVALL until the pointer value is
manually changed.
RTCEN bit
ALRMEN bit
RTCC Pin
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
Note 1: The CCP9 and CCP10 modules are not available on devices with 32 Kbytes of program memory
(PIC18FX5K90).
2: CCPxM<3:0> = 1011 will only reset the timer and not start the A/D conversion on a CCPx match.
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
Note 1: This bit is unimplemented and reads as ‘0’ on devices with 32 Kbytes of program memory (PIC18FX5K90).
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
18.1.1 CCP MODULES AND TIMER The assignment of a particular timer to a module is
RESOURCES determined by the Timer to CCP enable bits in the
CCPTMRSx registers (see Register 18-2 and
The CCP modules utilize Timers, 1 through 8, which Register 18-3). All of the modules may be active at
varies with the selected mode. Various timers are avail- once and may share the same timer resource if they
able to the CCP modules in Capture, Compare or PWM are configured to operate in the same mode
modes, as shown in Table 18-1. (Capture/Compare or PWM) at the same time.
The CCPTMRS1 register selects the timers for CCP
modules, 7, 6, 5 and 4, and the CCPTMRS2 register
selects the timers for CCP modules, 10, 9 and 8. The
possible configurations are shown in Table 18-2 and
Table 18-3.
CCP8
CCP8 CCP9(1) CCP10(1)
Devices with 32 Kbytes(1)
TMR5H TMR5L
Set CCP5IF
C5TSEL0 TMR5
CCP5 Pin Enable
Prescaler and CCPR5H CCPR5L
1, 4, 16 Edge Detect
TMR1
C5TSEL0 Enable
4 TMR1H TMR1L
CCP5CON<3:0> Set CCP4IF
4
Q1:Q4
4
CCP4CON<3:0>
C4TSEL1 TMR3H TMR3L
C4TSEL0
TMR3
Enable
CCP4 Pin
Prescaler and CCPR4H CCPR4L
1, 4, 16 Edge Detect
TMR1
Enable
C4TSEL0
TMR1H TMR1L
C4TSEL1
Note: This block diagram uses CCP4 and CCP5, and their appropriate timers, as an example. For details on all
of the CCP modules and their timer assignments, see Table 18-2 and Table 18-3.
18.2.3 SOFTWARE INTERRUPT Switching from one capture prescaler to another may
generate an interrupt. Doing that also will not clear the
When the Capture mode is changed, a false capture
prescaler counter – meaning the first capture may be
interrupt may be generated. The user should keep the
from a non-zero prescaler.
CCP4IE bit (PIE4<1>) clear to avoid false interrupts
and should clear the flag bit, CCP4IF, following any Example 18-1 shows the recommended method for
such change in operating mode. switching between capture prescalers. This example
also clears the prescaler counter and will not generate
18.2.4 CCP PRESCALER the “false” interrupt.
There are four prescaler settings in Capture mode.
They are specified as part of the operating mode EXAMPLE 18-1: CHANGING BETWEEN
selected by the mode select bits (CCP4M<3:0>). CAPTURE PRESCALERS
Whenever the CCP module is turned off, or the CCP CLRF CCP4CON ; Turn CCP module off
module is not in Capture mode, the prescaler counter MOVLW NEW_CAPT_PS ; Load WREG with the
is cleared. This means that any Reset will clear the ; new prescaler mode
prescaler counter. ; value and CCP ON
MOVWF CCP4CON ; Load CCP4CON with
; this value
Compare Output S Q
Comparator
Match Logic
R
TRIS
4 Output Enable
CCP5CON<3:0>
TMR1H TMR1L 0
TMR5H TMR5L 1
C5TSEL0
0 TMR1H TMR1L
1 TMR3H TMR3L
Special Event Trigger
(Timer1/Timer3 Reset, A/D Trigger)
C4TSEL1
C4TSEL0
Compare Output S Q
Comparator
Match Logic
R
TRIS
4 Output Enable
CCPR4H CCPR4L
CCP4CON<3:0>
Note: This block diagram uses CCP4 and CCP5, and their appropriate timers, as an example. For details on all
of the CCP modules and their timer assignments, see Table 18-2 and Table 18-3.
Duty Cycle
EQUATION 18-2:
TMR2 = PR2 PWM Duty Cycle = (CCPR4L:CCP4CON<5:4>) •
TOSC • (TMR2 Prescale Value)
TMR2 = Duty Cycle
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
TMR3H TMR3L
Set CCP1IF
C1TSEL0
C1TSEL1 TMR3
ECCP1 Pin C1TSEL2 Enable
Prescaler and CCPR1H CCPR1L
1, 4, 16 Edge Detect
C1TSEL0 TMR1
C1TSEL1 Enable
C1TSEL2
4 TMR1H TMR1L
CCP1CON<3:0>
4
Q1:Q4
0 TMR1H TMR1L
1 TMR3H TMR3L
Compare Output S Q
Comparator
Match Logic
R
TRIS
4 Output Enable
CCPR1H CCPR1L
CCP1CON<3:0>
FIGURE 19-3: EXAMPLE SIMPLIFIED BLOCK DIAGRAM OF THE ENHANCED PWM MODE
CCPR1H (Slave)
PxB Output Pin
Output TRIS
Comparator R Q Controller
PxC Output Pin
TMR2 (Note 1)
TRIS
S
Note 1: The 8-bit TMR2 register is concatenated with the 2-bit internal Q clock, or 2 bits of the prescaler to create
the 10-bit time base.
Note: The TRIS register value for each PWM output must be configured appropriately.
Any pin not used by an Enhanced PWM mode is available for alternate pin functions.
Period
PxA Active
PxD Modulated
PxA Inactive
PxD Inactive
Relationships:
• Period = 4 * TOSC * (PR2 + 1) * (TMR2 Prescale Value)
• Pulse Width = TOSC * (CCPRxL<7:0>:CCPxCON<5:4>) * (TMR2 Prescale Value)
• Delay = 4 * TOSC * (ECCPxDEL<6:0>)
Note 1: Dead-band delay is programmed using the ECCPxDEL register (see Section 19.4.6 “Programmable
Dead-Band Delay Mode”).
Pulse PR2 + 1
PxM<1:0> Signal 0
Width
Period
PxA Modulated
Delay(1) Delay(1)
10 (Half-Bridge) PxB Modulated
PxA Active
PxD Modulated
PxA Inactive
PxD Inactive
Relationships:
• Period = 4 * TOSC * (PR2 + 1) * (TMR2 Prescale Value)
• Pulse Width = TOSC * (CCPRxL<7:0>:CCPxCON<5:4>) * (TMR2 Prescale Value)
• Delay = 4 * TOSC * (ECCPxDEL<6:0>)
Note 1: Dead-band delay is programmed using the ECCP1DEL register (see Section 19.4.6 “Programmable Dead-Band
Delay Mode”).
FET
Driver +
PxA
-
Load
FET
Driver
+
PxB
-
V+
FET FET
Driver Driver
PxA
Load
FET FET
Driver Driver
PxB
FET QA QC FET
Driver Driver
PxA
Load
PxB
FET FET
Driver Driver
PxC
QB QD
V-
PxD
PxB(2)
PxC(2)
PxD(2)
(1) (1)
Reverse Mode
Period
Pulse Width
PxA(2)
PxB(2)
PxC(2)
PxD(2)
(1) (1)
Note 1: At this time, the TMR2 register is equal to the PR2 register.
2: The output signal is shown as active-high.
Period(1) Period
Signal
PxA (Active-High)
PxB (Active-High)
Pulse Width
PxC (Active-High)
(2)
PxD (Active-High)
Pulse Width
Note 1: The direction bit, PxM1 of the CCPxCON register, is written any time during the PWM cycle.
2: When changing directions, the PxA and PxC signals switch before the end of the current PWM cycle. The
modulated PxB and PxD signals are inactive at this time. The length of this time is:
(1/FOSC) • TMR2 Prescale Value.
PxA
PxB
PW
PxC
PxD
PW
TON(2)
External Switch C
TOFF(3)
External Switch D
19.4.3 START-UP CONSIDERATIONS complete a full PWM cycle before enabling the PWM
pin output drivers. The completion of a full PWM cycle
When any PWM mode is used, the application
is indicated by the TMR2IF or TMR4IF bit of the PIR1
hardware must use the proper external pull-up and/or
or PIR5 register being set as the second PWM period
pull-down resistors on the PWM output pins.
begins.
Note: When the microcontroller is released from
Reset, all of the I/O pins are in the 19.4.4 ENHANCED PWM
High-Impedance state. The external AUTO-SHUTDOWN MODE
circuits must keep the power switch The PWM mode supports an Auto-Shutdown mode that
devices in the OFF state until the micro- will disable the PWM outputs when an external
controller drives the I/O pins with the shutdown event occurs. Auto-Shutdown mode places
proper signal levels or activates the PWM the PWM output pins into a predetermined state. This
output(s). mode is used to help prevent the PWM from damaging
The CCPxM<1:0> bits of the CCPxCON register allow the application.
the user to choose whether the PWM output signals are The auto-shutdown sources are selected using the
active-high or active-low for each pair of PWM output ECCPxAS<2:0> bits (ECCPxAS<6:4>). A shutdown
pins (PxA/PxC and PxB/PxD). The PWM output event may be generated by:
polarities must be selected before the PWM pin output
• A logic ‘0’ on the pin that is assigned the FLT0
drivers are enabled. Changing the polarity configura-
input function
tion while the PWM pin output drivers are enabled is
not recommended since it may result in damage to the • Comparator C1
application circuits. • Comparator C2
The PxA, PxB, PxC and PxD output latches may not be • Setting the ECCPxASE bit in firmware
in the proper states when the PWM module is A shutdown condition is indicated by the ECCPxASE
initialized. Enabling the PWM pin output drivers at the (Auto-Shutdown Event Status) bit (ECCPxAS<7>). If
same time as the Enhanced PWM modes may cause the bit is a ‘0’, the PWM pins are operating normally. If
damage to the application circuit. The Enhanced PWM the bit is a ‘1’, the PWM outputs are in the shutdown
modes must be enabled in the proper Output mode and state.
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
Note: The auto-shutdown condition is a level-based signal, not an edge-based signal. As long as the level is
present, the auto-shutdown will persist.
Writing to the ECCPxASE bit is disabled while an auto-shutdown condition persists. Once the
auto-shutdown condition has been removed and the PWM restarted (either through firmware or
auto-restart), the PWM signal will always restart at the beginning of the next PWM period.
PWM Period
Shutdown Event
ECCPxASE bit
PWM Activity
Normal PWM
ECCPxASE
Cleared by
Start of Firmware
Shutdown Shutdown PWM
PWM Period Event Occurs Event Clears Resumes
19.4.5 AUTO-RESTART MODE The module will wait until the next PWM period begins,
however, before re-enabling the output pin. This behav-
The Enhanced PWM can be configured to automatically
ior allows the auto-shutdown with auto-restart features
restart the PWM signal once the auto-shutdown condi-
to be used in applications based on current mode of
tion has been removed. Auto-restart is enabled by
PWM control.
setting the PxRSEN bit (ECCPxDEL<7>).
If auto-restart is enabled, the ECCPxASE bit will
remain set as long as the auto-shutdown condition is
active. When the auto-shutdown condition is removed,
the ECCPxASE bit will be cleared via hardware and
normal operation will resume.
PWM Period
Shutdown Event
ECCPxASE bit
PWM Activity
Normal PWM
FET
Driver +
PxA V
-
Load
FET
Driver
+
PxB V
-
V-
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
19.4.7 PULSE STEERING MODE While the PWM Steering mode is active, the
CCPxM<1:0> bits (CCPxCON<1:0>) select the PWM
In Single Output mode, pulse steering allows any of the
output polarity for the Px<D:A> pins.
PWM pins to be the modulated signal. Additionally, the
same PWM signal can simultaneously be available on The PWM auto-shutdown operation also applies to the
multiple pins. PWM Steering mode, as described in Section 19.4.4
“Enhanced PWM Auto-shutdown mode”. An
Once the Single Output mode is selected
auto-shutdown event will only affect pins that have
(CCPxM<3:2> = 11 and PxM<1:0> = 00 of the
PWM outputs enabled.
CCPxCON register), the user firmware can bring out
the same PWM signal to one, two, three or four output
pins by setting the appropriate STR<D:A> bits
(PSTRxCON<3:0>), as provided in Table 19-3.
Note: The associated TRIS bits must be set to
output (‘0’) to enable the pin output driver
in order to see the PWM signal on the pin.
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
bit 7-6 CMPL<1:0>: Complementary Mode Output Assignment Steering Sync bits
00 = See STRD:STRA
01 = PA and PB are selected as the complementary output pair
10 = PA and PC are selected as the complementary output pair
11 = PA and PD are selected as the complementary output pair
bit 5 Unimplemented: Read as ‘0’
bit 4 STRSYNC: Steering Sync bit
1 = Output steering update occurs on the next PWM period
0 = Output steering update occurs at the beginning of the instruction cycle boundary
bit 3 STRD: Steering Enable Bit D
1 = PxD pin has the PWM waveform with polarity control from CCPxM<1:0>
0 = PxD pin is assigned to a PORT pin
bit 2 STRC: Steering Enable Bit C
1 = PxC pin has the PWM waveform with polarity control from CCPxM<1:0>
0 = PxC pin is assigned to a PORT pin
bit 1 STRB: Steering Enable Bit B
1 = PxB pin has the PWM waveform with polarity control from CCPxM<1:0>
0 = PxB pin is assigned to a PORT pin
bit 0 STRA: Steering Enable Bit A
1 = PxA pin has the PWM waveform with polarity control from CCPxM<1:0>
0 = PxA pin is assigned to a PORT pin
Note 1: The PWM Steering mode is available only when the CCPxCON register bits, CCPxM<3:2> = 11 and
PxM<1:0> = 00.
PORT Data 0
TRIS
Note 1: PORT outputs are configured as displayed
when the CCPxCON register bits,
PxM<1:0> = 00 and CCP1Mx<3:2> = 11.
2: Single PWM output requires setting at least
one of the STRx bits.
PWM Period
PWM
STRn
P1n = PWM
PWM
STRn
P1n = PWM
LCDDATAx SE<47:0>
Data Bus Registers 192-to-48
MUX To I/O Pads
24 x 8
(= 4 x 48)
Timing Control
LCDCON COM<3:0>
To I/O Pads
LCDPS
LCDSEx
FOSC/4
Maximum Maximum
LMUX<1:0> Multiplex Number of Pixels Number of Pixels Bias
(PIC18F6X90) (PIC18F8X90)
00 Static (COM0) 33 48 Static
01 1/2 (COM<1:0>) 66 96 1/2 or 1/3
10 1/3 (COM<2:0>) 99 144 1/2 or 1/3
11 1/4 (COM<3:0>) 132 192 1/3
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
bit 7-6 LRLAP<1:0>: LCD Reference Ladder A Time Power Control bits
During Time Interval A:
11 = Internal LCD reference ladder is powered in High-Power mode
10 = Internal LCD reference ladder is powered in Medium Power mode
01 = Internal LCD reference ladder is powered in Low-Power mode
00 = Internal LCD reference ladder is powered down and unconnected
bit 5-4 LRLBP<1:0>: LCD Reference Ladder B Time Power Control bits
During Time Interval B:
11 = Internal LCD reference ladder is powered in High-Power mode
10 = Internal LCD reference ladder is powered in Medium Power mode
01 = Internal LCD reference ladder is powered in Low-Power mode
00 = Internal LCD reference ladder is powered down and unconnected
bit 3 Unimplemented: Read as ‘0’(1)
bit 2-0 LRLAT<2:0>: LCD Reference Ladder A Time Interval Control bits
Sets the number of 32 clock counts when the A Time Interval Power mode is active.
For Type-A Waveforms (WFT = 0):
000 = Internal LCD reference ladder is always in B Power mode
001 = Internal LCD reference ladder is in A Power mode for 1 clock and B Power mode for 15 clocks
010 = Internal LCD reference ladder is in A Power mode for 2 clocks and B Power mode for 14 clocks
011 = Internal LCD reference ladder is in A Power mode for 3 clocks and B Power mode for 13 clocks
100 = Internal LCD reference ladder is in A Power mode for 4 clocks and B Power mode for 12 clocks
101 = Internal LCD reference ladder is in A Power mode for 5 clocks and B Power mode for 11 clocks
110 = Internal LCD reference ladder is in A Power mode for 6 clocks and B Power mode for 10 clocks
111 = Internal LCD reference ladder is in A Power mode for 7 clocks and B Power mode for 9 clocks
For Type-B Waveforms (WFT = 1):
000 = Internal LCD reference ladder is always in B Power mode
001 = Internal LCD reference ladder is in A Power mode for 1 clock and B Power mode for 31 clocks
010 = Internal LCD reference ladder is in A Power mode for 2 clocks and B Power mode for 30 clocks
011 = Internal LCD reference ladder is in A Power mode for 3 clocks and B Power mode for 29 clocks
100 = Internal LCD reference ladder is in A Power mode for 4 clocks and B Power mode for 28 clocks
101 = Internal LCD reference ladder is in A Power mode for 5 clocks and B Power mode for 27 clocks
110 = Internal LCD reference ladder is in A Power mode for 6 clocks and B Power mode for 26 clocks
111 = Internal LCD reference ladder is in A Power mode for 7 clocks and B Power mode for 25 clocks
LCDSE3 31:24 (RE7, RB0, RB5, Note: In PIC18F6XK90 devices, writing into the
RC<7:6>, RG4, RF<7:6>) registers, LCDDATA4, LCDDATA5,
LCDSE4 39:32 (RJ<4:7>, RJ<3:1>, RC1) LCDDATA10, LCDDATA11, LCDDATA16,
LCDDATA17, LCDDATA22 and
LCDSE5 47:40 (RH<0:3>, RH<7:4>) LCDDATA23, will not affect the status of
any pixel. These registers can be used as
general purpose registers.
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
COM0
COM1
COM2
COM3
System Clock
(FOSC/4) ÷8192
÷4 STAT
SOSC 32 kHz ÷1, 2, 3, 4
÷32 ÷2 DUP 4-Bit Prog Prescaler
Crystal Oscillator Ring Counter
TRIP
LF-INTOSC Oscillator QUAD
÷32 LP<3:0>
Nom FRC = 31.25 kHz LMUX<1:0>
(LCDPS<3:0>)
(LCDCON<1:0>)
CS<1:0> LMUX<1:0>
(LCDCON<3:2>) (LCDCON<1:0>)
Static
1/2 Bias 1/3 Bias
Bias
VLCD0 AVSS AVSS AVSS
VLCD3 To VLCD1 — 1/2 AVDD 1/3 AVDD
VLCD2 LCD
VLCD1 Driver VLCD2 — 1/2 AVDD 2/3 AVDD
VLCD0 VLCD3 AVDD AVDD AVDD
LCD Bias 3 LCD Bias 2 LCD Bias 1 Connections for External R-ladder
1/2 Bias
AVDD* 10 k* 10 k*
AVSS
* These values are provided for design guidance only and should be optimized for the application by the designer.
3x VDDCORE
Band Gap
LCDIRS
LCDIRE
LCDCST<2:0>
VLCD3PE
LCDBIAS3
VLCD2PE
LCDBIAS2
VLCD1PE
LCDBIAS1
A Power Mode
B Power Mode
LRLAT<2:0>
LRLAP<1:0> LRLBP<1:0>
lcd_32x_clk
cnt<4:0> 'H00 'H01 'H02 'H03 'H04 'H05 'H06 'H07 'H1E 'H1F 'H00 'H01
lcd_clk
LRLAT<2:0> 'H3
Segment Data
LRLAT<2:0>
Power Mode Power Mode A Power Mode B Mode A
VDD 7 Stages
R R R R
Analog
MUX
7
To Top of
Reference Ladder
0
LCDCST<2:0>
3
Internal Reference Contrast Control
Multiplex Frame Frequency = The COM signal represents the time slice for each
common, while the SEG contains the pixel data.
Static Clock Source/(4 x 1 x (LP<3:0> + 1))
The pixel signal (COM-SEG) will have no DC
1/2 Clock Source/(2 x 2 x (LP<3:0> + 1)) component and can take only one of the two rms values.
1/3 Clock Source/(1 x 3 x (LP<3:0> + 1)) The higher rms value will create a dark pixel and a lower
1/4 Clock Source/(1 x 4 x (LP<3:0> + 1)) rms value will create a clear pixel.
Note: Clock source is (FOSC/4)/8192, As the number of commons increases, the delta
Timer1 Osc/32 or INTRC/32. between the two rms values decreases. The delta
represents the maximum contrast that the display can
have.
TABLE 20-6: APPROXIMATE FRAME
FREQUENCY (IN Hz) USING The LCDs can be driven by two types of waveforms:
FOSC AT 32 MHz, TIMER1 AT Type-A and Type-B. In a Type-A waveform, the phase
changes within each common type, whereas a Type-B
32.768 kHz OR INTRC OSC
waveform’s phase changes on each frame boundary.
LP<3:0> Static 1/2 1/3 1/4 Thus, Type-A waveforms maintain 0 VDC over a single
frame, whereas Type-B waveforms take two frames.
1 125 125 167 125
2 83 83 111 83 Note 1: If Sleep has to be executed with
LCD Sleep enabled (SLPEN
3 62 62 83 62
(LCDCON<6>) = 1), care must be taken
4 50 50 67 50 to execute Sleep only when VDC on all
5 42 42 56 42 the pixels is ‘0’.
6 36 36 48 36 2: When the LCD clock source is (FOSC/4)/
7 31 31 42 31 8192, if Sleep is executed irrespective of
the LCDCON<SLPEN> setting, the LCD
goes into Sleep. Thus, take care to see
that VDC on all pixels is ‘0’ when Sleep is
executed.
Figure 20-7 through Figure 20-17 provide waveforms
for static, half-multiplex, one-third multiplex and quarter
multiplex drives for Type-A and Type-B waveforms.
V1
COM0
COM0 V0
V1
SEG0
V0
V1
SEG1
V0
SEG7
SEG6
SEG5
SEG4
SEG3
SEG2
SEG1
SEG0
V1
COM0-SEG0 V0
-V1
COM0-SEG1 V0
1 Frame
V2
COM0 V1
V0
COM1
V2
COM0
COM1 V1
V0
V2
SEG0 V1
V0
V2
SEG3
SEG2
SEG1
SEG0
SEG1 V1
V0
V2
V1
COM0-SEG0 V0
-V1
-V2
V2
V1
COM0-SEG1 V0
-V1
-V2
1 Frame
V2
COM0 V1
COM1
V0
COM0
V2
COM1 V1
V0
V2
SEG0
V1
V0
V2
SEG1
SEG3
SEG2
SEG1
SEG0
V1
V0
V2
V1
COM0-SEG0 V0
-V1
-V2
V2
V1
COM0-SEG1 V0
-V1
-V2
2 Frames
V3
V2
COM0
V1
COM1
V0
V3
COM0
V2
COM1
V1
V0
V3
V2
SEG0
V1
V0
V3
V2
SEG1
SEG3
SEG2
SEG1
SEG0
V1
V0
V3
V2
V1
COM0-SEG0 V0
-V1
-V2
-V3
V3
V2
V1
COM0-SEG1 V0
-V1
-V2
1 Frame
-V3
V3
V2
COM0
V1
COM1
V0
V3
COM0
V2
COM1
V1
V0
V3
V2
SEG0
V1
V0
V3
V2
SEG1
SEG3
SEG2
SEG1
SEG0
V1
V0
V3
V2
V1
COM0-SEG0 V0
-V1
-V2
-V3
V3
V2
V1
COM0-SEG1 V0
-V1
-V2
2 Frames
-V3
V2
COM0
V1
V0
COM2 V2
COM1 V1
COM1 V0
COM0
V2
COM2 V1
V0
V2
SEG0
V1
SEG2
V0
SEG2
SEG1
SEG0
V2
SEG1 V1
V0
V2
V1
COM0-SEG0 V0
-V1
-V2
V2
V1
COM0-SEG1 V0
-V1
-V2
1 Frame
V2
COM0
V1
V0
COM2
V2
COM1
V1
COM1
V0
COM0
V2
COM2
V1
V0
V2
SEG0
V1
V0
SEG2
SEG1
SEG0
V2
SEG1
V1
V0
V2
V1
COM0-SEG0 V0
-V1
-V2
V2
V1
COM0-SEG1 V0
-V1
-V2
2 Frames
V3
V2
COM0
V1
V0
COM2 V3
V2
COM1
V1
COM1
V0
COM0
V3
V2
COM2
V1
V0
V3
V2
SEG0
SEG2 V1
V0
SEG2
SEG1
SEG0
V3
V2
SEG1
V1
V0
V3
V2
V1
COM0-SEG0 V0
-V1
-V2
-V3
V3
V2
V1
COM0-SEG1 V0
-V1
-V2
-V3
1 Frame
V3
V2
COM0
V1
V0
COM2 V3
V2
COM1
V1
COM1
V0
COM0
V3
V2
COM2
V1
V0
V3
V2
SEG0
V1
V0
SEG2
SEG1
SEG0
V3
V2
SEG1
V1
V0
V3
V2
V1
COM0-SEG0 V0
-V1
-V2
-V3
V3
V2
V1
COM0-SEG1 V0
-V1
-V2
-V3
2 Frames
COM3
V3
COM2 V2
COM0 V1
V0
V3
COM1 V2
COM1 V1
COM0 V0
V3
V2
COM2 V1
V0
V3
V2
COM3 V1
V0
V3
V2
SEG0 V1
V0
SEG1
SEG0
V3
V2
SEG1 V1
V0
V3
V2
V1
COM0-SEG0 V0
-V1
-V2
-V3
V3
V2
V1
COM0-SEG1 V0
-V1
-V2
-V3
1 Frame
COM3
V3
COM2 V2
COM0 V1
V0
V3
COM1 V2
COM1 V1
COM0 V0
V3
V2
COM2 V1
V0
V3
V2
COM3 V1
V0
V3
V2
SEG0 V1
V0
SEG1
SEG0
V3
V2
SEG1 V1
V0
V3
V2
V1
COM0-SEG0 V0
-V1
-V2
-V3
V3
V2
V1
COM0-SEG1 V0
-V1
-V2
-V3
2 Frames
V3
V2
COM1 V1
V0
V3
V2
COM2 V1
V0
COM3 V3
V2
V1
V0
2 Frames
TFINT
TFWR Frame
Frame Frame
Boundary Boundary Boundary
To ensure that no DC component is introduced on the Note: The internal RC oscillator or external
panel, the SLEEP instruction should be executed SOSC oscillator must be used to operate
immediately after an LCD frame boundary. The LCD the LCD module during Sleep.
V2
V1
COM0 V0
V3
V2
V1
COM1 V0
V3
V2
V1
COM2 V0
V3
V2
V1
SEG0 V0
2 Frames
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
Note 1: Polarity of the clock state is set by the CKP bit (SSPxCON1<4>).
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
Note 1: In Master mode, the overflow bit is not set since each new reception (and transmission) is initiated by
writing to the SSPxBUF register.
2: When enabled, these pins must be properly configured as inputs or outputs.
3: Bit combinations not specifically listed here are either reserved or implemented in I2C™ mode only.
SDOx SDIx
SDIx SDOx
Shift Register Shift Register
(SSPxSR) (SSPxSR)
MSb LSb MSb LSb
Serial Clock
SCKx SCKx
PROCESSOR 1 PROCESSOR 2
Write to
SSPxBUF
SCKx
(CKP = 0
CKE = 0)
SCKx
(CKP = 1
CKE = 0)
4 Clock
SCKx Modes
(CKP = 0
CKE = 1)
SCKx
(CKP = 1
CKE = 1)
Input
Sample
(SMP = 1)
SSPxIF
Next Q4 Cycle
SSPxSR to after Q2
SSPxBUF
SSx
SCKx
(CKP = 0
CKE = 0)
SCKx
(CKP = 1
CKE = 0)
Write to
SSPxBUF
SDIx bit 0
(SMP = 0) bit 7 bit 7
Input
Sample
(SMP = 0)
SSPxIF
Interrupt
Flag
Next Q4 Cycle
SSPxSR to after Q2
SSPxBUF
SSx
Optional
SCKx
(CKP = 0
CKE = 0)
SCKx
(CKP = 1
CKE = 0)
Write to
SSPxBUF
SDIx
(SMP = 0) bit 7 bit 0
Input
Sample
(SMP = 0)
SSPxIF
Interrupt
Flag
Next Q4 Cycle
SSPxSR to after Q2
SSPxBUF
SSx
Not Optional
SCKx
(CKP = 0
CKE = 1)
SCKx
(CKP = 1
CKE = 1)
Write to
SSPxBUF
SDIx
(SMP = 0) bit 0
bit 7
Input
Sample
(SMP = 0)
SSPxIF
Interrupt
Flag
Next Q4 Cycle
after Q2
SSPxSR to
SSPxBUF
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
Note 1: When enabled, the SDAx and SCLx pins must be configured as inputs.
2: Bit combinations not specifically listed here are either reserved or implemented in SPI mode only.
3: When SSPM<3:0> = 1001, any reads or writes to the SSPxADD SFR address actually access the
SSPxMSK register.
4: This mode is only available when 7-Bit Address Masking mode is selected (MSSPMSK Configuration bit is ‘1’).
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
Note 1: The value that will be transmitted when the user initiates an Acknowledge sequence at the end of a
receive.
2: If the I2C module is active, these bits may not be set (no spooling) and the SSPxBUF may not be written to
(or writes to the SSPxBUF are disabled).
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
Note 1: If the I2C module is active, this bit may not be set (no spooling) and the SSPxBUF may not be written to
(or writes to the SSPxBUF are disabled).
REGISTER 21-7: SSPxMSK: I2C™ SLAVE ADDRESS MASK REGISTER (7-BIT MASKING MODE)(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
MSK7 MSK6 MSK5 MSK4 MSK3 MSK2 MSK1 MSK0(2)
bit 7 bit 0
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
Note 1: This register shares the same SFR address as SSPxADD and is only addressable in select MSSPx
operating modes. See Section 21.4.3.4 “7-Bit Address Masking Mode” for more details.
2: MSK0 is not used as a mask bit in 7-bit addressing.
DS39957D-page 322
Receiving Address R/W = 0 Receiving Data ACK Receiving Data ACK
SDAx A7 A6 A5 A4 A3 A2 A1 ACK D7 D6 D5 D4 D3 D2 D1 D0 D7 D6 D5 D4 D3 D2 D1 D0
SCLx 1 2 3 4 5 6 7 8 9 1 2 3 4 5 6 7 8 9 1 2 3 4 5 6 7 8 9
S P
terminates
transfer
BF (SSPxSTAT<0>)
Cleared in software
SSPxBUF is read
SSPOV (SSPxCON1<6>)
SSPOV is set
because SSPxBUF is
still full. ACK is not sent.
CKP (SSPxCON<4>)
(CKP does not reset to ‘0’ when SEN = 0)
I2C™ SLAVE MODE TIMING WITH SEN = 0 (RECEPTION, 7-BIT ADDRESS)
SDAx A7 A6 A5 X A3 X X ACK D7 D6 D5 D4 D3 D2 D1 D0 D7 D6 D5 D4 D3 D2 D1 D0
SCLx 1 2 3 4 5 6 7 8 9 1 2 3 4 5 6 7 8 9 1 2 3 4 5 6 7 8 9
S P
transfer
BF (SSPxSTAT<0>)
Cleared in software
SSPxBUF is read
SSPOV (SSPxCON1<6>)
SSPOV is set
because SSPxBUF is
still full. ACK is not sent.
CKP (SSPxCON<4>)
Note 1: x = Don’t care (i.e., address bit can either be a ‘1’ or a ‘0’).
2: In this example, an address equal to A7.A6.A5.X.A3.X.X will be Acknowledged and cause an interrupt.
I2C™ SLAVE MODE TIMING WITH SEN = 0 AND ADMSK<5:1> = 01011
PIC18F87K90 FAMILY
DS39957D-page 323
FIGURE 21-10:
DS39957D-page 324
Receiving Address R/W = 1 Transmitting Data Transmitting Data
ACK ACK
SDAx A7 A6 A5 A4 A3 A2 A1 ACK D7 D6 D5 D4 D3 D2 D1 D0 D7 D6 D5 D4 D3 D2 D1 D0
SCLx
1 2 3 4 5 6 7 8 9 1 2 3 4 5 6 7 8 9 1 2 3 4 5 6 7 8 9
S
Data in SCLx held low P
sampled while CPU
responds to SSPxIF
BF (SSPxSTAT<0>)
Cleared in software Cleared in software
From SSPxIF ISR From SSPxIF ISR
SSPxBUF is written in software SSPxBUF is written in software
Clear by reading
CKP (SSPxCON<4>)
Receive First Byte of Address Receive Second Byte of Address Receive Data Byte Receive Data Byte
R/W = 0 ACK
Bus master
terminates
SSPxIF (PIR1<3> or PIR3<7>) transfer
BF (SSPxSTAT<0>)
SSPOV (SSPxCON1<6>)
SSPOV is set
because SSPxBUF is
still full. ACK is not sent.
UA (SSPxSTAT<1>)
Note 1: x = Don’t care (i.e., address bit can either be a ‘1’ or a ‘0’).
I2C™ SLAVE MODE TIMING WITH SEN = 0 AND ADMSK<5:1> = 01001
2: In this example, an address equal to A9.A8.A7.A6.A5.X.A3.A2.X.X will be Acknowledged and cause an interrupt.
3: Note that the Most Significant bits of the address are not affected by the bit masking.
PIC18F87K90 FAMILY
DS39957D-page 325
FIGURE 21-12:
DS39957D-page 326
Clock is held low until Clock is held low until
update of SSPxADD has update of SSPxADD has
taken place taken place
Receive First Byte of Address Receive Second Byte of Address Receive Data Byte Receive Data Byte
R/W = 0 ACK
SCLx 1 2 3 4 5 6 7 8 9 1 2 3 4 5 6 7 8 9 1 2 3 4 5 6 7 8 9 1 2 3 4 5 6 7 8 9
S P
Bus master
terminates
SSPxIF (PIR1<3> or PIR3<7>) transfer
BF (SSPxSTAT<0>)
PIC18F87K90 FAMILY
SSPOV is set
because SSPxBUF is
still full. ACK is not sent.
UA (SSPxSTAT<1>)
Bus master
terminates
Clock is held low until Clock is held low until transfer
update of SSPxADD has update of SSPxADD has Clock is held low until
taken place taken place CKP is set to ‘1’
R/W = 0
SCLx 1 2 3 4 5 6 7 8 9 1 2 3 4 5 6 7 8 9 1 2 3 4 5 6 7 8 9 1 2 3 4 5 6 7 8 9
S Sr P
BF (SSPxSTAT<0>)
DS39957D-page 327
PIC18F87K90 FAMILY
21.4.4 CLOCK STRETCHING 21.4.4.3 Clock Stretching for 7-Bit Slave
Both 7-Bit and 10-Bit Slave modes implement Transmit Mode
automatic clock stretching during a transmit sequence. The 7-Bit Slave Transmit mode implements clock
The SEN bit (SSPxCON2<0>) allows clock stretching stretching by clearing the CKP bit after the falling edge
to be enabled during receives. Setting SEN will cause of the ninth clock if the BF bit is clear. This occurs
the SCLx pin to be held low at the end of each data regardless of the state of the SEN bit.
receive sequence. The user’s ISR must set the CKP bit before transmis-
sion is allowed to continue. By holding the SCLx line
21.4.4.1 Clock Stretching for 7-Bit Slave low, the user has time to service the ISR and load the
Receive Mode (SEN = 1) contents of the SSPxBUF before the master device
In 7-Bit Slave Receive mode, on the falling edge of the can initiate another transmit sequence (see
ninth clock at the end of the ACK sequence, if the BF Figure 21-10).
bit is set, the CKP bit in the SSPxCON1 register is Note 1: If the user loads the contents of
automatically cleared, forcing the SCLx output to be SSPxBUF, setting the BF bit before the
held low. The CKP bit being cleared to ‘0’ will assert falling edge of the ninth clock, the CKP bit
the SCLx line low. The CKP bit must be set in the will not be cleared and clock stretching
user’s ISR before reception is allowed to continue. By will not occur.
holding the SCLx line low, the user has time to service
the ISR and read the contents of the SSPxBUF before 2: The CKP bit can be set in software
the master device can initiate another receive regardless of the state of the BF bit.
sequence. This will prevent buffer overruns from
occurring (see Figure 21-15). 21.4.4.4 Clock Stretching for 10-Bit Slave
Note 1: If the user reads the contents of the Transmit Mode
SSPxBUF before the falling edge of the In 10-Bit Slave Transmit mode, clock stretching is
ninth clock, thus clearing the BF bit, the controlled during the first two address sequences by
CKP bit will not be cleared and clock the state of the UA bit, just as it is in 10-Bit Slave
stretching will not occur. Receive mode. The first two addresses are followed
2: The CKP bit can be set in software by a third address sequence, which contains the
regardless of the state of the BF bit. The high-order bits of the 10-bit address and the R/W bit
user should be careful to clear the BF bit set to ‘1’. After the third address sequence is
in the ISR before the next receive performed, the UA bit is not set, the module is now
sequence in order to prevent an overflow configured in Transmit mode and clock stretching is
condition. controlled by the BF flag as in 7-Bit Slave Transmit
mode (see Figure 21-13).
21.4.4.2 Clock Stretching for 10-Bit Slave
Receive Mode (SEN = 1)
In 10-Bit Slave Receive mode, during the address
sequence, clock stretching automatically takes place
but CKP is not cleared. During this time, if the UA bit is
set after the ninth clock, clock stretching is initiated.
The UA bit is set after receiving the upper byte of the
10-bit address and following the receive of the second
byte of the 10-bit address with the R/W bit cleared to
‘0’. The release of the clock line occurs upon updating
SSPxADD. Clock stretching will occur on each data
receive sequence as described in 7-bit mode.
Note: If the user polls the UA bit and clears it by
updating the SSPxADD register before the
falling edge of the ninth clock occurs, and if
the user hasn’t cleared the BF bit by read-
ing the SSPxBUF register before that time,
then the CKP bit will still NOT be asserted
low. Clock stretching on the basis of the
state of the BF bit only occurs during a data
sequence, not an address sequence.
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 DX – 1
SCLx
Master Device
CKP Asserts Clock
Master Device
Deasserts Clock
WR
SSPxCON1
DS39957D-page 330
Clock is not held low
because buffer full bit is
clear prior to falling edge Clock is held low until Clock is not held low
of 9th clock CKP is set to ‘1’ because ACK = 1
SDAx A7 A6 A5 A4 A3 A2 A1 ACK D7 D6 D5 D4 D3 D2 D1 D0 D7 D6 D5 D4 D3 D2 D1 D0
SCLx 1 2 3 4 5 6 7 8 9 1 2 3 4 5 6 7 8 9 1 2 3 4 5 6 7 8 9
S P
terminates
transfer
BF (SSPxSTAT<0>)
Cleared in software
SSPxBUF is read
SSPOV (SSPxCON1<6>)
SSPOV is set
because SSPxBUF is
still full. ACK is not sent.
CKP (SSPxCON<4>)
CKP
If BF is cleared written
prior to the falling to ‘1’ in
edge of the 9th clock, software
CKP will not be reset BF is set after falling
to ‘0’ and no clock edge of the 9th clock,
stretching will occur CKP is reset to ‘0’ and
clock stretching occurs
I2C™ SLAVE MODE TIMING WITH SEN = 1 (RECEPTION, 7-BIT ADDRESS)
BF (SSPxSTAT<0>)
SSPxBUF is written with Dummy read of SSPxBUF Dummy read of SSPxBUF
contents of SSPxSR to clear BF flag to clear BF flag
SSPOV (SSPxCON1<6>)
SSPOV is set
because SSPxBUF is
still full. ACK is not sent.
UA (SSPxSTAT<1>)
DS39957D-page 331
PIC18F87K90 FAMILY
21.4.5 GENERAL CALL ADDRESS If the general call address matches, the SSPxSR is
SUPPORT transferred to the SSPxBUF, the BF flag bit is set
(eighth bit), and on the falling edge of the ninth bit (ACK
The addressing procedure for the I2C bus is such that
bit), the SSPxIF interrupt flag bit is set.
the first byte after the Start condition usually
determines which device will be the slave addressed by When the interrupt is serviced, the source for the
the master. The exception is the general call address interrupt can be checked by reading the contents of the
which can address all devices. When this address is SSPxBUF. The value can be used to determine if the
used, all devices should, in theory, respond with an address was device-specific or a general call address.
Acknowledge. In 10-Bit Addressing mode, the SSPxADD is required
The general call address is one of eight addresses to be updated for the second half of the address to
reserved for specific purposes by the I2C protocol. It match and the UA bit is set (SSPxSTAT<1>). If the gen-
consists of all ‘0’s with R/W = 0. eral call address is sampled when the GCEN bit is set,
while the slave is configured in 10-Bit Addressing
The general call address is recognized when the
mode, then the second half of the address is not
General Call Enable bit, GCEN, is enabled
necessary, the UA bit will not be set and the slave will
(SSPxCON2<7> set). Following a Start bit detect, 8 bits
begin receiving data after the Acknowledge
are shifted into the SSPxSR and the address is
(Figure 21-17).
compared against the SSPxADD. It is also compared to
the general call address and fixed in hardware.
SCLx 1 2 3 4 5 6 7 8 9 1 2 3 4 5 6 7 8 9
S
SSPxIF
BF (SSPxSTAT<0>)
Cleared in Software
SSPxBUF is Read
SSPOV (SSPxCON1<6>) ‘0’
GCEN (SSPxCON2<7>)
‘1’
Internal SSPM<3:0>
Data Bus SSPxADD<6:0>
Read Write
SSPxBUF Baud
Rate
Generator
SDAx Shift
Clock Arbitrate/WCOL Detect
SDAx In Clock
SSPxSR
(hold off clock source)
MSb LSb
Receive Enable
Acknowledge
Generate
SCLx
SSPM<3:0> SSPxADD<6:0>
SDAx DX DX – 1
BRG Decrements on
Q2 and Q4 Cycles
BRG
03h 02h 01h 00h (hold off) 03h 02h
Value
SCLx
TBRG
S
Sr = Repeated Start
DS39957D-page 340
Write SSPxCON2<0> (SEN = 1), ACKSTAT in
Start condition begins SSPxCON2 = 1
From slave, clear ACKSTAT bit (SSPxCON2<6>)
SEN = 0
Transmitting Data or Second Half
Transmit Address to Slave R/W = 0 ACK
of 10-bit Address
SDAx A7 A6 A5 A4 A3 A2 A1 ACK = 0 D7 D6 D5 D4 D3 D2 D1 D0
BF (SSPxSTAT<0>)
PEN
R/W
I 2C™ MASTER MODE WAVEFORM (TRANSMISSION, 7 OR 10-BIT ADDRESS)
Write to SSPxCON2<4>
to start Acknowledge sequence,
SDAx = ACKDT (SSPxCON2<5>) = 0
Write to SSPxCON2<0> (SEN = 1),
begin Start condition ACK from master, Set ACKEN, start Acknowledge sequence,
Master configured as a receiver SDAx = ACKDT = 0 SDAx = ACKDT = 1
SEN = 0 by programming SSPxCON2<3> (RCEN = 1)
PEN bit = 1
Write to SSPxBUF occurs here, RCEN cleared RCEN = 1, start RCEN cleared
ACK from Slave next receive automatically written here
start XMIT automatically
Bus master
ACK is not sent terminates
transfer
1 2 3 4 5 6 7 8 9 1 2 3 4 5 6 7 8 9 1 2 3 4 5 6 7 8 9
SCLx S P
Data shifted in on falling edge of CLK Set SSPxIF at end
of receive Set SSPxIF interrupt
Set SSPxIF interrupt at end of Acknowledge
Set SSPxIF interrupt sequence
at end of receive
at end of Acknowledge
SSPxIF sequence
Set P bit
Cleared in software Cleared in software Cleared in software Cleared in software (SSPxSTAT<4>)
Cleared in
SDAx = 0, SCLx = 1, software and SSPxIF
while CPU
responds to SSPxIF
BF
(SSPxSTAT<0>) Last bit is shifted into SSPxSR and
contents are unloaded into SSPxBUF
SSPOV
ACKEN
I 2C™ MASTER MODE WAVEFORM (RECEPTION, 7-BIT ADDRESS)
PIC18F87K90 FAMILY
DS39957D-page 341
PIC18F87K90 FAMILY
21.4.12 ACKNOWLEDGE SEQUENCE 21.4.13 STOP CONDITION TIMING
TIMING A Stop bit is asserted on the SDAx pin at the end of a
An Acknowledge sequence is enabled by setting the receive/transmit by setting the Stop Sequence Enable
Acknowledge Sequence Enable bit, ACKEN bit, PEN (SSPxCON2<2>). At the end of a
(SSPxCON2<4>). When this bit is set, the SCLx pin is receive/transmit, the SCLx line is held low after the
pulled low and the contents of the Acknowledge data bit falling edge of the ninth clock. When the PEN bit is set,
are presented on the SDAx pin. If the user wishes to the master will assert the SDAx line low. When the
generate an Acknowledge, then the ACKDT bit should SDAx line is sampled low, the Baud Rate Generator is
be cleared. If not, the user should set the ACKDT bit reloaded and counts down to 0. When the Baud Rate
before starting an Acknowledge sequence. The Baud Generator times out, the SCLx pin will be brought high
Rate Generator then counts for one rollover period and one TBRG (Baud Rate Generator rollover count)
(TBRG) and the SCLx pin is deasserted (pulled high). later, the SDAx pin will be deasserted. When the SDAx
When the SCLx pin is sampled high (clock arbitration), pin is sampled high while SCLx is high, the P bit
the Baud Rate Generator counts for TBRG; the SCLx pin (SSPxSTAT<4>) is set. A TBRG later, the PEN bit is
is then pulled low. Following this, the ACKEN bit is auto- cleared and the SSPxIF bit is set (see Figure 21-26).
matically cleared, the Baud Rate Generator is turned off
and the MSSP module then goes into an inactive state 21.4.13.1 WCOL Status Flag
(Figure 21-25). If the user writes the SSPxBUF when a Stop sequence
is in progress, then the WCOL bit is set and the
21.4.12.1 WCOL Status Flag contents of the buffer are unchanged (the write doesn’t
If the user writes the SSPxBUF when an Acknowledge occur).
sequence is in progress, then WCOL is set and the
contents of the buffer are unchanged (the write doesn’t
occur).
SCLx 8 9
SSPxIF
Cleared in
SSPxIF Set at Cleared in Software
the End of Receive Software SSPxIF Set at the End
of Acknowledge Sequence
Note: TBRG = one Baud Rate Generator period.
TBRG
SCLx
SDAx ACK
P
TBRG TBRG TBRG
SCLx Brought High After TBRG
SDAx Asserted Low Before Rising Edge of Clock
to Set Up Stop Condition
SDAx
BCLxIF
SDAx
SCLx
Set SEN, Enable Start SEN Cleared Automatically because of Bus Collision.
Condition if SDAx = 1, SCLx = 1 MSSP module Reset into Idle State.
SEN
SDAx Sampled Low before
Start Condition. Set BCLxIF.
S bit and SSPxIF Set because
BCLxIF SDAx = 0, SCLx = 1.
SSPxIF and BCLxIF are
Cleared in Software
SSPxIF
TBRG TBRG
SDAx
FIGURE 21-30: BRG RESET DUE TO SDAx ARBITRATION DURING START CONDITION
SDAx = 0, SCLx = 1
Set S Set SSPxIF
Less than TBRG
TBRG
SCLx S
SCLx Pulled Low After BRG
Time-out
SEN
Set SEN, Enable Start
Sequence if SDAx = 1, SCLx = 1
BCLxIF ‘0’
SSPxIF
SDAx = 0, SCLx = 1, Interrupts Cleared
Set SSPxIF in Software
SDAx
SCLx
RSEN
BCLxIF
Cleared in Software
S ‘0’
SSPxIF ‘0’
TBRG TBRG
SDAx
SCLx
S ‘0’
SSPxIF
PEN
BCLxIF
P ‘0’
SSPxIF ‘0’
SDAx
SCLx goes Low Before SDAx goes High,
Assert SDAx
Set BCLxIF
SCLx
PEN
BCLxIF
P ‘0’
SSPxIF ‘0’
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
0.3 — — — — — — — — — — — —
1.2 — — — 1.221 1.73 255 1.202 0.16 129 1.201 -0.16 103
2.4 2.441 1.73 255 2.404 0.16 129 2.404 0.16 64 2.403 -0.16 51
9.6 9.615 0.16 64 9.766 1.73 31 9.766 1.73 15 9.615 -0.16 12
19.2 19.531 1.73 31 19.531 1.73 15 19.531 1.73 7 — — —
57.6 56.818 -1.36 10 62.500 8.51 4 52.083 -9.58 2 — — —
115.2 125.000 8.51 4 104.167 -9.58 2 78.125 -32.18 1 — — —
0.3 — — — — — — — — — — — —
1.2 — — — — — — — — — — — —
2.4 — — — — — — 2.441 1.73 255 2.403 -0.16 207
9.6 9.766 1.73 255 9.615 0.16 129 9.615 0.16 64 9.615 -0.16 51
19.2 19.231 0.16 129 19.231 0.16 64 19.531 1.73 31 19.230 -0.16 25
57.6 58.140 0.94 42 56.818 -1.36 21 56.818 -1.36 10 55.555 3.55 8
115.2 113.636 -1.36 21 113.636 -1.36 10 125.000 8.51 4 — — —
0.3 0.300 0.00 8332 0.300 0.02 4165 0.300 0.02 2082 0.300 -0.04 1665
1.2 1.200 0.02 2082 1.200 -0.03 1041 1.200 -0.03 520 1.201 -0.16 415
2.4 2.402 0.06 1040 2.399 -0.03 520 2.404 0.16 259 2.403 -0.16 207
9.6 9.615 0.16 259 9.615 0.16 129 9.615 0.16 64 9.615 -0.16 51
19.2 19.231 0.16 129 19.231 0.16 64 19.531 1.73 31 19.230 -0.16 25
57.6 58.140 0.94 42 56.818 -1.36 21 56.818 -1.36 10 55.555 3.55 8
115.2 113.636 -1.36 21 113.636 -1.36 10 125.000 8.51 4 — — —
0.3 0.300 0.04 832 0.300 -0.16 415 0.300 -0.16 207
1.2 1.202 0.16 207 1.201 -0.16 103 1.201 -0.16 51
2.4 2.404 0.16 103 2.403 -0.16 51 2.403 -0.16 25
9.6 9.615 0.16 25 9.615 -0.16 12 — — —
19.2 19.231 0.16 12 — — — — — —
57.6 62.500 8.51 3 — — — — — —
115.2 125.000 8.51 1 — — — — — —
0.3 0.300 0.00 33332 0.300 0.00 16665 0.300 0.00 8332 0.300 -0.01 6665
1.2 1.200 0.00 8332 1.200 0.02 4165 1.200 0.02 2082 1.200 -0.04 1665
2.4 2.400 0.02 4165 2.400 0.02 2082 2.402 0.06 1040 2.400 -0.04 832
9.6 9.606 0.06 1040 9.596 -0.03 520 9.615 0.16 259 9.615 -0.16 207
19.2 19.193 -0.03 520 19.231 0.16 259 19.231 0.16 129 19.230 -0.16 103
57.6 57.803 0.35 172 57.471 -0.22 86 58.140 0.94 42 57.142 0.79 34
115.2 114.943 -0.22 86 116.279 0.94 42 113.636 -1.36 21 117.647 -2.12 16
0.3 0.300 0.01 3332 0.300 -0.04 1665 0.300 -0.04 832
1.2 1.200 0.04 832 1.201 -0.16 415 1.201 -0.16 207
2.4 2.404 0.16 415 2.403 -0.16 207 2.403 -0.16 103
9.6 9.615 0.16 103 9.615 -0.16 51 9.615 -0.16 25
19.2 19.231 0.16 51 19.230 -0.16 25 19.230 -0.16 12
57.6 58.824 2.12 16 55.555 3.55 8 — — —
115.2 111.111 -3.55 8 — — — — — —
In the Auto-Baud Rate Detect (ABD) mode, the clock to 2: It is up to the user to determine that the
the BRG is reversed. Rather than the BRG clocking the incoming character baud rate is within the
incoming RXx signal, the RXx signal is timing the BRG. range of the selected BRG clock source.
In ABD mode, the internal Baud Rate Generator is Some combinations of oscillator fre-
used as a counter to time the bit period of the incoming quency and EUSART baud rates are not
serial byte stream. possible due to bit error rates. Overall
system timing and communication baud
Once the ABDEN bit is set, the state machine will clear rates must be taken into consideration
the BRG and look for a Start bit. The Auto-Baud Rate when using the Auto-Baud Rate Detection
Detect must receive a byte with the value, 55h (ASCII feature.
“U”, which is also the LIN/J2602 bus Sync character), in
order to calculate the proper bit rate. The measurement 3: To maximize baud rate range, it is
is taken over both a low and a high bit time in order to recommended to set the BRG16
minimize any effects caused by asymmetry of the incom- (BAUDCONx<3>) bit if the auto-baud
ing signal. After a Start bit, the SPBRGx begins counting feature is used.
up, using the preselected clock source on the first rising
edge of RXx. After eight bits on the RXx pin or the fifth
TABLE 22-4: BRG COUNTER
rising edge, an accumulated value totalling the proper
CLOCK RATES
BRG period is left in the SPBRGHx:SPBRGx register
pair. Once the 5th edge is seen (this should correspond BRG16 BRGH BRG Counter Clock
to the Stop bit), the ABDEN bit is automatically cleared.
0 0 FOSC/512
If a rollover of the BRG occurs (an overflow from FFFFh
0 1 FOSC/128
to 0000h), the event is trapped by the ABDOVF status
bit (BAUDCONx<7>). It is set in hardware by BRG roll- 1 0 FOSC/128
overs and can be set or cleared by the user in software. 1 1 FOSC/32
ABD mode remains active after rollover events and the
ABDEN bit remains set (Figure 22-2). 22.1.3.1 ABD and EUSART Transmission
While calibrating the baud rate period, the BRG Since the BRG clock is reversed during ABD acquisi-
registers are clocked at 1/8th the preconfigured clock tion, the EUSART transmitter cannot be used during
rate. Note that the BRG clock can be configured by the ABD. This means that whenever the ABDEN bit is set,
BRG16 and BRGH bits. The BRG16 bit must be set to TXREGx cannot be written to. Users should also
use both SPBRG1 and SPBRGH1 as a 16-bit counter. ensure that ABDEN does not become set during a
This allows the user to verify that no carry occurred for transmit sequence. Failing to do this may result in
8-bit modes by checking for 00h in the SPBRGHx unpredictable EUSART operation.
register. Refer to Table 22-4 for counter clock rates to
the BRG.
BRG Clock
RCxIF bit
(Interrupt)
Read
RCREGx
Note: The ABD sequence requires the EUSART module to be configured in Asynchronous mode and WUE = 0.
BRG Clock
ABDEN bit
ABDOVF bit
FFFFh
BRG Value XXXXh 0000h 0000h
TRMT SPEN
BRG16 SPBRGHx SPBRGx
TX9
Baud Rate Generator TX9D
Write to TXREGx
Word 1
BRG Output
(Shift Clock)
TXx (pin)
Start bit bit 0 bit 1 bit 7/8 Stop bit
Word 1
TXxIF bit
(Transmit Buffer 1 TCY
Reg. Empty Flag)
Word 1
TRMT bit
Transmit Shift Reg
(Transmit Shift
Reg. Empty Flag)
Write to TXREGx
Word 1 Word 2
BRG Output
(Shift Clock)
TXx (pin)
Start bit bit 0 bit 1 bit 7/8 Stop bit Start bit bit 0
RX9
SPEN
8
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) bit to be set.
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
Cleared due to User Read of RCREGx
Note 1: The EUSART remains in Idle while the WUE bit is set.
RXx/DTx Line
Note 1
RCxIF
Cleared due to User Read of RCREGx
SLEEP Command Executed Sleep Ends
Note 1: 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.
2: The EUSART remains in Idle while the WUE bit is set.
Write to TXREGx
Dummy Write
BRG Output
(Shift Clock)
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)
RC7/RX1/DT1/
SEG28 Pin bit 0 bit 1 bit 2 bit 7 bit 0 bit 1 bit 7
Word 1 Word 2
RC6/TX1/CK1/
SEG27 Pin
(TXCKP = 0)
RC6/TX1/CK1/
SEG27 Pin
(TXCKP = 1)
Write to
TXREG1 Reg Write Word 1 Write Word 2
TX1IF bit
(Interrupt Flag)
TRMT bit
Note: Sync Master mode, SPBRGx = 0, continuous transmission of two 8-bit words. This example is equally applicable to EUSART2
(RG1/TX2/CK2/AN19/C3OUT and RG2/RX2/DT2/AN18/C3INA).
RC6/TX1/CK1/SEG27 Pin
Write to
TXREG1 reg
TX1IF bit
TRMT bit
TXEN bit
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/
SEG28 Pin bit 0 bit 1 bit 2 bit 3 bit 4 bit 5 bit 6 bit 7
RC6/TX1/CK1/
SEG27 Pin
(TXCKP = 0)
RC6/TX1/CK1/
SEG27 Pin
(TXCKP = 1)
Write to
bit, SREN
SREN bit
CREN bit ‘0’ ‘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/AN19/C3OUT and RG2/RX2/DT2/AN18/C3INA).
Positive input
CHS<4:0> + ADC
CHSN<2:0>
= 000
–
AVSS
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
Note 1: 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.
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
REGISTER 23-5: ADRESL: A/D RESULT LOW BYTE REGISTER, LEFT JUSTIFIED (ADFM = 0)
R/W-x R/W-x R/W-x R/W-x R/W-x R/W-x R/W-x R/W-x
ADRES3 ADRES2 ADRES1 ADRES0 ADSGN ADSGN ADSGN ADSGN
bit 7 bit 0
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
REGISTER 23-7: ADRESL: A/D RESULT LOW BYTE REGISTER, RIGHT JUSTIFIED (ADFM = 1)
R/W-x R/W-x R/W-x R/W-x R/W-x R/W-x R/W-x R/W-x
ADRES7 ADRES6 ADRES5 ADRES4 ADRES3 ADRES2 ADRES1 ADRES0
bit 7 bit 0
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
bit 7-0 ANSEL<7:0>: Analog Port Configuration bits (AN7 and AN0)
0 = Pin is configured as a digital port
1 = Pin is configured as an analog channel – digital input disabled and any inputs read as ‘0’
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
bit 7-0 ANSEL<15:8>: Analog Port Configuration bits (AN15 through AN8)
0 = Pin is configured as a digital port
1 = Pin is configured as an analog channel – digital input is disabled and any inputs read as ‘0’
Note 1: AN12 through AN15, and AN20 to AN23, are implemented only on 80-pin devices. For 64-pin devices, the
corresponding ANSELx bits are still implemented for these channels, but have no effect.
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
bit 7-0 ANSEL<23:16>: Analog Port Configuration bits (AN23 through AN16)
0 = Pin configured as a digital port
1 = Pin configured as an analog channel — digital input disabled and any inputs read as ‘0’
Note 1: AN12 through AN15, and AN20 to AN23, are implemented only on 80-pin devices. For 64-pin devices, the
corresponding ANSELx bits are still implemented for these channels, but have no effect.
The analog reference voltage is software-selectable to Each port pin associated with the A/D Converter can be
either the device’s positive and negative supply voltage configured as an analog input or a digital I/O. The
(AVDD and AVSS) or the voltage level on the ADRESH and ADRESL registers contain the result of
RA3/AN3/VREF+ and RA2/AN2/VREF- pins. VREF+ has the A/D conversion. When the A/D conversion is com-
two additional internal voltage reference selections: plete, the result is loaded into the ADRESH:ADRESL
2.048V and 4.096V. register pair, the GO/DONE bit (ADCON0<1>) is
The A/D Converter can uniquely operate while the cleared and the A/D Interrupt Flag bit, ADIF (PIR1<6>),
device is in Sleep mode. To operate in Sleep, the A/D is set.
conversion clock must be derived from the A/D A device Reset forces all registers to their Reset state.
Converter’s internal RC oscillator. This forces the A/D module to be turned off and any
The output of the Sample-and-Hold (S/H) is the input conversion in progress is aborted. The value in the
into the converter, which generates the result via ADRESH:ADRESL register pair is not modified for a
successive approximation. Power-on Reset. These registers will contain unknown
data after a Power-on Reset.
The block diagram of the A/D module is shown in
Figure 23-4.
11111
1.024V Band Gap
11110
VDDCORE
11101 Reserved
Temperature Diode
11100
Reserved CTMU
11011
(Unimplemented)
11010
(Unimplemented)
11001
(Unimplemented)
11000
(Unimplemented)
10111
AN23(1)
12-Bit
A/D 10110
Converter AN22(1)
00100
AN4
00011
AN3
00010
AN2
00001
AN1
00000
AN0
111
Negative Input Voltage AN6
110
AN5
Reference
Voltage
VCFG<1:0>
AN2
VSS(2)
Note 1: Channels, AN12 through AN15, and AN20 through AN23, are not available on 64-pin devices.
2: I/O pins have diode protection to VDD and VSS.
VSS
Conversion starts
Holding capacitor is disconnected from analog input (typically 100 ns)
FIGURE 23-7: A/D CONVERSION TAD CYCLES (ACQT<2:0> = 010, TACQ = 4 TAD)
1 2 3 4 1 2 3 4 5 6 7 8 9 10 11 12 13
b11 b10 b9 b8 b7 b6 b5 b4 b3 b2 b1 b0
Automatic
Acquisition Conversion starts
Time (Holding capacitor is disconnected)
CCH<1:0> CMPxOUT
(CMSTAT<7:5>)
CxINB 0
CxINC(2) 1
Interrupt
C2INB/C2IND (1,2) 2 CMPxIF
Logic
VBG 3
EVPOL<1:0>
CREF COE
VIN- CxOUT
Polarity
CxINA 0 VIN+ Cx Logic
CVREF 1
CON CPOL
Note 1: Comparators, 1 and 3, use C2INB as an input to the inverting terminal. Comparator 2 uses C2IND as an input to
the inverted terminal.
2: C1INC, C2INC and C2IND are all unavailable on 64-pin devices (PIC18F6XK90).
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
Note 1: The CMPxIF bit is automatically set any time this mode is selected and must be cleared by the application
after the initial configuration.
2: Comparators, 1 and 3, use C2INB as an input to the inverting terminal; Comparator 2 uses C2IND.
3: C1INC, C2INC and C2IND are all unavailable for 64-pin devices (PIC18F6XK90).
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
VDD
VT = 0.6V RIC
RS
Comparator
<10k Input
AIN
CPIN ILEAKAGE
VA VT = 0.6V ±100 nA
5 pF
VSS
Comparator CxINB > CxINA Compare Comparator CxINC > CxINA Compare(2,3)
CON = 1, CREF = 0, CCH<1:0> = 00 CON = 1, CREF = 0, CCH<1:0> = 01
COE COE
Comparator CxIND > CxINA Compare(3) Comparator VIRV > CxINA Compare
CON = 1, CREF = 0, CCH<1:0> = 10 CON = 1, CREF = 0, CCH<1:0> = 11
COE COE
C2INB/ VIN- VIN-
C2IND VBG(1)
VIN+ Cx VIN+ Cx
CxINA CxOUT CxINA CxOUT
Pin Pin
Comparator CxINB > CVREF Compare Comparator CxINC > CVREF Compare(2,3)
CON = 1, CREF = 1, CCH<1:0> = 00 CON = 1, CREF = 1, CCH<1:0> = 01
COE COE
Comparator CxIND > CVREF Compare(3) Comparator VIRV > CVREF Compare
CON = 1, CREF = 1, CCH<1:0> = 10 CON = 1, CREF = 1, CCH<1:0> = 11
COE COE
CxINB/ VIN- VIN-
CxIND VBG(1)
VIN+ Cx VIN+ Cx
CVREF CxOUT CVREF
CxOUT
Pin Pin
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
CVRSS = 1
VREF+
AVDD
CVRSS = 0
CVR<4:0>
CVREN
32-to-1 MUX
32 Steps CVREF
R
R
R
CVRSS = 1
VREF-
CVRSS = 0
PIC18F87K90
CVREF
R(1)
Module
+
Voltage RF5 CVREF Output
–
Reference
Output
Impedance
Note 1: R is dependent upon the Voltage Reference Configuration bits, CVRCON<3:0> and CVRCON<5>.
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
Externally Generated
Trip Point
VDD
HLVDEN VDIRMAG
HLVDIN
16-to-1 MUX
Set
HLVDIF
HLVDEN
Internal Voltage
BOREN Reference
1.024V Typical
VDD
VHLVD
HLVDIF
Enable HLVD
TIRVST
IRVST
HLVDIF Cleared in Software
Internal Reference is Stable
CASE 2:
VDD
VHLVD
HLVDIF
Enable HLVD
TIRVST
IRVST
Internal Reference is Stable HLVDIF Cleared in Software
HLVDIF Cleared in Software,
HLVDIF Remains Set since HLVD Condition still Exists
VHLVD
VDD
HLVDIF
Enable HLVD
IRVST TIRVST
CASE 2:
VHLVD
VDD
HLVDIF
Enable HLVD
IRVST TIRVST
CTMUCON
EDGEN CTMUICON
EDGSEQEN
ITRIM<5:0> TGEN
EDG1SELx
EDG1POL IRNG<1:0> IDISSEN
EDG2SELx EDG1STAT CTTRIG
EDG2POL EDG2STAT Current Source
CTED1 Edge
CTMU
Control Control A/D Trigger
CTED2 Logic Current Logic
Control
ECCP2
Pulse CTPLS
ECCP1 Generator
A/D Converter Comparator 2
Input
Comparator 2 Output
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
6. Select the operating mode (Measurement or • The current source needs calibration to set it to a
Time Delay) with the TGEN bit. precise current.
• The circuit being measured needs calibration to
The default mode is the Time/Capacitance
measure or nullify any capacitance other than that
Measurement.
to be measured.
7. Configure the module to automatically trigger
an A/D conversion when the second edge 27.4.1 CURRENT SOURCE CALIBRATION
event has occurred using the CTTRIG bit The current source on board the CTMU module has a
(CTMUCONH<0>). range of ±60% nominal for each of three current
The conversion trigger is disabled by default. ranges. For precise measurements, it is possible to
8. Discharge the connected circuit by setting the measure and adjust this current source by placing a
IDISSEN bit (CTMUCONH<1>). high-precision resistor, RCAL, onto an unused analog
channel. An example circuit is shown in Figure 27-2.
9. After waiting a sufficient time for the circuit to
discharge, clear IDISSEN. To measure the current source:
10. Disable the module by clearing the CTMUEN bit 1. Initialize the A/D Converter.
(CTMUCONH<7>). 2. Initialize the CTMU.
11. Clear the Edge Status bits, EDG2STAT and 3. Enable the current source by setting EDG1STAT
EDG1STAT (CTMUCONL<1:0>). (CTMUCONL<0>).
12. Enable both edge inputs by setting the EDGEN 4. Issue the settling time delay.
bit (CTMUCONH<3>). 5. Perform the A/D conversion.
13. Enable the module by setting the CTMUEN bit. 6. Calculate the current source current using
I = V/RCAL, where RCAL is a high-precision
resistance and V is measured by performing an
A/D conversion.
A/D
Trigger
A/D Converter
ANx
A/D
RCAL MUX
/**************************************************************************/
//Setup AD converter;
/**************************************************************************/
// ADCON1
ADCON2bits.ADFM=1; //Resulst format 1= Right justified
ADCON2bits.ACQT=1; //Acquition time 7 = 20TAD 2 = 4TAD 1=2TAD
ADCON2bits.ADCS=2; //Clock conversion bits 6= FOSC/64 2=FOSC/32
// ADCON0
ADCON1bits.VCFG0 =0; //Vref+ = AVdd
ADCON1bits.VCFG1 =0; //Vref+ = AVdd
ADCON1bits.VNCFG =0; //Vref- = AVss
ADCON0bits.CHS=2; //Select ADC channel
int main(void)
{
int i;
int j = 0; //index for loop
unsigned int Vread = 0;
double VTot = 0;
float Vavg=0, Vcal=0, CTMUISrc = 0; //float values stored for calcs
Where:
• I is known from the current source measurement
step
• t is a fixed delay
• V is measured by performing an A/D conversion
int main(void)
{
int i;
int j = 0; //index for loop
unsigned int Vread = 0;
float CTMUISrc, CTMUCap, Vavg, VTot, Vcal;
int main(void)
{
unsigned int Vread; //storage for reading
unsigned int switchState;
int i;
PIC18F87K90
CTMU
CTED1 EDG1
Current Source
CTED2 EDG2
Output Pulse
A/D Converter
ANX
CAD
RPR
PIC18F87K90
CTMU
CTED1 EDG1 CTPLS
Current Source
Comparator CTMUDS
CTMUI CTDIN
C2
CDELAY
CVREF
C1
External Reference
External Comparator
ADCON0bits.GO=1;
while(ADCON0bits.GO==1);
Temp=ADRES; ;//read ADC results ( inversely proportional to temperature)
----------------------------------------------------------------------------------------------
Note: The temperature diode is not calibrated; the user will have to calibrate the diode to their application.
Note 1: For the specifications, see Section 31.1 “DC Characteristics: Supply Voltage PIC18F87K90 Family
(Industrial/Extended)”.
2: The Power-up Timer is decoupled from Brown-out Reset, allowing these features to be independently
controlled.
Note 1: For the memory size of the blocks, refer to Figure 28-6.
Note 1: This bit is read-only in Normal Execution mode; it can be written only in Program mode.
2: For the memory size of the blocks, refer to Figure 28-6.
Note 1: For the memory size of the blocks, refer to Figure 28-6.
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
Note 1: These values for DEV<10:3> may be shared with other devices. The specific device is always identified by
using the entire DEV<10:0> bit sequence.
WDT Enabled,
SWDTEN Disabled
WDT Controlled with
SWDTEN bit Setting
WDT Enabled only While
Device Active, Disabled
WDT Disabled in Hardware,
SWDTEN Disabled
Sleep
INTRC Source
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
Note 1: This bit has no effect if the Configuration bits, WDTEN<1:0>, are enabled.
2: This bit is only available when ENVREG = 1 and RETEN = 0.
3: This bit is not valid unless ULPEN = 1.
Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3
INTOSC
Multiplexer
OSC1
TOST(1) TPLL(1)
1 2 n-1 n
PLL Clock
Output
Clock
Transition(2)
CPU Clock
Peripheral
Clock
Program
Counter PC PC + 2 PC + 4 PC + 6
Note 1: TOST = 1024 TOSC; TPLL = 2 ms (approx). These intervals are not shown to scale.
2: Clock transition typically occurs within 2-4 TOSC.
Sample Clock
Device Oscillator
Clock Failure
Output
CM Output
(Q)
Failure
Detected
OSCFIF
000000h
Code Memory
01FFFFh Device/Memory Size(2)
3FFFFFh
28.6.1 PROGRAM MEMORY location outside of that block is not allowed to read and
CODE PROTECTION will result in reading ‘0’s. Figures 28-7 through 28-9
illustrate table write and table read protection.
The program memory may be read to, or written from,
any location using the table read and table write Note: Code protection bits may only be written
instructions. The Device ID may be read with table to a ‘0’ from a ‘1’ state. It is not possible to
reads. The Configuration registers may be read and write a ‘1’ to a bit in the ‘0’ state. Code
written with the table read and table write instructions. protection bits are only set to ‘1’ by a full
In Normal Execution mode, the CPn bits have no direct chip erase or block erase function. The full
effect. CPn bits inhibit external reads and writes. A block chip erase and block erase functions can
of user memory may be protected from table writes if the only be initiated via ICSP or an external
WRTn Configuration bit is ‘0’. programmer. Refer to the device
programming specification for more
The EBTRn bits control table reads. For a block of user information.
memory with the EBTRn bit set to ‘0’, a table read
instruction that executes from within that block is allowed
to read. A table read instruction that executes from a
TBLPTR = 0008FFh
WRT0, EBTR0 = 01
00FFFFh
000000h
WRTB, EBTRB = 11
0007FFh
000800h
TBLPTR = 0008FFh
WRT0, EBTR0 = 10
003FFFh
004000h
PC = 007FFEh TBLRD* WRT1, EBTR1 = 11
007FFFh
008000h
WRT2, EBTR2 = 11
00BFFFh
00C000h
WRT3, EBTR3 = 11
00FFFFh
Results: All table reads from external blocks to Blockn are disabled whenever EBTRn = 0.
The TABLAT register returns a value of ‘0’.
00FFFFh
Results: Table reads are permitted within Blockn, even when EBTRBn = 0.
The TABLAT register returns the value of the data at the location, TBLPTR.
Literal operations
15 8 7 0
OPCODE k (literal) MOVLW 7Fh
Control operations
CALL, GOTO and Branch operations
15 8 7 0
OPCODE n<7:0> (literal) GOTO Label
15 12 11 0
1111 n<19:8> (literal)
15 8 7 0
OPCODE S n<7:0> (literal) CALL MYFUNC
15 12 11 0
1111 n<19:8> (literal)
S = Fast bit
15 11 10 0
OPCODE n<10:0> (literal) BRA MYFUNC
15 8 7 0
OPCODE n<7:0> (literal) BC MYFUNC
BYTE-ORIENTED OPERATIONS
ADDWF f, d, a Add WREG and f 1 0010 01da ffff ffff C, DC, Z, OV, N 1, 2
ADDWFC f, d, a Add WREG and Carry bit to f 1 0010 00da ffff ffff C, DC, Z, OV, N 1, 2
ANDWF f, d, a AND WREG with f 1 0001 01da ffff ffff Z, N 1, 2
CLRF f, a Clear f 1 0110 101a ffff ffff Z 2
COMF f, d, a Complement f 1 0001 11da ffff ffff Z, N 1, 2
CPFSEQ f, a Compare f with WREG, Skip = 1 (2 or 3) 0110 001a ffff ffff None 4
CPFSGT f, a Compare f with WREG, Skip > 1 (2 or 3) 0110 010a ffff ffff None 4
CPFSLT f, a Compare f with WREG, Skip < 1 (2 or 3) 0110 000a ffff ffff None 1, 2
DECF f, d, a Decrement f 1 0000 01da ffff ffff C, DC, Z, OV, N 1, 2, 3, 4
DECFSZ f, d, a Decrement f, Skip if 0 1 (2 or 3) 0010 11da ffff ffff None 1, 2, 3, 4
DCFSNZ f, d, a Decrement f, Skip if Not 0 1 (2 or 3) 0100 11da ffff ffff None 1, 2
INCF f, d, a Increment f 1 0010 10da ffff ffff C, DC, Z, OV, N 1, 2, 3, 4
INCFSZ f, d, a Increment f, Skip if 0 1 (2 or 3) 0011 11da ffff ffff None 4
INFSNZ f, d, a Increment f, Skip if Not 0 1 (2 or 3) 0100 10da ffff ffff None 1, 2
IORWF f, d, a Inclusive OR WREG with f 1 0001 00da ffff ffff Z, N 1, 2
MOVF f, d, a Move f 1 0101 00da ffff ffff Z, N 1
MOVFF fs, fd Move fs (source) to 1st word 2 1100 ffff ffff ffff None
fd (destination) 2nd word 1111 ffff ffff ffff
MOVWF f, a Move WREG to f 1 0110 111a ffff ffff None
MULWF f, a Multiply WREG with f 1 0000 001a ffff ffff None 1, 2
NEGF f, a Negate f 1 0110 110a ffff ffff C, DC, Z, OV, N
RLCF f, d, a Rotate Left f through Carry 1 0011 01da ffff ffff C, Z, N 1, 2
RLNCF f, d, a Rotate Left f (No Carry) 1 0100 01da ffff ffff Z, N
RRCF f, d, a Rotate Right f through Carry 1 0011 00da ffff ffff C, Z, N
RRNCF f, d, a Rotate Right f (No Carry) 1 0100 00da ffff ffff Z, N
SETF f, a Set f 1 0110 100a ffff ffff None 1, 2
SUBFWB f, d, a Subtract f from WREG with 1 0101 01da ffff ffff C, DC, Z, OV, N
Borrow
SUBWF f, d, a Subtract WREG from f 1 0101 11da ffff ffff C, DC, Z, OV, N 1, 2
SUBWFB f, d, a Subtract WREG from f with 1 0101 10da ffff ffff C, DC, Z, OV, N
Borrow
SWAPF f, d, a Swap Nibbles in f 1 0011 10da ffff ffff None 4
TSTFSZ f, a Test f, Skip if 0 1 (2 or 3) 0110 011a ffff ffff None 1, 2
XORWF f, d, a Exclusive OR WREG with f 1 0001 10da ffff ffff Z, N
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’.
2: If this instruction is executed on the TMR0 register (and, where applicable, d = 1), the prescaler will be cleared if
assigned.
3: If the Program Counter (PC) is modified or a conditional test is true, the instruction requires two cycles. The
second cycle is executed as a NOP.
4: 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.
BIT-ORIENTED OPERATIONS
BCF f, b, a Bit Clear f 1 1001 bbba ffff ffff None 1, 2
BSF f, b, a Bit Set f 1 1000 bbba ffff ffff None 1, 2
BTFSC f, b, a Bit Test f, Skip if Clear 1 (2 or 3) 1011 bbba ffff ffff None 3, 4
BTFSS f, b, a Bit Test f, Skip if Set 1 (2 or 3) 1010 bbba ffff ffff None 3, 4
BTG f, b, a Bit Toggle f 1 0111 bbba ffff ffff None 1, 2
CONTROL OPERATIONS
BC n Branch if Carry 1 (2) 1110 0010 nnnn nnnn None
BN n Branch if Negative 1 (2) 1110 0110 nnnn nnnn None
BNC n Branch if Not Carry 1 (2) 1110 0011 nnnn nnnn None
BNN n Branch if Not Negative 1 (2) 1110 0111 nnnn nnnn None
BNOV n Branch if Not Overflow 1 (2) 1110 0101 nnnn nnnn None
BNZ n Branch if Not Zero 1 (2) 1110 0001 nnnn nnnn None
BOV n Branch if Overflow 1 (2) 1110 0100 nnnn nnnn None
BRA n Branch Unconditionally 2 1101 0nnn nnnn nnnn None
BZ n Branch if Zero 1 (2) 1110 0000 nnnn nnnn None
CALL n, s Call Subroutine 1st word 2 1110 110s kkkk kkkk None
2nd word 1111 kkkk kkkk kkkk
CLRWDT — Clear Watchdog Timer 1 0000 0000 0000 0100 TO, PD
DAW — Decimal Adjust WREG 1 0000 0000 0000 0111 C
GOTO n Go to Address 1st word 2 1110 1111 kkkk kkkk None
2nd word 1111 kkkk kkkk kkkk
NOP — No Operation 1 0000 0000 0000 0000 None
NOP — No Operation 1 1111 xxxx xxxx xxxx None 4
POP — Pop Top of Return Stack (TOS) 1 0000 0000 0000 0110 None
PUSH — Push Top of Return Stack (TOS) 1 0000 0000 0000 0101 None
RCALL n Relative Call 2 1101 1nnn nnnn nnnn None
RESET Software Device Reset 1 0000 0000 1111 1111 All
RETFIE s Return from Interrupt Enable 2 0000 0000 0001 000s GIE/GIEH,
PEIE/GIEL
RETLW k Return with Literal in WREG 2 0000 1100 kkkk kkkk None
RETURN s Return from Subroutine 2 0000 0000 0001 001s None
SLEEP — Go into Standby mode 1 0000 0000 0000 0011 TO, PD
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’.
2: If this instruction is executed on the TMR0 register (and, where applicable, d = 1), the prescaler will be cleared if
assigned.
3: If the Program Counter (PC) is modified or a conditional test is true, the instruction requires two cycles. The
second cycle is executed as a NOP.
4: 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.
LITERAL OPERATIONS
ADDLW k Add Literal and WREG 1 0000 1111 kkkk kkkk C, DC, Z, OV, N
ANDLW k AND Literal with WREG 1 0000 1011 kkkk kkkk Z, N
IORLW k Inclusive OR Literal with WREG 1 0000 1001 kkkk kkkk Z, N
LFSR f, k Move literal (12-bit) 2nd word 2 1110 1110 00ff kkkk None
to FSR(f) 1st word 1111 0000 kkkk kkkk
MOVLB k Move Literal to BSR<3:0> 1 0000 0001 0000 kkkk None
MOVLW k Move Literal to WREG 1 0000 1110 kkkk kkkk None
MULLW k Multiply Literal with WREG 1 0000 1101 kkkk kkkk None
RETLW k Return with Literal in WREG 2 0000 1100 kkkk kkkk None
SUBLW k Subtract WREG from Literal 1 0000 1000 kkkk kkkk C, DC, Z, OV, N
XORLW k Exclusive OR Literal with WREG 1 0000 1010 kkkk kkkk Z, N
DATA MEMORY PROGRAM MEMORY OPERATIONS
TBLRD* Table Read 2 0000 0000 0000 1000 None
TBLRD*+ Table Read with Post-Increment 0000 0000 0000 1001 None
TBLRD*- Table Read with Post-Decrement 0000 0000 0000 1010 None
TBLRD+* Table Read with Pre-Increment 0000 0000 0000 1011 None
TBLWT* Table Write 2 0000 0000 0000 1100 None
TBLWT*+ Table Write with Post-Increment 0000 0000 0000 1101 None
TBLWT*- Table Write with Post-Decrement 0000 0000 0000 1110 None
TBLWT+* Table Write with Pre-Increment 0000 0000 0000 1111 None
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’.
2: If this instruction is executed on the TMR0 register (and, where applicable, d = 1), the prescaler will be cleared if
assigned.
3: If the Program Counter (PC) is modified or a conditional test is true, the instruction requires two cycles. The
second cycle is executed as a NOP.
4: 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.
Note: 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).
Words: 1
Cycles: 1
Q Cycle Activity:
Q1 Q2 Q3 Q4
Decode Read Process Write to
register ‘f’ Data destination
BTFSC Bit Test File, Skip if Clear BTFSS Bit Test File, Skip if Set
Description: Clears the contents of the specified Encoding: 0000 0000 0000 0100
register. Description: CLRWDT instruction resets the
If ‘a’ is ‘0’, the Access Bank is selected. Watchdog Timer. It also resets the post-
If ‘a’ is ‘1’, the BSR is used to select the scaler of the WDT. Status bits, TO and
PD, are set.
GPR bank.
If ‘a’ is ‘0’ and the extended instruction Words: 1
set is enabled, this instruction operates Cycles: 1
in Indexed Literal Offset Addressing Q Cycle Activity:
mode whenever f 95 (5Fh). See
Q1 Q2 Q3 Q4
Section 29.2.3 “Byte-Oriented and
Bit-Oriented Instructions in Indexed Decode No Process No
Literal Offset Mode” for details. operation Data operation
Words: 1
Example: CLRWDT
Cycles: 1
Before Instruction
Q Cycle Activity:
WDT Counter = ?
Q1 Q2 Q3 Q4 After Instruction
Decode Read Process Write WDT Counter = 00h
register ‘f’ Data register ‘f’ WDT Postscaler = 0
TO = 1
Example: CLRF FLAG_REG,1 PD = 1
Before Instruction
FLAG_REG = 5Ah
After Instruction
FLAG_REG = 00h
CPFSGT Compare f with W, Skip if f > W CPFSLT Compare f with W, Skip if f < W
Syntax: CPFSGT f {,a} Syntax: CPFSLT f {,a}
Operands: 0 f 255 Operands: 0 f 255
a [0,1] a [0,1]
Operation: (f) –W),
Operation: (f) –W),
skip if (f) > (W) skip if (f) < (W)
(unsigned comparison) (unsigned comparison)
Status Affected: None
Status Affected: None
Encoding: 0110 010a ffff ffff
Encoding: 0110 000a ffff ffff
Description: Compares the contents of data memory
location ‘f’ to the contents of the W by Description: Compares the contents of data memory
performing an unsigned subtraction. location ‘f’ to the contents of W by
performing an unsigned subtraction.
If the contents of ‘f’ are greater than the
contents of WREG, then the fetched If the contents of ‘f’ are less than the
instruction is discarded and a NOP is contents of W, then the fetched
executed instead, making this a instruction is discarded and a NOP is
two-cycle instruction. executed instead, making this a
two-cycle instruction.
If ‘a’ is ‘0’, the Access Bank is selected.
If ‘a’ is ‘1’, the BSR is used to select the If ‘a’ is ‘0’, the Access Bank is selected.
GPR bank. If ‘a’ is ‘1’, the BSR is used to select the
GPR bank.
If ‘a’ is ‘0’ and the extended instruction
set is enabled, this instruction operates Words: 1
in Indexed Literal Offset Addressing Cycles: 1(2)
mode whenever f 95 (5Fh). See Note: 3 cycles if skip and followed
Section 29.2.3 “Byte-Oriented and by a 2-word instruction.
Bit-Oriented Instructions in Indexed
Q Cycle Activity:
Literal Offset Mode” for details.
Q1 Q2 Q3 Q4
Words: 1
Decode Read Process No
Cycles: 1(2) register ‘f’ Data operation
Note: 3 cycles if skip and followed
If skip:
by a 2-word instruction.
Q1 Q2 Q3 Q4
Q Cycle Activity:
No No No No
Q1 Q2 Q3 Q4
operation operation operation operation
Decode Read Process No
register ‘f’ Data operation If skip and followed by 2-word instruction:
If skip: Q1 Q2 Q3 Q4
Q1 Q2 Q3 Q4 No No No No
No No No No operation operation operation operation
operation operation operation operation No No No No
If skip and followed by 2-word instruction: operation operation operation operation
Q1 Q2 Q3 Q4
No No No No Example: HERE CPFSLT REG, 1
operation operation operation operation NLESS :
No No No No LESS :
operation operation operation operation Before Instruction
PC = Address (HERE)
Example: HERE CPFSGT REG, 0 W = ?
NGREATER : After Instruction
GREATER : If REG < W;
Before Instruction PC = Address (LESS)
If REG W;
PC = Address (HERE) PC = Address (NLESS)
W = ?
After Instruction
If REG W;
PC = Address (GREATER)
If REG W;
PC = Address (NGREATER)
Before Instruction
W = A5h Example: DECF CNT, 1, 0
C = 0 Before Instruction
DC = 0
CNT = 01h
After Instruction Z = 0
W = 05h After Instruction
C = 1
DC = 0 CNT = 00h
Z = 1
Example 2:
Before Instruction
W = CEh
C = 0
DC = 0
After Instruction
W = 34h
C = 1
DC = 0
POP Pop Top of Return Stack PUSH Push Top of Return Stack
RLNCF Rotate Left f (No Carry) RRCF Rotate Right f through Carry
Words: 1 C register f
Cycles: 1
Words: 1
Q Cycle Activity:
Cycles: 1
Q1 Q2 Q3 Q4
Decode Read Process Write to Q Cycle Activity:
register ‘f’ Data destination Q1 Q2 Q3 Q4
Decode Read Process Write to
Example: RLNCF REG, 1, 0 register ‘f’ Data destination
Before Instruction
REG = 1010 1011 Example: RRCF REG, 0, 0
After Instruction Before Instruction
REG = 0101 0111 REG = 1110 0110
C = 0
After Instruction
REG = 1110 0110
W = 0111 0011
C = 0
ADDFSR Add Literal to FSR ADDULNK Add Literal to FSR2 and Return
Syntax: ADDFSR f, k Syntax: ADDULNK k
Operands: 0 k 63 Operands: 0 k 63
f [ 0, 1, 2 ] Operation: FSR2 + k FSR2,
Operation: FSR(f) + k FSR(f) (TOS) PC
Status Affected: None Status Affected: None
Encoding: 1110 1000 ffkk kkkk Encoding: 1110 1000 11kk kkkk
Description: The 6-bit literal ‘k’ is added to the Description: The 6-bit literal ‘k’ is added to the
contents of the FSR specified by ‘f’. contents of FSR2. A RETURN is then
Words: 1 executed by loading the PC with the
TOS.
Cycles: 1
Q Cycle Activity: The instruction takes two cycles to
execute; a NOP is performed during
Q1 Q2 Q3 Q4
the second cycle.
Decode Read Process Write to
literal ‘k’ Data FSR This may be thought of as a special
case of the ADDFSR instruction,
where f = 3 (binary ‘11’); it operates
Example: ADDFSR 2, 23h only on FSR2.
Words: 1
Before Instruction
FSR2 = 03FFh Cycles: 2
After Instruction Q Cycle Activity:
FSR2 = 0422h Q1 Q2 Q3 Q4
Decode Read Process Write to
literal ‘k’ Data FSR
No No No No
Operation Operation Operation Operation
Note: 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).
MOVSS Move Indexed to Indexed PUSHL Store Literal at FSR2, Decrement FSR2
Syntax: MOVSS [zs], [zd] Syntax: PUSHL k
Operands: 0 zs 127 Operands: 0k 255
0 zd 127
Operation: k (FSR2),
Operation: ((FSR2) + zs) ((FSR2) + zd) FSR2 – 1 FSR2
Status Affected: None Status Affected: None
Encoding:
Encoding: 1110 1010 kkkk kkkk
1st word (source) 1110 1011 1zzz zzzzs
2nd word (dest.) 1111 xxxx xzzz zzzzd Description: The 8-bit literal ‘k’ is written to the data
Description The contents of the source register are memory address specified by FSR2.
FSR2 is decremented by 1 after the
moved to the destination register. The
addresses of the source and destination operation.
registers are determined by adding the This instruction allows users to push
7-bit literal offsets, ‘zs’ or ‘zd’, values onto a software stack.
respectively, to the value of FSR2. Both Words: 1
registers can be located anywhere in
the 4096-byte data memory space Cycles: 1
(000h to FFFh). Q Cycle Activity:
The MOVSS instruction cannot use the Q1 Q2 Q3 Q4
PCL, TOSU, TOSH or TOSL as the Decode Read ‘k’ Process Write to
destination register. data destination
If the resultant source address points to
an Indirect Addressing register, the
value returned will be 00h. If the Example: PUSHL 08h
resultant destination address points to Before Instruction
an Indirect Addressing register, the FSR2H:FSR2L = 01ECh
instruction will execute as a NOP. Memory (01ECh) = 00h
Words: 2
After Instruction
Cycles: 2 FSR2H:FSR2L = 01EBh
Q Cycle Activity: Memory (01ECh) = 08h
Q1 Q2 Q3 Q4
Decode Determine Determine Read
source addr source addr source reg
Decode Determine Determine Write
dest addr dest addr to dest reg
SUBFSR Subtract Literal from FSR SUBULNK Subtract Literal from FSR2 and Return
Syntax: SUBFSR f, k Syntax: SUBULNK k
Operands: 0 k 63 Operands: 0 k 63
f [ 0, 1, 2 ] Operation: FSR2 – k FSR2,
Operation: FSRf – k FSRf (TOS) PC
Status Affected: None Status Affected: None
Encoding: 1110 1001 ffkk kkkk Encoding: 1110 1001 11kk kkkk
Description: The 6-bit literal ‘k’ is subtracted from Description: The 6-bit literal ‘k’ is subtracted from the
the contents of the FSR specified contents of the FSR2. A RETURN is then
by ‘f’. executed by loading the PC with the
Words: 1 TOS.
Cycles: 1 The instruction takes two cycles to
Q Cycle Activity: execute; a NOP is performed during the
second cycle.
Q1 Q2 Q3 Q4
Decode Read Process Write to This may be thought of as a special case
of the SUBFSR instruction, where f = 3
register ‘f’ Data destination
(binary ‘11’); it operates only on FSR2.
Words: 1
Example: SUBFSR 2, 23h Cycles: 2
Before Instruction Q Cycle Activity:
FSR2 = 03FFh Q1 Q2 Q3 Q4
After Instruction Decode Read Process Write to
FSR2 = 03DCh register ‘f’ Data destination
No No No No
Operation Operation Operation Operation
† 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.
6V
5.5V
5V
3V
3V
1.8V
Note 1: FMAX = 64 MHz in all other modes. For VDD values, 1.8V to 3V, FMAX = (VDD – 1.72)/0.02 MHz.
4V
3.75V
3.6V
PIC18F87K90 Family
3.25V PIC18F87K90 Family (Industrial Only)
(Extended) 3V
Voltage (VDD)
2.5V
1.8V
Note 1: When the on-chip voltage regulator is disabled, VDD must be maintained so that VDD 3.6V.
2: For VDD values, 1.8V to 3V, FMAX = (VDD – 1.72)/0.02 MHz.
Param
Sym Characteristics Min Typ Max Units Comments
No.
D300 VIOFF Input Offset Voltage — ±5.0 40 mV
D301 VICM Input Common-Mode Voltage — — AVDD – 1.5 V
D302 CMRR Common-Mode Rejection Ratio 55 — — dB
D303 TRESP Response Time(1) — 150 400 ns
D304 TMC2OV Comparator Mode Change to — — 10 s
Output Valid*
Note 1: Response time measured with one comparator input at (AVDD – 1.5)/2, while the other input transitions
from VSS to VDD.
Param
Sym Characteristics Min Typ Max Units Comments
No.
D310 VRES Resolution — VDD/32 — LSb
D311 VRAA Absolute Accuracy — — 1/2 LSb
D312 VRUR Unit Resistor Value (R) — 2k —
D313 TSET Settling Time(1) — — 10 s
Note 1: Settling time measured while CVRR = 1 and CVR<3:0> transitions from ‘0000’ to ‘1111’.
Param
Sym Characteristics Min Typ Max Units Comments
No.
VRGOUT Regulator Output Voltage — 3.3 — V
CEFC External Filter Capacitor Value 4.7 10 — F Capacitor must be
low-ESR, a low series
resistance (< 5)
VDD/2
RL
CL Pin CL
Pin
VSS VSS
RL = 464
CL = 50 pF for all pins except OSC2/CLKO/RA6
and including D and E outputs as ports
CL = 15 pF for OSC2/CLKO/RA6
OSC1
1 3 3 4 4
2
CLKO
OSC1
10 11
CLKO
13 12
14 19 18
16
I/O Pin
(Input)
17 15
20, 21
VDD
MCLR
30
Internal
POR
33
PWRT
Time-out 32
Oscillator
Time-out
Internal
Reset
Watchdog
Timer
Reset
31
34 34
I/O Pins
VDD BVDD
35
VBGAP = 1.2V
VIRVST
Enable Internal
Reference Voltage
Internal Reference
Voltage Stable 36
VHLVD
VHLVD
HLVDIF
T0CKI
40 41
42
SOSCO/T1CKI
45 46
47 48
TMR0 or
TMR1
CCPx
(Capture Mode)
50 51
52
CCPx
(Compare or PWM Mode)
53 54
SCKx
(CKP = 0)
78 79
SCKx
(CKP = 1)
79 78
80
75, 76
81
SCKx
(CKP = 0)
79
73
SCKx
(CKP = 1)
80
78
75, 76
74
SSx
70
SCKx
(CKP = 0) 83
71 72
78 79
SCKx
(CKP = 1)
79 78
80
75, 76 77
TABLE 31-16: EXAMPLE SPI MODE REQUIREMENTS (SLAVE MODE TIMING, CKE = 0)
Param
Symbol Characteristic Min Max Units Conditions
No.
70 TSSL2SCH, SSx to SCKx or SCKx Input 3 TCY — ns
TSSL2SCL
70A TSSL2WB SSx to write to SSPxBUF 3 TCY — ns
71 TSCH SCKx Input High Time Continuous 1.25 TCY + 30 — ns
71A (Slave mode) Single Byte 40 — ns (Note 1)
72 TSCL SCKx Input Low Time Continuous 1.25 TCY + 30 — ns
72A (Slave mode) Single Byte 40 — ns (Note 1)
73 TDIV2SCH, Setup Time of SDIx Data Input to SCKx Edge 20 — ns
TDIV2SCL
73A TB2B Last Clock Edge of Byte 1 to the First Clock Edge of Byte 2 1.5 TCY + 40 — ns (Note 2)
74 TSCH2DIL, Hold Time of SDIx Data Input to SCKx Edge 40 — ns
TSCL2DIL
75 TDOR SDOx Data Output Rise Time — 25 ns
76 TDOF SDOx Data Output Fall Time — 25 ns
77 TSSH2DOZ SSx to SDOx Output High-Impedance 10 50 ns
78 TSCR SCKx Output Rise Time (Master mode) — 25 ns
79 TSCF SCKx Output Fall Time (Master mode) — 25 ns
80 TSCH2DOV, SDOx Data Output Valid after SCKx Edge — 50 ns
TSCL2DOV
83 TSCH2SSH, SSx after SCKx Edge 1.5 TCY + 40 — ns
TSCL2SSH
Note 1: Requires the use of Parameter #73A.
2: Only if Parameter #71A and #72A are used.
70
SCKx 83
(CKP = 0)
71 72
SCKx
(CKP = 1)
80
75, 76 77
SDIx
MSb In bit 6 - - - - 1 LSb In
74
Note: Refer to Figure 31-3 for load conditions.
SCLx
91 93
90 92
SDAx
Start Stop
Condition Condition
91 92
SDAx
In
110
109 109
SDAx
Out
SCLx
91 93
90 92
SDAx
Start Stop
Condition Condition
SDAx
Out
TXx/CKx
Pin
121 121
RXx/DTx
Pin
120
122
Note: Refer to Figure 31-3 for load conditions.
TXx/CKx
Pin 125
RXx/DTx
Pin
126
BSF ADCON0, GO
(Note 2)
131
Q4
130
A/D CLK 132
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.
XXXXXXXXXXX PIC18F67K90
XXXXXXXXXXX -I/MR e3
XXXXXXXXXXX 1110017
YYWWNNN
XXXXXXXXXX 18F67K90
XXXXXXXXXX -I/PT e3
XXXXXXXXXX 1110017
YYWWNNN
XXXXXXXXXXXX PIC18F87K90
XXXXXXXXXXXX -I/PT e3
YYWWNNN 1110017
Note: 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.
Note: For the most current package drawings, please see the Microchip Packaging Specification located at
http://www.microchip.com/packaging
Note: For the most current package drawings, please see the Microchip Packaging Specification located at
http://www.microchip.com/packaging
Note: For the most current package drawings, please see the Microchip Packaging Specification located at
http://www.microchip.com/packaging
/HDG3ODVWLF7KLQ4XDG)ODWSDFN37±[[PP%RG\PP>74)3@
1RWH )RUWKHPRVWFXUUHQWSDFNDJHGUDZLQJVSOHDVHVHHWKH0LFURFKLS3DFNDJLQJ6SHFLILFDWLRQORFDWHGDW
KWWSZZZPLFURFKLSFRPSDFNDJLQJ
D
D1
E
e
E1
N
b
β A1
L L1
8QLWV 0,//,0(7(56
'LPHQVLRQ/LPLWV 0,1 120 0$;
1XPEHURI/HDGV 1
/HDG3LWFK H %6&
2YHUDOO+HLJKW $ ± ±
0ROGHG3DFNDJH7KLFNQHVV $
6WDQGRII $ ±
)RRW/HQJWK /
)RRWSULQW / 5()
)RRW$QJOH
2YHUDOO:LGWK ( %6&
2YHUDOO/HQJWK ' %6&
0ROGHG3DFNDJH:LGWK ( %6&
0ROGHG3DFNDJH/HQJWK ' %6&
/HDG7KLFNQHVV F ±
/HDG:LGWK E
0ROG'UDIW$QJOH7RS
0ROG'UDIW$QJOH%RWWRP
1RWHV
3LQYLVXDOLQGH[IHDWXUHPD\YDU\EXWPXVWEHORFDWHGZLWKLQWKHKDWFKHGDUHD
&KDPIHUVDWFRUQHUVDUHRSWLRQDOVL]HPD\YDU\
'LPHQVLRQV'DQG(GRQRWLQFOXGHPROGIODVKRUSURWUXVLRQV0ROGIODVKRUSURWUXVLRQVVKDOOQRWH[FHHGPPSHUVLGH
'LPHQVLRQLQJDQGWROHUDQFLQJSHU$60(<0
%6& %DVLF'LPHQVLRQ7KHRUHWLFDOO\H[DFWYDOXHVKRZQZLWKRXWWROHUDQFHV
5() 5HIHUHQFH'LPHQVLRQXVXDOO\ZLWKRXWWROHUDQFHIRULQIRUPDWLRQSXUSRVHVRQO\
0LFURFKLS 7HFKQRORJ\ 'UDZLQJ &%
/HDG3ODVWLF7KLQ4XDG)ODWSDFN37±[[PP%RG\PP>74)3@
1RWH )RUWKHPRVWFXUUHQWSDFNDJHGUDZLQJVSOHDVHVHHWKH0LFURFKLS3DFNDJLQJ6SHFLILFDWLRQORFDWHGDW
KWWSZZZPLFURFKLSFRPSDFNDJLQJ
/HDG3ODVWLF7KLQ4XDG)ODWSDFN37±[[PP%RG\PP>74)3@
1RWH )RUWKHPRVWFXUUHQWSDFNDJHGUDZLQJVSOHDVHVHHWKH0LFURFKLS3DFNDJLQJ6SHFLILFDWLRQORFDWHGDW
KWWSZZZPLFURFKLSFRPSDFNDJLQJ
D
D1
E
e
E1
b N
NOTE 1
12 3 NOTE 2 α
A
c
φ
β A2
A1
L L1
8QLWV 0,//,0(7(56
'LPHQVLRQ/LPLWV 0,1 120 0$;
1XPEHURI/HDGV 1
/HDG3LWFK H %6&
2YHUDOO+HLJKW $ ± ±
0ROGHG3DFNDJH7KLFNQHVV $
6WDQGRII $ ±
)RRW/HQJWK /
)RRWSULQW / 5()
)RRW$QJOH
2YHUDOO:LGWK ( %6&
2YHUDOO/HQJWK ' %6&
0ROGHG3DFNDJH:LGWK ( %6&
0ROGHG3DFNDJH/HQJWK ' %6&
/HDG7KLFNQHVV F ±
/HDG:LGWK E
0ROG'UDIW$QJOH7RS
0ROG'UDIW$QJOH%RWWRP
1RWHV
3LQYLVXDOLQGH[IHDWXUHPD\YDU\EXWPXVWEHORFDWHGZLWKLQWKHKDWFKHGDUHD
&KDPIHUVDWFRUQHUVDUHRSWLRQDOVL]HPD\YDU\
'LPHQVLRQV'DQG(GRQRWLQFOXGHPROGIODVKRUSURWUXVLRQV0ROGIODVKRUSURWUXVLRQVVKDOOQRWH[FHHGPPSHUVLGH
'LPHQVLRQLQJDQGWROHUDQFLQJSHU$60(<0
%6& %DVLF'LPHQVLRQ7KHRUHWLFDOO\H[DFWYDOXHVKRZQZLWKRXWWROHUDQFHV
5() 5HIHUHQFH'LPHQVLRQXVXDOO\ZLWKRXWWROHUDQFHIRULQIRUPDWLRQSXUSRVHVRQO\
0LFURFKLS 7HFKQRORJ\ 'UDZLQJ &%
/HDG3ODVWLF7KLQ4XDG)ODWSDFN37±[[PP%RG\PP>74)3@
1RWH )RUWKHPRVWFXUUHQWSDFNDJHGUDZLQJVSOHDVHVHHWKH0LFURFKLS3DFNDJLQJ6SHFLILFDWLRQORFDWHGDW
KWWSZZZPLFURFKLSFRPSDFNDJLQJ
Questions:
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?