Note the following details of the code protection feature on Microchip devices:
•Microchip products meet the specification contained in their particular Microchip Data Sheet.
•Microchip believes that its family of products is one of the most secure families of its kind on the market today, when used in the
intended manner and under normal conditions.
•There are dishonest and possibly illegal methods used to breach the code protection feature. All of these methods, to our
knowledge, require using the Microchip products in a manner outside the operating specifications contained in Microchip’s Data
Sheets. Most likely, the person doing so is engaged in theft of intellectual property.
•Microchip is willing to work with the customer who is concerned about the integrity of their code.
•Neither Microchip nor any other semiconductor manufacturer can guarantee the security of their code. Code protection does not
mean that we are guaranteeing the product as “unbreakable.”
Code protection is constantly evolving. We at Microchip are committed to continuously improving the code protection features of our
products. Attempts to break Microchip’s code protection feature may be a violation of the Digital Millennium Copyright Act. If such acts
allow unauthorized access to your software or other copyrighted work, you may have a right to sue for relief under that Act.
Information contained in this publication regarding device
applications and t he lik e is provided only for your convenience
and may be su perseded by upda t es . It is y our responsibility to
ensure that your application meets with your specifications.
MICROCHIP MAKES NO REPRESENTATIONS OR
WARRANTIES OF ANY KIND WHETHER EXPRESS OR
IMPLIED, WRITTEN OR ORAL, STATUTORY OR
OTHERWISE, RELATED TO THE INFORMATION,
INCLUDING BUT NOT LIMITED TO ITS CONDITION,
QUALITY, PERFORMANCE, MERCHANTABILITY OR
FITNESS FOR PURPOSE. Microchip disclaims all liability
arising from this information and its use. Use of Microchip
devices in life supp ort and/or safety ap plications is entir ely at
the buyer’s risk, and the buyer agrees to defend, indemnify and
hold harmless M icrochip from any and all dama ges, claims,
suits, or expenses re sulting from such use. No licens es are
conveyed, implicitly or otherwise, under any Microchip
intellectual property rights.
Trademarks
The Microchip name and logo, the Microchip logo, dsPIC,
K
rfPIC and UNI/O are registered trademarks of Microchip
Technology Incorporated in the U.S.A. and other countries.
FilterLab, Hampshire, HI-TECH C, Linear Active Thermistor,
MXDEV, MXLAB, SEEVAL and The Embedded Control
Solutions Company are registered trademarks of Microchip
Technology Incorporated in the U.S.A.
logo, REAL ICE, rfLAB,
Select Mode, Total Endurance, TSHARC, WiperLock and
ZENA are trademarks of Microchip Technology Incorporated
in the U.S.A. and other countries.
SQTP is a service mark of Microchip Technology Incorporated
in the U.S.A.
All other trademarks mentioned herein are property of their
respective companies.
Microchip received ISO/TS-16949:2002 certification for its worldwide
headquarters, design and wafer fabrication facilities in Chandler and
Tempe, Arizona; Gresham, Oregon and design centers in California
and India. The Company’s quality system processes and procedures
are for its PIC
devices, Serial EEPROMs, microperipherals, nonvolatile memory and
analog products. In addition, Microchip’s quality system for the design
and manufacture of development systems is ISO 9001:2000 certified.
3.0Special Features of the CPU........................... .............. .............................. .............. ................................................................. 37
Appendix D: Migration From Baseline to Enhanced Devices .............................................................................................................. 46
Index .................................................................................................................................................................................................... 47
The Microchip Web Site.............. ............... ............... .............. ............... ............... .............. ................................................................. 49
Customer Change Notification Service ................................................................................................................................................ 49
It is our intention to provide our valued customers with the best documentation possible to ensure successful use of your Microchip
products. To this end, we will continue to improve our publications to better suit your needs. Our publications will be refined and
enhanced as new volumes and updates are introduced.
If you have any questions or c omm ents r egarding t his publication, p lease c ontact the M arket ing Communications Department via
E-mail at docerrors@microchip.com or fax the Reader Response Form in the back of this data sheet to (480) 792-4150. We
welcome your feedback.
Most Current Data Sheet
To obtain the most up-to-date version of this data sheet, please register at our Worldwide Web site at:
http://www.microchip.com
You can determine the version of a data sheet by examining its literature number found on the bottom outside corner of any page.
The last character of the literature number is the version number, (e.g., DS30000A is version A of document DS30000).
Errata
An errata sheet, describing minor operational differences from the data sheet and recommended workarounds, may exist for current
devices. As device/documentation issues become known to us, we will publish an errata sheet. The errata will specify the revision
of silicon and revision of document to which it applies.
To determine if an errata sheet exists for a particular device, please check with one of the following:
• Microchip’s Worldwide Web site; http://www.microchip.com
• Your local Microchip sales office (see last page)
When contacting a sales office, please specify which device, revision of silicon and data sheet (include literature number) you are
using.
Customer Notification System
Register on our web site at www.microchip.com to receive the most current information on all of our products.
This document cont a ins dev ice -specific information for
the following devices:
• PIC18F66J93• PIC18F67J93
• PIC18F86J93• PIC18F87J93
Note: This data sheet documents only the devices’
features and specific ations that are in addi tion
to the features and specifications of the
PIC18F87J90 family devices. For information
on the features and specifications shared by
the PIC18F87J93 family and PIC18F87J90
family devices, see the “PIC18F87J90 FamilyData Sheet” (DS39933).
The PIC18F87J93 family of devices offers the
advantages of all PIC18 microcontrollers – high computatio n al pe r fo rm a nc e, a rich fea ture set an d econ omica l
price – with the addition of a versatile, on-chip LCD
driver . These feat ures ma ke the PIC18 F87 J93 famil y a
logical choice for many high-performance applications
where price is a primary consideration.
1.1Special Features
• 12-Bit A/D Converter: The PIC18F87J93 family
implements a 12-bit A/D converter. A/D converters
in both families incorporate programmable acquisition time. This allows for a channel to be selected
and a conversion to be initiated, without waiting for
a sampling period and thus, reducing code
overhead.
• Data RAM: The PIC18F87J93 family devices have
3,923 bytes of RAM.
1.2Details on Individual Family
Members
Devices in the PIC18F87J93 family are available in
64-pin and 80-pin packages. Block diagrams for the
two groups are shown in Figure 1-1 and Figure 1-2.
The devices are differentiated from each other in the
following ways:
• Flash Program Memory (64 Kbytes for
PIC18FX6J93 devices and 128 Kbytes for
PIC18FX7J93).
• LCD Pixels:
- 64-pin devices – 132 pixels
(33 SEGs x 4 COMs)
- 80-pin devices – 192 pixels
(48 SEGs x 4 COMs)
• I/O Ports (seven bidirectional ports on
PIC18F6XJ93 devices and nine bidirection al ports
on PIC18F8XJ93 devices).
All other features for devic es in this fam il y ar e id enti ca l
and are summarized in Table 1-1 and Table 1-2.
The devices’ block diagrams are given in Figure 1-1
and Figure 1-2.
The pinouts for all devices are listed in Table 1-3 and
Table 1-4.
TABLE 1-1:DEVICE FEATURES FOR THE PIC18F6XJ93 (64-PIN DEVICES)
FeaturesPIC18F66J93PIC18F67J93
Operating FrequencyDC – 48 MHz
Program Memory (Bytes)64K128K
Program Memory (Instructions)32,76865,536
Data Memory (Bytes)3,9233,923
Interrupt Sources29
I/O PortsPorts A, B, C, D , E, F, G
LCD Driver (available pixels to drive)132 (33 SEGs x 4 COMs)
Timers4
Comparators2
CTMUYes
RTCCY es
Capture/Compare/PWM Modules2
Serial CommunicationsMSSP, Addressable USART, Enhanced USART
12-Bit Analog-to-Digital Module12 Input Channels
Resets (and Delays)POR, BOR, RESET Instruction, Stack Full, Stack Underflow , MCLR
(PWRT, OST)
Instruction Set75 Instructions, 83 with Extended Instruction Set Enabled
Packages64-Pin TQFP
, WDT
TABLE 1-2:DEVICE FEATURES FOR THE PIC18F8XJ93 (80-PIN DEVICES)
FeaturesPIC18F86J93PIC18F87J93
Operating FrequencyDC – 48 MHz
Program Memory (Bytes)64K128K
Prog r a m M e m o r y ( I n s t r u c t i on s )32,76865,536
Data Memory (Bytes)3,9233,923
Interrupt Sources29
I/O PortsPorts A, B, C , D, E, F, G, H, J
LCD Driver (available pixels to drive)192 (48 SEGs x 4 COMs)
Timers4
Comparators2
CTMUYes
RTCCY es
Capture/Compare/PWM Modules2
Serial CommunicationsMSSP, Addressable USART, Enhanced USART
12-Bit Analog-to-Digital Module12 Input Channels
Resets (and Delays)POR, BOR, RESET Instruction, Stack Full, Stack Underflow , MCLR
(PWRT, OST)
Instruction Set75 Instructions, 83 with Extended Instruction Set Enabled
Packages80-Pin TQFP
Note 1: See Table 1-3 for I/O port pin descriptions.
2: RA6 and RA7 are only available as digital I/Os in select oscillator modes.
3: Brown-out Reset and Low-Voltage Detect functions are provided when the on-board voltage regulator is enabled.
Note 1: See Table1-3 for I/O port pin descriptions.
2: RA6 and RA7 are only available as digital I/Os in select oscillator modes.
3: Brown-out Reset and Low-Voltage Detect functions are provided when the on-board voltage regulator is enabled.
T ABLE 1-3:PIC18F6XJ93 (64-PIN DEVICE) PINOUT I/O DESCRIPTIONS
Pin Name
Pin Number
TQFP
Pin
Type
Buffer
Type
Description
MCLR
OSC1/CLKI/RA7
OSC1
CLKI
RA7
OSC2/CLKO/RA6
OSC2
CLKO
RA6
RA0/AN0
RA0
AN0
RA1/AN1/SEG18
RA1
AN1
SEG18
RA2/AN2/V
RA2
AN2
V
REF-
REF-
7ISTMaster Clear (input) or programming voltage (input). This
pin is an active-low Reset to the device.
39
40
24
23
22
I
CMOS
I
CMOS
I/O
O
O
I/O
I/OITTL
Analog
I/O
I
Analog
O
Analog
I/O
I
Analog
I
Analog
Oscillator crystal or external clock input.
Oscillator cryst al inp ut.
External clock source input. Always associated
with pin function OSC1. (See related OSC1/CLKI,
OSC2/CLKO pins.)
TTL
—
—
TTL
TTL
TTL
General purpose I/O pin.
Oscillator crystal or clock output.
Oscillator crystal output. Connects to crystal or
resonator in Crystal Osc ill ato r mode .
In EC modes, OSC2 pin outputs CLKO, which has
1/4 the frequency of OSC1 and denotes the
instruction cycle rate.
General purpose I/O pin.
PORTA is a bidirectional I/O port.
Digital I/O.
Analog In put 0.
Digital I/O.
Analog In put 1.
SEG18 output for LCD.
Digital I/O.
Analog In put 2.
A/D reference voltage (l ow) input.
RA3/AN3/V
RA3
AN3
V
RA4/T0CKI/SEG14
RA4
T0CKI
SEG14
RA5/AN4/SEG15
RA5
AN4
SEG15
RA6See the OSC2/CLKO/RA6 pin.
RA7See the OSC1/CLKI/RA7 pin.
9ISTMaster Clear (input) or programming voltage (input). This
pin is an active-low Reset to the device.
49
50
30
29
28
I
CMOS
I
CMOS
I/O
O
O
I/O
I/OITTL
Analog
I/O
I
Analog
O
Analog
I/O
I
Analog
I
Analog
Oscillator crystal or external clock input.
Oscillator crystal input.
External clock source input. Alw ay s assoc ia ted
with pin function OSC1. (See related OSC1/CLKI,
OSC2/CLKO pins.)
TTL
—
—
TTL
TTL
TTL
General purpose I/O pin.
Oscillator crystal or clock output.
Oscillator crystal output. Connects to crystal or
resonator in Crystal Oscillator mode.
In EC modes, OSC2 pin outputs CLKO, which has
1/4 the frequency of OSC1 and denotes the
instruction cycle rate.
General purpose I/O pin.
PORTA is a bidirectional I/O port.
Digital I/O.
Analog Input 0.
Digital I/O.
Analog Input 1.
SEG18 output for LCD.
Digital I/O.
Analog Input 2.
A/D reference voltage (low) input.
RA3/AN3/V
RA3
AN3
V
RA4/T0CKI/SEG14
RA4
T0CKI
SEG14
RA5/AN4/SEG15
RA5
AN4
SEG15
RA6See the OSC2/CLKO/RA6 pin.
RA7See the OSC1/CLKI/RA7 pin.
The Analog-to-Digital (A/D) converter module has
12 inputs for all PIC18F87J93 family devices. This
module allows conversion of an analog input signal to
a corresponding 12-bit digital number.
The module has these registers:
• A/D Result High Register (ADRESH)
• A/D Result Low Register (ADRESL)
• A/D Control Register 0 (ADCON0)
• A/D Control Register 1 (ADCON1)
• A/D Control Register 2 (ADCON2)
The ADCON0 register, shown in Register 2-1, controls
the operation of the A/D module. The ADCON1
register, shown in Register2-2, configures the
functions of the port pins. The ADCON2 register,
shown in Register 2-3, configures the A/D clock
source, programmed acquisition time and justification.
REGISTER 2-1:ADCON0: A/D CONTROL REGISTER 0
R/W-0U-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0
ADCAL
bit 7bit 0
Legend:
R = Readable bitW = Writable bitU = Unimplemented bit, read as ‘0’
-n = Value at POR‘1’ = Bit is set‘0’ = Bit is clearedx = Bit is unknown
—CHS3CHS2CHS1CHS0GO/DONEADON
bit 7ADCAL: A/D Calibration bit
1 = Calibration is performed on next A/D conversion
0 = Normal A/D converter operation (no calibration is performed)
bit 6Unimplemented: Read as ‘0’
bit 5-2CHS<3:0>: Analog Channel Select bits
Note 1: Channels AN15 through AN12 are not available on PIC18F6XJ93 devices.
2: I/O pins have diode protection to V
DD and VSS.
AN5
0101
The analog reference voltage is software selectable to
either the device’s positive and negative supply voltage
(AV
DD and AVSS) or the voltage level on the RA3/AN3/
VREF+ and RA2/AN2/VREF- pins.
The A/D converter has a unique feature of being able
to operate while the device is in Sleep mode. To
operate in Sleep, the A/D conversion clock must be
derived from the A/D’s internal RC oscillator.
The output of the sample and hold is the input into the
converter, which generates the result via successive
approximation.
Each port pin associated with the A/D converter can be
configured as an analog input or as a digital I /O. The
ADRESH and ADRESL registers contain the result of the
FIGURE 2-1:A/D BLOCK DIAGRAM
(1,2)
A/D conversion. W hen the A/D conve rsion is complete,
the result is loaded into the ADRESH:ADRESL register
pair , t he GO/ DONE
A/D Interrupt Flag bi t, A D IF, is set.
A device Reset forces all registers to their Reset state.
This forces the A/D module to be turned off and any
conversion in progress is aborted. The value in the
ADRESH:ADRESL register pair is not modified for a
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 2-1.
After the A/D module has been configured as desired,
the selected channel must be acquired before the
conversion is started. The analog input channels must
have their corresponding TRIS bits selected as an
input. To determine acquisition time, see Section 2.1“A/D Acquisition Requirements”. After this acquisition time has elapsed, the A/D conversion can be
started. An acquisition time can be programmed to
occur between setting the GO /DONE
bit and the actual
start of the conversion.
The following steps should be followed to do an A/D
conversion:
1.Configure the A/D module:
• Configure analog pins, volt age refere nce and
digital I/O (ADCON1)
• Select A/D input channel (ADCON0)
• Select A/D acquisition time (ADCON2)
• Select A/D conversion clock (ADCO N2)
• Turn on A/D module (ADCON0)
FIGURE 2-2:ANALOG INPUT MODEL
2.Configure A/D interrupt (if desired):
• Clear ADIF bit
• Set ADIE bit
• Set GIE bit
3.Wait the required acquisition time (if required).
4.Start conversion:
• Set GO/DONE
bit (ADCON0<1>)
5.Wait for A/D conversion to complete, by either:
• Polling for the GO/DONE
bit to be cleared
OR
• Waiting for the A/D interrupt
6.Read A/D Result registers (ADRESH:ADRESL);
clear ADIF bit, if required.
7.For next conversion, go to step 1 or step 2, as
required. The A/D conversion time per bit is
defined as T
For the A/D co nverter to meet its s pecified accuracy,
the charge holding capacitor (C
to fully charge to the input channel voltage level. The
analog input model is sh own in Figure 2-2. The source
impedance (R
S) and the internal sampling switch (RSS)
impedance directly affect the time required to charge
the capacitor CHOLD. The sampling switch (RSS)
impedance varies over the device voltage (V
source impedance affect s the of fset vol tage at the analog input (due to pin leakage current). The maximum
recommended impedance for analog sources is
2.5 kΩ. After the analog input channel is selected
(changed), the channel must be sampled for at least
the minimum acquisition time before starting a
HOLD) must be allowed
DD). The
To calculate the minimum acquis ition time, Equation2-1
may be used. This equation assumes that 1/2 LSb error
is used (1,024 steps for the A/D). The 1/2 LSb error is the
maximum error allowed for the A/D to meet its specified
resolution.
Equation 2-3 shows the calculation of the minimum
required acquisition time, T
based on the following application system
assumptions:
CHOLD =25 pF
Rs=2.5 kΩ
Conversion Error≤1/2 LSb
V
DD =3V→ Rss = 2 kΩ
Temperature=85°C (system max.)
conversion.
Note:When the conversion is started, the
holding capacitor is disconnected from the
input pin.
EQUATION 2-1:ACQUISITION TIME
TACQ=Amplifier Settling Time + Holding Capacitor Charging Time + Temperature Coefficient
AMP + TC + TCOFF
=T
ACQ. This calculation is
EQUATION 2-2:A/D MINIMUM CHARGING TIME
V
HOLD = (VREF – (VREF/2048)) • (1 – e
or
TC = -(CHOLD)(RIC + RSS + RS) ln(1/2048)
(-TC/CHOLD(RIC + RSS + RS))
)
EQUATION 2-3:CALCULATING THE MINIMUM REQUIRED ACQUISITION TIME
T
ACQ =TAMP + TC + TCOFF
TAMP =0.2 μs
COFF=(Temp – 25°C)(0.02 μs/°C)
T
(85°C – 25°C)(0.02 μs/°C)
1.2 μs
Temperature coefficient is only required for temperatures > 25°C. Below 25°C, T
2.2Selecting and Configuring
Automatic A c q u is ition Time
The ADCON2 register allows the user to select an
acquisition time that occurs each time the GO/DONE
bit is set.
When the GO/DO NE
bit is set, sampling is stopp ed and
a conversion beg ins. The u ser is res ponsible for ensuring the required acquisition time has passed between
selecting the desired input channel and setting the
GO/DONE
bit. This occurs when the ACQT<2:0> bits
(ADCON2<5:3>) remain in their Reset state (‘000’) and
is compatible with devices that do not offer
programmable acquisition times.
If desired, the ACQT bits can be set to select a
programmable acquisition time for the A/D module.
When the GO/DONE
bit is set, the A/D modu le continues
to sample the i nput for the select ed acquis ition tim e, then
automatically begins a conversion. Since the acquisition
time is program med, ther e may be no need to wait fo r an
acquisition time between selecting a channel and setting
the GO/DONE
bit.
In either case, when the conversion is completed, the
GO/DONE
bit is cleared, the ADIF flag is set and the
A/D begins sampling the currently selected channel
again. If an acquisition time is programmed, there is
nothing to indicate if the acquisition time has ended or
if the conversion has begun.
2.3Selecting the A/D Conversion
Clock
The A/D conversion time per bit is defined as TAD. The
A/D conversion requires 11 T
The source of the A/D conversion clock is software
selectable.
There are seven possible options for T
OSC
•2 T
•4 TOSC
•8 TOSC
•16 TOSC
•32 TOSC
•64 T
OSC
• Internal RC Oscill ator
For correct A/D conversions, the A/D conversion clock
AD) must be as short as possible but greater than the
(T
minimum T
AD.
Table 2-1 shows the resultant T
the device operating frequencies and the A/D clock
source selected.
AD per 12-bit conversion.
AD:
AD times derive d from
T ABLE 2-1:TAD vs. DEVICE OPERATING
FREQUENCIES
AD Clock Source (TAD)Maximum
Device
OperationADCS<2:0>
2 T
OSC0002.86 MHz
OSC1005.71 MHz
4 T
Frequency
8 TOSC00111.43 MHz
16 TOSC10122.86 MHz
OSC01040.0 MHz
32 T
64 TOSC11040.0 MHz
RC
(2)
x11 1.00 MHz
(1)
Note 1: The RC source has a typical TAD time of
4 μs.
2: For device frequencies above 1 MHz, the
device must be in Sleep mod e for the entire
conversion or the A/D accuracy m ay be ou t
of specification.
2.4Configuring Analog Port Pins
The ADCON1, TRISA, TRISF and TRISH registers
control the operation of the A/D port pins. The port pin s
needed as analog inputs must have their corresponding TRIS bits set (input). If the TRIS bit is cleared
(output), the digital output level (V
converted.
The A/D operation is independent of the state of the
CHS<3:0> bits and the TRIS bits.
Note 1: When reading the PORT register, all pins
configured as analog input channels will
read as cleared (a lo w l ev el). Pin s co nfi gured as digital inputs will convert an
analog input. Analog levels on a digitally
configured input will be accurately
converted.
2: Analog levels on any pin defined as a
digital input may cause the digital input
buffer to consume current out of the
device’s specification limits.
Holding capacitor is disconnected from analo g input (typically 100 ns )
TAD9 TAD10
TCY - TAD
Next Q4: ADRESH:ADRESL is loaded, GO/DONE bit is cleared,
ADIF bit is set, holding capacitor is connected to analog input.
Conversion starts
b0
b9
b6
b5
b4
b3
b2
b1
b8
b7
1
2
345
6
7
8
11
Set GO/DONE bit
(Holding capacitor is disconnected)
910
Next Q4: ADRESH:ADRESL is loaded, GO/DONE bit is cleared,
ADIF bit is set, holding capacitor is reconnected to analog input.
Conversio n starts
1
2
34
(Holding capacitor continues
acquiring input)
T
ACQT Cycles
TAD Cycles
Automatic
Acquisition
Time
b0b9
b6
b5b4
b3
b2
b1
b8
b7
2.5A/D Conversions
Figure 2-3 s hows the operation of the A/D converte r
after the GO/DONE
ACQT<2:0> bits are cleared. A conversion is started
after the following instruction to allow entry into Sleep
mode before the conversion begins.
Figure 2-4 s hows the operation of the A/D converte r
after the GO/DONE
bits are set to ‘010’ and a 4 T
selected before the conversion starts.
Clearing the GO/DONE
the current conversion. The A/D Result register pair will
NOT be updated with the partially completed A/D
conversion sample. This means the ADRESH:ADRESL
registers will continue to contain the value of the last
completed conversion (or the last value written to the
ADRESH:ADRESL registers).
After the A/D conversion is completed or aborted, a
ADwai t is required be fore the next a cquisition can b e
2T
started. After this wait, acquisition on the selected
channel is automatically started.
Note:The GO/DONE bit should NOT be set in
the same instruction that turns on the A/D.
bit has been set and the
bit has been set; the ACQT<2:0>
AD acquisition time is
bit during a conversion will abort
2.6Use of the CCP2 Trigger
An A/D conversion can be st arted by t he “S pecial Event
Trigger” of the CCP2 module. This requires that the
CCP2M<3:0> bits (CCP2CON<3:0>) be programmed
as ‘1011’ and that the A/D module is enabled (ADON
bit is set). When the trigger occurs, the GO/DONE
will be set, st arting the A/D acquis ition and conversion,
and the Timer1 (or Timer3) counte r will be reset to zero.
Timer1 (or Timer3) is reset to automatically repeat the
A/D acquisition period with minimal software overhead
(moving ADRESH:ADRESL to the desired location).
The appropriate ana log input cha nnel must b e selected
and the minimum acquisition period is either timed by
the user , or an ap propriate T
the Special Eve nt T rigger set s the GO/DONE
a conversion).
If the A/D module is not enabled (A DON is cleared) , the
Specia l Event T rigger will be i gnored by the A/D module
but will still reset the Timer1 (or Timer3) counter.
The A/D converter in the PIC18F87J93 family of
devices includes a self-calibration feature which compensates for any offset generated within the module.
The calibration proce ss is au tomated and i s initiate d by
setting the ADCAL bit (ADCON0<7>). The next time
the GO/DONE
“dummy” conversion (w hich means it is rea ding none of
the input channels) and store the resulting value
internally to compensate for offset. Thus, subsequent
offsets will be compensated.
The calibration proces s assumes that the dev ice is in a
relatively steady-state operating condition. If A/D
calibration is used, it should be performed after each
device Reset or if there are other major changes in
operating conditions.
bit is set, the module will perform a
2.8Operation in Power-Managed
Modes
The selection of the automatic acquisition time and A/D
conversion clock is determined in part by the clock
source and frequency while in a power-managed mode.
If the A/D is expected to operate while the device is in
a power-managed mode, the ACQT<2:0> and
ADCS<2:0> bits in ADCON2 should be updated in
accordance with the power-managed mode clock that
will be used. After the power-mana ged mode is entered
(either of the power-managed Run modes), an A/D
acquisition or conversion may be started. Once an
acquisition or conversion is started, the device should
continue to be clocked by the same power-managed
mode clock source until the conversion has been
completed. I f desired, the dev ice may be placed into
the corresponding power-managed Idle mode during
the conversion.
If the power-managed mode clock frequency is less
than 1 MHz, the A/D RC clock source should be
selected.
Operation in Sleep mode requires the A/D RC clock to
be selected. If bi ts, ACQ T< 2 :0 > , ar e se t t o ‘000’ and a
conversion is started, the conversion will be delayed
one instruction cycle to allow execution of the SLEEP
instruction and entry to Sleep mode. The IDLEN and
SCSx bits in the OSCCON register must have already
been cleared prior to starting the conversion.
TABLE 2-2:SUMMARY OF A/D REGISTERS
NameBit 7Bit 6Bit 5Bit 4Bit 3Bit 2Bit 1Bit 0Notes
INTCONGIE/GIEH PEIE/GIEL
PIR1
PIE1—ADIERC1IETX1IESSPIE—TMR2IETMR1IE2
IPR1—ADIPRC1IPTX1IPSSPIP—TMR2IPTMR1IP2
PIR3
PIE3—LCDIERC2IETX2IECTMUIECCP2IECCP1IERTCCIE2
IPR3—LCDIPRC2IPTX2IPCTMUIPCCP2IPCCP1IPRTCCIP2
ADRESH A/D Result Register High Byte2
ADRESL A/D Result Register Low Byte2
ADCON0ADCAL
ADCON1TRIGSEL
ADCON2ADFM
CCP2CON——DC2B1DC2B0CCP2M3 CCP2M2CCP2M1CCP2M02
PORTA
TRISA
PORTFRF7RF6RF5RF4RF3RF2RF1—2
TRISFTRISF5TRISF4TRISF5TRISF4TRISF3TRISF2TRISF1
Legend: — = unimplemented, read as ‘0’. Shaded cells are not used for A/D conversion.
Note 1:RA<7:6> and their associated latch and direction bits are configured as port pins only when the internal
oscillator is selected as the default clock source (FOSC2 Configuration bit = 0); otherwise, they are
disabled and these bits read as ‘0’.
2:For these Reset values, see Section 4.0 “Reset” of the “PIC18F87J90 Family Data Sheet” (DS39933).
features that are di fferent from, or in addition to, the features of the PIC18F87J90
family devices.
2: For additional details on the Configuration
bits, refer to Section 24.1 “Configuration
Bits” in the “PIC18F87J90 Family Data
Sheet” (DS39933).
3.1Device ID Registers
The Device ID registers are “read-onl y” registers . They
identify the device type and revision for device
programmers and can be read by firmware using table
reads.
Legend:x = unknown, — = unimplemented. Shaded cells are unimplemented, read as ‘0’.
Note 1:Values reflect the unprogrammed state as received from the factory and following Power-on Resets. In all other Reset
states, the configuration bytes maintain their previously programmed states.
2:See Register 3-1 and Register 3-2 for DEVID values. These registers are read-only and cannot be programmed by
Note: Other than some basic data, this section docume nts only the PIC18F87J93 fam il y de vi ce s’ s pec ifi ca tio ns that
differ from those of the PIC18F87J90 family devices. For detailed information on the electrical specifications
shared by the PIC18F87J93 family and PIC18F87J90 family devices, see the “PIC18F87J90 Family DataSheet” (DS39933).
Absolute Maximum Ratings
Ambient temperature under bias.............................................................................................................-40°C to +100°C
Storage temperature.............................................................................................................................. -65°C to +150°C
Voltage on any digital only I/O pin or MCLR
Voltage on any combined digital and analog pin with respect to V
Voltage on V
Voltage on V
Total power dissipation (Note 1) ...............................................................................................................................1.0W
Maximum current out of V
Maximum current into V
Maximum output current sunk by PORTA<7:6> and any PORTB and PORTC I/O pins.........................................25 mA
Maximum output current sunk by any PORTD, PORTE and PORTJ I/O pins..........................................................8 mA
Maximum output current sunk by PORTA<5:0> and any PORTF, PORTG and PORTH I/O pins ............................2 mA
Maximum output current sourced by PORTA<7:6> and any PORTB and PORTC I/O pins ...................................25 mA
Maximum output current sourced by any PORTD, PORTE and PORTJ I/O pins.....................................................8 mA
Maximum output current sourced by PORTA<5:0> and any PORTF, PORTG and PORTH I/O pins.......................2 mA
Maximum current sunk by all ports combined.......................................................................................................200 mA
Note 1: Power dissipation is calcu la t ed as follows :
DDCORE with respect to VSS...................................................................................................-0.3V to 2.75V
DD with respect to VSS ........................................................................................................... -0.3V to 3.6V
SS pin...........................................................................................................................300 mA
DD pin..............................................................................................................................250 mA
Pdis = V
DD x {IDD – ∑ IOH} + ∑ {(VDD – VOH) x IOH} + ∑(VOL x IOL)
(†)
with respect to VSS (except VDD) ...........................................-0.3V to 6.0V
SS (except VDD and MCLR)...... -0.3V to (VDD + 0.3V)
† 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.
This appendix discusses the considerations for
converting from previous versions of a device to the
ones listed in this data sheet. Typically, these changes
are due to the differences in the process technology
used. An example of this type of conversion is from a
PIC16C74A to a PIC16C74B.
Not Applicable
APPENDIX D:MIGRATION FROM
BASELINE TO
ENHANCED DEVICES
This section di scusses how to migrate from a Baseline
device (such as the PIC16C5X) to an Enhanced MCU
device (such as the PIC18FXXX).
The following are the list of modifications over the
PIC16C5X microcontroller fam il y:
Microchip provides onlin e support v ia our W WW site at
www.m ic roc hi p.c om . Thi s web si te i s us ed as a m ean s
to make files and information easily available to
customers. Accessible by using your favorite Internet
browser, the web site contains the following
information:
• Product Support – Data sheets and errata,
application notes and sample programs, design
resources, user’s guides and hardware support
documents, latest software releases and archived
software
• General Technical Support – Frequently Asked
Questions (FAQ), technical support requests,
online discussion groups, Microchip consultant
program member listing
• Business of Microchip – Product selector and
ordering guides, latest Microchip press releases,
listing of s eminars and events, listings of
Microchip sales offices, distributors and factory
representatives
CUSTOMER CHANGE NOTIFICATION
SERVICE
CUSTOMER SUPPORT
Users of Microchip products can receive assistance
through several channels:
• Distributor or Representative
• Local Sales Office
• Field Application Engineer (FAE)
• Technical Support
• Development Systems Information Line
Customers should contact their distributor,
representative or field application engineer (FAE) for
support. Local sales offices are also available to help
customers. A listing of sales offices and locations is
included in the back of this document.
T echnic al suppo rt is avail able throug h the web si te
at: http://support.microchip.com
Microchip’s customer notification service helps keep
customers current on Microchip products. Subscribers
will receive e-mail notification whenever there are
changes, updates, revisions or errata related to a
specified produ ct family or develo pment tool of inte rest.
To register, access the Microchip web site at
www.microchip.com, click on Customer Change
Notification and follow the registration instructions.
Application (optional):
Would you like a reply? Y N
Device: Literature Number:
Questions:
FAX: (______) _________ - _________
DS39948APIC18F87J93 Family
READER RESPONSE
It is our intentio n to pro vi de you with the best docu mentation possib le to e ns ure suc c es sfu l u se of y ou r Mic r oc hip pro duct. If you wish to provid e your c omment s on org anizatio n, clarity, subject matter, a nd ways in whic h our doc umenta tion
can better serve you, please FAX your comments to the Technical Publications Manager at (480) 792-4150.
Please list the following information, and use this outline to provide us with your comments about this document.
1. What are the best features of this document?
2. How does this document meet your hardware and software development needs?
3. Do you find the organization of this document easy to follow? If not, why?
4. What additions to the document do you think would enhance the structure and subject?
5. What deletions from the document could be made without affecting the overall usefulness?
6. Is there any incorrect or misleading information (what and where)?