PIC16LF84-04/SO Microchip Technology, PIC16LF84-04/SO Datasheet

IC MCU FLASH 1KX14 EE 18SOIC

PIC16LF84-04/SO

Manufacturer Part Number
PIC16LF84-04/SO
Description
IC MCU FLASH 1KX14 EE 18SOIC
Manufacturer
Microchip Technology
Series
PIC® 16Fr
Datasheets

Specifications of PIC16LF84-04/SO

Core Size
8-Bit
Program Memory Size
1.75KB (1K x 14)
Core Processor
PIC
Speed
4MHz
Peripherals
POR, WDT
Number Of I /o
13
Program Memory Type
FLASH
Eeprom Size
64 x 8
Ram Size
68 x 8
Voltage - Supply (vcc/vdd)
2 V ~ 6 V
Oscillator Type
External
Operating Temperature
0°C ~ 70°C
Package / Case
18-SOIC (7.5mm Width)
Controller Family/series
PIC16LF
No. Of I/o's
13
Eeprom Memory Size
64Byte
Ram Memory Size
68Byte
Cpu Speed
4MHz
No. Of Timers
1
Lead Free Status / RoHS Status
Lead free / RoHS Compliant
Data Converters
-
Connectivity
-
Lead Free Status / RoHS Status
Lead free / RoHS Compliant, Lead free / RoHS Compliant
Other names
PIC16LC84A-04/SO

Available stocks

Company
Part Number
Manufacturer
Quantity
Price
Part Number:
PIC16LF84-04/SO
Manufacturer:
ON
Quantity:
34 000
Devices Included in this Data Sheet:
• PIC16F83
• PIC16F84
• PIC16CR83
• PIC16CR84
• Extended voltage range devices available
High Performance RISC CPU Features:
• Only 35 single word instructions to learn
• All instructions single cycle except for program
• Operating speed: DC - 10 MHz clock input
• 14-bit wide instructions
• 8-bit wide data path
• 15 special function hardware registers
• Eight-level deep hardware stack
• Direct, indirect and relative addressing modes
• Four interrupt sources:
• 1000 erase/write cycles Flash program memory
• 10,000,000 erase/write cycles EEPROM data mem-
• EEPROM Data Retention > 40 years
Peripheral Features:
• 13 I/O pins with individual direction control
• High current sink/source for direct LED drive
• TMR0: 8-bit timer/counter with 8-bit
PIC16F83
PIC16F84
PIC16CR83 512 ROM
PIC16CR84 1 K ROM
1998 Microchip Technology Inc.
(PIC16LF8X, PIC16LCR8X)
branches which are two-cycle
- External RB0/INT pin
- TMR0 timer overflow
- PORTB<7:4> interrupt on change
- Data EEPROM write complete
ory
- 25 mA sink max. per pin
- 20 mA source max. per pin
programmable prescaler
Device
Program
Memory
(words)
512 Flash
1 K Flash
18-pin Flash/EEPROM 8-Bit Microcontrollers
DC - 400 ns instruction cycle
Data
RAM
(bytes)
36
68
36
68
Data
EEPROM
(bytes)
64
64
64
64
Max.
Freq
(MHz)
10
10
10
10
Pin Diagrams
Special Microcontroller Features:
• In-Circuit Serial Programming (ICSP™) - via two
• Power-on Reset (POR)
• Power-up Timer (PWRT)
• Oscillator Start-up Timer (OST)
• Watchdog Timer (WDT) with its own on-chip RC
• Code-protection
• Power saving SLEEP mode
• Selectable oscillator options
CMOS Flash/EEPROM Technology:
• Low-power, high-speed technology
• Fully static design
• Wide operating voltage range:
• Low power consumption:
pins (ROM devices support only Data EEPROM
programming)
oscillator for reliable operation
- Commercial: 2.0V to 6.0V
- Industrial:
- < 2 mA typical @ 5V, 4 MHz
- 15 A typical @ 2V, 32 kHz
- < 1 A typical standby current @ 2V
RA4/T0CKI
RB0/INT
MCLR
RA2
RA3
RB1
RB2
RB3
V
SS
PIC16F8X
2.0V to 6.0V
2
3
4
5
6
7
8
9
1
PDIP, SOIC
18
17
16
15
14
13
12
11
10
DS30430C-page 1
RA1
RA0
OSC1/CLKIN
OSC2/CLKOUT
V
RB7
RB6
RB5
RB4
DD

Related parts for PIC16LF84-04/SO

PIC16LF84-04/SO Summary of contents

Page 1

... I/O pins with individual direction control • High current sink/source for direct LED drive - 25 mA sink max. per pin - 20 mA source max. per pin • TMR0: 8-bit timer/counter with 8-bit programmable prescaler 1998 Microchip Technology Inc. PIC16F8X Pin Diagrams RA2 RA3 RA4/T0CKI ...

Page 2

... However, we realize that we may have missed a few things. If you find any information that is missing or appears in error, please use the reader response form in the back of this data sheet to inform us. We appreciate your assistance in making this a better document. DS30430C-page 2 1998 Microchip Technology Inc. ...

Page 3

... This is also useful for remote applications where the code may need to be updated (such as rate information). 1998 Microchip Technology Inc. PIC16F8X Table 1-1 lists the features of the PIC16F8X. A simpli- fied block diagram of the PIC16F8X is shown in Figure 3-1 ...

Page 4

... All PIC16F8X Family devices use serial programming with clock pin RB6 and data pin RB7. DS30430C-page 4 PIC16F83 PIC16CR83 PIC16F84 512 — 1K — — — — 512 — TMR0 TMR0 TMR0 2.0-6.0 2.0-6.0 2.0-6.0 18-pin DIP, 18-pin DIP, 18-pin DIP, SOIC SOIC SOIC PIC16CR84 10 — — TMR0 4 13 2.0-6.0 18-pin DIP, SOIC 1998 Microchip Technology Inc. ...

Page 5

... PIC16F84. These devices have Flash program memory and operate over the standard voltage range PIC16LF84. These devices have Flash program memory and operate over an extended voltage range PIC16CR83. These devices have ROM program memory and operate over the standard voltage range ...

Page 6

