Professional Documents
Culture Documents
16c55x PDF
16c55x PDF
PIC16C55X
RA3 2 17 RA0
High Performance RISC CPU: RA4/T0CKI 3 16 OSC1/CLKIN
MCLR/ VPP 4 15 OSC2/CLKOUT
VSS 5 14 VDD
• Only 35 instructions to learn RB0/INT 6 13 RB7
• All single-cycle instructions (200 ns), except for RB1 7 12 RB6
RB2 8 11 RB5
program branches which are two-cycle RB3 9 10 RB4
• Operating speed:
- DC - 20 MHz clock input
- DC - 200 ns instruction cycle
Device Program Data SSOP
Memory Memory
RA2 •1 20 RA1
PIC16C554 512 80 RA3 2 19 RA0
PIC16C55X
RA4/T0CKI 3 18 OSC1/CLKIN
PIC16C558 2K 128 MCLR/ VPP 4 17 OSC2/CLKOUT
VSS 5 16 VDD
VSS 6 15 VDD
• Interrupt capability RB0/INT 7 14 RB7
• 16 special function hardware registers RB1 8 13 RB6
RB2 9 12 RB5
• 8-level deep hardware stack RB3 10 11 RB4
• Direct, Indirect and Relative addressing modes
Peripheral Features:
• 13 I/O pins with individual direction control Special Microcontroller Features (cont’d)
• High current sink/source for direct LED drive
• Timer0: 8-bit timer/counter with 8-bit • Programmable code protection
programmable prescaler • Power saving SLEEP mode
• Selectable oscillator options
Special Microcontroller Features: • Serial in-circuit programming (via two pins)
• Power-on Reset (POR) • Four user programmable ID locations
• Power-up Timer (PWRT) and Oscillator Start-up CMOS Technology:
Timer (OST)
• Watchdog Timer (WDT) with its own on-chip RC • Low-power, high-speed CMOS EPROM technology
oscillator for reliable operation • Fully static design
• Wide operating voltage range
- 2.5V to 5.5V
• Commercial, industrial and extended tempera-
ture range
• Low power consumption
- < 2.0 mA @ 5.0V, 4.0 MHz
- 15 µA typical @ 3.0V, 32 kHz
- < 1.0 µA typical standby current @ 3.0V
PIC16C554 PIC16C558
Clock Maximum Frequency of Operation (MHz) 20 20
EPROM Program Memory (x14 words) 512 2K
Memory
Data Memory (bytes) 80 128
Peripherals Timer Module(s) TMR0 TMR0
Interrupt Sources 3 3
I/O Pins 13 13
Voltage Range (Volts) 2.5-5.5 2.5-5.5
Features Brown-out Reset — —
Packages 18-pin DIP, 18-pin DIP,
SOIC; SOIC;
20-pin SSOP 20-pin SSOP
All PICmicro® Family devices have Power-on Reset, selectable Watchdog Timer, selectable code protect and high
I/O current capability. All PIC16C55X Family devices use serial programming with clock pin RB6 and data pin RB7.
PIC16C554 512 x 14 80 x 8
PIC16C558 2K x 14 128 x 8
STATUS reg
8
3
Power-up MUX
Timer
Instruction Oscillator
Decode & Start-up Timer ALU
Control
Power-on
Reset 8
Timing Watchdog
Generation Timer W reg
OSC1/CLKIN
OSC2/CLKOUT
Timer0
MCLR VDD, VSS
Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4
OSC1
Q1
Q2 Internal
phase
Q3 clock
Q4
PC PC PC+1 PC+2
OSC2/CLKOUT
(RC mode)
Fetch INST (PC)
Execute INST (PC-1) Fetch INST (PC+1)
Execute INST (PC) Fetch INST (PC+2)
Execute INST (PC+1)
All instructions are single cycle, except for any program branches. These take two cycles since the fetch
instruction is “flushed” from the pipeline while the new instruction is being fetched and then executed.
On-chip Program
Stack Level 1
Memory
Stack Level 2 07FFh
0800h
Stack Level 8
1FFFh
Bank 0
Addressing this location uses contents of FSR to address data memory (not a physical
00h INDF xxxx xxxx xxxx xxxx
register)
01h TMR0 Timer0 Module’s Register xxxx xxxx uuuu uuuu
02h PCL Program Counter's (PC) Least Significant Byte 0000 0000 0000 0000
03h STATUS IRP(2) RP1(2) RP0 TO PD Z DC C 0001 1xxx 000q quuu
04h FSR Indirect data memory address pointer xxxx xxxx uuuu uuuu
05h PORTA — — — RA4 RA3 RA2 RA1 RA0 ---x xxxx ---u uuuu
06h PORTB RB7 RB6 RB5 RB4 RB3 RB2 RB1 RB0 xxxx xxxx uuuu uuuu
07h Unimplemented — —
08h Unimplemented — —
09h Unimplemented — —
0Ah PCLATH — — — Write buffer for upper 5 bits of program counter ---0 0000 ---0 0000
0Bh INTCON GIE (3) T0IE INTE RBIE T0IF INTF RBIF 0000 000x 0000 000u
0Ch Unimplemented — —
0Dh-1Eh Unimplemented — —
1Fh Unimplemented — —
Bank 1
Addressing this location uses contents of FSR to address data memory (not a physical xxxx xxxx xxxx xxxx
80h INDF
register)
81h OPTION RBPU INTEDG T0CS T0SE PSA PS2 PS1 PS0 1111 1111 1111 1111
82h PCL Program Counter's (PC) Least Significant Byte 0000 0000 0000 0000
83h STATUS — — RP0 TO PD Z DC C 0001 1xxx 000q quuu
84h FSR Indirect data memory address pointer xxxx xxxx uuuu uuuu
85h TRISA — — — TRISA4 TRISA3 TRISA2 TRISA1 TRISA0 ---1 1111 ---1 1111
86h TRISB TRISB7 TRISB6 TRISB5 TRISB4 TRISB3 TRISB2 TRISB1 TRISB0 1111 1111 1111 1111
87h Unimplemented — —
88h Unimplemented — —
89h Unimplemented — —
8Ah PCLATH — — — Write buffer for upper 5 bits of program counter ---0 0000 ---0 0000
8Bh INTCON GIE (3) T0IE INTE RBIE T0IF INTF RBIF 0000 000x 0000 000u
8Ch Unimplemented — —
8Dh Unimplemented — —
8Eh PCON — — — — — — POR — ---- --0- ---- --u-
8Fh-9Eh Unimplemented — —
9Fh Unimplemented — —
Legend: — = Unimplemented locations read as ‘0’, u = unchanged, x = unknown, q = value depends on condition,
shaded = unimplemented
Note 1: Other (non power-up) resets include MCLR reset and Watchdog Timer reset during normal operation.
Note 2: IRP & RP1bits are reserved, always maintain these bits clear.
Note 3: Bit 6 of INTCON register is reserved for future use. Always maintain this bit as clear.
The program counter (PC) is 13-bits wide. The low byte The PIC16C55X family has an 8 level deep x 13-bit
comes from the PCL register, which is a readable and wide hardware stack (Figure 4-1 and Figure 4-2). The
writable register. The high bits (PC<12:8>) are not directly stack space is not part of either program or data space
readable or writable and come from PCLATH. On any and the stack pointer is not readable or writable. The
reset, the PC is cleared. Figure 4-9 shows the two PC is PUSHed onto the stack when a CALL instruction
situations for the loading of the PC. The upper example in is executed or an interrupt causes a branch. The stack
the figure shows how the PC is loaded on a write to PCL is POPed in the event of a RETURN, RETLW or a RETFIE
(PCLATH<4:0> → PCH). The lower example in Figure 4-9 instruction execution. PCLATH is not affected by a
shows how the PC is loaded during a CALL or GOTO PUSH or POP operation.
instruction (PCLATH<4:3> → PCH). The stack operates as a circular buffer. This means that
FIGURE 4-9: LOADING OF PC IN after the stack has been PUSHed eight times, the ninth
push overwrites the value that was stored from the first
DIFFERENT SITUATIONS
push. The tenth push overwrites the second push (and
so on).
PCH PCL
Note 1: There are no STATUS bits to indicate
12 8 7 0 Instruction with stack overflow or stack underflow
PC PCL as
Destination conditions.
PCLATH<4:0> 8
5 ALU result Note 2: There are no instructions mnemonics
called PUSH or POP. These are actions
PCLATH
that occur from the execution of the
CALL, RETURN, RETLW and RETFIE
PCH PCL instructions, or vectoring to an interrupt
12 11 10 8 7 0 address.
PC GOTO, CALL
PCLATH<4:3> 11
2 Opcode <10:0>
PCLATH
The INDF register is not a physical register. Addressing EXAMPLE 4-1: INDIRECT ADDRESSING
the INDF register will cause indirect addressing.
movlw 0x20 ;initialize pointer
Indirect addressing is possible by using the INDF reg- movwf FSR ;to RAM
ister. Any instruction using the INDF register actually
NEXT clrf INDF ;clear INDF register
accesses data pointed to by the file select register
incf FSR ;inc pointer
(FSR). Reading INDF itself indirectly will produce 00h.
Writing to the INDF register indirectly results in a btfss FSR,4 ;all done?
no-operation (although status bits may be affected). An goto NEXT ;no clear next
effective 9-bit address is obtained by concatenating the ;yes continue
8-bit FSR register and the IRP bit (STATUS<7>), as CONTINUE:
shown in Figure 4-10. However, IRP is not used in the
PIC16C55X.
not used
Data
Memory
7Fh 7Fh
Bank 0 Bank 1 Bank 2 Bank 3
For memory map detail see Figure 4-3 and Figure 4-4.
Note 1: The RP1 and IRP bits are reserved, always maintain these bits clear.
Data
bus
D Q
VDD
WR VDD
PortA CK Q
P
Data Latch
D Q N I/O pin
WR
TRISA CK Q VSS
VSS
Schmitt
TRIS Latch Trigger
input
buffer
RD TRISA
Q D
EN
RD PORTA
Buffer
Name Bit # Function
Type
RA0 bit0 ST Bi-directional I/O port.
RA1 bit1 ST Bi-directional I/O port.
RA2 bit2 ST Bi-directional I/O port.
RA3 bit3 ST Bi-directional I/O port.
RA4/T0CKI bit4 ST Bi-directional I/O port or external clock input for TMR0. Output is open
drain type.
Legend: ST = Schmitt Trigger input
Value on Value on
Address Name Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0
POR All Other Resets
05h PORTA — — — RA4 RA3 RA2 RA1 RA0 ---x xxxx ---u uuuu
85h TRISA — — — TRISA4 TRISA3 TRISA2 TRISA1 TRISA0 ---1 1111 ---1 1111
D Q
VSS
WR TRISB VSS
CK Q
TTL ST
Input Buffer
Buffer
RD TRISB Latch
Q D
RD PortB EN
Set RBIF
From other Q D
RB7:RB4 pins
EN
RD Port B
RB7:RB6 in serial programming mode
D Q
VSS
WR TRISB VSS
CK Q
TTL ST
Input Buffer
Buffer
RD TRISB Latch
Q D
RD PortB EN
RB0:INT
ST RD Port B
Buffer
Value on Value on
Address Name Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0
POR All Other Rests
06h PORTB RB7 RB6 RB5 RB4 RB3 RB2 RB1 RB0 xxxx xxxx uuuu uuuu
86h TRISB TRISB7 TRISB6 TRISB5 TRISB4 TRISB3 TRISB2 TRISB1 TRISB0 1111 1111 1111 1111
81h OPTION RBPU INTEDG T0CS T0SE PSA PS2 PS1 PS0 1111 1111 1111 1111
Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Note:
This example shows write to PORTB
PC PC PC + 1 PC + 2 PC + 3 followed by a read from PORTB.
Instruction MOVWF PORTB MOVF PORTB, W NOP NOP Note that:
fetched Write to Read PORTB
PORTB data setup time = (0.25 TCY - TPD)
where TCY = instruction cycle and
RB7:RB0
RB <7:0> TPD = propagation delay of Q1 cycle
to output valid.
Port pin Therefore, at higher clock frequencies,
sampled here a write followed by a read may be
TPD problematic.
Execute Execute Execute
MOVWF MOVF NOP
PORTB PORTB, W
Data bus
RA4/T0CKI FOSC/4 0
pin PSout 8
1
Sync with
1 Internal TMR0
clocks
Programmable 0 PSout
Prescaler
T0SE (2 Tcy delay)
Note 1: Bits, T0SE, T0CS, PS2, PS1, PS0 and PSA are located in the OPTION register.
2: The prescaler is shared with Watchdog Timer (Figure 6-6)
PC 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
(Program
Counter) PC-1 PC PC+1 PC+2 PC+3 PC+4 PC+5 PC+6
Instruction MOVWF TMR0 MOVF TMR0,W MOVF TMR0,W MOVF TMR0,W MOVF TMR0,W MOVF TMR0,W
Fetch
Instruction
Executed
Write TMR0 Read TMR0 Read TMR0 Read TMR0 Read TMR0 Read TMR0
executed reads NT0 reads NT0 reads NT0 reads NT0 + 1 reads NT0 + 2
PC 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
(Program
Counter) PC-1 PC PC+1 PC+2 PC+3 PC+4 PC+5 PC+6
Instruction MOVWF TMR0 MOVF TMR0,W MOVF TMR0,W MOVF TMR0,W MOVF TMR0,W MOVF TMR0,W
Fetch
Instruction
Execute Write TMR0 Read TMR0 Read TMR0 Read TMR0 Read TMR0 Read TMR0
executed reads NT0 reads NT0 reads NT0 reads NT0 reads NT0 + 1
Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4
OSC1
CLKOUT(3)
GIE bit
(INTCON<7>)
Interrupt Latency Time
INSTRUCTION FLOW
PC PC PC +1 PC +1 0004h 0005h
Instruction
fetched Inst (PC) Inst (PC+1) Inst (0004h) Inst (0005h)
Instruction Inst (PC-1) Inst (PC) Dummy cycle Dummy cycle Inst (0004h)
executed
Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4
Small pulse
External Clock Input or misses sampling
Prescaler output (2)
(1)
(3)
External Clock/Prescaler
Output after sampling
Increment Timer0 (Q4)
Timer0 T0 T0 + 1 T0 + 2
Note 1: Delay from clock input change to Timer0 increment is 3Tosc to 7Tosc. (Duration of Q = Tosc).
Therefore, the error in measuring the interval between two edges on Timer0 input = ±4Tosc max.
2: External clock if no prescaler selected, Prescaler output otherwise.
3: The arrows indicate the points in time where sampling occurs.
8
M 1
0
T0CKI U M
X SYNC
pin U 2 TMR0 reg
1 0
X Tcy
T0SE
T0CS Set flag bit T0IF
PSA
on Overflow
0
M 8-bit Prescaler
U
Watchdog 1 X 8
Timer
0 1
WDT Enable bit
MUX PSA
WDT
Time-out
Note: T0SE, T0CS, PSA, PS0-PS2 are bits in the OPTION register.
Value on Value on
Address Name Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0
POR All Other Resets
01h TMR0 Timer0 module’s register xxxx xxxx uuuu uuuu
0Bh/8Bh INTCON GIE + T0IE INTE RBIE T0IF INTF RBIF 0000 000x 0000 000x
81h OPTION RBPU INTEDG T0CS T0SE PSA PS2 PS1 PS0 1111 1111 1111 1111
85h TRISA — — — TRISA4 TRISA3 TRISA2 TRISA1 TRISA0 ---1 1111 ---1 1111
Legend: — = Unimplemented locations, read as ‘0’.
+ = Reserved for future use.
Note: Shaded bits are not used by TMR0 module.
CP1 CP01 CP1 CP01 CP1 CP01 — Reserved CP1 CP01 PWRTE WDTE F0SC1 F0SC0 CONFIG Address
bit13 bit0 REGISTER: 2007h
Note 1: All of the CP1:CP0 pairs have to be given the same value to enable the code protection scheme listed.
Clock from
ext. system OSC1
PIC16C55X
Open OSC2
VDD
20 pF 20 pF PIC16C55X
Rext
Figure 7-5 shows a series resonant oscillator circuit. OSC1
This circuit is also designed to use the fundamental Internal Clock
frequency of the crystal. The inverter performs a 180° Cext
phase shift in a series resonant oscillator circuit. The
VDD
330 Ω resistors provide the negative feedback to bias OSC2/CLKOUT
Fosc/4
the inverters in their linear region.
FIGURE 7-5: EXTERNAL SERIES
RESONANT CRYSTAL
OSCILLATOR CIRCUIT
To other
330 Ω 330 Ω Devices
PIC16C55X
74AS04 74AS04 74AS04
CLKIN
0.1 µF
XTAL
MCLR/
VPP Pin SLEEP
WDT WDT
Module Time-out
Reset
VDD rise
detect
Power-on Reset
VDD
OST/PWRT
OST
Chip_Reset
10-bit Ripple-counter R Q
OSC1/
CLKIN
Pin PWRT
On-chip(1)
RC OSC 10-bit Ripple-counter
Enable PWRT
See Table 7-3 for time-out situations.
Enable OST
Note 1: This is a separate oscillator from the RC oscillator of the CLKIN pin.
POR TO PD
0 1 1 Power-on-reset
0 0 X Illegal, TO is set on POR
0 X 0 Illegal, PD is set on POR
1 0 u WDT Reset
1 0 0 WDT Wake-up
1 u u MCLR reset during normal operation
1 1 0 MCLR reset during SLEEP
VDD
MCLR
INTERNAL POR
TPWRT
OST TIME-OUT
INTERNAL RESET
FIGURE 7-9: TIME-OUT SEQUENCE ON POWER-UP (MCLR NOT TIED TO VDD): CASE 2
VDD
MCLR
INTERNAL POR
TPWRT
OST TIME-OUT
INTERNAL RESET
VDD
MCLR
INTERNAL POR
TPWRT
OST TIME-OUT
INTERNAL RESET
D R
R1
MCLR
C PIC16C55X
Wake-up
T0IF (If in SLEEP mode)
T0IE
INTF
INTE
Interrupt
to CPU
RBIF
RBIE
GIE
An external interrupt on RB0/INT pin is edge triggered: An overflow (FFh → 00h) in the TMR0 register will
either rising if INTEDG bit (OPTION<6>) is set, or fall- set the T0IF (INTCON<2>) bit. The interrupt can
ing if INTEDG bit is clear. When a valid edge appears be enabled/disabled by setting/clearing T0IE
on the RB0/INT pin, the INTF bit (INTCON<1>) is set. (INTCON<5>) bit. For operation of the Timer0 module,
This interrupt can be disabled by clearing the INTE see Section 6.0.
control bit (INTCON<4>). The INTF bit must be cleared
in software in the interrupt service routine before 7.5.3 PORTB INTERRUPT
re-enabling this interrupt. The RB0/INT interrupt can
An input change on PORTB <7:4> sets the RBIF
wake-up the processor from SLEEP, if the INTE bit was
(INTCON<0>) bit. The interrupt can be enabled/dis-
set prior to going into SLEEP. The status of the GIE bit
abled by setting/clearing the RBIE (INTCON<4>) bit.
decides whether or not the processor branches to the
For operation of PORTB (Section 5.2).
interrupt vector following wake-up. See Section 7.8 for
details on SLEEP and Figure 7-16 for timing of Note: If a change on the I/O pin should occur
wake-up from SLEEP through RB0/INT interrupt. when the read operation is being executed
(start of the Q2 cycle), then the RBIF inter-
rupt flag may get set.
Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4
OSC1
CLKOUT 3
4
INT pin
1
1
INTF flag 5 Interrupt Latency 2
(INTCON<1>)
GIE bit
(INTCON<7>)
INSTRUCTION FLOW
0
M Postscaler
Watchdog 1 U
Timer • X 8
8 - to -1 MUX PS<2:0>
PSA
WDT
Enable Bit
• To TMR0 (Figure 6-6)
0 1
MUX PSA
WDT
Time-out
Note: T0SE, T0CS, PSA, PS0-PS2 are bits in the OPTION register.
Value on all
Address Name Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 Value on POR
other Resets
Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4
OSC1
CLKOUT(4) TOST(2)
INT pin
INTF flag
(INTCON<1>) Interrupt Latency
(Note 2)
GIE bit Processor in
(INTCON<7>)
SLEEP
INSTRUCTION FLOW
PC PC PC+1 PC+2 PC+2 PC + 2 0004h 0005h
Instruction
fetched Inst(PC) = SLEEP Inst(PC + 1) Inst(PC + 2) Inst(0004h) Inst(0005h)
To Normal
Connections
External
Connector PIC16C55X
Signals
+5V VDD
0V VSS
VPP MCLR/VPP
CLK RB6
VDD
To Normal
Connections
For bit-oriented instructions, 'b' represents a bit field Table 8-1 lists the instructions recognized by the
designator which selects the number of the bit affected MPASM assembler.
by the operation, while 'f' represents the number of the Figure 8-1 shows the three general formats that the
file in which the bit is located. instructions can have.
For literal and control operations, 'k' represents an Note: To maintain upward compatibility with
eight or eleven bit constant or literal value. future PICmicro® products, do not use the
TABLE 8-1: OPCODE FIELD OPTION and TRIS instructions.
DESCRIPTIONS All examples use the following format to represent a
hexadecimal number:
Field Description
0xhh
f Register file address (0x00 to 0x7F)
where h signifies a hexadecimal digit.
W Working register (accumulator)
b Bit address within an 8-bit file register FIGURE 8-1: GENERAL FORMAT FOR
k Literal field, constant data or label INSTRUCTIONS
x Don't care location (= 0 or 1)
Byte-oriented file register operations
The assembler will generate code with x = 0. It is the
recommended form of use for compatibility with all 13 8 7 6 0
Microchip software tools. OPCODE d f (FILE #)
d Destination select; d = 0: store result in W, d = 0 for destination W
d = 1: store result in file register f. d = 1 for destination f
Default is d = 1 f = 7-bit file register address
label Label name
TOS Top of Stack Bit-oriented file register operations
PC Program Counter 13 10 9 7 6 0
PCLATH Program Counter High Latch OPCODE b (BIT #) f (FILE #)
GIE Global Interrupt Enable bit
b = 3-bit bit address
WDT Watchdog Timer/Counter f = 7-bit file register address
TO Time-out bit
PD Power-down bit Literal and control operations
dest Destination either the W register or the specified
register file location General
[ ] Options 13 8 7 0
( ) Contents OPCODE k (literal)
→ Assigned to
k = 8-bit immediate value
<> Register bit field
∈ In the set of CALL and GOTO instructions only
italics User defined term (font is courier) 13 11 10 0
OPCODE k (literal)
Description: The contents of the W register are Description: The contents of W register are
added to the eight bit literal 'k' and the AND’ed with the eight bit literal 'k'. The
result is placed in the W register. result is placed in the W register.
Words: 1 Words: 1
Cycles: 1 Cycles: 1
Example ADDLW 0x15 Example ANDLW 0x5F
Words: 1 Cycles: 1
Before Instruction
W = 0x07
After Instruction
W = value of k8
Description: Return from subroutine. The stack is Encoding: 00 1100 dfff ffff
POPed and the top of the stack (TOS) Description: The contents of register 'f' are rotated
is loaded into the program counter. one bit to the right through the Carry
This is a two cycle instruction. Flag. If 'd' is 0 the result is placed in
Words: 1 the W register. If 'd' is 1 the result is
placed back in register 'f'.
Cycles: 2
C Register f
Example RETURN
After Interrupt Words: 1
PC = TOS
Cycles: 1
Example RRF REG1,0
Before Instruction
REG1 = 1110 0110
C = 0
After Instruction
REG1 = 1110 0110
W = 0111 0011
C = 0
Description: The contents of register 'f' are rotated Status Affected: TO, PD
one bit to the left through the Carry Encoding: 00 0000 0110 0011
Flag. If 'd' is 0 the result is placed in
the W register. If 'd' is 1 the result is Description: The power-down status bit, PD is
cleared. Time-out status bit, TO is
stored back in register 'f'.
set. Watchdog Timer and its
C Register f prescaler are cleared.
The processor is put into SLEEP
Words: 1 mode with the oscillator stopped.
See Section 7.8 for more details.
Cycles: 1
Words: 1
Example RLF REG1,0
Cycles: 1
Before Instruction
REG1 = 1110 0110 Example: SLEEP
C = 0
After Instruction
REG1 = 1110 0110
W = 1100 1100
C = 1
Description: The W register is subtracted (2’s com- Encoding: 00 0010 dfff ffff
plement method) from the eight bit literal Description: Subtract (2’s complement method)
'k'. The result is placed in the W register. W register from register 'f'. If 'd' is 0 the
Words: 1 result is stored in the W register. If 'd' is 1
the result is stored back in register 'f'.
Cycles: 1
Words: 1
Example 1: SUBLW 0x02
Cycles: 1
Before Instruction
Example 1: SUBWF REG1,1
W = 1
C = ? Before Instruction
After Instruction REG1 = 3
W = 2
W = 1 C = ?
C = 1; result is posi-
tive After Instruction
Encoding: 00 1110 dfff ffff Description: The contents of the W register are
XOR’ed with the eight bit literal 'k'.
Description: The upper and lower nibbles of The result is placed in the
register 'f' are exchanged. If 'd' is 0 W register.
the result is placed in W register. If 'd'
is 1 the result is placed in register 'f'.
Words: 1
Words: 1 Cycles: 1
The MPLAB-ICE Universal In-Circuit Emulator is 9.5 PICSTART Plus Entry Level
intended to provide the product development engineer Development System
with a complete microcontroller design tool set for
PICmicro microcontrollers (MCUs). MPLAB-ICE is sup- The PICSTART programmer is an easy-to-use,
plied with the MPLAB Integrated Development Environ- low-cost prototype programmer. It connects to the PC
ment (IDE), which allows editing, “make” and via one of the COM (RS-232) ports. MPLAB Integrated
download, and source debugging from a single envi- Development Environment software makes using the
ronment. programmer simple and efficient. PICSTART Plus is
not recommended for production programming.
Interchangeable processor modules allow the system
to be easily reconfigured for emulation of different pro- PICSTART Plus supports all PIC12CXXX, PIC14C000,
cessors. The universal architecture of the MPLAB-ICE PIC16C5X, PIC16CXXX and PIC17CXX devices with
allows expansion to support all new Microchip micro- up to 40 pins. Larger pin count devices such as the
controllers. PIC16C923, PIC16C924 and PIC17C756 may be sup-
ported with an adapter socket. PICSTART Plus is CE
The MPLAB-ICE Emulator System has been designed compliant.
as a real-time emulation system with advanced fea-
tures that are generally found on more expensive
development tools. The PC compatible 386 (and higher)
machine platform and Microsoft Windows 3.x or
Windows 95 environment were chosen to best make
these features available to you, the end user.
MPLAB-ICE is available in two versions.
MPLAB-ICE 1000 is a basic, low-cost emulator system
with simple trace capabilities. It shares processor mod-
ules with the MPLAB-ICE 2000. This is a full-featured
emulator system with enhanced trace, trigger, and data
monitoring features. Both systems will operate across
the entire operating speed reange of the PICmicro
MCU.
TABLE 9-1:
24CXX HCS200
PIC12C5XX PIC14000 PIC16C5X PIC16CXXX PIC16C6X PIC16C7XX PIC16C8X PIC16C9XX PIC17C4X PIC17C7XX 25CXX HCS300
93CXX HCS301
Emulator Products
MPLAB™-ICE ü ü ü ü ü ü ü ü ü ü
MPLAB
Integrated
Development ü ü ü ü ü ü ü ü ü ü
Environment
Software Tools
MPLAB C17*
Compiler ü ü
fuzzyTECH-MP
Explorer/Edition
Fuzzy Logic ü ü ü ü ü ü ü ü ü
Preliminary
Dev. Tool
Total Endurance
Software Model ü
PICSTARTPlus
Low-Cost ü ü ü ü ü ü ü ü ü ü
Programmers
SEEVAL
Designers Kit ü
PIC16C55X
SIMICE ü ü
PICDEM-14A ü
Demo Boards
PICDEM-1 ü ü ü ü
PICDEM-2 ü ü
DS40143C-page 67
PICDEM-3 ü
KEELOQ®
Evaluation Kit ü
KEELOQ
Transponder Kit ü
PIC16C55X
NOTES:
† 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.
PIC16C55X
OSC PIC16C55X-04 PIC16C55X-20 PIC16LC55X-04
JW Devices
RC VDD: 3.0V to
VDD: 4.5V to 5.5V VDD: 2.5V to 5.5V VDD: 3.0V to 5.5V
5.5V
IDD: 1.8 mA typ. IDD: 1.4 mA typ. IDD: 3.3 mA max.
IDD: 3.3 mA
@5.5V @3.0V @5.5V
max.@5.5V
IPD: 1.0 µA typ. IPD: 0.7 µA typ. IPD: 20 µA max.
IPD: 20 µA max.
@4.5V @3.0V @4.0V
@4.0V
Freq: 4.0 MHz Freq: 4.0 MHz Freq: 4.0 MHz
Freq: 4.0 MHz
max. max. max.
max.
XT VDD: 3.0V to
VDD: 4.5V to 5.5V VDD: 2.5V to 5.5V VDD: 3.0V to 5.5V
5.5V
IDD: 1.8 mA typ. IDD: 1.4 mA typ. IDD: 3.3 mA max.
IDD: 3.3 mA
@5.5V @3.0V @5.5V
max.@5.5V
IPD: 1.0 µA typ. IPD: 0.7 µA typ. IPD: 20 µA max.
IPD: 20 µA max.
@4.5V @3.0V @4.0V
@4.0V
Freq: 4.0 MHz Freq: 4.0 MHz Freq: 4.0 MHz
Freq: 4.0 MHz
max. max. max.
max.
The shaded sections indicate oscillator selections which are tested for functionality, but not for MIN/MAX specifications.
It is recommended that the user select the device type that ensures the specifications required.
VDD/2
RL
CL CL
Pin Pin
VSS VSS
RL = 464Ω
CL = 50 pF for all pins except OSC2
15 pF for OSC2 output
Q4 Q1 Q2 Q3 Q4 Q1
OSC1
1 3 3
4 4
2
CLKOUT
Q4 Q1 Q2 Q3
OSC1
10 11
22
CLKOUT
23
13 18 12
14 19 16
I/O Pin
(input)
17 15
20, 21
Note: All tests must be do with specified capacitance loads (Figure 10-1) 50 pF on I/O pins and CLKOUT
VDD
MCLR
30
Internal
POR
33
PWRT
Timeout 32
OSC
Timeout
Internal
RESET
Watchdog
Timer
RESET
31
34 34
I/O Pins
TABLE 10-4: RESET, WATCHDOG TIMER, OSCILLATOR START-UP TIMER AND POWER-UP
TIMER REQUIREMENTS
Parameter Sym Characteristic Min Typ† Max Units Conditions
No.
30 TmcL MCLR Pulse Width (low) 2000 — — ns -40° to +85°C
31 Twdt Watchdog Timer Time-out Period 7* 18 33* ms VDD = 5.0V, -40° to +85°C
(No Prescaler)
32 Tost Oscillation Start-up Timer Period — 1024 TOSC — — TOSC = OSC1 period
33 Tpwrt Power-up Timer Period 28* 72 132* ms VDD = 5.0V, -40° to +85°C
34 TIOZ I/O hi-impedance from MCLR low — 2.0 µs
* These parameters are characterized but not tested.
† Data in "Typ" column is at 5.0V, 25°C unless otherwise stated. These parameters are for design guidance
only and are not tested.
RA4/T0CKI
40 41
42
TMR0
VDD/2
RL
CL CL
Pin Pin
VSS VSS
RL = 464Ω
CL = 50 pF for all pins except OSC2
15 pF for OSC2 output
XXXXXXXXXXXXXXXXX PIC16C558
XXXXXXXXXXXXXXXXX -04I / P456
AABBCDE 9823 CBA
XXXXXXXX 16C558
XXXXXXXX /JW
AABBCDE 9801 CBA
XXXXXXXXXXX PIC16C558
XXXXXXXXXXX -04I / 218
AABBCDE 9851 CBP
W2 D
n 1
W1
E1
A
A1
R
c L
A2
eB B1
B p
n 1 α
E1
A1
R
c L
A2
B1
β
B p
eB
E1
p
E
2
B n 1
X
α
45 °
L
R2
c
A
A1
R1
φ
β L1 A2
E1
E
p
B 2
n 1
α
L
R2
c
A
A1
R1
φ
L1 A2
β
From: Name
Company
Address
City / State / ZIP / Country
Telephone: (_______) _________ - _________ FAX: (______) _________ - _________
Application (optional):
Would you like a reply? Y N
Questions:
2. How does this document meet your hardware and software development needs?
3. Do you find the organization of this data sheet easy to follow? If not, why?
4. What additions to the data sheet do you think would enhance the structure and subject?
5. What deletions from the data sheet could be made without affecting the overall usefulness?
8. How would you improve our software, systems, and silicon products?
Package: P = PDIP
SO = SOIC (Gull Wing, 300 mil body)
SS = SSOP (209 mil)
JW* = Windowed CERDIP Examples:
f) PIC16C554 - 04/P 301 =
Temperature - = 0˚C to +70˚C Commercial temp., PDIP pack-
Range: I = –40˚C to +85˚C age, 4 MHz, normal VDD limits,
E = –40˚C to +125˚C QTP pattern #301.
g) PIC16LC558- 04I/SO =
Industrial temp., SOIC pack-
Frequency 04 = 200kHz (LP osc) age, 200kHz, extended VDD
Range: 04 = 4 MHz (XT and RC osc) limits.
20 = 20 MHz (HS osc)
* JW Devices are UV erasable and can be programmed to any device configuration. JW Devices meet the electrical requirement of
each oscillator type (including LC devices).
Please specify which device, revision of silicon and Data Sheet (include Literature #) you are using.
For latest version information and upgrade kits for Microchip Development Tools, please call 1-800-755-2345 or 1-602-786-7302.
• The PICmicro family meets the specifications contained in the Microchip Data Sheet.
• Microchip believes that its family of PICmicro microcontrollers is one of the most secure products 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 knowl-
edge, require using the PICmicro microcontroller in a manner outside the operating specifications contained in the data sheet.
The person doing so may be 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 product.
If you have any further questions about this matter, please contact the local sales office nearest to you.
01/18/02