... PIC16F8X NOTES: DS30430C-page 6 1998 Microchip Technology Inc. ...

Page 7

... This symmetrical nature and lack of ‘special optimal situations’ make programming with the PIC16CXX simple yet efficient. In addition, the learning curve is reduced significantly. 1998 Microchip Technology Inc. PIC16F8X DS30430C-page 7 ...

Page 8

... Data Bus 8 RAM File Registers PIC16F83/CR83 PIC16F84/CR84 RAM Addr Addr Mux 7 Indirect Direct Addr Addr FSR reg STATUS reg 8 MUX ALU W reg EEPROM Data Memory EEPROM EEDATA Data Memory EEADR TMR0 RA4/T0CKI I/O Ports 8 RA3:RA0 RB7:RB1 RB0/INT 1998 Microchip Technology Inc. ...

Page 9

... Note 1: This buffer is a Schmitt Trigger input when configured as the external interrupt. 2: This buffer is a Schmitt Trigger input when used in serial programming mode. 3: This buffer is a Schmitt Trigger input when configured in RC oscillator mode and a CMOS input otherwise. 1998 Microchip Technology Inc. Buffer Description ...

Page 10

... Q2, Q3, and Q4 cycles. Data memory is read during Q2 (operand read) and written during Q4 (destination write PC+1 Fetch INST (PC+1) Execute INST (PC) Execute 1 Fetch 2 Execute 2 Fetch 3 Execute 3 Fetch Internal phase clock PC+2 Fetch INST (PC+2) Execute INST (PC+1) Flush Fetch SUB_1 Execute SUB_1 1998 Microchip Technology Inc. ...

Page 11

... For example, for the PIC16F84 locations 20h, 420h, 820h, C20h, 1020h, 1420h, 1820h, and 1C20h will be the same instruction. The reset vector is at 0000h and the interrupt vector is at 0004h. 1998 Microchip Technology Inc. FIGURE 4-1: CALL, RETURN RETFIE, RETLW Peripheral Interrupt Vector ...

Page 12

... The special function registers can be classified into two sets, core and peripheral. Those associated with the core functions are described in this section. Those related to the operation of the peripheral features are described in the section for that specific feature. 1998 Microchip Technology Inc. ...

Page 13

... Mapped Purpose (accesses) registers in Bank 0 (SRAM) 2Fh 30h 7Fh Bank 0 Bank 1 Unimplemented data memory location; read as ’0’. Note 1: Not a physical register. 1998 Microchip Technology Inc. FIGURE 4-2: File Address File Address (1) 80h 00h Indirect addr. 81h 01h 82h 02h 83h ...

Page 14

... PS1 PS0 0000 0000 0000 0000 DC C 0001 1xxx 000q quuu xxxx xxxx uuuu uuuu ---1 1111 ---1 1111 1111 1111 1111 1111 ---- ---- ---- ---- WR RD ---0 x000 ---0 q000 ---- ---- ---- ---- ---0 0000 ---0 0000 INTF RBIF 0000 000x 0000 000u 1998 Microchip Technology Inc. ...

Page 15

... For rotate (RRF, RLF) instructions, this bit is loaded with either the high or low order bit of the source register. 1998 Microchip Technology Inc. Only the BCF, BSF, SWAPF and MOVWF instructions should be used to alter the STATUS register (Table 9-2) because these instructions do not affect any status bit. Note 1: The IRP and RP1 bits (STATUS< ...

Page 16

... Note: When the prescaler is assigned to the WDT (PSA = ’1’), TMR0 has a 1:1 prescaler assignment. R/W-1 R/W-1 R/W-1 R/W-1 PSA PS2 PS1 PS0 128 R = Readable bit W = Writable bit bit0 U = Unimplemented bit, read as ‘0’ Value at POR reset 1998 Microchip Technology Inc. ...

Page 17

... RBIF: RB Port Change Interrupt Flag bit 1 = When at least one of the RB7:RB4 pins changed state (must be cleared in software None of the RB7:RB4 pins have changed state 1998 Microchip Technology Inc. Note: Interrupt flag bits get set when an interrupt condition occurs regardless of the state of its corresponding enable bit or the global enable bit, GIE (INTCON< ...

Page 18

... The tenth push overwrites the second push (and so on). If the stack is effectively popped nine times, the PC value is the same as the value from the first pop. Note: There are no status bits to indicate stack overflow or stack underflow conditions. 1998 Microchip Technology Inc. ...

Page 19

... Bank 0 Note 1: PIC16F83 and PIC16CR83 devices. 2: PIC16F84 and PIC16CR84 devices 3: For memory map detail see Figure 4-1. 1998 Microchip Technology Inc. A simple program to clear RAM locations 20h-2Fh using indirect addressing is shown in Example 4-2. EXAMPLE 4-2: movlw movwf NEXT clrf ...

Page 20

... PIC16F8X NOTES: DS30430C-page 20 1998 Microchip Technology Inc. ...

Page 21

... Port Q CK Data Latch TRIS Q CK TRIS Latch TTL input buffer RD TRIS PORT Note: I/O pins have protection diodes 1998 Microchip Technology Inc. EXAMPLE 5-1: CLRF PORTA BSF STATUS, RP0 MOVLW 0x0F MOVWF TRISA FIGURE 5-2: Data bus WR PORT WR TRIS PORT N ...

Page 22

... Input/output or external clock input for TMR0. Output is open drain type. Bit 5 Bit 4 Bit 3 Bit 2 — RA4/T0CKI RA3 RA2 — TRISA4 TRISA3 TRISA2 TRISA1 Value on Value on all Bit 1 Bit 0 Power-on other resets Reset RA1 RA0 ---x xxxx ---u uuuu TRISA0 ---1 1111 ---1 1111 1998 Microchip Technology Inc. ...

Page 23

... Note 1: TRISB = ’1’ enables weak pull-up (if RBPU = ’0’ in the OPTION_REG register). 2: I/O pins have diode protection 1998 Microchip Technology Inc. This interrupt can wake the device from SLEEP. The user, in the interrupt service routine, can clear the interrupt in the following manner: a) Read (or write) PORTB ...

Page 24

... RB4 RB3 RB2 TRISB4 TRISB3 TRISB2 TRISB1 T0CS T0SE PSA PS2 Value on Value on all Bit 1 Bit 0 Power-on other resets Reset RB1 RB0/INT xxxx xxxx uuuu uuuu TRISB0 1111 1111 1111 1111 1111 1111 1111 1111 PS1 PS0 1998 Microchip Technology Inc. ...

Page 25

... PORTB RB7:RB0 Instruction executed MOVWF PORTB write to PORTB 1998 Microchip Technology Inc. 5.3.2 SUCCESSIVE OPERATIONS ON I/O PORTS The actual write to an I/O port happens at the end of an instruction cycle, whereas for reading, the data must be valid at the beginning of the instruction cycle (Figure 5-5) ...

Page 26

... PIC16F8X NOTES: DS30430C-page 26 1998 Microchip Technology Inc. ...

Page 27

... T0 TMR0 T0+1 Instruction Executed 1998 Microchip Technology Inc. edge select bit, T0SE (OPTION_REG<4>). Clearing bit T0SE selects the rising edge. Restrictions on the exter- nal clock input are discussed in detail in Section 6.2. The prescaler is shared between the Timer0 Module and the Watchdog Timer. The prescaler assignment is ...

Page 28

... NT0 executed 00h 1 (2) Interrupt Latency Inst (PC+1) Dummy cycle Inst (PC) PC+4 PC+5 PC+6 MOVF TMR0,W NT0+1 Read TMR0 Read TMR0 reads NT0 reads NT0 + 01h 02h 0004h 0005h Inst (0004h) Inst (0005h) Dummy cycle Inst (0004h) 1998 Microchip Technology Inc. ...

Page 29

... Refer to parameters 40, 41 and 42 in the AC Electrical Specifications of the desired device. 1998 Microchip Technology Inc. 6.2.2 TMR0 INCREMENT DELAY Since the prescaler output is synchronized with the internal clocks, there is a small delay from the time the ...

Page 30

... Timer PSA WDT Enable bit Note: T0CS, T0SE, PSA, PS2:PS0 are bits in the OPTION_REG register. DS30430C-page SYNC Cycles PSA 8-bit Prescaler 1MUX PS2:PS0 PSA WDT time-out (Note 4Tosc max. Data Bus 8 TMR0 register Set bit T0IF on overflow 1998 Microchip Technology Inc. ...

Page 31

... OPTION_ 81h RBPU INTEDG T0CS REG 85h TRISA — — Legend unknown unchanged unimplemented read as ’0’. Shaded cells are not associated with Timer0. 1998 Microchip Technology Inc. EXAMPLE 6-1: BCF STATUS, RP0 CLRF TMR0 BSF STATUS, RP0 CLRWDT sequence MOVLW b’ ...

Page 32

... PIC16F8X NOTES: DS30430C-page 32 1998 Microchip Technology Inc. ...

Page 33

... Initiates an EEPROM read (read takes one cycle cleared in hardware. The RD bit can only be set (not cleared) in software Does not initiate an EEPROM read 1998 Microchip Technology Inc. data memory is rated for high erase/write cycles. The write time is controlled by an on-chip timer. The write- time will vary with voltage and temperature as well as from chip to chip ...

Page 34

... WREN bit is set. At the completion of the write cycle, the WR bit is cleared in hardware and the EE Write Complete Interrupt Flag bit (EEIF) is set. The user can either enable this interrupt or poll this bit. EEIF must be cleared by software. 1998 Microchip Technology Inc. ...

Page 35

... EECON1 — — 89h EECON2 EEPROM control register 2 Legend unknown unchanged unimplemented read as ’0’ value depends upon condition. Shaded cells are not used by Data EEPROM. 1998 Microchip Technology Inc. SUBWF EEDATA, W BTFSS STATUS, Z GOTO WRITE_ERR : : 7.6 Protection Against Spurious Writes There are conditions when the device may not want to write to the data EEPROM memory ...

Page 36

... PIC16F8X NOTES: DS30430C-page 36 1998 Microchip Technology Inc. ...

Page 37

... Watchdog Timer time-out or through an interrupt. Several oscillator options are provided to allow the part to fit the application. The RC oscillator option saves system cost while the LP crystal option saves power. A set of configuration bits are used to select the various options. 1998 Microchip Technology Inc. of external PIC16F8X DS30430C-page 37 ...

Page 38

... To find out how to program the PIC16C84, refer to PIC16C84 EEPROM Memory Programming Specifica- tion (DS30189). R-u R/P-u R-u R-u R-u R PWRTE WDTE FOSC1 FOSC0 R-u R-u R-u bit0 R = Readable bit P = Programmable bit - n = Value at POR reset u = unchanged 1998 Microchip Technology Inc. ...

Page 39

... HS High Speed Crystal/Resonator • RC Resistor/Capacitor 8.2.2 CRYSTAL OSCILLATOR / CERAMIC RESONATORS In XT modes a crystal or ceramic resonator is connected to the OSC1/CLKIN and OSC2/CLKOUT pins to establish oscillation (Figure 8-3). 1998 Microchip Technology Inc. R/P-u R/P PWRTE WDTE FOSC1 FOSC0 FIGURE 8-3: CRYSTAL/CERAMIC RESONATOR OPERATION ...

Page 40

... PPM 20 PPM 20 PPM 50 PPM 50 PPM 50 PPM 50 PPM resistor provides negative potentiometer biases EXTERNAL PARALLEL RESONANT CRYSTAL OSCILLATOR CIRCUIT To Other Devices PIC16FXX 74AS04 4.7k CLKIN 74AS04 10k XTAL 20 pF resistors provide 1998 Microchip Technology Inc. ...

Page 41

... The oscillator frequency, divided available on the OSC2/CLKOUT pin, and can be used for test purposes or to synchronize other logic (see Figure 3-2 for waveform). 1998 Microchip Technology Inc. FIGURE 8-7: RC OSCILLATOR MODE V DD Rext PIC16FXX ...

Page 42

... DD detect Power_on_Reset V DD OST/PWRT OST 10-bit Ripple counter OSC1/ CLKIN PWRT On-chip (1) 10-bit Ripple counter RC OSC Note 1: This is a separate oscillator from the RC oscillator of the CLKIN pin. DS30430C-page Enable PWRT See Table 8-5 Enable OST 1998 Microchip Technology Inc. Chip_Reset Q ...

Page 43

... Note 1: One or more bits in INTCON will be affected (to cause wake-up). 2: When the wake-up is due to an interrupt and the GIE bit is set, the PC is loaded with the interrupt vector (0004h). 3: Table 8-3 lists the reset value for each specific condition. 1998 Microchip Technology Inc. Program Counter 000h 000h ...

Page 44

... C in the event of an MCLR pin breakdown due to ESD or EOS. The Figure 8-11, EXTERNAL POWER-ON RESET CIRCUIT (FOR SLOW V POWER-UP MCLR PIC16FXX C power-up rate is too slow. The DD powers down. DD level on the MCLR pin will limit any current 1998 Microchip Technology Inc. ...

Page 45

... FIGURE 8-10: TIME-OUT SEQUENCE ON POWER-UP (MCLR NOT TIED MCLR INTERNAL POR PWRT TIME-OUT OST TIME-OUT INTERNAL RESET FIGURE 8-11: TIME-OUT SEQUENCE ON POWER-UP (MCLR NOT TIED MCLR INTERNAL POR PWRT TIME-OUT OST TIME-OUT INTERNAL RESET 1998 Microchip Technology Inc. PIC16F8X ): CASE PWRT T OST ): CASE PWRT T OST DS30430C-page 45 ...

Page 46

... T DD has reached its final value. In this example, the chip will reset properly if, and only if, V1 DS30430C-page 46 ): FAST PWRT T OST ): SLOW PWRT T OST time-out and T time-out will expire before V PWRT OST V min. DD 1998 Microchip Technology Inc. RISE TIME DD RISE TIME DD DD ...

Page 47

... MCLR Reset during SLEEP or interrupt 1 0 wake-up from SLEEP 1998 Microchip Technology Inc. 8.8 Reset on Brown-Out A brown-out is a condition where device power (V dips below its minimum value, but not to zero, and then recovers. The device should be reset in the event of a brown-out. ...

Page 48

... The interrupt flag bit(s) must be cleared in software before re-enabling interrupts to avoid infinite interrupt requests. Note 1: Individual interrupt flag bits are set regardless of the status corresponding mask bit or the GIE bit. Wake-up (If in SLEEP mode) Interrupt to CPU 1998 Microchip Technology Inc. of their ...

Page 49

... SLEEP. The status of the GIE bit decides whether the processor branches to the interrupt vector following wake-up. 8.9.2 TMR0 INTERRUPT An overflow (FFh 00h) in TMR0 will set flag bit T0IF (INTCON<2>). The interrupt can be enabled/disabled by setting/clearing enable bit T0IE (INTCON<5>) (Section 6.0). 1998 Microchip Technology Inc ...

Page 50

... Interrupt Service Routine ; should configure Bank as required ; ; Swap nibbles in STATUS_TEMP register ; and place result into W ; Move W into STATUS register ; (sets bank to original state) ; Swap nibbles in W_TEMP and place result in W_TEMP ; Swap nibbles in W_TEMP and place result into W 1998 Microchip Technology Inc. ...

Page 51

... Note 1: See Figure 8-1 and Figure 8-2 for operation of the PWRTE bit. 2: See Figure 8-1, Figure 8-2 and Section 8.13 for operation of the Code and Data protection bits. 1998 Microchip Technology Inc. part (see DC specs). If longer time-out periods are desired, a prescaler with a division ratio 1:128 can be assigned to the WDT under software control by writing to the OPTION_REG register ...

Page 52

... In cases where the execution of the instruction following SLEEP desirable, the user should have a NOP after the SLEEP instruction (2) OST Interrupt Latency (Note 2) Processor in SLEEP PC+2 PC Inst( Dummy cycle Inst( not 0004h 0005h Inst(0004h) Inst(0005h) Dummy cycle Inst(0004h) 1998 Microchip Technology Inc. ...

Page 53

... Only the 4 least significant bits of ID location are usable. For ROM devices, these values are submitted along with the ROM code. 1998 Microchip Technology Inc. 8.15 In-Circuit Serial Programming PIC16F8X microcontrollers programmed while in the end application circuit ...

Page 54

... PIC16F8X DS30430C-page 54 1998 Microchip Technology Inc. ...

Page 55

... Assigned to < > Register bit field In the set of i User defined term (font is courier) talics 1998 Microchip Technology Inc. PIC16F8X The instruction set is highly orthogonal and is grouped into three basic categories: • Byte-oriented operations • Bit-oriented operations • Literal and control operations ...

Page 56

... TO PD 0000 0110 0100 , 1kkk kkkk kkkk Z 1000 kkkk kkkk 00xx kkkk kkkk 0000 0000 1001 01xx kkkk kkkk 0000 0000 1000 TO PD 0000 0110 0011 , C,DC,Z 110x kkkk kkkk Z 1010 kkkk kkkk 1998 Microchip Technology Inc. ...

Page 57

... Decode Read Process register ’f’ Example ADDWF FSR, 0 Before Instruction W = 0x17 FSR = 0xC2 After Instruction W = 0xD9 FSR = 0xC2 1998 Microchip Technology Inc. ANDLW Syntax: Operands: Operation: Status Affected: Encoding: kkkk kkkk Description: . Words: Cycles Cycle Activity: Write to data W Example ANDWF ...

Page 58

... No-Operat register ’f’ data ion (2nd Cycle No-Operati No-Opera No-Operat No-Operat on tion ion ion HERE BTFSC FLAG,1 FALSE GOTO PROCESS_CODE • TRUE • • Before Instruction PC = address HERE After Instruction if FLAG<1> address TRUE if FLAG<1>= address FALSE 1998 Microchip Technology Inc. ...

Page 59

... FLAG,1 FALSE GOTO PROCESS_CODE • TRUE • • Before Instruction PC = address HERE After Instruction if FLAG<1> address FALSE if FLAG<1> address TRUE 1998 Microchip Technology Inc. CALL Syntax: Operands: Operation: Status Affected: bfff ffff Encoding: Description: instruction. CY Words Cycles: Process No-Operat Q Cycle Activity: ...

Page 60

... CLRWDT instruction resets the Watch- dog Timer. It also resets the prescaler of the WDT. Status bits TO and PD are set Decode No-Opera Process Clear tion data WDT Counter CLRWDT Before Instruction WDT counter = ? After Instruction WDT counter = 0x00 WDT prescaler 1998 Microchip Technology Inc. ...

Page 61

... Q Cycle Activity Decode Read Process register ’f’ Example DECF CNT, 1 Before Instruction CNT = Z = After Instruction CNT = Z = 1998 Microchip Technology Inc. DECFSZ Syntax: Operands: Operation: Status Affected: ffff Encoding: Description Words: Write to data destination Cycles: Q Cycle Activity: 0x13 If Skip: 0x13 0xEC ...

Page 62

... The contents of register ’f’ are incre- mented. If ’d’ the result is placed in the W register. If ’d’ the result is placed back in register ’f’ Decode Read Process Write to register data destination ’f’ INCF CNT, 1 Before Instruction CNT = 0xFF After Instruction CNT = 0x00 1998 Microchip Technology Inc. ...

Page 63

... Before Instruction PC = address HERE After Instruction CNT = CNT + 1 if CNT address CONTINUE if CNT address HERE +1 1998 Microchip Technology Inc. IORLW Syntax: Operands: Operation: Status Affected: Encoding: Description: dfff ffff Words: Cycles: Q Cycle Activity: instruc- CY Example Q3 Q4 Process Write to data ...

Page 64

... Move label ] MOVWF 127 (W) (f) None 00 0000 1fff ffff Move data from W register to register . ' Decode Read Process Write register data register ’f’ ’f’ MOVWF OPTION_REG Before Instruction OPTION = 0xFF W = 0x4F After Instruction OPTION = 0x4F W = 0x4F 1998 Microchip Technology Inc. ...

Page 65

... PIC16C5X products. Since OPTION is a readable/writable register, the user can directly address it. Words: 1 Cycles: 1 Example To maintain upward compatibility with future PIC16CXX products, do not use this instruction. 1998 Microchip Technology Inc. RETFIE Syntax: Operands: Operation: Status Affected: 0xx0 0000 Encoding: Description ...

Page 66

... POPed and the top of the stack (TOS) is loaded into the program counter. This is a two cycle instruction Decode No-Opera No-Opera Pop from tion tion the Stack No-Opera No-Opera No-Opera No-Operat tion tion tion ion RETURN After Interrupt PC = TOS 1998 Microchip Technology Inc. ...

Page 67

... Q1 Q2 Decode Read register ’f’ Example RLF REG1,0 Before Instruction REG1 = C = After Instruction REG1 = 1998 Microchip Technology Inc. RRF f,d Syntax: Operands: Operation: Status Affected: Encoding: dfff ffff Description: Words: Cycles Cycle Activity: Process Write to data destination Example 1110 0110 ...

Page 68

... The result is placed in the W register Decode Read Process Write to W literal ’k’ data SUBLW 0x02 Before Instruction After Instruction result is positive Before Instruction After Instruction result is zero Before Instruction After Instruction W = 0xFF result is negative 1998 Microchip Technology Inc. ...

Page 69

... Before Instruction REG1 = After Instruction REG1 = 0xFF result is negative 1998 Microchip Technology Inc. SWAPF Syntax: Operands: Operation: Status Affected: dfff ffff Encoding: Description: Words: Cycles Cycle Activity: Process Write to data destination Example TRIS Syntax: Operands: Operation: Status Affected: None Encoding: Description: ...

Page 70

... Exclusive OR the contents of the W register with register 'f the result is stored in the W register the result is stored back in register 'f Decode Read Process Write to register data destination ’f’ XORWF REG 1 Before Instruction REG = 0xAF W = 0xB5 After Instruction REG = 0x1A W = 0xB5 1998 Microchip Technology Inc. ...

Page 71

... Microsoft Windows 3.x environ- ment were chosen to best make these features avail- able to you, the end user compliant version of PICMASTER is available for European Union (EU) countries. 1998 Microchip Technology Inc. 10.3 ICEPIC: Low-Cost PICmicro™ In-Circuit Emulator ICEPIC is a low-cost in-circuit emulator solution for the Microchip PIC12CXXX, PIC16C5X and PIC16CXXX families of 8-bit OTP microcontrollers ...

Page 72

... MPASM offers full featured Macro capabilities, condi- tional assembly, and several source and listing formats. It generates various object code formats to support Microchip's development tools as well as third party programmers. MPASM allows full symbolic debugging PICMASTER, Microchip’s Universal Emulator System. 1998 Microchip Technology Inc. from ...

Page 73

... TECH-MP, Edition for imple- menting more complex systems. Both versions include Microchip’s fuzzy LAB stration board for hands-on experience with fuzzy logic systems implementation. 1998 Microchip Technology Inc. 10.14 MP-DriveWay Generator MP-DriveWay is an easy-to-use Windows-based Appli- cation Code Generator. With MP-DriveWay you can ...

Page 74

PIC12C5XX PIC14000 PIC16C5X PICMASTER / PICMASTER-CE á á á In-Circuit Emulator ICEPIC Low-Cost In-Circuit Emulator á á MPLAB Integrated Development á á á Environment MPLAB C17 Compiler fuzzy TECH -MP Explorer/Edition Fuzzy Logic á á á Dev. Tool MP-DriveWay Applications ...

Page 75

... 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. 1998 Microchip Technology Inc. PIC16F83/84 .......................................................................................................-0.3 to +14V (except V and MCLR) ...

Page 76

... Do not use in HS mode I : 1.0 A typ. at 4.5V WDT dis PD Freq: 10 MHz max not use in LP mode I PD Freq: 200 kHz max. PIC16LF84-04 PIC16LF83-04 : 2.0V to 6.0V : 4.5 mA max. at 5.5V : 7.0 A max WDT dis : 2.0V to 6.0V : 4.5 mA max. at 5.5V : 7.0 A max WDT dis : 2 ...

Page 77

... SLEEP mode, with all I/O pins in hi-impedance state and tied For RC osc configuration, current through Rext is not included. The current through the resistor can be esti- mated by the formula 1998 Microchip Technology Inc. PIC16F83/84 PIC16F84, PIC16F83 (Commercial, Industrial) Standard Operating Conditions (unless otherwise stated) Operating temperature 0 C -40 C Min Typ† ...

Page 78

... SLEEP mode, with all I/O pins in hi-impedance state and tied For RC osc configuration, current through Rext is not included. The current through the resistor can be estimated by the formula DS30430C-page 78 PIC16F83/84 PIC16LF84, PIC16LF83 (Commercial, Industrial) Standard Operating Conditions (unless otherwise stated) Operating temperature 0 C -40 C Min Typ† Max Units 2.0 — ...

Page 79

... Negative current is defined as coming out of the pin. 4: The user may choose the better of the two specs. 1998 Microchip Technology Inc. PIC16F83/84 PIC16F84, PIC16F83 (Commercial, Industrial) PIC16LF84, PIC16LF83 (Commercial, Industrial) Standard Operating Conditions (unless otherwise stated) Operating temperature 0 C -40 C Operating voltage V ...

Page 80

... These parameters are characterized but not tested. † Data in “Typ” column is at 5.0V unless otherwise stated. These parameters are for design guidance only and are not tested. DS30430C-page 80 PIC16F83/84 PIC16LF84, PIC16F83 (Commercial, Industrial) Standard Operating Conditions (unless otherwise stated) Operating temperature 0 C -40 C Operating voltage V ...

Page 81

... FIGURE 11-2: LOAD CONDITIONS Load Condition Pin 464 for all pins except OSC2 for OSC2 output. 1998 Microchip Technology Inc. PIC16F83/84 T Time os,osc OSC1 ost oscillator start-up timer pwrt power-up timer rbt RBx pins t0 T0CKI wdt watchdog timer P Period R Rise V Valid Z ...

Page 82

... PIC16LF8X-04 ns XT, RC osc PIC16LF8X-04 ns XT, RC osc PIC16F8X- osc PIC16F8X- osc PIC16LF8X- osc PIC16LF8X- osc PIC16F8X- osc PIC16LF8X- osc PIC16F8X- osc PIC16F8X- osc PIC16LF8X- osc PIC16LF8X- osc PIC16F8X- osc PIC16LF8X- osc PIC16F8X- osc PIC16F8X- osc PIC16LF8X- osc PIC16F8X-10 1998 Microchip Technology Inc. ...

Page 83

... These parameters are characterized but not tested. † Data in "Typ" column is at 5.0V unless otherwise stated. These parameters are for design guidance only and are not tested. § By design Note 1: Measurements are taken in RC Mode where CLKOUT output 1998 Microchip Technology Inc. PIC16F83/ ...

Page 84

... These parameters are for design guidance only and are not tested. DS30430C-page 84 PIC16F83/ Min Typ† Max Units 1000 * — — 1024T ms OSC 132 * ms — — 100 * ns 34 Conditions 2. OSC1 period OSC V = 5.0V DD 1998 Microchip Technology Inc. ...

Page 85

... Sym Characteristic No. 40 Tt0H T0CKI High Pulse Width 41 Tt0L T0CKI Low Pulse Width 42 Tt0P T0CKI Period * These parameters are characterized but not tested. C † Data in "Typ" column is at 5.0V, 25 tested. 1998 Microchip Technology Inc. PIC16F83/ Min No Prescaler 0. With Prescaler Prescaler 0.5T ...

Page 86

... PIC16F8X NOTES: DS30430C-page 86 PIC16F83/84 1998 Microchip Technology Inc. ...

Page 87

... 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. 1998 Microchip Technology Inc. PIC16CR83/84 .......................................................................................................-0.3 to +14V (except V and MCLR) ...

Page 88

... Freq: 10 MHz max not use in LP mode I PD Freq: 200 kHz max. PIC16LCR84-04 PIC16LCR83-04 : 2.0V to 6.0V : 4.5 mA max max WDT dis : 2.0V to 6.0V : 4.5 mA max max WDT dis : 2. max kHz, 2. max WDT dis 1998 Microchip Technology Inc. ...

Page 89

... SLEEP mode, with all I/O pins in hi-impedance state and tied For RC osc configuration, current through Rext is not included. The current through the resistor can be esti- mated by the formula 1998 Microchip Technology Inc. PIC16CR83/84 PIC16CR84, PIC16CR83 (Commercial, Industrial) Standard Operating Conditions (unless otherwise stated) Operating temperature 0 C -40 C Min Typ† ...

Page 90

... Rext in kOhm +70 C (commercial +85 C (industrial) A Conditions ( 2.0 MHz 5.5V OSC 2.0 MHz 5.5V OSC DD (During EEPROM programming kHz 2.0V, OSC DD WDT disabled = 2.0V, WDT enabled, industrial = 2.0V, WDT disabled, commercial = 2.0V, WDT disabled, industrial , T0CKI = and 1998 Microchip Technology Inc. ...

Page 91

... Higher leakage current may be measured at different input volt- ages. 3: Negative current is defined as coming out of the pin. 4: The user may choose the better of the two specs. 1998 Microchip Technology Inc. PIC16CR83/84 PIC16CR84, PIC16CR83 (Commercial, Industrial) PIC16LCR84, PIC16LCR83 (Commercial, Industrial) ...

Page 92

... Section 12.1 and Section 12.2. Min Typ† Max — — 15 — — 10M — V — 6.0 MIN — 10 20* T +70 C (commercial +85 C (industrial) A Units Conditions pF In XT, HS and LP modes when external clock is used to drive OSC1 Minimum operating MIN voltage ms 1998 Microchip Technology Inc. ...

Page 93

... FIGURE 12-2: LOAD CONDITIONS Load Condition Pin 464 for all pins except OSC2 for OSC2 output. 1998 Microchip Technology Inc. PIC16CR83/84 T Time os,osc OSC1 ost oscillator start-up timer pwrt power-up timer rbt RBx pins t0 T0CKI wdt watchdog timer P Period R Rise V Valid Z ...

Page 94

... PIC16LCR8X-04 ns XT, RC osc PIC16LCR8X-04 ns XT, RC osc PIC16CR8X- osc PIC16CR8X- osc PIC16LCR8X- osc PIC16LCR8X- osc PIC16CR8X- osc PIC16LCR8X- osc PIC16CR8X- osc PIC16CR8X- osc PIC16LCR8X- osc PIC16LCR8X- osc PIC16CR8X- osc PIC16LCR8X- osc PIC16CR8X- osc PIC16CR8X- osc PIC16LCR8X- osc PIC16CR8X-10 1998 Microchip Technology Inc. ...

Page 95

... These parameters are characterized but not tested. † Data in "Typ" column is at 5.0V unless otherwise stated. These parameters are for design guidance only and are not tested. § By design Note 1: Measurements are taken in RC Mode where CLKOUT output 1998 Microchip Technology Inc. PIC16CR83/ ...

Page 96

... These parameters are for design guidance only and are not tested. DS30430C-page 96 PIC16CR83/ Min Typ† Max Units 1000 * — — 1024T ms OSC 132 * ms — — 100 * ns 34 Conditions 2. OSC1 period OSC V = 5.0V DD 1998 Microchip Technology Inc. ...

Page 97

... Characteristic No. 40 Tt0H T0CKI High Pulse Width 41 Tt0L T0CKI Low Pulse Width 42 Tt0P T0CKI Period * These parameters are characterized but not tested. C † Data in "Typ" column is at 5.0V, 25 tested. 1998 Microchip Technology Inc. PIC16CR83/ Min No Prescaler 0. With Prescaler Prescaler 0. With Prescaler ...

Page 98

... PIC16F8X NOTES: DS30430C-page 98 PIC16CR83/84 1998 Microchip Technology Inc. ...

Page 99

... Measured on DIP packages. The percentage variation indicated here is part-to-part variation due to normal process distribution. The variation indicated is 3 standard deviation from average value for full V 1998 Microchip Technology Inc. is standard deviation. Frequency normalized to +25 C Rext 10 k Cext = 100 ...

Page 100

... FIGURE 13-2: TYPICAL RC OSCILLATOR FREQUENCY vs. V 5.5 5.0 4.5 4.0 3.5 3.0 2.5 2.0 1.5 1.0 0.5 0.0 2.0 DS30430C-page 100 , C DD Measured on DIP Packages 25° 10k R = 100k 2.5 3.0 3.5 4.0 4.5 5.0 5.5 V (Volts EXT P 6.0 1998 Microchip Technology Inc. ...

Page 101

... FIGURE 13-4: TYPICAL RC OSCILLATOR FREQUENCY vs. V 0.6 0.5 0.4 0.3 0.2 0.1 0.0 2.0 1998 Microchip Technology Inc EXT Measured on DIP Packages 25° 10k R = 100k 2.5 3.0 3.5 4.0 4.5 5.0 5.5 V (Volts) ...

Page 102

... Note: These input pins have TTL input buffers. DS30430C-page 102 , FIGURE 13-6: TYPICAL 2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5 6.0 3.5 4.0 4.5 V (Volts WATCHDOG ENABLED (Volts 5.0 5.5 6.0 1998 Microchip Technology Inc. ...

Page 103

... OF MCLR, T0CKI AND OSC1 (IN RC MODE) vs 5.0 4.5 4.0 3.5 3.0 2.5 2.0 1.5 1.0 0.5 0.0 2.0 2.5 3.0 Note: These input pins have Schmitt Trigger input buffers. 1998 Microchip Technology Inc. DD 3.5 4.0 4.5 5.0 V (Volts 3.5 4.0 4.5 5.0 V (Volts) DD PIC16F8X 5 ...

Page 104

... PIC16F8X FIGURE 13-10: TYPICAL I vs. FREQUENCY (RC MODE @20PF 10000 1000 6.0V 5.5V 5.0V 4.5V 4.0V 3.5V 100 3.0V 2.5V 2.0V 10 100000 DS30430C-page 104 TYPICAL IDD vs FREQ (RC MODE @20pF) 1000000 FREQ (Hz) 10000000 1998 Microchip Technology Inc. ...

Page 105

... FIGURE 13-11: TYPICAL I vs. FREQUENCY (RC MODE @100PF 10000 1000 6.0V 100 5.0V 4.5V 4.0V 3.5V 3.0V 2.5V 2.0V 10 10000 1998 Microchip Technology Inc. TYPICAL IDD vs FREQ (RC MODE @100 pF) 5.5V 100000 1000000 FREQ (Hz) PIC16F8X 10000000 DS30430C-page 105 ...

Page 106

... PIC16F8X FIGURE 13-12: TYPICAL I vs. FREQUENCY (RC MODE @300PF 1000 6.0V 5.5V 100 5.0V 4.5V 4.0V 3.5V 3.0V 2.5V 2.0V 10 10000 DS30430C-page 106 TYPICAL IDD vs FREQ (RC MODE @300pF) 100000 FREQ (Hz) 1000000 1998 Microchip Technology Inc. ...

Page 107

... FIGURE 13-13: WDT TIMER TIME-OUT PERIOD vs Typ + 3.0 4.0 5.0 2.0 V (Volts) DD 1998 Microchip Technology Inc. FIGURE 13-14: TRANSCONDUCTANCE (gm OSCILLATOR vs. V 9000 8000 7000 6000 5000 4000 3000 2000 100 0 6.0 2.0 PIC16F8X DD Typ +25 C 3.0 4.0 5.0 6.0 V (Volts) DD DS30430C-page 107 ...

Page 108

... PIC16F8X FIGURE 13-15: TRANSCONDUCTANCE (gm OSCILLATOR vs Typ + 3.0 4.0 5.0 2.0 V (Volts) DD DS30430C-page 108 FIGURE 13-16: TRANSCONDUCTANCE (gm OSCILLATOR vs 2500 2000 1500 1000 500 0 2.0 3.0 6.0 DD Typ +25 C 4.0 5.0 6.0 V (Volts) DD 1998 Microchip Technology Inc. ...

Page 109

... V (Volts) OH FIGURE 13-18 –5 –10 –15 –20 Typ +25 C –25 –30 –35 –40 1.5 2.0 2.5 3.0 3.5 4.0 V (Volts) OH 1998 Microchip Technology Inc. FIGURE 13-19 2.5 3.0 0 0.0 FIGURE 13-20 4.5 5.0 0 0.0 PIC16F8X vs. V ...

Page 110

... All capacitance values are typical part to part variation of 25% (three standard deviations) should be taken into account. DS30430C-page 110 3.0 3.5 4.0 4.5 5.0 V (Volts) DD Typical Capacitance (pF) 18L PDIP 5.0 5.0 17.0 4.0 4.3 3.2 5.5 6.0 6.5 18L SOIC 4.3 4.3 17.0 3.5 3.5 2.8 1998 Microchip Technology Inc. ...

Page 111

... For OTP marking beyond this, certain price adders apply. Please check with your Microchip Sales Office. For QTP devices, any special marking adders are included in QTP price. 1998 Microchip Technology Inc. PIC16F8X Example ...

Page 112

... Microchip Technology Inc. ...

Page 113

... Dimensions “D” and “E” do not include mold flash or protrusions. Mold flash or protrusions shall not exceed 0.010” (0.254 mm) per side or 0.020” (0.508 mm) more than dimensions “D” or “E.” 1998 Microchip Technology Inc ...

Page 114

... PIC16F8X NOTES: DS30430C-page 114 1998 Microchip Technology Inc. ...

Page 115

... V , RB6 (clock) and RB7 (data in/out). 1998 Microchip Technology Inc. APPENDIX B: CODE COMPATIBILITY To convert code written for PIC16C5X to PIC16F8X, the user should take the following steps: 1. Remove any program memory page select operations (PA2, PA1, PA0 bits) for CALL, GOTO. ...

Page 116

... Option register name has been changed from OPTION to OPTION_REG. This is consistant with other data sheets and header files, and resolves the conflict between the OPTION com- mand and OPTION register. 3. Errors have been fixed. 4. The appendix containing PIC16/17 microcon- trollers has been removed. 1998 Microchip Technology Inc. ...

Page 117

... RETFIE instruction). PIC16F8X PIC16F84 PWRTE RAM = 68 bytes MCLR pulse width (low) = 1000ns; 2. (typ @ 2V) < (max @ 4V, WDT disabled) PD =14 A (PIC16F84 (PIC16LF84) N/A TTL/ST* (* This buffer is a Schmitt Trigger input when configured as the exter- nal interrupt.) N bits 100k EXT N/A DS30430C-page 117 ...

Page 118

... PIC16F8X NOTES: DS30430C-page 118 1998 Microchip Technology Inc. ...

Page 119

... I/O Programming Considerations ....................................... 25 ICEPIC Low-Cost PIC16CXXX In-Circuit Emulator ........... 69 In-Circuit Serial Programming ...................................... 37, 52 INDF ................................................................................... 42 Instruction Format .............................................................. 53 Instruction Set ADDLW ...................................................................... 55 ADDWF ...................................................................... 55 ANDLW ...................................................................... 55 ANDWF ...................................................................... 55 BCF ............................................................................ 56 BSF ............................................................................ 56 BTFSC ....................................................................... 56 BTFSS ....................................................................... 57 1998 Microchip Technology Inc. PIC16F8X CALL .......................................................................... 57 CLRF ......................................................................... 58 CLRW ........................................................................ 58 CLRWDT ................................................................... 58 COMF ........................................................................ 59 DECF ......................................................................... 59 DECFSZ .................................................................... 59 GOTO ........................................................................ 60 INCF .......................................................................... 60 INCFSZ ...................................................................... 61 IORLW ....................................................................... 61 IORWF ....................................................................... 62 MOVF ...

Page 120

... TMR0 Interrupt ........................................................... 48 TMR0 with External Clock .......................................... 29 Timing Diagrams Time-out Sequence .................................................... 44 Timing Diagrams and Specifications ............................ 80, 92 TRISA ................................................................................. 21 TRISB ........................................................................... 23 ........................................................................................ 42 Wake-up from SLEEP .................................................. 42, 51 Watchdog Timer (WDT) ................................... 37, 41, 42, 50 WDT ................................................................................... 42 Period ......................................................................... 50 DS30430C-page 120 Programming Considerations .................................... 50 Time-out .................................................................... ...................................................................................... 46 Z Zero bit ................................................................................. 7 1998 Microchip Technology Inc. ...

Page 121

... Trademarks: The Microchip name, logo, PIC, PICSTART, PICMASTER and PRO MATE are registered trademarks of Microchip Technology Incorporated in the U.S.A. and other countries. PICmicro, Flex ROM, MPLAB and fuzzy LAB are trademarks and SQTP is a service mark of Microchip in the U ...

Page 122

... Is there any incorrect or misleading information (what and where)? 7. How would you improve this document? 8. How would you improve our software, systems, and silicon products? DS30430C-page 122 Total Pages Sent FAX: (______) _________ - _________ N Literature Number: DS30430C 1998 Microchip Technology Inc. ...

Page 123

... XXX Examples: Package Pattern a) PIC16F84 -04/P 301 = Commercial temp., PDIP package, 4 MHz, normal V DD (3) b) PIC16LF84 - 04I/SO = Industrial temp., (3) SOIC package, 200 kHz, Extended V (3) limits. (3) c) PIC16CR84 - 10I/P = ROM program (3) memory, Industrial temp., PDIP package, (3) 10MHz, normal V Note blank ...

Page 124

... Serialized Quick Turn Programming (SQTP service mark of Microchip Technology Incorporated in the U.S.A. All other trademarks mentioned herein are property of their respective companies. © 2002, Microchip Technology Incorporated, Printed in the U.S.A., All Rights Reserved. Printed on recycled paper. Microchip received QS-9000 quality system ...

Page 125

... Korea Microchip Technology Korea 168-1, Youngbo Bldg. 3 Floor Samsung-Dong, Kangnam-Ku Seoul, Korea 135-882 Tel: 82-2-554-7200 Fax: 82-2-558-5934 Singapore Microchip Technology Singapore Pte Ltd. 200 Middle Road #07-02 Prime Centre Singapore, 188980 Tel: 65-334-8870 Fax: 65-334-8850 Taiwan Microchip Technology Taiwan 11F-3, No. 207 ...

Related keywords