AC/DC http://www.microchip.comERRATA PIC16C7X (R) PIC16C7X A/D CMOS - PIC16C710 PIC16C71 PIC16C711 PIC16C72 PIC16C73 PIC16C73A PIC16C74 PIC16C74A CMOSEPROM (2.5V6.0V) 25mA/ 25mA - 2mA5V,4MHz - 15 Atyp. 3V,32kHz - Atyp. PIC16C7X PIC16C7X RISCCPU 35 (200ns) DC20MHz DC200ns 8 ()()( ) (POR) (PWRT) (OST) RC (WDT) SLEEP 8 A/D 08 8 / 116 / / 28 8 / PWM 16 12.5ns 16 200nsPWM 10 SPITM I2CTM (SSP) / (USART/SCI) RDWRCS 8 PSP BOR PIC16C7X 710 71 711 72 73 73A 74 74A (EPROM)x14bit 512 1K 1K 2K 4K 4K 4K 4K (Bytes)x8bit 36 36 68 128 192 192 192 192 I/O 13 13 13 22 22 22 33 33 - - - - - - Yes Yes Capture/Compare/PWM - - - 1 2 2 2 2 Timer 1 1 1 3 3 3 3 3 A/D 4 4 4 5 5 5 8 8 - - - SPI/I C Yes Yes Yes Yes Yes Yes Yes Yes Yes - Yes Yes - Yes - Yes 4 4 4 8 11 11 12 12 2 2 2 2 2 SPI/I C SPI/I C SPI/I C SPI/I C USART USART USART USART I2CPhillipsCorporationSPIMotorolaCorporation (c) 1996 Microchip Technology Inc. DS30390B-J00 - page 1 AC/DC http://www.microchip.comERRATA PIC16C7X SSOP PDIP, SOIC, Windowed CERDIP RA2/AN2 *1 RA4/T0CKI 3 MCLR/VPP 4 VSS 5 RB0/INT 6 RB1 RB2 7 8 RB3 9 18 RA1/AN1 RA2/AN2 *1 20 RA1/AN1 17 RA0/AN0 RA3/AN3/VREF 2 19 RA0/AN0 16 OSC1/CLKIN RA4/T0CKI 3 18 OSC1/CLKIN 15 OSC2/CLKOUT MCLR/VPP 4 17 OSC2/CLKOUT 14 VDD VSS 5 13 RB7 VSS 6 12 11 RB6 RB5 RB0/INT RB1 7 8 10 RB4 RB2 RB3 PIC16C710 2 PIC16C710 RA3/AN3/VREF 16 VDD 15 VDD 14 13 RB7 RB6 9 12 RB5 10 11 RB4 PDIP, SOIC, Windowed CERDIP RA2/AN2 *1 2 RA4/T0CKI 3 MCLR/VPP 4 VSS 5 RB0/INT 6 RB1 RB2 7 8 RB3 9 PIC16C71 RA3/AN3/VREF 18 RA1/AN1 17 RA0/AN0 16 OSC1/CLKIN 15 OSC2/CLKOUT 14 VDD 13 RB7 12 11 RB6 RB5 10 RB4 SSOP PDIP, SOIC, Windowed CERDIP RA2/AN2 *1 RA4/T0CKI 3 MCLR/VPP 4 VSS 5 RB0/INT 6 RB1 RB2 7 8 RB3 9 18 RA1/AN1 RA2/AN2 *1 20 RA1/AN1 17 RA0/AN0 RA3/AN3/VREF 2 19 RA0/AN0 16 OSC1/CLKIN RA4/T0CKI 3 18 OSC1/CLKIN 15 OSC2/CLKOUT MCLR/VPP 4 17 OSC2/CLKOUT 14 VDD VSS 5 13 RB7 VSS 6 12 11 RB6 RB5 RB0/INT RB1 7 8 10 RB4 RB2 RB3 16 VDD 15 VDD 14 13 RB7 RB6 9 12 RB5 10 11 RB4 SDIP, SOIC, Windowed Side Brazed Ceramic MCLR/VPP PIC16C711 2 PIC16C711 RA3/AN3/VREF SSOP RB7 MCLR/VPP *1 28 RB7 27 RB6 RA0/AN0 2 27 RB6 RA1/AN1 3 26 RB5 RA1/AN1 3 26 RB5 RA2/AN2 4 25 RB4 RA2/AN2 4 25 RB4 RA3/AN3/VREF 5 24 RB3 RA3/AN3/VREF 5 24 RB3 RA4/T0CKI 6 23 RB2 RA4/T0CKI 6 23 RB2 RA5/AN4/SS VSS 7 8 22 21 RB1 RB0/INT RA5/AN4/SS VSS 7 8 22 21 RB1 RB0/INT OSC1/CLKIN 9 9 PIC16C72 28 2 PIC16C72 *1 RA0/AN0 20 VDD OSC1/CLKIN 20 VDD OSC2/CLKOUT 10 19 VSS OSC2/CLKOUT 10 19 VSS RC0/T1OSO/T1CKI 11 18 RC7 RC0/T1OSO/T1CKI 11 18 RC7 RC1/T1OSI 12 17 RC6 RC1/T1OSI 12 17 RC6 RC2/CCP1 13 16 RC5/SDO RC2/CCP1 13 16 RC5/SDO RC3/SCK/SCL 14 15 RC4/SDI/SDA RC3/SCK/SCL 14 15 RC4/SDI/SDA DS30390B-J00 - page 2 (c) 1996 Microchip Technology Inc. AC/DC http://www.microchip.comERRATA PIC16C7X MCLR/VPP 28 RB7 2 27 RB6 RA1/AN1 3 26 RB5 RA2/AN2 4 25 RB4 RA3/AN3/VREF 5 24 RB3 RA4/T0CKI 6 23 RB2 RA5/AN4/SS VSS 7 8 22 21 RB1 RB0/INT OSC1/CLKIN 9 PIC16C73 PIC16C73A *1 RA0/AN0 VDD 19 VSS 11 18 RC7/RX/DT 12 17 RC6/TX/CK RC2/CCP1 13 16 RC5/SDO RC3/SCK/SCL 14 15 RC4/SDI/SDA 10 RC0/T1OSO/T1CKI RC1/T1OSI/CCP2 RC7/RX/DT RD4/PSP4 RD5/PSP5 RD6/PSP6 RD7/PSP7 VSS VDD RB0/INT RB1 RB2 RB3 1 2 3 4 5 6 7 8 9 10 11 PIC16C74 33 32 31 30 29 28 27 26 25 24 23 NC RC0/T1OSO/T1CK OSC2/CLKOUT OSC1/CLKIN VSS VDD RE2/CS/AN7 RE1/WR/AN6 RE0/RD/AN5 RA5/AN4/SS RA4/T0CKI 33 32 31 30 29 28 27 26 25 24 23 NC RC0/T1OSO/T1CK OSC2/CLKOUT OSC1/CLKIN VSS VDD RE2/CS/AN7 RE1/WR/AN6 RE0/RD/AN5 RA5/AN4/SS RA4/T0CKI 22 21 20 19 18 17 16 15 14 13 12 20 OSC2/CLKOUT MQFP 44 43 42 41 40 39 38 37 36 35 34 SDIP, SOIC, Windowed Side Brazed Ceramic RC6/TX/CK RC5/SDO RC4/SDI/SDA RD3/PSP3 RD2/PSP2 RD1/PSP1 RD0/PSP0 RC3/SCK/SCL RC2/CCP1 RC1/T1OSI/CCP2 NC 6 5 4 3 2 1 44 43 42 41 40 7 8 9 10 11 12 13 14 15 16 17 PIC16C74 PIC16C74A 39 38 37 36 35 34 33 32 31 30 29 RC7/RX/DT RD4/PSP4 RD5/PSP5 RD6/PSP6 RD7/PSP7 VSS VDD RB0/INT RB1 RB2 RB3 RB3 RB2 RB1 RB0/INT VDD VSS RD7/PSP7 RD6/PSP6 RD5/PSP5 RD4/PSP4 RC7/RX/DT 1 2 3 4 5 6 7 8 9 10 11 PIC16C74A 22 21 20 19 18 17 16 15 14 13 12 RA4/T0CKI RA5/AN4/SS RE0/RD/AN5 RE1/WR/AN6 RE2/CS/AN7 VDD VSS OSC1/CLKIN OSC2/CLKOUT RC0/T1OSO/T1CKI NC RC6/TX/CK RC5/SDO RC4/SDI/SDA RD3/PSP3 RD2/PSP2 RD1/PSP1 RD0/PSP0 RC3/SCK/SCL RC2/CCP1 RC1/T1OSI/CCP2 NC MQFP TQFP 44 43 42 41 40 39 38 37 36 35 34 RA3/AN3/VREF RA2/AN2 RA1/AN1 RA0/AN0 MCLR/VPP NC RB7 RB6 RB5 RB4 NC RA3/AN3/VREF RA2/AN2 RA1/AN1 RA0/AN0 MCLR/VPP RB7 RB6 RB5 RB4 NC NC PLCC 28 27 26 25 24 23 22 21 20 19 18 RA3/AN3/VREF RA2/AN2 RA1/AN1 RA0/AN0 MCLR/VPP RB7 RB6 RB5 RB4 NC NC NC RC6/TX/CK RC5/SDO RC4/SDI/SDA RD3/PSP3 RD2/PSP2 RD1/PSP1 RD0/PSP0 RC3/SCK/SCL RC2/CCP1 RC1/T1OSI /CCP2 PDIP, Windowed CERDIP PIC16C74 (c) 1996 Microchip Technology Inc. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 PIC16C74A MCLR/VPP RA0/AN0 RA1/AN1 RA2/AN2 RA3/AN3/VREF RA4/T0CKI RA5/AN4/SS RE0/RD/AN5 RE1/WR/AN6 RE2/CS/AN7 VDD VSS OSC1/CLKIN OSC2/CLKOUT RC0/T1OSO/T1CKI RC1/T1OSI/CCP2 RC2/CCP1 RC3/SCK/SCL RD0/PSP0 RD1/PSP1 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 RB7 RB6 RB5 RB4 RB3 RB2 RB1 RB0/INT VDD VSS RD7/PSP7 RD6/PSP6 RD5/PSP5 RD4/PSP4 RC7/RX/DT RC6/TX/CK RC5/SDO RC4/SDI/SDA RD3/PSP3 RD2/PSP2 DS30390B-J00 - page 3 AC/DC http://www.microchip.comERRATA PIC16C7X 1.0 ............................................................................................ 5 2.0 PIC16C7X .......................................................................... 7 3.0 ............................................................................ 9 4.0 ..................................................................................... 21 5.0 I/O ...................................................................................... 43 6.0 ....................................................................... 57 7.0 ............................................................................. 59 8.0 ............................................................................. 65 9.0 ............................................................................. 69 10.0 //PWM .............................................................. 71 11.0 (SSP) .............................................................. 77 12.0 (USART) ........................................ 93 13.0 (A/D) ..................................................... 109 14.0 CPU ................................................................................. 121 15.0 ................................................................................ 141 16.0 .................................................................................. 153 17.0 PIC16C710PIC16C711 ........................................................ 159 18.0 PIC16C710PIC16C711DCAC ............................................. 173 19.0 PIC16C71 .................................................................... 175 20.0 PIC16C71DCAC ......................................................... 189 AC/DC AC/DC 21.0 PIC16C72 .................................................................... 197 22.0 PIC16C72DCAC ......................................................... 217 23.0 PIC16C73/74 ................................................................. 219 24.0 PIC16C73/74DCAC ...................................................... 241 25.0 PIC16C73A/74A ............................................................... 243 26.0 PIC16C73A/74ADCAC .................................................... 265 27.0 ............................................................................ 267 A ........................................................................................... 283 B ..................................................................................... 283 C ............................................................................... 284 D ................................................................................... 284 EPIC16/17 ............................................................... 285 .......................................................................................... 293 MicrochipBBS ..................................................................... 309 .................................................................................. 310 .............................................................................. 312 PIC16C711PIC16C72PIC16C73A PIC16C74A 710 71 711 72 73 73A 74 74A DS30390B-J00 - page 4 (c) 1996 Microchip Technology Inc. AC/DC http://www.microchip.com ERRATA PIC16C7X 1.0 PIC16C7XPIC16CXX ( A / D ) CMOS8 P I C 1 6 / 1 7 RISCPIC16CXX 8 8 1 4 2 (2 ) 35() PIC16CXX PIC16CXX 8 22 : 1 44 : 1 P I C 1 6 C 7 1 0 / 7 1 3 6 R A M PIC16C71168RAM PIC16C710/71/ PIC16C711 711 71113I/O /4 8 A / D8 PIC16C72 PIC16C72128RAM22I/O 3 / 1 //PWM1 ( ) 3 (SPI) 2I 2 C 58 A/D8 PIC16C73/73A PIC16C73/73A192RAM22 I / O 3/ 2/ /PWM2 3 (SPI)2 I 2 C (USART)- S C I 5 8 A / D 8 PIC16C74/74A PIC16C74/74A PIC16C74/74A192RAM33 I / O 3/ 2/ /PWM2 3 (c) 1996 Microchip Technology Inc. (SPI) 2I 2 C (USART)- S C I 8 8 8 A / D 8 PIC16C7X 4 R C LPXT HSSLEEP() SLEEP RR C UVCERDIP (OTP) PIC16C7X EPROM( ) I / O PIC16C7X P W M ) 1 . 1 PIC16C5X PIC16C5X A P I C 1 6 C 5 X PIC16CXX(B ) 1 . 2 PIC16CXX (16.0) DS30390B-J00-page 5 PIC16C7X P I C 1 6 C 7 X C I O S , P I D S n i p 8 2 C I O S , P I D S n i p 8 2 s e Y P F Q M , C C L P n i p 4 4 P F Q T , P F Q M , C C L P n i p 4 4 C I O S , PP IO D S S n in pi p 80 12 s e Y C I O S , P I D n i p 8 1 s e Y s e Y s e Y s e Y s e Y s e Y s e Y s e Y 0 . 6 0 . 3 0 . 6 0 . 3 0 . 6 0 . 3 0 . 6 5 . 2 0 . 6 0 . 3 0 . 6 5 . 2 0 . 6 0 . 3 0 . 6 5 . 2 3 1 3 1 3 1 2 2 2 2 2 2 3 3 3 3 4 4 4 8 1 1 1 1 2 1 2 1 4 4 4 5 5 5 8 8 s e Y s e Y C 2 I / I P S 1 0 R M T 2 R M T , 1 R M T C 2 I / I P S T R A S U 2 0 R M T 2 R M T , 1 R M T C 2 I / I P S T R A S U 2 0 R M T 2 R M T , 1 R M T P I D n i p 0 4 C 2 I / I P S T R A S U C 2 I / I P S T R A S U 2 2 0 R M T P I D n i p 0 4 s e Y 2 R M T , 1 R M T 0 R M T 2 R M T , 1 R M T 0 R M T 0 R M T 0 R M T 6 3 6 3 8 6 8 2 1 2 9 1 2 9 1 2 9 1 2 9 1 2 1 5 0 2 K 1 K 1 K 2 K 4 K 4 K 4 K 4 0 2 0 2 0 2 0 2 0 2 0 2 0 2 1 7 C 6 1 C I P 1 1 7 C 6 1 C I P 2 7 C 6 1 C I P 3 7 C 6 1 C I P A 3 7 C 6 1 C I P 4 7 C 6 1 C I P A 4 7 C 6 1 C I P E PR O M By (x te 1 4 ) b it ) C a p tu r e /C om p ar e / PW M ( S PI /I A 2 / C, D U S AR T) I/ ( O 8 bit ) (V ) (B OR ) 0 1 7 C 6 1 C I P DS30390B-J00-page 6 C I O S , PP IO D S S n in pi p 80 12 s e Y P O S S , C I O S , P I D S n i p 0 2 s e Y PIC16/17 I/O PIC16CXX RB6 RB7 - AC/DC http://www.microchip.com ERRATA (c) 1996 Microchip Technology Inc. AC/DC http://www.microchip.com ERRATA PIC16C7X 2 . 0 P I C 1 6 C 7 X PIC16C7X 2.2 (( O T P ) PIC16C7X 2 1. OTP1 C(PIC16C74) EPROM 2. O T P LC(PIC16LC74) EPROM 2.1 U V CERDIP MicrochipPICSTARTTMPRO MATE TM PIC16C7X M i c r o c h i p (c) 1996 Microchip Technology Inc. 2 . 3 - ( Q T P ) ( MicrochipQTP O T P E P R O M 2 . 4 ( S Q T P S M ) ( Microchip // ID DS30390B-J00 - page 7 PIC16C7X DS30390B-J00 - page 8 AC/DC http://www.microchip.com ERRATA (c) 1996 Microchip Technology Inc. AC/DC http://www.microchip.comERRATA 3.0 PIC16CXXRISC PIC16CXX 8 1414 1 4 ( 31 ) (35) (200ns@20MHz) PIC16C7X (EPROM)(RAM) PIC16C710 5 1 2 x 1 4 3 6 x 8 PIC16C71 1 K x 1 4 3 6 x 8 PIC16C711 1 K x 1 4 6 8 x 8 PIC16C72 2 K x 1 4 1 2 8 x 8 PIC16C73 4 K x 1 4 1 9 2 x 8 PIC16C73A 4 K x 1 4 1 9 2 x 8 PIC16C74 4 K x 1 4 1 9 2 x 8 PIC16C74A 4 K x 1 4 1 9 2 x 8 PIC16C7X PIC16CXX8ALU ALU A L U 2 2 ( W ) 1W W ALU 8 ALUSTATUS (C)(DC)(Z) DCborrowdigitborrow SUBLWSUBWF PIC16CXX PIC16CXX() PIC16CXX (c) 1996 Microchip Technology Inc. DS30390B-J00 - page - 9 PIC16C7X AC/DC http://www.microchip.comERRATA 31: PIC16C710/71/711 Device Program Memory Data Memory (RAM) PIC16C710 PIC16C71 PIC16C711 512 x 14 1K x 14 1K x 14 36 x 8 36 x 8 68 x 8 13 8 Data Bus Program Counter PORTA EPROM Program Memory Program Bus RAM File Registers 8 Level Stack (13-bit) 14 RA0/AN0 RA1/AN1 RA2/AN2 RA3/AN3/VREF RA4/T0CKI RAM Addr (1) PORTB 9 Addr MUX Instruction reg Direct Addr 7 8 Indirect Addr FSR reg RB0/INT RB7:RB1 STATUS reg 8 3 MUX Power-up Timer Instruction Decode & Control Timing Generation OSC1/CLKIN OSC2/CLKOUT Oscillator Start-up Timer Power-on Reset ALU 8 W reg Watchdog Timer Brown-out Reset(2) Timer0 MCLR VDD, VSS A/D STATUS Note 1:PIC16C71 Higher order bits are from the STATUS register. 2: Brown-out Reset is not available on the PIC16C71. DS30390B-J00 - page 10 (c) 1996 Microchip Technology Inc. AC/DC http://www.microchip.comERRATA PIC16C7X 32: PIC16C72 13 Program Memory Program Bus 14 PORTA RA0/AN0 RA1/AN1 RA2/AN2 RA3/AN3/VREF RA4/T0CKI RA5/AN4/SS RAM File Registers 128 x 8 8 Level Stack (13-bit) 2K x 14 8 Data Bus Program Counter EPROM RAM Addr(1) PORTB 9 Addr MUX Instruction reg 7 Direct Addr 8 RB0/INT Indirect Addr RB7:RB1 FSR reg STATUS reg 8 3 Power-up Timer Instruction Decode & Control Oscillator Start-up Timer Timing Generation Watchdog Timer Brown-out Reset Power-on Reset OSC1/CLKIN OSC2/CLKOUT MCLR MUX ALU PORTC RC0/T1OSO/T1CKI RC1/T1OSI RC2/CCP1 RC3/SCK/SCL RC4/SDI/SDA RC5/SDO RC6 RC7 8 W reg VDD, VSS Timer0 Timer1 Timer2 A/D Synchronous Serial Port CCP1 Note 1: Higher order bits are from the STATUS register. 1 STATUS (c) 1996 Microchip Technology Inc. DS30390B-J00 - page - 11 AC/DC http://www.microchip.comERRATA PIC16C7X 33:PIC16C73/73A 13 Program Memory Program Bus 14 PORTA RA0/AN0 RA1/AN1 RA2/AN2 RA3/AN3/VREF RA4/T0CKI RA5/AN4/SS RAM File Registers 192 x 8 8 Level Stack (13-bit) 4K x 14 8 Data Bus Program Counter EPROM RAM Addr(1) PORTB 9 Addr MUX Instruction reg 7 Direct Addr 8 RB0/INT Indirect Addr RB7:RB1 FSR reg STATUS reg 8 3 MUX Power-up Timer Instruction Decode & Control Timing Generation OSC1/CLKIN OSC2/CLKOUT Oscillator Start-up Timer Power-on Reset Watchdog Timer Brown-out Reset(2) MCLR ALU PORTC RC0/T1OSO/T1CKI RC1/T1OSI/CCP2 RC2/CCP1 RC3/SCK/SCL RC4/SDI/SDA RC5/SDO RC6/TX/CK RC7/RX/DT 8 W reg VDD, VSS Timer0 Timer1 Timer2 A/D CCP1 CCP2 Synchronous Serial Port USART STATUS Note 1: Higher order bits are from the STATUS register. PIC16C73 2: Brown-out Reset is not available on the PIC16C73. DS30390B-J00 - page 12 (c) 1996 Microchip Technology Inc. AC/DC http://www.microchip.comERRATA PIC16C7X 34: PIC16C74/74A 13 Program Memory Program Bus 14 PORTA RA0/AN0 RA1/AN1 RA2/AN2 RA3/AN3/VREF RA4/T0CKI RA5/AN4/SS RAM File Registers 192 x 8 8 Level Stack (13-bit) 4K x 14 8 Data Bus Program Counter EPROM RAM Addr (1) PORTB 9 Addr MUX Instruction reg Direct Addr 7 8 RB0/INT Indirect Addr RB7:RB1 FSR reg STATUS reg 8 3 Power-up Timer Instruction Decode & Control Timing Generation OSC1/CLKIN OSC2/CLKOUT Oscillator Start-up Timer Power-on Reset RC0/T1OSO/T1CKI RC1/T1OSI/CCP2 RC2/CCP1 RC3/SCK/SCL RC4/SDI/SDA RC5/SDO RC6/TX/CK RC7/RX/DT MUX ALU PORTD 8 Watchdog Timer Brown-out Reset(2) W reg RD7/PSP7:RD0/PSP0 Parallel Slave Port MCLR PORTC VDD, VSS PORTE RE0/RD/AN5 RE1/WR/AN6 Timer0 Timer1 Timer2 A/D CCP1 CCP2 Synchronous Serial Port USART 1 2 RE2/CS/AN7 STATUS PIC16C74 Note 1: Higher order bits are from the STATUS register. 2: Brown-out Reset is not available on the PIC16C74. (c) 1996 Microchip Technology Inc. DS30390B-J00 - page - 13 AC/DC http://www.microchip.comERRATA PIC16C7X 31 PIC16C710/711 31 PIC16C710/711 OSC1/CLKIN DIP Pin# 16 SSOP Pin# 18 SOIC Pin# 16 OSC2/CLKOUT 15 17 15 MCLR/V PP 4 4 4 I/O/P Buffer Type Type (3) I ST/CMOS / RC O - OSC2 OSC11/4 CLKOUT ( )/ I/P ST PORTA I/O RA0/AN0 17 19 17 I/O TTL 0 RA1/AN1 18 20 18 I/O TTL 1 RA2/AN2 1 1 1 I/O TTL 2 RA3/AN3/V REF 2 2 2 I/O TTL 3/V REF RA4/T0CKI 3 3 3 I/O ST 0 PORTB I/O PORTB TTL/ST(1) RB0/INT RB0/INT 6 7 6 I/O RB1 7 8 7 I/O TTL RB2 8 9 8 I/O TTL RB3 9 10 9 I/O TTL RB4 10 11 10 I/O TTL RB5 11 12 11 I/O TTL RB6 12 13 12 I/O TTL/ST (2) TTL/ST (2) RB7 13 14 13 I/O V SS 5 4,6 5 P - I/O V DD 14 15,16 14 P - I/O I=O=I/O=/P= -=TTL=TTLST= 1 2 3 RCCMOS DS30390B-J00 - page 14 (c) 1996 Microchip Technology Inc. AC/DC http://www.microchip.comERRATA PIC16C7X 32 PIC16C71 32 PIC16C71 OSC 1/CL KIN OSC 2/CL KOUT MCL R/V PP DI P Pi n# SO IC Pi n# I/ O/ P Ty pe Bu ff er Ty pe 16 16 I ST/ CMOS (3) 15 15 O - 4 4 I/P ST / R C OSC 2 OSC 11 /4 CLKO UT ( ) / POR TA I/ O RA0 /AN0 17 17 I/O TTL 0 RA1 /AN1 18 18 I/O TTL 1 RA2 /AN2 1 1 I/O TTL 2 RA3 /AN3 /V REF 2 2 I/O TTL 3/V REF RA4 /TOC KI 3 3 I/O ST RB0 /INT 6 6 I/O TTL /ST (1) RB1 7 7 I/O TTL RB2 8 8 I/O TTL RB3 9 9 I/O TTL RB4 10 10 I/O TTL RB5 11 11 I/O TTL RB6 12 12 I/O TTL /ST (2) (2) TTL /ST 0 POR TB I/ O POR TB RB0 /INT RB7 13 13 I/O V SS 5 5 P - I/O V DD 14 14 P - I/O I=O=I/O=/P= -=TTL=TTLST= 1 2 3 RCCMOS (c) 1996 Microchip Technology Inc. DS30390B-J00 - page - 15 PIC16C7X AC/DC http://www.microchip.comERRATA 33 PIC16C72 33 PIC16C72 OS C1/ CL KIN DIP Pin# SSOP Pin# SOIC Pin# I/O/P Type B u f f e r T y p e 9 9 9 I S T / C M O S (3 ) / 10 10 10 O - M C L R / V PP 1 1 1 I/ P ST ( ) / RA 0/A N0 2 2 2 I/ O TT L 0 RA 1/A N1 3 3 3 I/ O TT L 1 RA 2/A N2 4 4 4 I/ O TT L 2 R A 3 / A N 3 / V RE F 5 5 5 I/ O TT L 3 / V RE F RA 4/T 0C KI 6 6 6 I/ O ST OS C2/ CL KOU T RC O SC2 OSC 1 1/ 4 C LKO UT PO RTA I/ O 0 RA 5/A N4 /SS 7 7 7 I/ O 4 TT L PO RTB I/ O PO RTB RB 0/I NT 21 21 21 I/ O T T L / S T (1 ) RB 1 22 22 22 I/ O TT L RB 2 23 23 23 I/ O TT L RB 3 24 24 24 I/ O TT L RB 4 25 25 25 I/ O TT L RB 5 26 26 26 I/ O TT L RB 0/I NT (2 ) RB 6 27 27 27 I/ O TT L/S T RB 7 28 28 28 I/ O T T L / S T (2 ) PO RTC I/ O RC 0/T 1O SO/ T1 CKI 11 11 11 I/ O ST RC 0/T 1O SO/ T1C KI 1 / 1 RC 1/T 1O SI 12 12 12 I/ O ST RC 1/T 1O SI/ CCP 2 1 2 / 2 /P WM2 RC 2/C CP 1 13 13 13 I/ O ST RC 2/C CP 1 1 / 1 /PW M1 RC 3/S CK /SC L 14 14 14 I/ O ST RC 3/S CK /SC L SP I I2C / RC 4/S DI /SD A 15 15 15 I/ O ST RC 4/S DI /SD A (S PI ) SPI ( I 2C ) I / O RC 5/S DO 16 16 16 I/ O ST RC 5/S DO ( SPI )S PI RC 6 17 17 17 I/ O ST RC 7 18 18 18 I/ O ST V SS 8, 19 8, 19 8, 19 P - I/ O V DD 20 20 20 P - I/ O I=O=I/O=/P= -=TTL=TTLST= 1 2 3 RCCMOS DS30390B-J00 - page 16 (c) 1996 Microchip Technology Inc. AC/DC http://www.microchip.comERRATA PIC16C7X 34 PIC16C73/73A 34 PIC16C73/73A O S C1 / C L K IN O S C2 / C L K OU T M C LR / V P P DIP Pin# SOIC Pin# I / O /P Type B u f fe r Type 9 9 I S T /C M O S ( 3) 10 10 O - RC O S C2 O SC 1 1/ 4 C L K O UT 1 1 I/P ST ( ) / / P O RT A I/ O R A 0/ A N 0 2 2 I/O TTL 0 R A 1/ A N 1 3 3 I/O TTL 1 R A 2/ A N 2 4 4 I/O TTL 2 R A 3/ A N 3 / V R EF 5 5 I/O TTL 3 /V R EF R A 4/ T 0 C K I 6 6 I/O ST 0 R A 5/ A N 4 / SS 7 7 I/O TTL 4 P O RT B I/ O PO R T B R B 0/ I N T 21 21 I/O T T L/ S T ( 1) RB1 22 22 I/O TTL RB2 23 23 I/O TTL RB3 24 24 I/O TTL RB4 25 25 I/O TTL RB5 26 26 I/O TTL RB6 27 27 I/O T T L/ S T ( 2) RB7 28 28 I/O T T L/ S T ( 2) R B 0/ I N T P O RT C I/ O R C 0/ T 1 O S O/ T 1 C KI 11 11 I/O ST R C 0/ T 1 O S O/ T 1 C KI 1 / 1 R C 1/ T 1 O S I 12 12 I/O ST R C 1/ T 1 O S I/ C C P 2 1 2 / 2 / P W M 2 R C 2/ C C P 1 13 13 I/O ST R C 2/ C C P 1 1 / 1 / PW M 1 R C 3/ S C K / SC L 14 14 I/O ST R C 3/ S C K / SC L SP I I 2 C / R C 4/ S D I / SD A 15 15 I/O ST R C 4/ S D I / SD A (S P I ) S P I ( I 2 C ) I/ O R C 5/ S D O 16 16 I/O ST R C 5/ S D O ( S P I ) S P I ST R C 6/ T X / C K U SA R T R C 6/ T X / C K R C 7/ R X / D T 17 17 I/O 18 18 I/O ST R C 7/ R X / D T U S AR T VS S 8 , 19 8 , 19 P - I / O VD D 20 20 P - I / O I=O=I/O=/P= -=TTL=TTLST= 1 2 3 RCCMOS (c) 1996 Microchip Technology Inc. DS30390B-J00 - page - 17 PIC16C7X AC/DC http://www.microchip.comERRATA 34 PIC16C74/74A 34 PIC16C74/74A D IP P in # P LC C P in # Q PF P in # I /O / P T yp e B u f f e r T y p e OSC1/C LKIN 13 14 30 I S T / C M O S (3) OSC2/C LKOUT 14 15 31 O - 1 2 18 I/P ST ( ) / M C L R / V PP / R C O S C 2 O S C 1 1 / 4 C L K O U T PO RT A I /O RA0/AN 0 2 3 19 I/O TTL 0 RA1/AN 1 3 4 20 I/O TTL 1 RA2/AN 2 4 5 21 I/O TTL 2 R A 3 / A N 3 / V REF 5 6 22 I/O TTL 3 / V REF RA4/T0 CKI 6 7 23 I/O ST RA5/AN 4/SS 7 8 24 I/O TTL 0 4 PO RT B I /O PO RTB RB0/IN T 33 36 8 I/O T T L / S T (1) RB1 34 37 9 I/O TTL RB2 35 38 10 I/O TTL RB3 36 39 11 I/O TTL RB4 37 41 14 I/O TTL RB5 38 42 15 I/O TTL RB6 39 43 16 I/O T T L / S T (2) RB7 40 44 17 I/O T T L / S T (2) RB 0/ INT I=O=I/O=/P= -=TTL=TTLST= 1 2 3 RCCMOS DS30390B-J00 - page 18 (c) 1996 Microchip Technology Inc. AC/DC http://www.microchip.comERRATA PIC16C7X 35 PIC16C74/74A 35 PIC16C74/74A D IP P in # P LC C P in # Q FP P in # I /O /P T yp e B u f f e r T y p e P O R T C I / O R C 0 / T 1 OS O / T 1 C K I 1 5 1 6 3 2 I / O S T R C 0 / T 1 OS O / T 1 C K I 1 / 1 R C 1 / T 1 OS I 1 6 1 8 3 5 I / O S T R C 1 / T 1 OS I / C C P 2 1 2 / 2 / P W M 2 R C 2 / C C P1 1 7 1 9 3 6 I / O S T R C 2 / C C P1 1 / 1 / P W M 1 R C 3 / S C K/ S C L 1 8 2 0 3 7 I / O S T R C 3 / S C K / S C L S P I I 2C / R C 4 / S D I/ S D A 2 3 2 5 4 2 I / O S T R C 4 / S D I/ S D A ( S P I ) S P I ( I 2C ) I / O R C 5 / S D O 2 4 2 6 4 3 I / O S T R C 5 / S D O ( S P I ) S P I R C 6 / T X /C K 2 5 2 7 4 4 I / O S T R C 6 / T X /C K U S A R T R C 7 / R X /D T 2 6 2 9 1 I / O S T R C 7 / R X /D T U S A R T P O R T D I / O R D 0 / P S P0 1 9 2 1 3 8 I / O S T / T T L (3) R D 1 / P S P1 2 0 2 2 3 9 I / O S T / T T L (3) R D 2 / P S P2 2 1 2 3 4 0 I / O S T / T T L (3) R D 3 / P S P3 2 2 2 4 4 1 I / O S T / T T L (3) R D 4 / P S P4 2 7 3 0 2 I / O S T / T T L (3) R D 5 / P S P5 2 8 3 1 3 I / O S T / T T L (3) R D 6 / P S P6 2 9 3 2 4 I / O S T / T T L (3) R D 7 / P S P7 3 0 3 3 5 I / O S T / T T L (3) P O R T E I / O R E 0 / R D /A N 5 5 R E 0 / R D /A N 5 8 9 2 5 I / O S T / T T L (3) R E 1 / W R /A N 6 9 1 0 2 6 I / O S T / T T L (3) R E 2 / C S /A N 7 1 0 1 1 2 7 I / O S T / T T L (3) 1 2 , 3 1 1 3 , 3 4 6 , 2 9 P - I / O 1 1 , 3 2 1 2 , 3 5 7 , 2 0 P - I / O 1 1 2 , 1 2 , 1 3 , 3 3 , 3 4 - V V SS DD N C - , 7 8 4 , 0 R E 1 / W R /A N 6 6 R E 2 / C S /A N 7 7 I=O=I/O=/P= -=TTL=TTLST= 1 2 3 I/O( )TTL (c) 1996 Microchip Technology Inc. DS30390B-J00 - page - 19 PIC16C7X 3.1 AC/DC http://www.microchip.comERRATA / / 3.2 (OSC1)4Q1 Q2Q3Q44 ( P C ) Q 1 Q 4 Q 1 Q 4 35 / / 4Q(Q1Q2Q3Q4) (GOTO)2 (31) (PC)Q1 Q1 ""(IR) Q2Q3Q4 Q 2 ( )Q4( ) 35: Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q2 Q1 Q3 Q4 OSC1 Q1 Q2 Internal phase clock Q3 Q4 PC OSC2/CLKOUT (RC mode) 31: PC PC+1 Fetch INST (PC) Execute INST (PC-1) PC+2 Fetch INST (PC+1) Execute INST (PC) Fetch INST (PC+2) Execute INST (PC+1) 1. MOVLW 55h 2. MOVWF PORTB 3. CALL SUB_1 4. BSF PORTA,BIT3 Fetch1 Execute1 Fetch2 Execute2 Fetch3 Execute3 Fetch4 Flush Fetch SUB_1 Execute SUB_1 DS30390B-J00 - page 20 (c) 1996 Microchip Technology Inc. AC/DC http://www.microchip.com ERRATA 4.0 710 71 711 4.1 PIC16C7X 72 73 73A 74 74A 4 2 P I C 1 6 C 7 1 / 7 1 1 PIC16C7X8Kx14 13 PIC16C710512x14(0000h01FFh) PIC16C71/711 1Kx14(0000h03FFh) PIC16C722Kx14(0000h07FFh) P I C 1 6 C 7 3 P I C 1 6 C 7 3 A PIC16C74PIC16C74A4Kx14(0000h0FFFh) 0000h0004h PC<12:0> CALL, RETURN RETFIE, RETLW 13 Stack Level 1 Stack Level 8 Reset Vector 0000h Interrupt Vector 0004h 0005h On-chip Program Memory 03FFh 0200h 4 1 P I C 1 6 C 7 1 0 1FFFh PC<12:0> CALL, RETURN RETFIE, RETLW 13 Stack Level 1 Stack Level 8 Reset Vector 0000h Interrupt Vector 0004h 0005h On-chip Program Memory 01FFh 0200h 1FFFh (c) 1996 Microchip Technology Inc. DS30390B-J00 - page 21 PIC16C7X AC/DC http://www.microchip.com ERRATA 4 3 P I C 1 6 C 7 2 4 4 P I C 1 6 C 7 3 / 7 3 A / 7 4 / 7 4 A PC<12:0> CALL, RETURN RETFIE, RETLW PC<12:0> 13 CALL, RETURN RETFIE, RETLW 13 Stack Level 1 Stack Level 1 Stack Level 8 Stack Level 8 Reset Vector 0000h Reset Vector 0000h Interrupt Vector 0004h 0005h Interrupt Vector 0004h 0005h On-chip Program Memory (Page 0) 07FFh On-chip Program Memory 0800h On-chip Program Memory (Page 1) 07FFh 0800h 0FFFh 1000h 1FFFh 1FFFh 4.2 710 71 711 72 73 73A 74 74A R P 0 RP0(STATUS<5>)=1Bank1 RP0(STATUS<5>)=0Bank0 7Fh(128) R A M 4.2.1 F S R (4.5) DS30390B-J00 - page 22 (c) 1996 Microchip Technology Inc. AC/DC http://www.microchip.com ERRATA 4 5 P I C 1 6 C 7 1 0 / 7 1 File Address 00h 01h 02h 03h 04h 05h 06h 07h 08h 09h 0Ah 0Bh 0Ch INDF(1) TMR0 PCL STATUS FSR PORTA PORTB ADCON0 ADRES INDF(1) OPTION PCL STATUS FSR TRISA TRISB PCON(2) ADCON1 ADRES PCLATH INTCON PCLATH INTCON General Purpose Register General Purpose Register PIC16C7X 4 6 P I C 1 6 C 7 1 1 File Address File Address 80h 81h 82h 83h 84h 85h 86h 87h 88h 89h 8Ah 8Bh 8Ch 00h 01h 02h 03h 04h 05h 06h 07h 08h 09h 0Ah 0Bh 0Ch File Address INDF(1) TMR0 PCL STATUS FSR PORTA PORTB ADCON0 ADRES INDF(1) OPTION PCL STATUS FSR TRISA TRISB PCON ADCON1 ADRES PCLATH INTCON PCLATH INTCON General Purpose Register Mapped in Bank 0(3) General Purpose Register 80h 81h 82h 83h 84h 85h 86h 87h 88h 89h 8Ah 8Bh 8Ch Mapped in Bank 0(2) 2Fh AFh 4Fh CFh 30h B0h 50h D0h 7Fh FFh 7Fh FFh Bank 0 Bank 1 Unimplemented data memory locations, read 0 as '0'. 1: Note 1: Not a physical register. 2: P2:C O NThe P I C 1 is 6 Cnot 7 1 PCON register implemented on the PIC16C71. 3: These locations are unimplemented in Bank 1. 3: Any access to these locations will access the corresponding Bank 0 register. (c) 1996 Microchip Technology Inc. Bank 0 Bank 1 Unimplemented data memory locations, read 0 as '0'. Note 1: Not a physical register. 1: 2: These locations are unimplemented in Bank 1. 2: Any access to these locations will access the corresponding Bank 0 register. DS30390B-J00 - page 23 PIC16C7X AC/DC http://www.microchip.com ERRATA 4 7 P I C 1 6 C 7 2 File Address 00h 01h 02h 03h 04h 05h 06h 07h 08h 09h 0Ah 0Bh 0Ch 0Dh 0Eh 0Fh 10h 11h 12h 13h 14h 15h 16h 17h 18h 19h 1Ah 1Bh 1Ch 1Dh 1Eh 1Fh 20h INDF(1) TMR0 PCL STATUS FSR PORTA PORTB PORTC INDF(1) OPTION PCL STATUS FSR TRISA TRISB TRISC PCLATH INTCON PIR1 PCLATH INTCON PIE1 TMR1L TMR1H T1CON TMR2 T2CON SSPBUF SSPCON CCPR1L CCPR1H CCP1CON PCON ADRES ADCON0 General Purpose Register PR2 SSPADD SSPSTAT ADCON1 General Purpose Register 4 8 P I C 1 6 C 7 3 / 7 3 A / 7 4 / 7 4 A File Address File Address 80h 81h 82h 83h 84h 85h 86h 87h 88h 89h 8Ah 8Bh 8Ch 8Dh 8Eh 8Fh 90h 91h 92h 93h 94h 95h 96h 97h 98h 99h 9Ah 9Bh 9Ch 9Dh 9Eh 9Fh 00h 01h 02h 03h 04h 05h 06h 07h 08h 09h 0Ah 0Bh 0Ch 0Dh 0Eh 0Fh 10h 11h 12h 13h 14h 15h 16h 17h 18h 19h 1Ah 1Bh 1Ch 1Dh 1Eh 1Fh 20h File Address INDF(1) TMR0 PCL STATUS FSR PORTA PORTB PORTC PORTD(2) PORTE(2) PCLATH INTCON PIR1 PIR2 TMR1L TMR1H T1CON TMR2 T2CON SSPBUF SSPCON CCPR1L CCPR1H CCP1CON RCSTA TXREG RCREG CCPR2L CCPR2H CCP2CON ADRES ADCON0 INDF(1) OPTION PCL STATUS FSR TRISA TRISB TRISC TRISD(2) TRISE(2) PCLATH INTCON PIE1 PIE2 PCON PR2 SSPADD SSPSTAT TXSTA SPBRG ADCON1 80h 81h 82h 83h 84h 85h 86h 87h 88h 89h 8Ah 8Bh 8Ch 8Dh 8Eh 8Fh 90h 91h 92h 93h 94h 95h 96h 97h 98h 99h 9Ah 9Bh 9Ch 9Dh 9Eh 9Fh A0h A0h BFh General Purpose Register General Purpose Register Bank 0 Bank 1 C0h FFh 7Fh 7Fh FFh Bank 0 Bank 1 Unimplemented data memory locations, read 0 as '0'. Note Not a physical register. 1: 1: DS30390B-J00 - page 24 Unimplemented data memory locations, read 0 as '0'. Note Not a physical register. 1: 1: 2: These registers are not physically imple2: P I C 1 6 C 7 3 / 7 3 A mented on the PIC16C73/73A, read as '0'. 0 (c) 1996 Microchip Technology Inc. AC/DC http://www.microchip.comERRATA 4.2.2 PIC16C7X C P U R A M 41 PIC16C710/71/711 PIC16C710/71/711 Name Ba nk 0 00h(3) 01h 02h(3) 03h(3) 04h(3) 05h 06h 07h 08h 09h(3) 0Ah(2,3) 0Bh(3) INDF TMR0 PCL STATUS FSR PORTA PORTB ADCON0 ADRES PCLATH INTCON TMR0 (PC) IRP(5) RP1(5) RP0 TO PD Z DC C PORTA:PORTA PORTB:PORTB ADCS1 ADCS0 (6) CHS1 CHS0 GO/DONE ADIF ADON A/D GIE ADIE T0IE INTE RBIE T0IF INTF RBIF 00000000 xxxxxxxx 00000000 00011xxx xxxxxxxx x0000 xxxxxxxx 0000000 xxxxxxxx 00000 0000000x 00000000 uuuuuuuu 00000000 000qquuu uuuuuuuu u0000 uuuuuuuu 0000000 uuuuuuuu 00000 0000000u Ba nk 1 80h(3) 81h 82h(3) 83h(3) 84h(3) 85h 86h 87h(3) 88h 89h(3) 8Ah(2,3) 8Bh(3) INDF OPTION PCL STATUS FSR TRISA TRISB PCON ADCON1 ADRES PCLATH INTCON RBPU INTEDG T0CS T0SE PSA PS2 PS1 (PC) IRP(5) RP1(5) RP0 TO PD Z DC PORTA PORTB POR PCFG1 A/D GIE ADIE T0IE INTE RBIE T0IF INTF 00000000 11111111 00000000 00011xxx xxxxxxxx 11111 11111111 qq 00 xxxxxxxx 00000 0000000x 00000000 11111111 00000000 000qquuu uuuuuuuu 11111 11111111 uu 00 uuuuuuuu 00000 0000000u Bit6 Bit5 Bit4 Bit3 Bit2 Bit1 Bit0 (1) Address Bit7 POR BOR PS0 C BOR PCFG0 RBIF x=u=q=-= 0 0 (nonpowerup)MCLR PCLATHPC<12:8> PCONPIC16C71 IRPRP1PIC16C7X ADCON05PIC16C71R/WPIC16C710/711 0 (c) 1996 Microchip Technology Inc. 0 DS30390B-J00 - page 25 PIC16C7X AC/DC http://www.microchip.comERRATA 42: PIC16C72 PIC16C72 Address Name Bit7 Bit6 Bit5 Bit4 Bit3 Bit2 Bit1 Bit0 POR BOR (3) B a n k 0 00h(1) INDF 00000000 00000000 01h 02h(1) TMR0 PCL 0 (PC) xxxxxxxx 00000000 uuuuuuuu 00000000 03h(1) 04h(1) STATUS FSR IRP(4) RP1(4) RP0 TO 00011xxx xxxxxxxx 000qquuu uuuuuuuu 05h 06h PORTA PORTB PORTAPORTA PORTBPORTB 0x0000 xxxxxxxx 0u0000 uuuuuuuu 07h 08h PORTC PORTCPORTC xxxxxxxx uuuuuuuu 00000 00000 0000000x 00000 0000000u 00000 xxxxxxxx uuuuuuuu xxxxxxxx 000000 uuuuuuuu uuuuuu 00000000 0000000 0000000 0000000 xxxxxxxx 00000000 uuuuuuuu 00000000 xxxxxxxx xxxxxxxx uuuuuuuu uuuuuuuu 000000 000000 09h 0Ah(1,2) PCLATH GIE PEIE ADIF T0IE PD Z DC C 5 0Bh(1) 0Ch INTCON PIR1 0Dh 0Eh TMR1L 16TMR1 0Fh 10h TMR1H T1CON 16TMR1 T1CKPS1 T1CKPS0 T1OSCEN T1SYNC TMR1CS 11h 12h TMR2 T2CON TOUTPS3 TOUTPS2 TOUTPS1 TOUTPS0 TMR2ON T2CKPS1 T2CKPS0 13h 14h SSPBUF SSPCON / WCOL SSPOV SSPEN CKP SSPM3 SSPM2 15h 16h CCPR1L CCPR1H //PWM(LSB) //PWM(MSB) 17h 18h CCP1CON CCP1X INTE CCP1Y RBIE SSPIF CCP1M3 T0IF CCP1IF CCP1M2 INTF TMR2IF SSPM1 CCP1M1 RBIF TMR1IF TMR1ON SSPM0 CCP1M0 19h 1Ah 1Bh 1Ch xxxxxxxx uuuuuuuu 0000000 0000000 1Dh 1Eh ADRES A/D 1Fh ADCON0 ADCS1 x=u=q== ADCS0 CHS2 CHS1 CHS0 GO/DONE ADCON PCLATHPC<12:8> (nonpowerup)MCLR IRPRP1PIC16C7X DS30390B-J00 - page 26 (c) 1996 Microchip Technology Inc. AC/DC http://www.microchip.comERRATA PIC16C7X 42: PIC16C72 PIC16C72 Address Name B a n k 1 80h(1) 81h 82h(1) 83h(1) 84h(1) 85h 86h 87h 88h 89h 8Ah(1,2) 8Bh(1) 8Ch 8Dh 8Eh 8Fh 90h 91h 92h 93h 94h 95h 96h 97h 98h 99h 9Ah 9Bh 9Ch 9Dh 9Eh 9Fh INDF OPTION PCL STATUS FSR TRISA TRISB TRISC PCLATH INTCON PIE1 PCON PR2 SSPADD SSPSTAT ADCON1 Bit7 Bit6 Bit5 Bit4 Bit3 Bit2 Bit1 Bit0 RBPU INTEDG T0CS T0SE PSA PS2 PS1 (PC) IRP(4) RP1(4) RP0 TO PD Z DC PORTA PORTB PORT PC5 GIE PEIE T0IE INTE RBIE T0IF INTF ADIE SSPIE CCP1IE TMR2IE POR (I2C) D/A P S R/W UA PCFG2 PCFG1 x=u=q== PS0 C RBIF TMR1IE BOR BF PCFG0 POR BOR (3) 00000000 11111111 00000000 00011xxx xxxxxxxx 111111 11111111 11111111 00000 0000000x 00000 qq 11111111 00000000 000000 000 00000000 11111111 00000000 000qquuu uuuuuuuu 111111 11111111 11111111 00000 0000000u 00000 uu 11111111 00000000 000000 000 PCLATHPC<12:8> (nonpowerup)MCLR IRPRP1PIC16C7X (c) 1996 Microchip Technology Inc. DS30390B-J00 - page 27 PIC16C7X AC/DC http://www.microchip.comERRATA 43: PIC16C73/73A/74/74A Address Name Bit7 B an k0 00h(4) 01h 02h(4) 03h(4) 04h(1) 05h 06h 07h 08h 09h 0Ah(1,2) 0Bh(1) 0Ch 0Dh 0Eh 0Fh 10h 11h 12h 13h 14h 15h 16h 17h 18h 19h 1Ah 1Bh 1Ch 1Dh 1Eh 1Fh INDF TMR0 PCL STATUS FSR PORTA PORTB PORTC PORTD PORTE PCLATH INTCON PIR1 PIR2 TMR1L TMR1H T1CON TMR2 T2CON SSPBUF SSPCON CCPR1L CCPR1H CCP1CON RCSTA TXREG RCREG CCPR2L CCPR2H CCP2CON ADRES ADCON0 0 (PC) IRP(7) RP1(7) RP0 TO PD Z DC C PORTAPO RTA PORTBPO RTB PORTCPO RTC PORTDPO RTD RE2 RE1 RE0 5 GIE PEIE T0IE INTE RBIE T0IF INTF RBIF PSPIF(3) ADIF RCIF TXIF SSPIF CCP1IF TMR2IF TMR1IF CCP2IF 16TMR1 16TMR1 T1CKPS1 T1CKPS0 T1OSCEN T1SYNC TMR1CS TMR1ON TOUTPS3 TOUTPS2 TOUTPS1 TOUTPS0 TMR2ON T2CKPS1 T2CKPS0 / WCOL SSPOV SSPEN CKP SSPM3 SSPM2 SSPM1 SSPM0 //PWM(LSB) //PWM(MSB) CCP1X CCP1Y CCP1M3 CCP1M2 CCP1M1 CCP1M0 SPEN RX9 SREN CREN FERR OERR RX9D USART USART //PWM2(LSB) //PWM2(MSB) CCP2X CCP2Y CCP2M3 CCP2M2 CCP2M1 CCP2M0 A/D ADCS1 ADCS0 CHS2 CHS1 CHS0 GO/DONE ADON Bit6 Bit5 Bit4 Bit3 Bit2 Bit1 Bit0 POR BOR (2) 00000000 xxxxxxxx 00000000 00011xxx xxxxxxxx 0x0000 xxxxxxxx xxxxxxxx xxxxxxxx 000 00000 0000000x 00000000 0 xxxxxxxx xxxxxxxx 000000 00000000 0000000 xxxxxxxx 00000000 xxxxxxxx xxxxxxxx 000000 000000x 00000000 00000000 xxxxxxxx xxxxxxxx 000000 xxxxxxxx 0000000 00000000 uuuuuuuu 00000000 000qquuu uuuuuuuu 0u0000 uuuuuuuu uuuuuuuu uuuuuuuu 000 00000 0000000u 00000000 0 uuuuuuuu uuuuuuuu uuuuuu 00000000 0000000 uuuuuuuu 00000000 uuuuuuuu uuuuuuuu 000000 000000x 00000000 00000000 uuuuuuuu uuuuuuuu 000000 uuuuuuuu 0000000 x=u=q== PCLATHPC<12:8> (nonpowerup)MCLR PSPIEPSPIFPIC16C73/73A PORTDPORTEPIC16C73/73A PIC16C73PIC16C74 IRPRP1PIC16C7X DS30390B-J00 - page 28 0 (c) 1996 Microchip Technology Inc. AC/DC http://www.microchip.comERRATA PIC16C7X 43: PIC16C73/73A/74/74A Address Name Bit7 B an k 1 80h(4) INDF () 81h 82h(4) 83h(4) 84h(4) 85h 86h RBPU INTEDG T0CS T0SE PSA (PC) IRP(7) RP1(7) RP0 TO PD PORTA PORTB OPTION PCL STATUS FSR TRISA TRISB Bit6 Bit5 87h TRISC 88h(5) TRISD 89h(5) TRISE 8Ah(1,2)PCLATH 8Bh(1) INTCON 8Ch PIE1 8Dh PIE2 PORTC PORTD IBF OBF IBOV GIE PEIE T0IE PSPIE(3) ADIE RCIE 8Eh 8Fh 90h 91h 92h 93h Timer2 PCON PR2 SSPADD Bit4 Bit3 (I 2C) SSPSTAT D/A P S TXSTA CSRC TX9 TXEN SYNC SPBRG 9Ah 9Bh 9Ch 9Dh 9Eh 9Fh ADCON1 Bit1 Bit0 PS2 PS1 PS0 Z DC C PSPMODE TRISE2 TRISE1 PC INTE RBIE T0IF INTF TXIE SSPIE CCP1IE TMR2IE 94h 95h 96h 97h 98h 99h Bit2 TRISE0 RBIF TMR1IE CCP2IE POR BOR (1) 00000000 0000 0000 11111111 00000000 00011xxx xxxxxxxx 111111 11111111 1111 1111 0000 0000 000q quuu uuuu uuuu 11 1111 1111 1111 11111111 11111111 0000111 00000 0000000x 00000000 0 1111 1111 1111 1111 0000 111 0 0000 0000 000u 0000 0000 0 POR BOR(6) qq 11111111 00000000 uu 1111 1111 0000 0000 R/W UA BF BRGH TRMT TX9D 000000 0000010 00000000 00 0000 0000 010 0000 0000 000 000 PCFG2 PCFG1 PCFG0 x=u=q== PCLATHPC<12:8> (nonpowerup)MCLR PSPIEPSPIFPIC16C73/73A PORTDPORTEPIC16C73/73A 0 PIC16C73PIC16C74 IRPRP1PIC16C7X (c) 1996 Microchip Technology Inc. DS30390B-J00 - page 29 PIC16C7X 4.2.2.1 AC/DC http://www.microchip.comERRATA STATUS 710 71 711 72 73 73A 74 74A STATUS49 ALU RESET STATUS STATUS ZDCC TOPD STATUS CLRFSTATUS3Z STATUS000u u1uu(u=) BCFBSFSWAPFMOVWFSTA TUS ZCDC STATUS 1IRPRP1(STATUS<7:6>)PIC16C7X 2 C D C borrowdigitborrow SUBLWSUBWF 49: STATUS ( 03h 83h) STATUS ( 03h 03h R/W-0 IRP R/W-0 R/W-0 R-1 R-1 RP1 RP0 TO PD bit7 R/W-x Z R/W-x DC R/W-x C bit0 R= W= U= 0 IRP IRP() 1=23(100h1FFh) n=POR 0=01(000h0FFh) IRPPIC16C7X RP0 bit65 RP1 RP1 RP0() 11=3(180h1FFh) 10=2(100h17Fh) 01=1(080h0FFh) 00=0(000h07Fh) 128RP1PIC16C7X TO bit4 TO 1=CLRWDTSLEEP 0=WDT PD bit3 PD 1=CLRWDT 0=SLEEP Z bit2 1=0 0=0 DC bit1 DC/borrow(ADDWFADDLWSUBLWSUBWF)(borrow) 1=4 0=4 C/borrow(ADDWFADDLWSUBLWSUBWF) bit0 1= 0= bit7 b o r r o w2 2 (RRFRLF) DS30390B-J00 - page 30 (c) 1996 Microchip Technology Inc. AC/DC http://www.microchip.comERRATA 4.2.2.2 PIC16C7X OPTION 710 71 711 : 72 73 73A 74 74A TMR0 1:1 PSA(OPTION<3>) O P T I O N T M R 0 / W D T I N T TMR0 PORTB 410:OPTION (( 81 h) 81h R/W-1 R/W-1 R/W-1 R/W-1 RBPU INTEDG T0CS T0SE R/W-1 PSA R/W-1 R/W-1 R/W-1 PS2 PS1 PS0 R= bit0 W= bit7 U= bit7 RBPU RBPUPORTB 1=PORTB 0=PORTB bit6 INTEDG INTEDG 1=RB0/INT 0=RB0/INT bit5 T0CS T0CSTMR0 1=RA4/T0CKI 0=(CLKOUT) bit4 T0SE T0SETMR0 1=RA4/T0CKI 0=RA4/T0CKI bit3 PSA PSA 1=WDT 0=0 0 n=POR bit20 PS2:PS0 PS2:PS0 BitValue TMR0Rate WDTRate 000 001 010 011 100 101 110 111 1:2 1:4 1:8 1:16 1:32 1:64 1:128 1:256 1:1 1:2 1:4 1:8 1:16 1:32 1:64 1:128 (c) 1996 Microchip Technology Inc. DS30390B-J00 - page 31 PIC16C7X 4.2.2.3 AC/DC http://www.microchip.comERRATA INTCON 710 71 711 72 73 73A 74 74A I N T C O N TMR0RB RB0/INT GIE(INTCON<7>) 411 PIC16C710/71/711 INTCON ( 0Bh 8Bh ) 411 PIC16C710/71/711 ( 0Bh 0Bh R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 GIE INTE RBIE T0IF ADIE T0IE R/W-0 INTF bit7 R/W-x R= RBIF W= bit0 U= 0 n=POR bit7 GIE GIE( 1 ) 1= 0= bit6 ADIE ADIEA/D 1=A/D 0=A/D bit5 T0IE T0IETMR0 1=TMR0 0=TMR0 bit4 INTE INTERB0/INT 1=RB0/INT 0=RB0/INT bit3 RBIE RBIERB 1=RB 0=RB bit2 T0IF T0IFTMR0 1=TMR0() 0=TMR0 bit1 INTF INTFRB0/INT 1=RB0/INT() 0=RB0/INT bit0 RBIF RBIFRB 1=RB7:RB41) 0=RB7:RB4 1 PIC16C71GIEGIE RETFIE 14.5 DS30390B-J00 - page 32 (c) 1996 Microchip Technology Inc. AC/DC http://www.microchip.comERRATA PIC16C7X 412 PIC16C72/73/73A/74/74A INTCON (( 0Bh 8Bh) 412 PIC16C72/73/73A/74/74A INTCON 0Bh 0Bh R/W-0 R/W-0 R/W-0 GIE PEIE T0IE R/W-0 R/W-0 R/W-0 INTE RBIE R/W-0 R/W-x INTF RBIF T0IF bit7 bit0 bit7 GIE GIE( 1 ) 1= 0= R= W= U= 0 n=POR bit6 PEIE PEIE 1= 0= bit5 T0IE T0IETMR0 1=TMR0 0=TMR0 bit4 INTE INTERB0/INT 1=RB0/INT 0=RB0/INT bit3 RBIE RBIERB 1=RB 0=RB bit2 T0IF T0IFTMR0 1=TMR0() 0=TMR0 bit1 INTF INTFRB0/INT 1=RB0/INT() 0=RB0/INT bit0 RBIF RBIFRB 1=RB7:RB41 0=RB7:RB4 1 PIC16C73PIC16C74GIEGIE RETFIE 14.5 (c) 1996 Microchip Technology Inc. DS30390B-J00 - page 33 PIC16C7X AC/DC http://www.microchip.comERRATA 4.2.2.4 PIE1 710 71 711 : 72 73 73A 74 74A PEIE (INTCON<6>) . 413:PIC16C72 PIE1 ( 8C h) 413:PIC16C72 ( 8Ch) U-0 R/W-0 U-0 U-0 R/W-0 R/W-0 - ADIE - - SSPIE CCP1IE R/W-0 R/W-0 TMR2IE TMR1IE bit7 bit0 bit7 0 bit6 ADIE ADIEA/D R= W= U= 0 n=POR 1=A/D 0=A/D bit54 0 bit3 SSPIE SSPIE 1=SSP 0=SSP bit2 CCP1IE CCP1IECCP1 1=CCP1 0=CCP1 bit1 TMR2IE TMR2IEPR2TMR2 1=PR2TMR2 0==PR2TMR2 bit0 TMR1IE TMR1IETMR1 1=TMR1 0=TMR1 DS30390B-J00 - page 34 (c) 1996 Microchip Technology Inc. AC/DC http://www.microchip.comERRATA PIC16C7X 414: PIC16C73/73A/74/74A PIE1 ( 8Ch) PIC16C73/73A/74/74A PIE1 ( 8Ch) R/W-0 (1) PSPIE R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 ADIE RCIE TXIE SSPIE CCP1IE TMR2IE TMR1IE bit0 bit7 R= W= U= 0 n=POR bit7 PSPIE(1)/ 1=PSP/ 0=PSP/ bit6 ADIE ADIEA/D 1=A/D 0=A/D bit5 RCIE RCIEUSART 1=USART 0=USART bit4 TXIE TXIEUSART 1=USART 0=USART bit3 SSPIE SSPIE 1=SSP 0=SSP bit2 CCP1IE CCP1IECCP1 1=CCP1 0=CCP1 bit1 TMR2IE TMR2IEPR2TMR2 1=PR2TMR2 0==PR2TMR2 bit0 TMR1IE TMR1IETMR1 1=TMR1 0=TMR1 1 PIC16C73PIC16C73A 2 (c) 1996 Microchip Technology Inc. DS30390B-J00 - page 35 AC/DC http://www.microchip.comERRATA PIC16C7X 4.2.2.5 PIR1 710 71 711 72 73 73A 74 GIE(INTCON<7>) 74A 415 PIC16C72 PIR1 ( 0Ch) 415 ( U-0 R/W-0 U-0 U-0 R/W-0 R/W-0 - ADIF - - SSPIF CCP1IF R/W-0 R/W-0 TMR2IF TMR1IF bit0 bit7 R= W= U= 0 n=POR bit7 0 bit6 ADIF ADIFA/D 1=A/D() 0=A/D bit54 bit3 0 SSPIF SSPIF 1=/() 0=/ bit2 CCP1IF CCP1IFCCP1 1=TMR1() 0=TMR1 1=TMR1() 0=TMR1 PWM bit1 TMR2IF TMR2IFPR2TMR2 1=PR2TMR2() 0==PR2TMR2 bit0 TMR1IF TMR1IFTMR1 1=TMR1() 0=TMR1 DS30390B-J00 - page 36 (c) 1996 Microchip Technology Inc. AC/DC http://www.microchip.comERRATA PIC16C7X 416: PIC16C73/73A/74/74A PIR1 ( 0C h) PIC16C73/73A/74/74A PIR1 ( 0C 0Ch R/W-0 (1) PSPIF R/W-0 R-0 R-0 R/W-0 R/W-0 ADIF RCIF TXIF SSPIF CCP1IF R/W-0 R/W-0 TMR2IF TMR1IF bit7 bit0 R= W= U= 0 n=POR bit7 PSPIF(1) / 1=/() 0=/ bit6 ADIF ADIFA/D 1=A/D() 0=A/D bit5 RCIF RCIFUSART 1=USART() 0=USART bit4 TXIF TXIFUSART 1=USART() 0=USART bit3 SSPIF SSPIF 1=/() 0=/ bit2 CCP1IF CCP1IFCCP1 1=TMR1() 0=TMR1 1=TMR1() 0=TMR1 PWM bit1 TMR2IF TMR2IFPR2TMR2 1=PR2TMR2() 0==PR2TMR2 bit0 TMR1IF TMR1IFTMR1 1=TMR1() 0=TMR1 1 PIC16C73PIC16C73A (c) 1996 Microchip Technology Inc. DS30390B-J00 - page 37 AC/DC http://www.microchip.comERRATA PIC16C7X 4.2.2.6 PIE2 710 71 711 72 73 73A 74 74A CCP2 417:PIE2 (( 8D h) 8Dh) U-0 U-0 U-0 U-0 U-0 U-0 U-0 R/W-0 - - - - - - - CCP2IE bit7 bit0 bit71 0 bit0 R= W= U= 0 n=POR CCP2IE CCP2IECCP2 1=CCP2 0=CCP2 DS30390B-J00 - page 38 (c) 1996 Microchip Technology Inc. AC/DC http://www.microchip.comERRATA 4.2.2.7 PIR2 710 71 711 72 73 73A 74 PIC16C7X GIE(INTCON<7>) 74A CCP2 418:PIR2 (( 0D h) 0Dh) U-0 U-0 U-0 U-0 U-0 U-0 - - - - - - U-0 - R/W-0 CCP2IF bit7 bit0 R= W= U= 0 n=POR bit71 bit0 CCP2IF CCP2IFCCP2 0 1=TMR1() 0=TMR1 1=TMR1() 0=TMR1 PWM (c) 1996 Microchip Technology Inc. DS30390B-J00 - page 39 AC/DC http://www.microchip.comERRATA PIC16C7X 4.2.2.8 PCON : 710 71 711 72 73 73A 74 74A (PCON) (POR) (BOR) 419: PCON ( 8E h) U-0 U-0 - - U-0 - U-0 - U-0 - U-0 - R/W-q POR bit7 R/W-q BOR(1) bit0 bit72 : bit1 B O R B O R ( BODEN ) B O R 0 R= W= U= 0 n=POR POR POR: 1= 0 = ( ) bit0 BOR(1): 1= 0 = ( PIC16C73/74 DS30390B-J00 - page 40 (c) 1996 Microchip Technology Inc. AC/DC http://www.microchip.comERRATA PCL PCLATH 4.3 710 71 711 1: 72 73 73A 74 74A (PC)13 P C L (PC<12:8>) PCLATH PC420 P C PCPCL(PCLATH<4:0>PCH) PC CALLGOTO(PCLATH<4:3>PCH) 420: P CC P PCH PCL 12 8 7 0 PC 5 8 PCLATH<4:0> Instruction with PCL as Destination ALU result PCLATH PCH 12 11 10 PCL 8 PIC16C7X 7 0 PC 2: PUSH POP 4.4 710 71 711 72 73 73A 74 74A PIC16C73/73APIC16C74/74A4K CALLGOTO11 11 2K CALLGOTO4K PCLATH<3> (420)CALLGOTO (PCLATH<3>) CALL 13PCPUSH 13 PC POP PCLATH<3>( PCLATH<3>) GOTO, CALL 2 PCLATH<4:3> 11 Opcode <10:0> PCLATH 4.3.1 GOTO G O T O ( A D D W F P C L ) G O T O PCL(256) (AN556) 4.3.2 1: PIC16C710/71/711/72 (PCLATH<4:3>)PIC16C7X / PCLATH<4:3> P I C 1 6 C 7 3 / 7 3 A / 7 4 / 7 4 A (PCLATH<4>) 2 3 (1000h1FFFh) PCLATH<4> PIC16CXX8x13 C A L L P C PUSH RETURN RETLW RETFIEPOPPCLATHPUSH POP 8PUSH91 1 0 2 (c) 1996 Microchip Technology Inc. DS30390B-J00 - page 41 PIC16C7X AC/DC http://www.microchip.comERRATA 4 1 PCLATH 0x500 PCLATH,3 SUB1_P1 : : : ORG 0x900 SUB1_P1 : : : RETURN 710 71 711 72 73 73A 74 74A INDFINDF 41: ORG BSF CALL 4.5 INDF FSR 4.5 INDF INDF FSR I N D F I N D F (FSR) I N D F ( F S R = 0 )00hINDF ( 4218FSR IRP(STATUS<7>) IRPPIC16C7X ;Select page1(800h-FFFh) ;Call subroutine in ;page1 (800h-FFFh) ;called subroutine ;page1 (800h-FFFh) ;return to Call subroutine ;in page 0 (000h-7FFh) RAM20h2Fh 42 42: movlw movwf NEXT clrf incf btfss goto CONTINUE : 0x20 FSR INDF FSR,F FSR,4 NEXT ;initialize pointer ;to RAM ;clear INDF register ;inc pointer ;all done? ;no clear next ;yes continue 421: / Direct Addressing (1)RP1 RP0 bank select from opcode 6 Indirect Addressing IRP(1) 0 7 FSR register bank select location select 00 01 10 0 location select 11 00h 00h not used Data Memory 7Fh 7Fh Bank 0 Bank 1 Bank 2 Bank 3 For register file map detail see Figure 4-5, Figure 4-6, Figure 4-7, and Figure 4-8. 45464748 Note 1: The RP1 and IRP bits are reserved, always maintain these bits clear. 1RP1IRP DS30390B-J00 - page 42 (c) 1996 Microchip Technology Inc. AC/DC http://www.microchip.comERRATA 5.0 I/O I/O 710 71 711 72 73 73A 74 74A I / O I / O 5.1 PORTA TRISA PORTA TRISA 710 71 711 72 73 73A 74 PIC16C7X RA4T0CKI0 PORTA R E F ADCON1 ( A / D ) : 74A PIC16C710/71/711PORTA5 PIC16C72/73/73A/74/74APORTA6 RA4/T0CKI R A TTLCMOC (TRIS) T R I S A TRISA P O R T A TRISARA TRISA 51 PORTA 51 CLRF PORTA BSF MOVLW MOVWF ; ; ; STATUS, RP0 ; 0xCF ; ; ; TRISA ; ; ; ; Initialize PORTA by setting output data latches Select Bank 1 Value used to initialize data direction Set RA<3:0> as inputs RA<5:4> as outputs TRISA<7:6> are always read as 0'. 51 RA3:RA0 RA5 51 RA3:RA0 Data bus D Q VDD WR PORT CK Q P Data Latch WR TRIS D Q CK Q N I/O pin Analog input mode TRIS Latch RD TRIS Q TTL input buffer D EN RD PORT To A/D Converter I/OVDDVSSPIC16C710/71/711RA5 (c) 1996 Microchip Technology Inc. DS30390B-J00 - page 43 PIC16C7X AC/DC http://www.microchip.comERRATA 52 RA4/T0CKI 52 RA4/T0CKI Data Bus WR PORT D Q CK Q RA4/T0CKI pin N Data Latch VSS WR TRIS D Q CK Q Schmitt Trigger input buffer TRIS Latch RD TRIS Q D EN EN RD PORT TMR0 clock input Note: I/O pin has protection diodes to VSS only. I/OVSS 51 PORTA 51 PORTA Bit Buffer RA0/AN0 RA1/AN1 RA2/AN2 RA3/AN3/VREF bit0 bit1 bit2 bit3 TTL TTL TTL TTL /VREF 0 RA4/T0CKI bit4 ST RA5/AN4/SS(1) bit5 TTL TTL=TTLST= 1 PIC16C710/71/711PORTA<5>TRISA<5> 0 5 2 P O R T A Bit7 Bit6 Bit5 Bit4 Bit3 Bit2 Bit1 Bit0 PORBOR PORTA RA5(1) RA4 RA3 RA2 RA1 RA0 0x0000 0u0000 85h TRISA TRISA5(1) TRISA4 TRISA3 TRISA2 TRISA1 TRISA0 111111 111111 9Fh ADCON1 PCFG2(2) PCFG1 PCFG0 0000 0000 Address Name 05h x=u=-= 0 PORTA 1PORTA<5>TRISA<5>PIC16C710/71/711 2PCFG2PIC16C710/71/711 DS30390B-J00 - page 44 (c) 1996 Microchip Technology Inc. AC/DC http://www.microchip.comERRATA 5.2 RB4 O R (INTCON<0>)RB PORTB TRISB 710 71 711 72 73 73A 74 74A PORTB8 TRISBTRISB TRISB 52:PORTB 52:PORTB CLRF PORTB BSF MOVLW STATUS, RP0 0xCF MOVWF TRISB ; ; ; ; ; ; ; ; ; ; PIC16C7X Initialize PORTB by setting output data latches Select Bank 1 Value used to initialize data direction Set RB<3:0> as inputs RB<5:4> as outputs RB<7:6> as inputs P O R T B RBPU(OPTION<7>) 53:RB3:RB0 VDD RBPU(2) S L E E P a) PORTB b) RBIF RBIF PORTB RBIF (AN552) : PIC16C71/73/74 (Q2)I/O RBIF PORTB PORTB 54: RB7:RB4 weak P pull-up Data Latch D Q Data bus WR Port I/O pin(1) CK Data bus TTL Input Buffer CK weak P pull-up Data Latch D WR PORT TRIS Latch D Q WR TRIS VDD RBPU(2) Q I/O pin(1) CK TRIS Latch D WR TRIS Q TTL Input Buffer CK ST Buffer RD TRIS Q RD Port D RD TRIS EN Latch Q RB0/INT RD Port Schmitt Trigger Buffer RD Port 1 DDV SS Note 1:I/OV I/O pins have diode protection to VDD and VSS. 2 RBPU= 0 (OPTION<7>)TRISB= 1 2: TRISB = '1' enables weak pull-up if RBPU = '0' (OPTION<7>). PORTB4RB7:RB4 ( RB7:RB4 )(RB7:RB4)PORTB RB7: (c) 1996 Microchip Technology Inc. D EN Set RBIF Q From other RB7:RB4 pins D EN RD Port RB7:RB6 in serial programming mode 1 I/OVDDVSS 2 RBPU= 0 (OPTION<7>)TRISB= 1 DS30390B-J00 - page 45 AC/DC http://www.microchip.comERRATA PIC16C7X 53:PORTB Bit BufferType RB1 bit1 TTL RB2 bit2 TTL RB3 bit3 TTL () RB4 bit4 TTL () RB5 bit5 TTL () RB6 bit6 TTL/ST(2) () RB7 bit7 TTL/ST(2) TTL=TTLST= 1 2 RB0/INT bit0 TTL/ST(1) 54: PORTB PORTB Bit7 Bit6 Bit5 Bit4 Bit3 Bit2 Bit1 Bit0 BOR POR uuuuuuuu 06h PORTB RB7 RB6 RB5 RB4 RB3 RB2 RB1 RB0 xxxxxxxx 86h TRISB TRISB7 TRISB6 TRISB5 TRISB4 TRISB3 TRISB2 TRISB1 TRISB0 11111111 11111111 81h OPTION RBPU INTEDG T0CS T0SE PSA PS2 PS1 PS0 11111111 11111111 x=u=PORTB DS30390B-J00 - page 46 (c) 1996 Microchip Technology Inc. AC/DC http://www.microchip.comERRATA 5.3 PORTC TRISC 710 71 711 53 PORTC 53 CLRF 72 73 PIC16C7X 73A 74 ; ; ; BSF STATUS, RP0 ; MOVLW 0xCF ; ; ; MOVWF TRISC ; ; ; 74A PORTC8TRISC PORTC (55)PORTC PORTC Initialize PORTC by setting output data latches Select Bank 1 Value used to initialize data direction Set RC<3:0> as inputs RC<5:4> as outputs RC<7:6> as inputs P O R T C TRIS TRIS TRIS TRIS TRIS 5 55 PORTC ( ) ( ) PORT/PERIPHERAL Select(1) Peripheral Data-out 0 VDD 1 Data Bus WR PORT D Q CK Q P Data Latch WR TRIS D Q CK Q I/O pin N TRIS Latch Peripheral OE(2) VSS RD TRIS Schmitt Trigger Q D RD PORT EN EN Peripheral input Note 1: Port/Peripheral select signal selects between port data and peripheral output. / 2: Peripheral OE (output enable) is only activated if peripheral select is active. 3: I/O pins have diode protection to VDD and VSS. OE() RD PORT I/OVDDVSS (c) 1996 Microchip Technology Inc. DS30390B-J00 - page 47 AC/DC http://www.microchip.comERRATA PIC16C7X 55 PORTC 55 PORTC Buffer Type Bit RC0/T1OSO/T1CKI bit0 ST RC1/T1OSI/CCP2(1) bit1 ST RC2/CCP1 bit2 ST RC3/SCK/SCL bit3 ST RC4/SDI/SDA bit4 ST RC5/SDO RC6/TX/CK(2) RC7/RX/DT(2) bit5 ST bit6 ST bit7 ST 1/1 1 2/2/PWM 1/1/PWM1 RC3/SCK/SCLSPIIC RC4/SDI/SDASPISPI USARTUSART USARTUSART ST= 1CCP2PIC16C72 2TX/CKRX/DTPIC16C72 56 PORTC 56 PORTC Bit7 Bit6 Bit5 Bit4 Bit3 Bit2 Bit1 Bit0 BOR POR 07h PORTC RC7 RC6 RC5 RC4 RC3 RC2 RC1 RC0 xxxxxxxx uuuuuuuu 87h TRISC TRIS7 TRIS6 TRIS5 TRIS4 TRIS3 TRIS2 TRIS1 TRIS0 11111111 11111111 x=u= DS30390B-J00 - page 48 (c) 1996 Microchip Technology Inc. AC/DC http://www.microchip.comERRATA 5.4 PORTD TRISD 710 71 711 72 73 73A 74 74A PIC16C7X PORTDPSPMODE(TRISE<4>) 8 ( ) TTL PORTD8 56: PORTD I/O PORTD Data Bus D Q CK Q I/O pin WR PORT Data Latch WR TRIS D Q CK Q Schmitt Trigger input buffer TRIS Latch RD TRIS Q D EN EN RD PORT Note: I/O pins has protection diodes to VDD and VSS. I/O 57: PORTD PORTD Buffer Type Bit RD0/PSP0 bit0 ST/TTL(1) RD1/PSP1 bit1 ST/TTL(1) RD2/PSP2 bit2 ST/TTL(1) RD3/PSP3 bit3 ST/TTL(1) RD4/PSP4 bit4 ST/TTL(1) RD5/PSP5 bit5 ST/TTL(1) RD6/PSP6 bit6 ST/TTL(1) RD7/PSP7 bit7 ST/TTL(1) ST=TTL=TTL 1 I/OTTL (c) 1996 Microchip Technology Inc. DS30390B-J00 - page 49 AC/DC http://www.microchip.comERRATA PIC16C7X 58: PORTD PORTD Bit7 Bit6 Bit5 Bit4 Bit3 Bit2 Bit1 Bit0 08h 88h 89h PORTD TRISD TRISE RD7 TRISD7 IBF RD6 TRISD6 OBF RD5 RD4 RD3 TRISD5 TRISD4 TRISD3 IBOV PSPMODE RD2 TRISD2 TRISE2 RD1 TRISD1 TRISE1 RD0 TRISD0 TRISE0 POR BOR xxxxxxxx uuuuuuuu 11111111 11111111 0000111 0000111 x=u=='0'PORTD DS30390B-J00 - page 50 (c) 1996 Microchip Technology Inc. AC/DC http://www.microchip.comERRATA 5.5 PORTE TRISE 710 71 711 72 73 73A 74 74A PORTE3 RE0/RD/AN5RE1/WR/AN6RE2/CS/AN7 I/OPORTEPSPMODE(TRISE<4>) TRISE<2:0> ( )ADCON1I/O TTL PIC16C7X 5 7 TRISE P O R T E ADCON1 TRISERE 57: TRISE ( 89h) TRISE R-0 R-0 R/W-0 R/W-0 U-0 R/W-1 R/W-1 R/W-1 IBF OBF IBOV PSPMODE - TRISE2 TRISE1 TRISE0 bit7 bit7 bit0 IBF IBF 1=CPU R= W= U= 0 n=POR 0= bit6 OBF OBF 1= bit5 IBOV IBOV() 1= 0= () bit4 0= PSPMODE PSPMODE 1= 0=I/O bit3 0 bit2 TRISE2 TRISE2RE2/CS/AN7 1= bit1 0= TRISE1RE1/WR/AN6 TRISE1 1= bit0 0= TRISE0RE0/RD/AN5 TRISE0 1= 0= (c) 1996 Microchip Technology Inc. DS30390B-J00 - page 51 AC/DC http://www.microchip.comERRATA PIC16C7X 58: PORTE I/O PORTE I/O Data Bus D Q CK Q I/O pin WR PORT Data Latch WR TRIS D Q CK Q Schmitt Trigger input buffer TRIS Latch RD TRIS Q D EN EN RD PORT 59:PORTE 59:PORTE Buffer Type Bit RD 1= 0=PORTD() RE1/WR/AN6 bit1 ST/TTL(1) WR 1= 0=PORTD() RE2/CS/AN7 bit2 ST/TTL(1) CS 1= 0= ST=TTL=TTL RE0/RD/AN5 bit0 ST/TTL(1) 1I/OTTL 510: 510: PORTE Bit7 Bit6 Bit5 Bit4 Bit3 Bit2 Bit1 Bit0 POR,BOR 09h PORTE RE2 RE1 RE0 000 000 89h TRISE IBF OBF IBOV PSPMODE TRISE2 TRISE1 TRISE0 0000111 0000111 9fh ADCON1 PCFG2 PCFG1 PCFG0 000 000 x=u=-= DS30390B-J00 - page 52 0 PORTE (c) 1996 Microchip Technology Inc. AC/DC http://www.microchip.comERRATA 5.6 I / O 710 71 711 5.6.1 72 73 PIC16C7X 54: I/O 73A 74 74A I / OO I BCFBSF C P U PORTB5BSF PORTB8CPU P O R T B PORTB0 0 C P U 0 (BCFBSF) 54I/O 2 ;Initial PORT settings: PORTB<7:4> Inputs ; PORTB<3:0> Outputs ;PORTB<7:6> have external pull-ups and are ;not connected to other circuitry ; ; PORT latch PORT pins ; ----- ----BCF PORTB, 7 ; 01pp ppp 11pp ppp BCF PORTB, 6 ; 10pp ppp 11pp ppp BSF STATUS, RP0 ; BCF TRISB, 7 ; 10pp ppp 11pp ppp BCF TRISB, 6 ; 10pp ppp 10pp ppp ; ;Note that the user may have expected the ;pin values to be 00pp ppp. The 2nd BCF ;caused RB7 to be latched as the pin value ;(high). (ORAND) 5.6.2 I / O I / O ( 5 9 )I/O C P U () C P U NOPI/O 59: I/O I/O I/O Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 PC Instruction fetched PC MOVWF PORTB write to PORTB PC + 1 PC + 2 PC + 3 MOVWF PORTB,W NOP NOP (0.25T CYTPD) TCY RB7:RB0 TPD Port pin sampled here TPD Instruction executed (c) 1996 Microchip Technology Inc. PORTB PORTB MOVWF PORTB write to PORTB MOVWF PORTB,W NOP DS30390B-J00 - page 53 PIC16C7X 5.7 AC/DC http://www.microchip.comERRATA 710 71 711 72 73 73A 74 74A PORTDPSPMODE(TRISE<4>) 8 RDRE0/RD/AN5WRRE1/ WR/AN6 8 PORTD8 P S P M O D E RE0/RD/AN5RDRE1/WR/AN6WR RE2/CS/AN7CS() TRISE(TRISE<2:0>) () A/D PCFG2: PCFG0(ADCON1<2:0>) I/ORE2:RE0 2 8 1 (PIC16/17)1 PORTD8 ( ) TRISD C P U I B F (TRISE<7>)PORTD IBFIBF P O R T D O B F (TRISE<6>)PORTD O B F C P U( 1 )2 I B O V (TRISE<5>) IBFOBF IBOV PSPIF(PIR1<7>) PSPIF PSPIE(PIE1<7>) 510 PORTD PORTE 510 PORTE Data bus Q WR Port D RDx pin CK EN D Q TTL RD Port EN EN One bit of PORTD Set interrupt flag PSPIF (PIR1<7>) Read Chip Select Write TTL RD CS WR Note: I/O pins has protection diodes to VDD and VSS. I/OVDDVSS DS30390B-J00 - page 54 (c) 1996 Microchip Technology Inc. AC/DC http://www.microchip.comERRATA PIC16C7X 5 1 1 Bit7 Bit6 Bit5 Bit4 Bit3 Bit2 Bit1 Bit0 POR BOR 08h PORTD RD7 RD6 RD5 RD4 RD3 RD2 RD1 RD0 xxxxxxxx uuuuuuuu 09h PORTE RE2 RE1 RE0 000 000 89h TRISE IBF OBF IBOV PSPMODE TRISE2 TRISE1 TRISE0 0000111 0000111 0Ch PIR1 PSPIF ADIF RCIF TXIF SSPIF CCP1IF TMR2IF TMR1IF 00000000 00000000 8Ch PIE1 PSPIE ADIE RCIE TXIE SSPIE CCP1IE TMR2IE TMR1IE 00000000 00000000 9fh ADCON1 PCFG2 PCFG1 PCFG0 000 000 x=u=-= (c) 1996 Microchip Technology Inc. 0 DS30390B-J00 - page 55 PIC16C7X AC/DC http://www.microchip.comERRATA NOTES: DS30390B-J00 - page 56 (c) 1996 Microchip Technology Inc. AC/DC http://www.microchip.comERRATA 6.0 710 71 711 72 73 73A 74 74A PIC16C710/71/7111 PIC16C72PIC16C73/73APIC16C74/74A3 () 0TMR0)(7) 1TMR1)(8) 2TMR2)(9) 6.1 0 0 710 71 711 72 73 73A 74 74A PIC16C7X 111214181/ /PWMCCP 1 1 6 16 6.3 2 2 710 71 711 72 73 73A 74 74A 8(PR2) ( S S P ) C C P 1 (PWM ) 1:11:41:16 TMR2 (PR2) 11 1:16 0(RTCC)8 (Fosc/4) 0 6.4 0 0 PSA(OPTION<3>) PS2:PS0(OPTION<2:0>) 0 1:1( )1214181161321 64 11281256(0) T M R 1 1 6 C C P R x H : CCPRxL CCPx 4 1 6 H i L o w 50MHz 6.2 1 1 710 71 711 72 73 73A 74 74A (Fosc/4) ( ) SLEEP CCP CCP 710 71 711 72 73 73A 74 74A CCP3 1616 10PWM T M R 1 H : T M R 1 L C C P R x H : CCPRxL CCPx () (CCP1) 1A/D(CCP2) CCPxM3:CCPxM0 P W M T M R 2 8 (PR2)10 (CCPRxH:CCPRxL<5:4>)TMR2 CCPx TMR2PR2TMR200h CCPx()Hi 1 (c) 1996 Microchip Technology Inc. DS30390B-J00 - page 57 PIC16C7X AC/DC http://www.microchip.comERRATA NOTES: DS30390B-J00 - page 58 (c) 1996 Microchip Technology Inc. AC/DC http://www.microchip.comERRATA 7.0 710 71 711 72 73 73A 74 PIC16C7X 74A 0 PSA(OPTION<3>) P S A 0 1256 7.3 / FFh00h - 7.1 0 0 T0CS(OPTION<5>) 0 () TMR02 (72 73)TMR0 710 71 711 72 73 73A 74 74A TMR0FFh00h T M R 0 T 0 I F (INTCON<2>)T0IE(INTCON<5>) T 0 I F SLEEPTMR0 S L E E P 074 T0CS(OPTION<5>) 0 RA4/T0CKI 0 T 0 S E (OPTION<4>)T0SE 7 1 Data bus FOSC/4 0 PSout 1 1 Programmable Prescaler RA4/T0CKI pin 8 Sync with Internal clocks 0 TMR0 PSout (2 cycle delay) T0SE 3 Set interrupt flag bit T0IF on overflow PSA PS2, PS1, PS0 T0CS 1T0CST0SEPSAPS2PS0(OPTION<5:0>) Note 1: T0CS, T0SE, PSA, PS2:PS0 (OPTION<5:0>). 2(76) 2: The prescaler is shared with Watchdog Timer (refer to Figure 7-6 for detailed block diagram). 7 2 PC (Program Counter) 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 PC-1 Instruction Fetch TMR0 PC PC+1 MOVWF TMR0 MOVF TMR0,W T0 Instruction Executed (c) 1996 Microchip Technology Inc. T0+1 PC+2 MOVF TMR0,W PC+3 MOVF TMR0,W T0+2 NT0 NT0 Write TMR0 executed Read TMR0 reads NT0 Read TMR0 reads NT0 PC+4 MOVF TMR0,W NT0 Read TMR0 reads NT0 PC+5 PC+6 MOVF TMR0,W NT0+1 Read TMR0 reads NT0 + 1 NT0+2 Read TMR0 reads NT0 + 2 DS30390B-J00 - page 59 T AC/DC http://www.microchip.comERRATA PIC16C7X 7 3 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 PC (Program Counter) PC-1 Instruction Fetch PC PC+1 MOVWF TMR0 MOVF TMR0,W PC+3 MOVF TMR0,W T0+1 T0 TMR0 PC+2 MOVF TMR0,W PC+4 PC+5 MOVF TMR0,W PC+6 MOVF TMR0,W Instruction Execute Read TMR0 reads NT0 Write TMR0 executed Read TMR0 reads NT0 PC NT0+1 NT0 Read TMR0 reads NT0 Read TMR0 reads NT0 Read TMR0 reads NT0 + 1 7 4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 OSC1 CLKOUT(3) Timer0 FFh FEh T0IF bit (INTCON<2>) 00h 01h 02h 1 1 GIE bit (INTCON<7>) INSTRUCTION FLOW PC PC Instruction fetched Inst (PC) Instruction executed Inst (PC-1) 1 PC +1 PC +1 Inst (PC+1) Inst (PC) Dummy cycle 0004h 0005h Inst (0004h) Inst (0005h) Dummy cycle Inst (0004h) T0IF(Q1) Note 1: Interrupt flag bit T0IF is sampled here (every Q1). 2 2: Interrupt4TcyTcy latency = 4Tcy where Tcy = instruction cycle time. 3: CLKOUT is available only in RC oscillator mode. 3 CLKOUTRC DS30390B-J00 - page 60 (c) 1996 Microchip Technology Inc. AC/DC http://www.microchip.comERRATA 7.2 710 71 711 72 73 73A 74 74A (Tosc) 7.2.1 PIC16C7X T0CKI4Tosc40nsRC T 0 C K I 10ns 404142 T0CKIQ2Q4 7 5 T 0 C K I 2Tosc20nsRC2Tosc 20nsRC 7.2.2 T M R 0 75 7 5 0 0 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 External Clock Input or Prescaler output (2) Q1 Q2 Q3 Q4 Small pulse misses sampling (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 QTosc Q = Tosc). 1 03Tosc 7Tosc Therefore, the error in measuring the interval between two edges on Timer0 input = 4Tosc max. 024Tosc 2: External clock if no prescaler selected, Prescaler output otherwise. 2 3: The arrows indicate the points in time where sampling occurs. 3 (c) 1996 Microchip Technology Inc. DS30390B-J00 - page 61 PIC16C7X 7.3 AC/DC http://www.microchip.comERRATA 710 71 711 72 73 73A 74 PSAPS2:PS0(OPTION<3:0>) 74A TMR0 (CLRF1MOVWF1BSF1 x)WDT CLRWDT (76) 76 /WDT /WDT Data Bus CLKOUT (=Fosc/4) 0 RA4/T0CKI pin 8 M U X 1 M U X 0 1 SYNC 2 Cycles TMR0 reg T0SE T0CS 0 Watchdog Timer 1 M U X Set flag bit T0IF on Overflow PSA 8-bit Prescaler 8 8 - to - 1MUX PS2:PS0 PSA WDT Enable bit 1 0 MUX PSA WDT Time-out Note: T0CS, T0SE, PSA, PS2:PS0 are (OPTION<5:0>). T0CST0SEPSAPS2:PS0(OPTION<5:0>) DS30390B-J00 - page 62 (c) 1996 Microchip Technology Inc. AC/DC http://www.microchip.comERRATA 7.3.1 PIC16C7X WDT 72 7 2 :: W D T W CLRWDT RESET WDT (71) WDT BSF MOVLW MOVWF BCF ;Clear WDT and ;prescaler STATUS, RP0 ;Bank 1 b'xxxx0xxx' ;Select TMR0, new ;prescale value and OPTION ;clock source STATUS, RP0 ;Bank 0 71 : ( 0 WDT) ( 0 BCF CLRF BSF CLRWDT MOVLW MOVWF BCF STATUS, RP0 TMR0 STATUS, RP0 ;Bank 0 ;Clear TMR0 & Prescaler ;Bank 1 ;Clears WDT ;Select new prescale ;value & WDT ;Bank 0 b'xxxx1xxx' OPTION STATUS, RP0 71 : 0 PIC16C710/71/711 0 PIC16C710/71/711 PIC16C710/71/711 Bit7 Bit6 Bit5 Bit4 Bit3 Bit2 Bit1 Bit0 POR BOR xxxxxxxx uuuuuuuu RBIE T0IF INTF RBIF 0000000x 0000000u 01h TMR0 0Bh/8Bh INTCON GIE ADIE T0IE 81h OPTION RBPU INTEDG T0CS T0SE PSA PS2 PS1 PS0 11111111 11111111 85h TRISA TRISA4 TRISA3 TRISA2 TRISA1 TRISA0 11111 11111 x=u=-= INTE 0 72 : 0 (PIC16C72/73/73A/74/74A) 0 (PIC16C72/73/73A/74/74A) Bit7 Bit6 Bit5 Bit4 Bit3 Bit2 Bit1 Bit0 POR BOR xxxxxxxx uuuuuuuu 01h TMR0 0Bh/8Bh INTCON GIE PEIE T0IE INTE RBIE T0IF INTF RBIF 0000000x 0000000u 81h OPTION RBPU INTEDG T0CS T0SE PSA PS2 PS1 PS0 11111111 11111111 85h TRISA 111111 111111 x=u=-= (c) 1996 Microchip Technology Inc. TRISA5 TRISA4 TRISA3 TRISA2 TRISA1 TRISA0 0 0 DS30390B-J00 - page 63 PIC16C7X AC/DC http://www.microchip.comERRATA NOTES: DS30390B-J00 - page 64 (c) 1996 Microchip Technology Inc. AC/DC http://www.microchip.comERRATA 8.0 1 1 710 71 711 72 73 73A 74 74A 1 2 8 (TMR1HTMR1L)16 (TMR1H+TMR1L)0000hFFFFh 0000hTMR1 TMR1IF(PIR1<0>) TMR1TMR1IE(PIE1<0>) 12 TMR1CS (T1CON <1>) PIC16C7X 1 R C 0 / T1OSO/T1CKI TMR1ON(T1CON<0>) 2CCP(10.0) 81 PIC16C72/73A/74A ( T 1 O S C E N ) R C 1 / T1OSI/CCP2RC0/T1OSO/T1CKI TRISC<1:0> PIC1673/741 (T1OSCEN)RC1/T1OSI/CCP2 RC0/T1OSO/T1CKI TRISC<0> 81 T1CON 1 ( 10h ) 81 T1CON 1 ( U-0 - U-0 R/W-0 - T1CKPS1 R/W-0 R/W-0 T1CKPS0 T1OSCEN R/W-0 T1SYNC R/W-0 R/W-0 TMR1CS TMR1ON bit7 bit0 bit76 0 TICKPS0 bit54TICKPS1 TICKPS1 TICKPS0:1 TICKPS1 11=1:8 R= W= U= 0 n=POR 10=1:4 01=1:2 00=1:1 bit3 T1OSCEN T1OSCEN 1= 0= bit2 T1SYNC T1SYNC TMR1CS=1 1= 0= TMR1CS=0 TMR1CS=01 bit1 TMR1CS TMR1CS 1=RC0/T1OSO/T1CKI() 0=(OSC/4) bit0 TMR1ON TMR1ON 1= 0= (c) 1996 Microchip Technology Inc. DS30390B-J00 - page 65 PIC16C7X 8.1 AC/DC http://www.microchip.comERRATA 11 710 71 711 72 73 73A 8.2.1 74 74A 1 (Tosc)TMR1 TMR1CS(T1CON<1>) OSC/4 T1SYNC(T1CON<2>) 11 T1CKIQ2Q4 T1CKI 2Tosc (20nsRC)2Tosc(20ns R C ) 454647 8.2 710 71 711 72 73 73A 74 74A T M R 1 C S T1OSCENRC1/T1OSI/CCP2 T1OSCENRC0/T1OSO/ T1CKI 1 1 T1CKI4Tosc(40ns RC) 10nsT1CKI 4042454647 T1SYNC SLEEP 8 2 1 1 Set flag bit TMR1IF on Overflow TMR1H Synchronized clock input 0 TMR1 TMR1L 1 TMR1ON on/off T1OSC RC0/T1OSO/T1CKI RC1/T1OSI/CCP2(2) Note 1 2 3 T1SYNC (3) 1 T1OSCEN OSC/4 Enable Internal Oscillator(1) Clock Synchronize Prescaler 1, 2, 4, 8 det 0 2 T1CKPS1:T1CKPS0 TMR1CS SLEEP input 1: When the T1OSCEN bit is cleared, the inverter and feedback resistor are turned off. This eliminates power drain. T1OSCEN 2: The CCP2 module is not implemented in the PIC16C72. CCP2PIC16C72 3: For the PIC16C73 and PIC16C74, the Schmitt Trigger is not implemented in external clock mode. PIC16C73PIC16C74 DS30390B-J00 - page 66 (c) 1996 Microchip Technology Inc. AC/DC http://www.microchip.comERRATA 8.3 8 8 1 : 1 66 710 71 711 72 73 73A 74 74A T1SYNC(T1CON<2>) S L E E P (8.3.2 ) 1 8.3.1 T1SYNC 45 46 47 8.3.2 PIC16C7X TMR1H TMR1L () - MOVF TMR1H, W ;Read high byte MOVWF TMPH ; MOVF TMR1L, W ;Read low byte MOVWF TMPL ; MOVF TMR1H, W ;Read high byte SUBWF TMPH, W ;Sub 1st read ; with 2nd read BTFSC STATUS,Z ;Is result = 0 GOTO CONTINUE ;Good 16-bit read ; ; TMR1L may have rolled over between the read ; of the high and low bytes. Reading the high ; and low bytes now will read a good value. ; MOVF TMR1H, W ;Read high byte MOVWF TMPH ; MOVF TMR1L, W ;Read low byte MOVWF TMPL ; ; Re-enable the Interrupt (if required) CONTINUE ;Continue with ;your code 8.4 710 71 711 72 73 73A 74 74A T 1 O S I ( ) T1OSO() T1OSCEN(T1CON<3>) 2 0 0 k H z SLEEP32kHz 8 1 LP 8 1 Osc Type Freq LP C1 C2 32 kHz(1) 15 pF 15 pF 100 kHz 15 pF 15 pF 200 kHz 0 - 15 pF 0 - 15 pF 1V DD4.5VC1 = C2 (c) 1996 Microchip Technology Inc. 30pF Crystals Tested: 32.768 kHz Epson C-001R32.768K-A 20 PPM 100 kHz Epson C-2 100.00 KC-P 20 PPM 200 kHz STD XTL 200.000 kHz 20 PPM DS30390B-J00 - page 67 AC/DC http://www.microchip.comERRATA PIC16C7X 8.5 CCPRxH:CCPRxL C C P 11 710 71 711 72 73 73A 74 74A 8.6 CCP2PIC16C72 CCP1CCP2 (CCP1M3:CCP1M0=1011) 1 CCP1 CCP2 TMR1IF(PIR1<0>) CCP1CCP2 1 (TMR1H 1 ( TMR1L) 710 71 711 72 73 73A 74 74A TMR1HTMR1LCCP1 P O R T 1 C O N 00h 8.7 11 710 71 711 72 73 73A 74 74A TMR1HTMR1L 82: Bit7 Bit6 Bit5 Bit4 GIE PEIE T0IE INTE Bit3 Bit2 Bit1 Bit0 POR BOR 0Bh/8Bh INTCON 0Ch PIR1 8Ch PIE1 0Eh TMR1L 16TMR1 0Fh TMR1H 16TMR1 10h T1CON x=u=-='0' 1: PSPIEPSPIFPIC16C73/73A PSPIF (1,2) ADIF RCIF PSPIE (1,2) ADIE RCIE RBIE T0IF INTF RBIF 0000000x 0000000u (2) SSPIF CCP1IF TMR2IF TMR1IF 00000000 00000000 (2) SSPIE CCP1IE TMR21E TMR1IE (2) TXIF (2) TXIE T1CKPS1 T1CKPS0 T1OSCEN T1SYNC TMR1CS TMR1ON 00000000 00000000 xxxxxxxx uuuuuuuu xxxxxxxx uuuuuuuu 000000 uuuuuu 2: PIC16C72USART DS30390B-J00 - page 68 0 (c) 1996 Microchip Technology Inc. AC/DC http://www.microchip.comERRATA 9.0 9.1 2 2 710 71 711 72 73 73A 74 (Fosc/4) ( T2CKPS1: T2CKPS0(T2CON<1:0>))1:11:41:16 2 8 P R 2 2 00hPR2 0 0 h P R 2 PR2RESET T M R 2 T M R 2 ( TMR2IFPIR1<1>)4 ( 1 : 1 1 : 1 6 ) T M R 2 O N (T2CON<2>)2 922 22 710 71 711 74A 28 CCPPWMPWM TMR2 PIC16C7X 72 73 73A 74 74A TMR2 T2CON M C L R ) WDTPORMCLRT2CON TMR2 9.2 TMR2 TMR2 710 71 711 72 73 73A 74 74A TMR2() 9 1 Sets flag bit TMR2IF TMR2 output (1) Reset Postscaler 1:1 to 1:16 4 1 EQ Prescaler 1:1, 1:4, 1:16 TMR2 reg Comparator OSC/4 2 PR2 reg TMR2 SSP Note 1: TMR2 register output can be software selected by the SSP Module as a baud clock. (c) 1996 Microchip Technology Inc. DS30390B-J00 - page 69 AC/DC http://www.microchip.comERRATA PIC16C7X 92 T2CON 2 ( 12h ) 92 T2CON 2 ( U-0 R/W-0 - R/W-0 R/W-0 R/W-0 TOUTPS3 TOUTPS2 TOUTPS1 R/W-0 R/W-0 TOUTPS0 TMR2ON T2CKPS1 R/W-0 T2CKPS0 bit7 bit0 bit7: bit63: bit2: bit10: 0 TOUTPS3:TOUTPS0:2 TOUTPS3:TOUTPS0: 0000=1:1 0001=1:2 1111=1:16 TMR2ON: TMR2ON:2 1=2 0=2 T2CKPS1:T2CKPS0: T2CKPS1:T2CKPS0:2 00=1 01=4 1x=16 R= W= U= 0 n=POR 9 1 0Bh/8Bh INTCON Bit7 Bit6 Bit5 Bit4 Bit3 Bit2 Bit1 Bit0 POR BOR GIE PEIE T0IE INTE RBIE T0IF INTF RBIF 0000000x 0000000u ADIF RCIF(2) TXIF(2) SSPIF CCP1IF TMR2IF TMR1IF 00000000 00000000 ADIE RCIE(2) TXIE(2) SSPIE CCP1IE TMR21E TMR1IE 00000000 00000000 00000000 00000000 0Ch PIR1 PSPIF (1,2) 8Ch PIE1 PSPIE (1,2) 11h TMR2 2 12h T2CON 92h PR2 TOUTPS3 2 TOUTPS2 TOUTPS1 TOUTPS0 TMR2ON T2CKPS1 T2CKPS0 0000000 0000000 11111111 11111111 x=u=-= 0 1: 2: PSPIEPSPIFPIC16C73/73A PIC16C72USART 0 DS30390B-J00 - page 70 (c) 1996 Microchip Technology Inc. AC/DC http://www.microchip.comERRATA 10.0 PWM P 710 71 711 72 73 73A 74 710 72 73 73A 74 71 711 74A CCP1 CCP1 74A CCP2 CCP2 CCP(//PWM)16 1 6 1 6 PWM CCP1CCP2 101102 CCP C C P 1 CCPCCP2 CCP1 PIC16C7X CCP1 //PWM1(CCPR1)28 CCPR1L()CCPR1H( ) CCP2 //PWM2(CCPR2)28 CCPR2L()CCPR2H( ) C C P CCP (AN594) 101 CCP 101 CCPMode TimerResour ce Ca ptu re Ti mer 1 Co mpa re Ti mer 1 PW M Ti mer 2 102 2 CCP 102 CCP CC Px M od e PWM PWM PWM CC Py M od e PWM (c) 1996 Microchip Technology Inc. TMR1 TMR1 TMR1 PWM(TMR2) DS30390B-J00 - page 71 AC/DC http://www.microchip.comERRATA PIC16C7X 101 CCP1CON ( 17h)/CCP2CON ( 1Dh) 101 CCP1CON ( 17h)/CCP2CON 17h)/CCP2CON ( 1Dh) U-0 U-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 - - CCPxX CCPxY CCPxM3 CCPxM2 CCPxM1 CCPxM0 bit7 bit0 bit76: bit54: bit30: 10.1 R= W= U= 0 0 CCPxX:CCPxY: CCPxX:CCPxY:PWM n=POR : : PWM:(10)2 ()( 0 ) CCPxM3:CCPxM0: CCPxM3:CCPxM0:CCPx 0000= //PWM(CCPx) 0100= 0101= 0110= 4 0111=16 1000= (CCPxIF) 1001= (CCPxIF) 1010= (CCPxIFCCPx ) 1011= (CCPxIFCCP1TMR1 ; CCP2TMR1A/D(A/D)) 11xx= PWM 710 71 711 72 73 73A 74 74A RC2/CCP1 CCPR1H:CCPR1LTMR116 R C 2 / C C P 1 CCP1IE(PIE1<2>) CCP1IF 1CCP1M3:CCP1M0(CCP1CON<3: 0 > ) CCP1IF(PIR1<2>) C C P R 1 RC2/CCP1 TRIS DS30390B-J00 - page 72 (c) 1996 Microchip Technology Inc. AC/DC http://www.microchip.comERRATA 10.1.1 CCP1M3:CCP1M04 C C P 101 C C P 1 M 3 : C C P 1 M 0 (CCP1CON<3:0>) TRISC<2> RC2/CCP1 CCP1CONRC2/CCP1 10.2.1 CLRF CCP1CON MOVLW NEW_CAPT_PS MOVWF CCP1CON ;Turn CCP module off ;Load the W reg with ; the new prescaler ; mode value and CCP ON ;Load CCP1CON with this ; value C C P 1 CCP() 10.2.3 10.1.2 C C P 1 1 0 2 Prescaler / 1, 4, 16 CCP1 10.2.2 101: PIC16C7X CCP1TMR1 CCPR1 1 1 6 CCP2TMR1 A / D ( A / D ) PIC16C72CCP1 TMR1A/D (A/D) Set flag bit CCP1IF (PIR1<2>) RC2/CCP1 Pin CCPR1H and edge detect CCPR1L Capture Enable TMR1H CCP1CCP2 TMR1IF(PIR1<0>) 1 0 3 TMR1L CCP1CON<3:0> Q's Special Event(1) 710 71 711 72 73 73A 74 74A 16 CCPR1 TMR1 RC2/CCP1 (c) 1996 Microchip Technology Inc. Trigger 10.2 Set flag bit CCP1IF (PIR1<2>) CCPR1H CCPR1L Q S Output Comparator Logic match RC2/CCP1 R Pin TRISC<2> TMR1H TMR1L Output Enable CCP1CON<3:0> Mode Select 1 For CCP1 (if enabled), reset Timer1. Note 1: CCP1()1 (if enabled), reset Timer1,1 and set bit GO/ C For C P 2CCP2 ( ) DONE (ADCON0<2>), which starts an A/D conversion. GO/DONE(ADCON0<2>)A/D DS30390B-J00 - page 73 PIC16C7X 10.3 AC/DC http://www.microchip.comERRATA PWM PWM 710 71 711 1 0 4 72 73 73A 74 74A CCPxCON<5:4> Duty cycle registers ( P W M ) R C 2 / C C P 1 1 0 P W M TRISC<2> PWM8 CCPR1 CCPR1LCCPR1H PWM1 ( ) 8 PWMPWM CCPR1HPWM 2 ( P R 2 ) CCPRxL CCPRxH (Slave) Q R Comparator RCy/CCPx Pin (Note 1) TMR2 S TRISC Comparator Clear Timer, CCP1 pin and latch Duty Cycle PR2 PWM= Note 1: 1 8-bit timer is concatenated with 2-bit internal Q 0 1 clock or 2-bits of the prescaler to create 10-bit time-base. [(PR2)+1]4Tosc(TMR2) PWM= (DC1)Tosc(TMR2) DC1=CCPRxLCCPxCON<5:4>10 PWM 1 0 103 20MHz PWM VS 103 20MHz PWM PWM VS CCP1CONRC2/CCP1PWM I / O 2 PWM PWM (High Resolu tion Mode) TMR2 Presc a le=1 Presca TMR2 Presc a le=4 Presca TMR2 Presc a le=16 Presca 10bit 19.53kHz 4.88kHz 1.22kHz 9bit 39.06kHz 9.77kHz 2.44kHz 8bit 78.13kHz 19.53kHz 4.88kHz 104 20MHz PWM 20MHz PWM PWM PWM 1.22kHz 4.88kHz 16 4 1 1 1 1 0xFF 0xFF 0xFF 0x3F 0x1F 0x17 (Highresolutionmode) 10bit 10bit 10bit 8bit 7bit 5.5bit (Standardresolutionmode)(1) 8bit 8bit 8bit 6bit 5bit 3.5bit TimerPrescaler(16,4,1) PR2Value 1 19.53kHz 78.12kHz 156.3kHz CCPxX:CCPxY( 0 Q DS30390B-J00 - page 74 208.3kH )PR2TMR2 (c) 1996 Microchip Technology Inc. AC/DC http://www.microchip.comERRATA PIC16C7X 1 0 5 1 1 0Bh/8Bh INTCON 0Ch PIR1 0Dh(2) PIR2 8Ch PIE1 Bit7 Bit6 Bit5 Bit4 Bit3 Bit2 Bit1 Bit0 POR BOR GIE PEIE T0IE INTE RBIE T0IF INTF RBIF 0000000x 0000000u ADIF RCIF(2) TXIF(2) SSPIF CCP1IF TMR2IF TMR1IF 00000000 00000000 CCP2IF 0 0 ADIE RCIE(2) TXIE(2) SSPIE CCP1IE TMR2IE TMR1IE 00000000 00000000 CCP2IE (1,2) PSPIF (1,2) PSPIE 8Dh(2) PIE2 0Eh TMR1L 16TMR 0Fh TMR1H 16TMR 10h T1CON 15h CCPR1L //PWM1(LSB) 16h CCPR1H //PWM1(MSB) 17h CCP1CON 1Bh(2) CCPR2L //PWM(LSB) 1Ch(2) CCPR2H //PWM(MSB) 1Dh(2) CCP2CON T1CKPS1 CCP1X CCP2X T1CKPS0 T1OSCEN CCP1Y CCP2Y CCP1M3 CCP2M3 T1SYNC CCP1M2 CCP2M2 TMR1CS CCP1M1 CCP2M1 TMR1ON CCP1M0 CCP2M0 0 0 xxxxxxxx uuuuuuuu xxxxxxxx uuuuuuuu 000000 uuuuuu xxxxxxxx uuuuuuuu xxxxxxxx uuuuuuuu 000000 000000 xxxxxxxx uuuuuuuu xxxxxxxx uuuuuuuu 000000 000000 x=u=-= 0 1 1: PSPIEPSPIFPIC16C73/73A 2: PIC16C72USARTCCP2 0' 1 0 6 0Bh/8Bh INTCON 0Ch PIR1 0Dh(2) PIR2 Bit7 GIE PSPIF (1,2) (1,2) Bit6 Bit5 Bit4 Bit3 Bit2 T0IE INTE RBIE T0IF INTF RBIF 0000000x 0000000u TXIF(2) SSPIF CCP1IF TMR2IF TMR1IF 00000000 00000000 CCP2IF 0 0 ADIE RCIE(2) TXIE(2) SSPIE CCP1IE TMR2IE TMR1IE 00000000 00000000 CCP2IE 0 0 xxxxxxxx uuuuuuuu xxxxxxxx uuuuuuuu PIE2 0Eh TMR1L 16TMR 0Fh TMR1H 16TMR 10h T1CON 15h CCPR1L //PWM1(LSB) 16h CCPR1H //PWM1(MSB) 17h CCP1CON 1Bh(2) CCPR2L //PWM(LSB) 1Ch(2) CCPR2H //PWM(MSB) 1Dh(2) CCP2CON RCIF(2) PIE1 POR BOR PEIE 8Dh(2) Bit0 ADIF 8Ch PSPIE Bit1 T1CKPS1 CCP1X CCP2X T1CKPS0 CCP1Y CCP2Y T1OSCEN CCP1M3 CCP2M3 T1SYNC CCP1M2 CCP2M2 TMR1CS CCP1M1 CCP2M1 TMR1ON CCP1M0 CCP2M0 000000 uuuuuu xxxxxxxx uuuuuuuu xxxxxxxx uuuuuuuu 000000 000000 xxxxxxxx uuuuuuuu xxxxxxxx uuuuuuuu 000000 000000 x=u=-= 0 1 1: PSPIEPSPIFPIC16C73/73A 2: PIC16C72USARTCCP2 0 (c) 1996 Microchip Technology Inc. DS30390B-J00 - page 75 AC/DC http://www.microchip.comERRATA PIC16C7X 1 0 77 P W M 0Bh/8Bh INTCON 0Ch PIR1 Bit7 Bit6 GIE Bit4 Bit2 Bit1 Bit0 POR BOR PEIE T0IE INTE RBIE T0IF INTF RBIF 0000000x 0000000u ADIF RCIF(2) TXIF(2) SSPIF CCP1IF TMR2IF TMR1IF 00000000 00000000 CCP2IF 0 0 (1,2) ADIE RCIE(2) TXIE(2) SSPIE CCP1IE TMR2IE TMR1IE 00000000 00000000 CCP2IE 0Dh(2) PIR2 8Ch PIE1 PSPIE 8Dh(2) PIE2 11h TMR2 2 92h PR2 2 12h T2CON 15h CCPR1L //PWM1(LSB) 16h CCPR1H //PWM1(MSB) 17h CCP1CON 1Bh(2) CCPR2L 1Ch(2) CCPR2H 1Dh(2) CCP2CON Bit3 (1,2) PSPIF Bit5 0000000 xxxxxxxx uuuuuuuu 000000 000000 //PWM2(LSB) xxxxxxxx uuuuuuuu //PWM2(MSB) xxxxxxxx uuuuuuuu 000000 000000 CCP2X CCP1Y CCP2Y TOUTPS0 CCP1M3 CCP2M3 TMR2ON CCP1M2 CCP2M2 T2CKPS1 CCP1M1 CCP2M1 T2CKPS0 11111111 uuuuuuuu CCP1X TOUTPS1 11111111 xxxxxxxx TOUTPS2 0 00000000 0000000 TOUTPS3 0 00000000 CCP1M0 CCP2M0 x = u = -= 0 P W M 2 1: PSPIEPSPIFPIC16C73/73A 2: PIC16C72USARTCCP2 0 DS30390B-J00 - page 76 (c) 1996 Microchip Technology Inc. AC/DC http://www.microchip.comERRATA 11.0 PIC16C7X AN578 I 2C S S P (SSP) (SSP) (SSP) ( S S P ) EEPROM A/DSSP 2 (SPI) (I 2C) 111 SSPSTAT ( 94h) ( 94h) U-0 U-0 R-0 R-0 R-0 R-0 R-0 R-0 - - D/A P S R/W UA BF R = W = U = - n = POR bit7 bit0 bit76: 0 D/A bit5: D/A:/(I2 C) 1= 0= P:(I2 CSSPSSPEN bit4: ) 1=(RESET 0 ) 0= S:(I2 CSSPSSPEN bit3: ) 1=(RESET 0 ) 0= R/W R/W:/(I2 C) bit2: R/W 1 0 UA bit1: UA:(10I2C) 1=SSPADD 0= BF bit0: BF: (SPII2C) 1=SSPBUF 0=SSPBUF (I2C) 1=SSPBUF 0=SSPBUF (c) 1996 Microchip Technology Inc. DS30390B-J00 - page 77 AC/DC http://www.microchip.comERRATA PIC16C7X 112 SSPCON ( 14h) ( 14h) R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 WCOL SSPOV SSPEN CKP SSPM3 SSPM2 SSPM1 SSPM0 bit7 bit0 R = W = U = - n = POR bit7: WCOL WCOL: 1=SSPBUF() 0= bit6: SSPOV SSPOV: SPI 1=SSPBUF SSPSR SSPBUF ()SSPBUF 0= I2C 1=SSPBUFSSPOV SSPOV 0= bit5: SSPEN SSPEN: SPI 1=SDKSDOSDI 0=I/O I2C 1=SDASCL 0=I/O CKP: bit4: CKP SPI 1= 0= I2C SCK 1= 0=()() SSPM3:SSPM0 bit30:SSPM3:SSPM0 SSPM3:SSPM0: 0000=SPI=Fosc/4 0001=SPI=Fosc/16 0010=SPI=Fosc/64 0011=SPI=TMR2/2 0100=SPI=SCKSS 0101=SPI=SCKSSSSI/O 0110=I2C7 0111=I2C10 1011=I2C() 1110=I2C7 1111=I2C10 DS30390B-J00 - page 78 (c) 1996 Microchip Technology Inc. AC/DC http://www.microchip.comERRATA 11.1 SPI 710 71 711 PIC16C7X 111 SSPBUF(SSPSR) 111 SSPBUF(SSPSR) 72 73 73A 74 74A LOOP SPI8 3 BSF BTFSS GOTO BCF MOVF (SDO)RC5/SDO (SDI)RC4/SDI (SCK)RC3/SCK STATUS,RP0 SSPSTAT,BF ;Specify Bank 1 ;Has data been ;received ;(transmit ;complete)? ;No ;Specify Bank 0 ;W reg = contents ; of SSPBUF ;Save in user RAM ;W reg = contents ; of TXDATA ;New data to xmit LOOP STATUS,RP0 SSPBUF,W MOVWF RXDATA MOVF TXDATA,W 4 MOVWF SSPBUF (SS)RA5/AN4/SS S P I SSPCON(SSPCON<5: 0 > ) (SCK) (SCK) (SCK / /) SPI SSP (113) SSPSRSSPBUF S S P ( S S P S T A T ) 113 SSP ( SPI ) 113 SPI ) () () SSP/(SSPSR) (SSPBUF)SSPSR SSPBUF SSPSR 8 SSPBUF BF(SSPSTAT<0>)SSPIF ( P I R 1 < 3 > ) (SSPBUF) / SSPBUF W C O L ( S S P C O N < 7 > )W C O L SSPBUF SSPBUFSSPBUF SSPBUF () BF(SSPSTAT<0>)SSPBUF B F SPI /SSP SSPBUF ( )/SSPBUF(SSPSR) 1 1 1 SSPBUF(SSPSR) (c) 1996 Microchip Technology Inc. Internal data bus Read Write SSPBUF reg SSPSR reg SDI shift clock bit0 SDO SS Control Enable SS Edge Select 2 Clock Select SSPM3:SSPM0 4 Edge Select SCK TMR2 output 2 Prescaler TCY 4, 16, 64 Data from TX/RX in SSPSR TRISC<3> DS30390B-J00 - page 79 PIC16C7X AC/DC http://www.microchip.comERRATA S S P SSPEN(SSPCON<5>) S P I SSPENSSPCON SSPEN SDISDOSCKSS (TRISC ) SDITRISC<4> SDOTRISC<5> SCK()TRISC<3> SCK()TRISC<3> SSTRISA<5> (TRIS) ( ) TRISSDISS 1 1 4 2 (1)SCK (CKP) ( ) 3 - - - S C K ( 2 ) SSPBUF /SPI S C K ()SSPSR S D I SSPBUF () S C K S S P I F (PIR1<3>) CKP(SSPCON<4>) 115 116SPI MSB SPI()1 Fosc/4(TCY ) Fosc/16(4TCY ) Fosc/64(16TCY ) 2/2 (20MHz) 5 M H z 114 SPI / 114 / SPI Master (SSPM3:SSPM0 = 00xxb) SPI Slave (SSPM3:SSPM0 = 010xb) SDO SDI Serial Input Buffer (SSPBUF) Serial Input Buffer (SSPBUF) SDI Shift Register (SSPSR) MSb SDO LSb Shift Register (SSPSR) MSb LSb Serial Clock SCK PROCESSOR 1 DS30390B-J00 - page 80 SCK PROCESSOR 2 (c) 1996 Microchip Technology Inc. AC/DC http://www.microchip.comERRATA SSSPI (SSPCON<3:0>=04h) TRISA<5> S S SDO S S S D O / PIC16C7X 2SDO SDI S P I S D O SDOSDI (SDI ) 115 SPI SS 115 SCK (CKP = 0) SCK (CKP = 1) bit7 SDO bit6 bit5 bit4 bit3 bit2 bit1 bit0 SDI bit7 bit0 SSPIF Interrupt flag 116 SPI SS 116 SS SCK (CKP = 0) SCK (CKP = 1) SDO bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0 SDI bit7 bit0 SSPIF (c) 1996 Microchip Technology Inc. DS30390B-J00 - page 81 AC/DC http://www.microchip.comERRATA PIC16C7X 111 SPI 111 0Bh/8Bh 0Ch INTCON PIR1 Bit7 Bit6 Bit5 Bit4 Bit3 Bit2 Bit1 Bit0 POR BOR GIE PEIE T0IE INTE RBIE T0IF INTF RBIF 0000000x 0000000u PSPIF (1,2) ADIF RCIF(2) TXIF(2) SSPIF CCP1IF TMR2IF TMR1IF 00000000 00000000 (1,2) ADIE RCIE(2) TXIE(2) SSPIE CCP1IE TMR2IE TMR1IE 00000000 00000000 xxxxxxxx uuuuuuuu 8Ch PIE1 PSPIE 13h SSPBUF 14h SSPCON WCOL SSPOV SSPEN CKP SSPM3 SSPM2 SSPM1 SSPM0 00000000 00000000 85h TRISA TRISA5 TRISA4 TRISA3 TRISA2 TRISA1 TRISA0 111111 111111 94h SSPSTAT D/A P S R/W UA BF 000000 000000 x=u=-= 0 SPISSP : PSPIEPSPIFPIC16C73/73A : PIC16C72USART 0 DS30390B-J00 - page 82 (c) 1996 Microchip Technology Inc. AC/DC http://www.microchip.comERRATA 11.2 I 2 C T M PIC16C7X 710 71 711 72 73 73A 74 74A ( I 2 C ) 11.3I2 CSSP I2CPhillipsCorporation2 1 0 0 K b p s 4 0 0 K b p s I 2 C ( ) S S P PIC16CXX 1 1 2 I 2 C I 2 C PhillipsCorpora t i o n I 2 C I 2 C talk l i s t e n / ( / )2 (SCL)(SDA) AND I 2 C 400pF 11.2.1 () (SCL)(SDA) S T A R T STOP STARTSCLSDA STOPSCLSDA 117STARTSTOP STARTSTOP S C L S D A 117 START STOP 117 START STOP SDA SCL S Start Condition P Change of Data Allowed Change of Data Allowed Stop Condition 112 I 2 C 112 1 1 2 (c) 1996 Microchip Technology Inc. DS30390B-J00 - page 83 AC/DC http://www.microchip.comERRATA PIC16C7X 11.2.2I2C 11.2.3 R/W7(118 )R/W10 (119)10 10 (ACK)(1110) STOPSDA (117) 1 1 8 7 MSb LSb slave address S R/W ACK 1110: R/W ACK S Sent by Slave Data Output by Transmitter Data Output by Receiver Start Condition Read/Write pulse Acknowledge not acknowledge acknowledge SCL from Master 119 I 2 C 1 00 S 1 1 1 1 0 A9 A8 R/W ACK S Start Condition Clock Pulse for Acknowledgment A7 A6 A5 A4 A3 A2 A1 A0 ACK sent by slave ) () STOPSDA STOP = 0 for write S R/W ACK 9 8 2 1 - Start Condition - Read/Write Pulse - Acknowledge S C L S C L 1111 1111 SDA MSB acknowledgment signal from receiver byte complete interrupt with receiver acknowledgment signal from receiver clock line held low while interrupts are serviced SCL S Start Condition DS30390B-J00 - page 84 1 2 Address 7 8 9 R/W ACK 1 Wait State 2 Data 3*8 9 ACK P Stop Condition (c) 1996 Microchip Technology Inc. AC/DC http://www.microchip.comERRATA 11121113 PIC16C7X ) 1114 ( S T O P )START(Sr) (SCL SDA ) ( 1 1 1 22 For 10-bit address: S Slave Address R/W A1 Slave Address A2 First 7 bits Second byte For 7-bit address: S Slave Address R/W A Data A Data A/A P '0' (write) data transferred (n bytes - acknowledge) A master transmitter addresses a slave receiver with a 7-bit address. The transfer direction is not changed. From master to slave From slave to master (write) Data A A = acknowledge (SDA low) A = not acknowledge (SDA high) S = Start Condition P = Stop Condition Data A/A P A master transmitter addresses a slave receiver with a 10-bit address. 1 1 1 33 For 10-bit address: S Slave Address R/W A1 Slave Address A2 First 7 bits Second byte For 7-bit address: S Slave Address R/W A Data A Data A P '1' (read) data transferred (n bytes - acknowledge) A master reads a slave immediately after the first byte. From master to slave From slave to master (write) A = acknowledge (SDA low) A = not acknowledge (SDA high) S = Start Condition P = Stop Condition Sr Slave Address R/W A3 Data A First 7 bits Data A P (read) A master transmitter addresses a slave receiver with a 10-bit address. 1114 1114 (read or write) (n bytes + acknowledge) S Slave Address R/W A Data A/A Sr Slave Address R/W A Data A/A P (read) Sr = repeated Start Condition (write) Direction of transfer may change at this point Transfer direction of data and acknowledgment bits depends on R/W bits. Combined format: Sr Slave Address R/W A Slave Address A Data A First 7 bits Second byte Data A/A Sr Slave Address R/W A Data A First 7 bits Data A P (read) (write) Combined format - A master addresses a slave with a 10-bit address, then transmits data to this slave and reads data from this slave. From master to slave From slave to master (c) 1996 Microchip Technology Inc. A = acknowledge (SDA low) A = not acknowledge (SDA high) S = Start Condition P = Stop Condition DS30390B-J00 - page 85 PIC16C7X 11.2.4 AC/DC http://www.microchip.comERRATA 11.2.4.2 I 2 C 2 11.2.4.1 SCLSDA ( 1115) 1 1 1 5 2 S C L ANDSCL S C L S C L S C L S C L S C L S C L SCLSCL (1116) 1116 1116 transmitter 1 loses arbitration DATA 1 SDA wait state DATA 1 start counting HIGH period DATA 2 CLK 1 SDA SCL CLK 2 counter reset SCL START STOP STARTSTOP DS30390B-J00 - page 86 (c) 1996 Microchip Technology Inc. AC/DC http://www.microchip.comERRATA 11.3 SSP I 2 C 710 71 711 72 73 73A 74 74A PIC16C7X SSPCONI 2C4 (SSPCON<3:0>)I2 C I2C(7) 2 I CSSP S S P 7 10 2 ( S C L ) R C 3 / SCK/SCL(SDA)RC4/SDI/SDA TRISC<4:3> S S P SSPEN(SSPCON<5>) SSP 1117 SP (I 2 C ) 1117 SP ) Internal data bus Read Write SSPBUF reg RC3/SCK/SCL shift clock SSPSR reg RC4/ SDI/ SDA MSb LSb Addr Match Match detect SSPADD reg Start and Stop bit detect Set, Reset S, P bits (SSPSTAT reg) S S P I 2 C 5 I2C(10) I2C(7) 2 I C(10) I 2 C S S P E N I 2 C SCLSDA TRISC SSPSTAT STARTSTOP 10 SSPSTAT SSPBUF SSPSR SSPBUFSSPSR SSPBUF S S P I F SSPBUF SSPOV(SSPCON<6>) SSPADD10 (11110A9A80) (A7:A0) SSP(SSPCON) SSP(SSPSTAT) /(SSPBUF) SSP(SSPSR) SSP(SSPADD) (c) 1996 Microchip Technology Inc. DS30390B-J00 - page 87 AC/DC http://www.microchip.comERRATA PIC16C7X 11.3.1 SCLSDA ( T R I S C < 4 : 3 > ) S S P () ( A C K ) SSPSRSSPBUF SSPACK a) B (SSPSTAT<0>) F b) SSPOV(SSPCON<6>) a) SSPSRSSPBUF b) BF c) ACK d) SSPSSPIF(PIR1<3>) S C L () 10 (1110) (MSbs) 1 0 R / W (SSPSTAT<2>) 10 1111 0A9A80 A9A8 10 SSPSRSSPBUF SSPIF(PIR1<3>) 113BFSSPOV BFSSPBUF SSPOV . ( ) ( SSPIFBFUA(SSPSTAT<1>)) S C L S S P I 2 C #100#101 . ()( SSPIFBFUA) 11.3.1.1 SSPSSPSTART START SSPSR (SCL) SSPSR<7:1>SSPADD ( S C L ) BFSSPOV . () SSPADD ( U A S C L ) . S S P B U F ( B F ) SSPIF . () SSPADD ( S C L UA) . S S P B U F ( B F ) SSPIF . START . ( ) ( SSPIFBF) . S S P B U F ( B F ) SSPIF 113: SSPIF ( SSP) BF SSPOV SSPSRSSPBUF ACKPulse 0 0 Yes Yes Yes 1 0 No No Yes 1 1 No No Yes 0 1 No No Yes DS30390B-J00 - page 88 (c) 1996 Microchip Technology Inc. AC/DC http://www.microchip.comERRATA 11.3.1.2 PIC16C7X R / W SSPSTATR/W S S P B U F (ACK) BF(SSPSTAT<0>) SSPOV(SSPCON<6>) SSPSTAT PIR1 S S P SSPIF(PIR1<3>) SSPSTAT 1118 I 2 C I Receiving Address Receiving Data R/W=0 Receiving Data ACK ACK ACK A7 A6 A5 A4 A3 A2 A1 D7 D6 D5 D4 D3 D2 D1 D0 D7 D6 D5 D4 D3 D2 D1 D0 SDA SCL S 1 2 3 4 5 6 7 8 9 1 2 3 4 5 6 7 8 9 1 2 3 4 5 6 7 8 SSPIF (PIR1<3>) 9 P Bus Master terminates transfer BF (SSPSTAT<0>) Cleared in software SSPBUF register is read SSPOV (SSPCON<6>) Bit SSPOV is set because the SSPBUF register is still full. ACK is not sent. (c) 1996 Microchip Technology Inc. DS30390B-J00 - page 89 AC/DC http://www.microchip.comERRATA PIC16C7X 11.3.1.3 R / W SSPSTATR/W SSPBUF ACK9 R C 3 / S C K / S C L SSPBUF SSPSR CKP(SSPCON<4>) RC3/SCK/SCL8 SCL SCLSDA (1119) S S P SSPIF SSPSTAT SSPIF9 A C K 9 S C L SDA(ACK) S T A R T S D A (ACK)SSPBUF SSPBUFSSPSR RC3/SCK/SCLCKP 1119 I 2 C I R/W = 1 Receiving Address A7 SDA SCL S A6 1 2 Data in sampled A5 A4 A3 A2 A1 3 4 5 6 7 Transmitting Data ACK 8 9 D7 1 SCL held low while CPU responds to SSPIF ACK D6 D5 D4 D3 D2 D1 D0 2 3 4 5 6 7 8 9 P SSPIF (PIR1<3>) BF (SSPSTAT<0>) cleared in software SSPBUF is written in software From SSP interrupt service routine CKP (SSPCON<4>) Set bit after writing to SSPBUF DS30390B-J00 - page 90 (c) 1996 Microchip Technology Inc. AC/DC http://www.microchip.comERRATA PIC16C7X 11.3.2 11.3.3 START STOP STOP(P)START (S)SSP P SP I2 C STARTSTOP STOP(P)START(S)SSP P(SSPSTAT<4>) S P I 2 C S S P STOP TRISC<4:3> SCLSDA PORTB<4:3> 1 TRISC<4> () 0 TRISC<4>() TRISC<3> SCL S D A SDASCL (TRISC<4:3>) 2 SSPSSPIF (SSP) START STOP / A C K (SSPM3:SSPM0=1011) 114 I 2 C 114 0Bh/8Bh INTCON Bit7 Bit6 Bit5 Bit4 Bit3 Bit2 Bit1 Bit0 GIE PEIE T0IE INTE POR BOR RBIE T0IF INTF RBIF 0000000x 0000000u (2) SSPIF CCP1IF TMR2IF TMR1IF 00000000 00000000 (2) SSPIE CCP1IE TMR1IE 00000000 00000000 13h 93h PSPIE RCIE TXIE SSPBUF SSPADD (I2C) TMR2IE 14h SSPCON WCOL SSPOV SSPEN CKP SSPM3 SSPM2 SSPM1 SSPM0 00000000 00000000 94h SSPSTAT D/A P S R/W UA BF 000000 000000 89h 1: 2: TRISC TRISC7 TRISC6 TRISC5 TRISC4 TRISC3 TRISC2 TRISC1 TRISC0 11111111 11111111 0Ch PIR1 8Ch PIE1 PSPIF (1,2) ADIF (1,2) ADIE RCIF (2) TXIF (2) xxxxxxxx uuuuuuuu 00000000 00000000 x=u=-= 0 I2CSSP PSPIEPSPIFPIC16C73/73A PIC16C72USART 0 (c) 1996 Microchip Technology Inc. DS30390B-J00 - page 91 AC/DC http://www.microchip.comERRATA PIC16C7X 1120 IDLEMODE RCVMODE XMITMODE I 2C 1120 IDLEMODE RCVMODE XMITMODE I IDLE_MODE (7-bit): if (Addr_match ) { Set interrupt; if (R/W = 1) { Send ACK = 0; set XMIT_MODE; } else if (R/W = 0) set RCV_MODE; } RCV_MODE: if ((SSPBUF=Full) OR (SSPOV = 1)) { Set SSPOV; Do not acknowledge; } else { transfer SSPSR SSPBUF; send ACK = 0; } Receive 8-bits in SSPSR; Set interrupt; XMIT_MODE: While ((SSPBUF = Empty) AND (CKP=0)) Hold SCL Low; Send byte; Set interrupt; if ( ACK Received = 1) { End of transmission; Go back to IDLE_MODE; } else if ( ACK Received = 0) Go back to XMIT_MODE; IDLE_MODE (10-Bit): If (High_byte_addr_match AND (R/W = 0)) { PRIOR_ADDR_MATCH = FALSE; Set interrupt; if ((SSPBUF = Full) OR ((SSPOV = 1)) { Set SSPOV; Do not acknowledge; } else { Set UA = 1; Send ACK = 0; While (SSPADD not updated) Hold SCL low; Clear UA = 0; Receive Low_addr_byte; Set interrupt; Set UA = 1; If (Low_byte_addr_match) { PRIOR_ADDR_MATCH = TRUE; Send ACK = 0; while (SSPADD not updated) Hold SCL low; Clear UA = 0; Set RCV_MODE; } } } else if (High_byte_addr_match AND (R/W = 1) { if (PRIOR_ADDR_MATCH) { send ACK = 0; set XMIT_MODE; } else PRIOR_ADDR_MATCH = FALSE; } DS30390B-J00 - page 92 (c) 1996 Microchip Technology Inc. AC/DC http://www.microchip.comERRATA 12.0 (USART) (USART) 710 71 711 PIC16C7X D/AEEPROM USART 72 73 73A 74 74A () -() (USART)I/O (USART S C I ) U S A R T C R T A/D -() SPEN(RCSTA<7>)TRISC<7:6> RC6/ TX/CKRC7/RX/DT 121 TXSTA 98h 121 TXSTA R/W-0 R/W-0 R/W-0 R/W-0 U-0 R/W-0 R-1 R/W-0 CSRC TX9 TXEN SYNC - BRGH TRMT TX9D bit7 bit 7: bit 6: bit 5: bit 4: bit 3: bit 2: bit 1: bit 0: bit0 R= W= U= 0 n=POR CSRC CSRC: 1=(BRG) 0=() TX9 TX9:9 1=9 0=8 TXEN TXEN: 1= 0= :SREN/CRENSYNCTXEN SYNC SYNC:USART 1= 0= : BRGH BRGH: 1=(PIC16C63,63A,65,65A,73,73A,74,74A) 0= TRMT TRMT: 1=TSR 0=TSR TX9D TX9D:9 (c) 1996 Microchip Technology Inc. DS30390B-J00 - page 93 AC/DC http://www.microchip.comERRATA PIC16C7X 122 RCSTA 18h RCSTA R/W-0 R/W-0 R/W-0 R/W-0 U-0 R-0 R-0 R-x SPEN RX9 SREN CREN - FERR OERR RX9D bit7 bit0 R= W= U= 0 n=POR bit 7: bit 6: bit 5: bit 4: bit 3: bit 2: bit 1: bit 0: SPEN SPEN: 1=(RC7/RX/DTRC6/TX/CK) 0= RX9 RX9:9 1=9 0=8 SREN SREN: - 1= 0= - CREN CREN: 1= 0= 1=CREN(CRENSREN) 0= : FERR FERR: 1=(RCREG) 0= OERR OERR: 1=(CREN) 0= RX9D RX9D:9() DS30390B-J00 - page 94 (c) 1996 Microchip Technology Inc. AC/DC http://www.microchip.comERRATA 12.1 USART (BRG) (BRG) 710 71 711 121: Desired Baud rate = 72 73 73A 74 PIC16C7X Fosc / (64 (X + 1)) 74A BRGUSART 8 SPBRG8 BRGH(TXSTA<2>) BRGH121 USART () 9600 = 16000000 /(64 (X + 1)) X e25.042u = 25 = Calculated Baud Rate = = Error Fosc SPBRG 121 = 16000000 / (64 (25 + 1)) 9615 (Calculated Baud Rate - Desired Baud Rate) Desired Baud Rate = (9615 - 9600) / 9600 = 0.16% (BRGH=1)Fosc/(16(x+1)) 121 Fosc=16MHz =9600 PIC16C63,63A,65,65A,73,73A,74,74A BRGH=1 BRGH=0 SYNC=0 SPBRGBRG () B R G 121: SYNC BRGH=0( ) BRGH=1( ) 0 ()=Fosc/(64(X+1)) =Fosc/(16(X+1)) 1 ()=Fosc/(4(X+1)) NA X=SPBRG(0255) (PIC16C63,63A,65,65A,73,73A,74,74A BRGH=1 ) (PIC16C63,63A,65,65A,73,73A,74,74A ) 122: 98h 18h 99h TXSTA RCSTA SPBRG Bit7 Bit6 Bit5 Bit4 CSRC TX9 TXEN SYNC SPEN RX9 SREN CREN x = , - = (c) 1996 Microchip Technology Inc. Bit3 Bit2 Bit1 Bit0 BRGH FERR TRMT OERR TX9D RX9D POR BOR 0000010 000000x 00000000 0000010 000000x 00000000 BRG DS30390B-J00 - page 95 PIC16C7X AC/DC http://www.microchip.comERRATA 123: Fosc=20MHz BAUD RATE (K) 0.3 1.2 2.4 9.6 19.2 76.8 96 300 500 HIGH LOW 16MHz KBAUD SPBRG value %ERROR (decimal) NA NA NA NA 19.53 76.92 96.15 294.1 500 5000 19.53 1.73 0.16 0.16 1.96 0 255 64 51 16 9 0 255 Fosc=5.0688MHz BAUD RATE (K) KBAUD 0.3 1.2 2.4 9.6 19.2 76.8 96 300 500 HIGH LOW NA NA NA 9.6 19.2 79.2 97.48 316.8 NA 1267 4.95 0 0 3.13 1.54 5.6 KBAUD NA NA NA NA 19.23 76.92 95.24 307.69 500 4000 15.625 0.16 0.16 0.79 2.56 0 207 51 41 12 7 0 255 3.579545MHz SPBRG value %ERROR (decimal) 10MHz SPBRG value %ERROR (decimal) 131 65 15 12 3 0 255 7.15909MHz KBAUD SPBRG value %ERROR (decimal) KBAUD %ERROR SPBRG value (decimal) NA NA NA 9.766 19.23 75.76 96.15 312.5 500 2500 9.766 1.73 0.16 1.36 0.16 4.17 0 NA NA NA 9.622 19.24 77.82 94.2 298.3 NA 1789.8 6.991 0.23 0.23 1.32 1.88 0.57 185 92 22 18 5 0 255 KBAUD %ERROR SPBRG value (decimal) 0.303 1.17 NA NA NA NA NA NA NA 8.192 0.032 1.14 2.48 26 6 0 255 KBAUD %ERROR SPBRG value (decimal) NA 1.203 2.38 9.322 18.64 NA NA NA NA 111.9 0.437 0.23 0.83 2.9 2.9 92 46 11 5 0 255 255 129 32 25 7 4 0 255 1MHz KBAUD SPBRG value %ERROR (decimal) KBAUD NA NA NA 9.622 19.04 74.57 99.43 298.3 NA 894.9 3.496 0.23 0.83 2.9 3.57 0.57 NA 1.202 2.404 9.615 19.24 83.34 NA NA NA 250 0.9766 92 46 11 8 2 0 255 32.768kHz SPBRG value %ERROR (decimal) 0.16 0.16 0.16 0.16 8.51 207 103 25 12 2 0 255 124: (BRGH=0) 124: Fosc=20MHz BAUD RATE (K) 0.3 1.2 2.4 9.6 19.2 76.8 96 300 500 HIGH LOW 16MHz KBAUD SPBRG value %ERROR (decimal) KBAUD NA 1.221 2.404 9.469 19.53 78.13 104.2 312.5 NA 312.5 1.221 1.73 0.16 1.36 1.73 1.73 8.51 4.17 NA 1.202 2.404 9.615 19.23 83.33 NA NA NA 250 0.977 255 129 32 15 3 2 0 0 255 Fosc=5.0688MHz BAUD RATE (K) KBAUD 0.3 1.2 2.4 9.6 19.2 76.8 96 300 500 HIGH LOW 0.31 1.2 2.4 9.9 19.8 79.2 NA NA NA 79.2 0.3094 DS30390B-J00 - page 96 0.16 0.16 0.16 0.16 8.51 207 103 25 12 2 0 255 3.579545MHz SPBRG value %ERROR (decimal) 3.13 0 0 3.13 3.13 3.13 10MHz SPBRG value %ERROR (decimal) 255 65 32 7 3 0 0 255 KBAUD NA 1.202 2.404 9.766 19.53 78.13 NA NA NA 156.3 0.6104 7.15909MHz SPBRG value %ERROR (decimal) 0.16 0.16 1.73 1.73 1.73 129 64 15 7 1 0 255 1MHz KBAUD SPBRG value %ERROR (decimal) 0.301 1.19 2.432 9.322 18.64 NA NA NA NA 55.93 0.2185 0.23 0.83 1.32 2.9 2.9 185 46 22 5 2 0 255 32.768kHz KBAUD SPBRG value %ERROR (decimal) KBAUD %ERROR SPBRG value (decimal) 0.3 1.202 2.232 NA NA NA NA NA NA 15.63 0.061 0.16 0.16 6.99 0.256 NA NA NA NA NA NA NA NA 0.512 0.002 14.67 1 0 255 51 12 6 0 255 (c) 1996 Microchip Technology Inc. AC/DC http://www.microchip.comERRATA PIC16C7X 125: (BRGH=1) Fosc=20MHz BAUD RATE (K) KBAUD 9.6 19.2 38.4 57.6 115.2 250 625 1250 9.615 19.23 37.878 56.818 113.636 250 625 1250 16MHz SPBRG value %ERROR (decimal) 0.16 0.16 1.36 1.3621 1.36 0 0 0 129 64 32 58.823 10 4 1 0 Fosc=5.0688MHz 9.615 19.23 38.461 2.12 111.111 250 NA NA 0.16 0.16 0.16 16 3.55 0 103 51 25 56.818 8 3 625 3.579MHz BAUD RATE (K) KBAUD SPBRG value %ERROR (decimal) 9.6 19.2 38.4 57.6 115.2 250 625 1250 9.6 18.645 39.6 52.8 105.6 NA NA NA 0 2.94 3.12 8.33 8.33 (c) 1996 Microchip Technology Inc. KBAUD 10MHz SPBRG value %ERROR (decimal) 32 16 7 5 2 KBAUD 9.727 18.643 37.286 55.93 111.86 223.721 NA NA 7.16MHz KBAUD SPBRG value %ERROR (decimal) KBAUD %ERROR 9.615 18.939 39.062 1.36 125 NA 0 NA 0.16 1.3632 1.7 10 8.51 0 9.52 1.32 37.286 2.9 111.86 NA NA 0.83 22 2.9 7 2.903 64 19.454 15 55.93 4 NA 1MHz 46 11 32.768kHz SPBRG value %ERROR (decimal) KBAUD SPBRG value %ERROR (decimal) 1.32 2.9 2.9 2.9 2.9 10.51 8.928 20.833 31.25 62.5 NA NA NA NA 6.99 8.51 18.61 8.51 22 11 5 3 1 0 SPBRG value (decimal) 6 2 1 0 KBAUD %ERROR SPBRG value (decimal) NA NA NA NA NA NA NA NA DS30390B-J00 - page 97 AC/DC http://www.microchip.comERRATA PIC16C7X 12.1.1 ( 123 )BRGH () x4 (124125) RC7/RX/DTRX B R G H ( T X S T A <2>)() x16789 123 RX (BRGH=0) 123 RX Start bit RX (RC7/RX/DT pin) Bit0 Baud CLK for all but start bit baud CLK x16 CLK 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 2 3 Samples 124 RX (BRGH=1) 124 RX RX pin bit0 Start Bit bit1 baud clk First falling edge after RX pin goes low Second rising edge x4 clk 1 2 3 4 1 2 3 4 1 2 Q2, Q4 clk Samples Samples Samples 125 RX (BRGH=1) 125 RX RX pin Start Bit bit0 Baud clk for all but start bit baud clk First falling edge after RX pin goes low Second rising edge x4 clk 1 2 3 4 Q2, Q4 clk Samples DS30390B-J00 - page 98 (c) 1996 Microchip Technology Inc. AC/DC http://www.microchip.comERRATA 12.2 TXIFTXIE TXREG TXIFTXREG TRMT(TXSTA<1>) TSR TRMTTSR T S R USART 710 71 711 72 73 73A 74 PIC16C7X 74A U S A R T ( N R Z ) (189 1) 8 8 USART LSbUSART B R G H( T X S T A < 2 > ) x1 6 x6 4 ( ) SLEEP T S R TXIFTXEN SYNC(TXSTA<4>) TXEN(TXSTA<5>) T X R E G (BRG) ( 1 2 6 ) T X R E G TXEN TSRTXREG TXREGTSR (128)TXEN R C 6 / T X / C K U S A R T 12.2.1USART USART126 ( ) ( T S R ) / TXREGTXREG TSR STOP STOPTSRTXREG ()TXREG TSR( T C Y ) T X R E G TXIF(PIR1<4>) TXIE(PIE1<4>)/ T X 9 TXSTA<6>TX9D(TXSTA < 0 > ) 8TXREG TXREG T S R (TSR ) 9 TSR 126 USART 126 USART Data Bus TXIF TXREG register TXIE 8 MSb LSb * * * (8) Pin Buffer and Control 0 TSR register RC6/TX/CK pin Interrupt TXEN Baud Rate CLK TRMT SPEN SPBRG Baud Rate Generator TX9 TX9D (c) 1996 Microchip Technology Inc. DS30390B-J00 - page 99 AC/DC http://www.microchip.comERRATA PIC16C7X 4. 9 T X 9 1. S P B R G BRGH(12.1) 5. T X E N T X I F 2. SYNCSPEN 6. 9 9 TX9D 7. 3. T X I E T X R E G ( ) 1 2 77 Write to TXREG Word 1 BRG output (shift clock) RC6/TX/CK (pin) Start Bit Bit 0 Bit 1 Bit 7/8 Stop Bit WORD 1 TXIF bit (Transmit buffer reg. empty flag) WORD 1 Transmit Shift Reg TRMT bit (Transmit shift reg. empty flag) 1 2 8 ( ) ( ) Write to TXREG Word 1 BRG output (shift clock) RC6/TX/CK (pin) TXIF bit (interrupt reg. flag) Word 2 Start Bit TRMT bit (Transmit shift reg. empty flag) Bit 0 Bit 1 WORD 1 Bit 7/8 WORD 1 Transmit Shift Reg. Start Bit WORD 2 Stop Bit Bit 0 WORD 2 Transmit Shift Reg. Note: This timing diagram shows two consecutive transmissions. 2 1 2 6 Bit7 Bit6 Bit5 Bit4 Bit3 Bit2 Bit1 Bit0 POR BOR 0Ch PIR1 PSPIF(1) ADIF RCIF TXIF SSPIF CCP1IF TMR2IF TMR1IF 00000000 00000000 18h RCSTA SPEN RX9 SREN CREN FERR OERR RX9D 000000x 000000x 19h TXREG TX7 TX6 TX5 TX4 TX3 TX2 TX1 TX0 00000000 00000000 8Ch PIE1 PSPIE(1) ADIE RCIE TXIE SSPIE CCP1IE TMR2IE TMR1IE 00000000 00000000 98h TXSTA CSRC TX9 TXEN SYNC BRGH TRMT TX9D 0000010 0000010 00000000 00000000 99h SPBRG x=-= 0 1 PSPIEPSPIFPIC16C73/73A DS30390B-J00 - page 100 (c) 1996 Microchip Technology Inc. AC/DC http://www.microchip.comERRATA 12.2.2 USART 1 2 9 RC7/RX/DT F o s c x16 CREN(RCSTA <4>) ( ) (RSR)STOPRSR R C R E G ( )RCIF(PIR1<5>) RCIE (PIE1<5>)/ RCIF RCREG RCREG FIFORCREGFIFO R S R PIC16C7X 3 S T O P R C R E G O E R R (RCSTA<1>)RSR RCREGFIFO2 2 OERR (CREN)OERR RSRRCREG OERR FERR(RCSTA<2>) FERR 9 RCREGRX9D FERRFERRRX9D RCREGRCSTA 129 USART 129 USART x64 Baud Rate CLK FERR OERR CREN SPBRG / 64 or / 16 Baud Rate Generator RSR register MSb Stop (8) 7 * * * 1 LSb 0 Start RC7/RX/DT Pin Buffer and Control Data Recovery RX9 RX9D SPEN RCREG register FIFO 8 RCIF Interrupt Data Bus RCIE 1210 1210 RX (pin) Start bit bit0 Rcv shift reg Rcv buffer reg Read Rcv buffer reg RCREG bit1 bit7/8 Stop bit Start bit WORD 1 RCREG bit0 bit7/8 Stop bit Start bit bit7/8 Stop bit WORD 2 RCREG RCIF (interrupt flag) OERR bit CREN 3RXOERR() Note: This timing diagram shows three words appearing on the RX input. The RCREG (receive buffer) is read after the third word, causing the OERR (overrun) bit to be set. RCREG()3 (c) 1996 Microchip Technology Inc. DS30390B-J00 - page 101 PIC16C7X AC/DC http://www.microchip.comERRATA 6. SPBRG BRGH (12.1) R C I F RCIE 7. SYNCSPEN 9RCSTA () 8. RCREG8 3. RCIE 9. CREN 4. 9RX9 5. CREN 1. 2. 1 2 7 0Ch 18h 1Ah 8Ch 98h 99h 1 Bit7 Bit6 Bit5 Bit4 Bit3 Bit2 Bit1 Bit0 POR BOR PIR1 PSPIF(1) ADIF RCIF TXIF SSPIF CCP1IF TMR2IF TMR1IF 00000000 00000000 RCSTA SPEN RX9 SREN CREN FERR OERR RX9D 000000x 000000x RCREG RX7 RX6 RX5 RX4 RX3 RX2 RX1 RX0 00000000 00000000 PIE1 PSPIE(1) ADIE RCIE TXIE SSPIE CCP1IE TMR2IE TMR1IE 00000000 00000000 TXSTA CSRC TX9 TXEN SYNC BRGH TRMT TX9D 0000010 0000010 SPBRG 00000000 00000000 x=-= 0 PSPIEPSPIFPIC16C73/73A DS30390B-J00 - page 102 (c) 1996 Microchip Technology Inc. AC/DC http://www.microchip.comERRATA 12.3 U S A R T 710 71 711 72 73 73A 74 74A SYNC(TXSTA<4>) SPEN(RCSTA<7>)RC6/TX/CKRC7/RX/DTI/O CK()DT() CK CSRC(TXSTA<7>) 12.3.1 USART USART126 ( ) (TSR)/ TXREGTXREG T S R T S R TXREG() TXREGTSR (Tcycle)TXREG TXIF(PIR1<4>) TXIE(PIE1<4>)/ TXIFTXIE TXREG TXIFTXREG TRMT(TXSTA<1>)TSR TRMTTSR T S R T S R TXEN(TXSTA<5>) T X R E G CK (1211)TXREG TXEN TXENCRENSREN B R G TXEN B R G TSRTXREG TXREG T S R (c) 1996 Microchip Technology Inc. PIC16C7X TXEN DTCK CRENSREN DT ( ) C S R C ( ) C K TXEN S R E N ( )SREN TXEN DT 9TX9(TXSTA<6>) 9TX9D(TXSTA<0>) 98 TXREG TXREG T S R (TSR)TSRTXREG TX9D TX9D 1. S P B R G (12.1) 2. SYNCSPENCSRC 3. T X I E 4. 9TX9 5. TXEN 6. 9 9 TX9D 7. TXREG DS30390B-J00 - page 103 PIC16C7X AC/DC http://www.microchip.comERRATA 1 2 8 Bit7 Bit6 Bit5 Bit4 Bit3 Bit2 Bit1 Bit0 POR BOR 0Ch PIR1 PSPIF(1) ADIF RCIF TXIF SSPIF CCP1IF TMR2IF TMR1IF 00000000 00000000 18h 19h RCSTA TXREG SPEN TX7 RX9 TX6 SREN TX5 CREN TX4 TX3 FERR TX2 OERR TX1 RX9D TX0 000000x 00000000 000000x 00000000 8Ch 98h 99h 1 PIE1 PSPIE(1) ADIE RCIE TXIE SSPIE CCP1IE TMR2IE TMR1IE 00000000 00000000 TXSTA CSRC TX9 TXEN SYNC BRGH TRMT TX9D 0000010 0000010 SPBRG 00000000 00000000 x=-= 0 PSPIEPSPIFPIC16C73/73A 1211 1211 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 RC7/RX/DT pin Bit 0 Bit 1 Bit 2 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 Bit 7 WORD 1 Bit 0 Bit 1 WORD 2 Bit 7 RC6/TX/CK pin Write to TXREG reg Write word1 Write word2 TXIF bit (Interrupt flag) TRMT TRMT bit TXEN bit '1' '1' Note: Sync master mode; SPBRG = '0'. Continuous transmission of two 8-bit words SPBRG= 0 28 1212 (TXEN ) 1212 (TXEN ) RC7/RX/DT pin bit0 bit1 bit2 bit6 bit7 RC6/TX/CK pin Write to TXREG reg TXIF bit TRMT bit DS30390B-J00 - page 104 (c) 1996 Microchip Technology Inc. AC/DC http://www.microchip.comERRATA PIC16C7X 9 RCREG RX9D RX9DRCREG R C S T A 12.3.2USART SREN(RCSTA<5>)CREN(RCSTA<4>) RC7/RX/DT SREN CRENCREN C R E N ( R S R ) RCREG() RCIF(PIR1<5>) R C I E (PIE1<5>)/ RCIF RCREG R C R E G 2 F I F O 2 RCREG FIFO3 R S R R C R E G OERR(RCSTA<1>) RSRRCREGFIFO 2 2 OERR (CREN) OERRRSRRCREG OERR 1. SPBRG (12.1) 2. SYNCSPENCSRC 3. CRENSREN 4. R C I E 5. 9 R X 9 6. S R E N CREN 7. R C I F R C I E 8. 9RCSTA ( ) 9. RCREG 8 10.C R E N 1 2 9 0Ch PIR1 18h RCSTA 1Ah RCREG 8Ch PIE1 98h TXSTA Bit7 (1) PSPIF SPEN RX7 PSPIE (1) CSRC Bit6 Bit5 Bit4 Bit3 Bit2 Bit1 Bit0 POR BOR ADIF RCIF TXIF SSPIF CCP1IF TMR2IF TMR1IF 00000000 00000000 RX9 SREN CREN FERR OERR RX9D 000000x 000000x RX6 RX5 RX4 RX3 RX2 RX1 RX0 00000000 00000000 ADIE RCIE TXIE SSPIE CCP1IE TMR2IE TMR1IE 00000000 00000000 TX9 TXEN SYNC BRGH TRMT TX9D 0000010 0000010 99h SPBRG 00000000 00000000 x= x=-= 0 1PSPIEPSPIFPIC16C73/73A (c) 1996 Microchip Technology Inc. DS30390B-J00 - page 105 PIC16C7X AC/DC http://www.microchip.comERRATA 1213 ( ,SREN) 1213 ( ,SREN) 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 Q4Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 DT pin bit0 bit1 bit2 bit3 bit4 bit5 bit6 bit7 CK pin Write to SREN bit SREN bit CREN bit '0' '0' RCIF bit (interrupt) Read RXREG Note: Timing diagram demonstrates master mode with SREN = '1' and BRG = '0'. SREN= 1 BRG= SYNC 0 SYNC DS30390B-J00 - page 106 (c) 1996 Microchip Technology Inc. AC/DC http://www.microchip.comERRATA 12.4 PIC16C7X USART 710 71 711 12.4.2 72 73 73A 74 74A RC6/TX/CK ( )SLEEP C S R C (TXSTA<7>) 12.4.1 USART S L E E P 2TXREG SLEEP a) T S R b) 2TXREG c) TXIF d) T S R T X R E G 2 T S R TXIF e) TXIE SLEEP (0004h) 1. SYNCSPENCSRC 2. CRENSREN 3. T X I E 4. 9 T X 9 5. T X E N 6. 9 9 TX9D 7. TXREG (c) 1996 Microchip Technology Inc. USART S L E E P S R E N SLEEPCREN 1SLEEP RSRRCREG RCIE SLEEP G I E (0004h) 1. SYNCSPENCSRC 2. R C I E 3. 9 R X 9 4. CREN 5. R C I F R C I E 6. 9RCSTA ( ) 7. RCREG8 8. C R E N DS30390B-J00 - page 107 AC/DC http://www.microchip.comERRATA PIC16C7X 1 2 1 0 Bit7 Bit6 Bit5 Bit4 Bit3 Bit2 CCP1IF TMR2IF TMR1IF FERR OERR RX9D 0Ch 18h PIR1 RCSTA PSPIF(1) SPEN ADIF RX9 RCIF SREN TXIF CREN SSPIF 19h TXREG TX7 TX6 TX5 TX4 TX3 ADIE RCIE TXIE SSPIE TX9 TXEN SYNC 8Ch PIE1 98h TXSTA (1) PSPIE CSRC TX2 Bit1 TX1 Bit0 TX0 CCP1IE TMR2IE TMR1IE BRGH TRMT TX9D POR BOR 00000000 000000x 00000000 000000x 00000000 00000000 00000000 00000000 0000010 0000010 99h SPBRG 00000000 00000000 x=-= 0 1PSPIEPSPIFPIC16C73/73A 1 2 1 1 Bit7 Bit6 Bit5 Bit4 Bit3 Bit2 Bit1 Bit0 POR BOR ADIF RCIF TXIF SSPIF CCP1IF TMR2IF TMR1IF 00000000 00000000 RX9 SREN CREN FERR OERR RX9D 000000x 000000x 0Ch PIR1 18h RCSTA PSPIF(1) SPEN 1Ah RCREG RX7 8Ch PIE1 98h TXSTA (1) PSPIE CSRC RX6 RX5 RX4 RX3 RX2 RX1 RX0 00000000 00000000 ADIE RCIE TXIE SSPIE CCP1IE TMR2IE TMR1IE 00000000 00000000 TX9 TXEN SYNC BRGH TRMT TX9D 0000010 0000010 99h SPBRG 00000000 00000000 x=-= 0 1PSPIEPSPIFPIC16C73/73A DS30390B-J00 - page 108 (c) 1996 Microchip Technology Inc. AC/DC http://www.microchip.comERRATA 13.0 (A/D) ( 710 71 711 72 73 73A 74 74A ( A / D ) PIC16C710/71/7114PIC16C72/73/ 73A5PIC16C74/74A8 A/D8 (A/D AN546 (V DD)RA3/AN3/VREF A/ DSLEEP PIC16C7X A/D3 A/D(ADRES) A/D0(ADCON0) A/D1(ADCON1) 131132ADCON0A/D A D C O N 1 133134 (RA3 )I/O 131 ADCON0 PIC16C710/71/711( 08h) 131 ADCON0 PIC16C710/71/711( 08h) R/W-0 R/W-0 U-0 R/W-0 R/W-0 ADCS1 ADCS0 - (1) CHS1 CHS0 GO/DONE bit7 R/W-0 R/W-0 R/W-0 ADIF ADON bit0 R= W= U= 0 n=POR bit76: ADCS1:ADCS0: ADCS1:ADCS0:A/D 00=Fosc/2 01=Fosc/8 10=Fosc/32 11=FrcRC bit5: 0 bit43: CHS2:CHS0: CHS2:CHS0: 00=0,(RA0/AN0) 01=1,(RA1/AN1) 10=2,(RA2/AN2) 11=3,(RA3/AN3) GO/DONE: bit2: GO/DONE:A/D ADON=1 1=A/D(A/D) 0=A/D(A/D ) ADIF: bit1: ADIF:A/D 1=() 0= ADON: bit0: ADON:A/D 1=A/D 0==A/D 1 ADCON0PIC16C71R/WPIC16C710/711 0 (c) 1996 Microchip Technology Inc. DS30390B-J00-page 109 AC/DC http://www.microchip.comERRATA PIC16C7X 132 ADCON0 PIC16C72/73/73A/74/74A( 1Fh) 132 ADCON0 PIC16C72/73/73A/74/74A( 1Fh) R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 U-0 R/W-0 ADCS1 ADCS0 CHS2 CHS1 CHS0 GO/DONE - ADON bit7 bit0 R= W= U= 0 n=POR bit1: ADCS1:ADCS0 ADCS1:ADCS0:A/D 00=Fosc/2 01=Fosc/8 10=Fosc/32 11=FRCRC CHS2:CHS0: CHS2:CHS0: 000=0,(RA0/AN0) 001=1,(RA1/AN1) 010=2,(RA2/AN2) 011=3,(RA3/AN3) 100=4,(RA5/AN4) 101=5,(RE0/AN5)(1) 1:A/D567PIC16C74/74A 110=6,(RE1/AN6)(1) 111=7,(RE2/AN7)(1) GO/DONE GO/DONE:A/D ADON=1 1=A/D(A/D) 0=A/D(A/D ) : 0 bit0: ADON ADON:A/D bit76: bit53: bit2: 1=A/D 0=A/D 133 ADCON1 PIC16C710/71/711( 88h) 133 ADCON1 PIC16C710/71/711( 88h) U-0 U-0 U-0 U-0 U-0 U-0 R/W-0 R/W-0 - - - - - - PCFG1 PCFG0 bit7 bit0 bit 7-2: 0 bit 1-0: PCFG1:PCFG0: A/D PCFG1:PCFG0 RA1 & RA0 RA2 RA3 VREF A A A VDD 00 01 A A VREF RA3 10 A D D VDD 11 D D D VDD R= W= U= 0 n=POR A = D = I/O DS30390B-J00-page 110 (c) 1996 Microchip Technology Inc. AC/DC http://www.microchip.comERRATA PIC16C7X 134 ADCON1 PIC16C72/73/73A/74/74A( 9Fh) 134 ADCON1 PIC16C72/73/73A/74/74A( 9Fh) U-0 U-0 U-0 U-0 U-0 R/W-0 R/W-0 R/W-0 - - - - - PCFG2 PCFG1 PCFG0 bit7 R= W= U= 0 n=POR bit0 bit 7-3: 0 bit 2-0: PCFG2:PCFG0: A/D PCFG2:PCFG0 RA0 RA1 RA2 RA5 RA3 RE0 RE1 RE2 000 A A A 001 A A A VREF A A A A A VDD A VREF A A A RA3 010 A A A A A D D D VDD 011 A A A A VREF D D D RA3 100 A A D D A D D D VDD 101 A A D D VREF D D D RA3 11x D D D D D D D D - A = D =I/O 1:RE0,RE1,RE2PIC16C74/74A (c) 1996 Microchip Technology Inc. DS30390B-J00-page 111 AC/DC http://www.microchip.comERRATA PIC16C7X ADRESA/DA/D A D R E S GO/DONE(ADCON0<2>)A/D A D I F A / D 135136 A / D T R I S 131 A / D A/D 1.A/D //I/O(ADCON1) 3. 4. GO/DONE(ADCON0) 5.A/D GO/DONE A/D 6.A/D(ADRES) ADIF 7 . A/DT AD 2T A D A/D(ADCON0) A/D(ADCON0) A/D(ADCON0) 2.A/D() ADIF ADIE GIE 135 A/D PIC16C710/71/711 135 A/D CHS1:CHS0 11 VIN 10 (Input voltage) 01 A/D Converter 00 RA3/AN3/VREF RA2/AN2 RA1/AN1 RA0/AN0 VDD 00 or 10 or 11 VREF (Reference voltage) 01 PCFG1:PCFG0 DS30390B-J00-page 112 (c) 1996 Microchip Technology Inc. AC/DC http://www.microchip.comERRATA PIC16C7X 136 A/D PIC16C72/73/73A/74/74A 136 A/D CHS2:CHS0 111 RE2/AN7(1) 110 RE1/AN6(1) 101 RE0/AN5(1) 100 RA5/AN4 011 VIN 010 (Input voltage) 001 A/D Converter 000 RA3/AN3/VREF RA2/AN2 RA1/AN1 RA0/AN0 VDD 000 or 010 or 100 VREF (Reference voltage) 001 or 011 or 101 PCFG2:PCFG0 1 (c) 1996 Microchip Technology Inc. PIC16C72/73/73A DS30390B-J00-page 113 AC/DC http://www.microchip.comERRATA PIC16C7X 13.1 A / D 710 71 711 72 73 1 (VREF ) 73A 74 74A (C HOLD ) 137 (Rs) (Rss)CHOLD 137 (Rss)(V D D ) 1 0 k 1 ( ) 1311/2LSb (A/D512)1/2LSb A / D 2 (CHOLD) 3 1 0 k 4 2.0T AD A / D 131 TACQ = Amplifier Settling Time + Holding Capacitor Charging Time + Temperature Coefficient TACQ = 5 s + Tc + [(Temp - 25)(0.05 ms/)] Tc = 131 A/D 131 A/D Vhold = (Vref - (Vref/512)) x (1 - e (-Tc/C HOLD(RIC -Chold (RIC + Rss + Rs) ln(1/512) -51.2 pF (1 k + 7 k + 10 k) ln(0.0020) + R SS + RS)) ) -51.2 pF (18 k) ln(0.0020) Tc = -(51.2 pF)(1 kW + Rss + Rs) ln(1/511) -0.921 s (-6.2146) 131TACQ 5.724 s TACQ = 5 s + 5.724 s + [(50 - 25)(0.05 s/)] 10.724 s + 1.25 s Rs = 10 k 1/2 LSb error Vdd = 5V Rss = 7 k Temp (system max.) = 50C 11.974 s Vhold = 0 @ t = 0 137 VDD VT=0.6V Rs VA CPIN 5nF VT=0.6V RIC 1k Sampling Switch SS Rss I leakage 500 nA CHOLD = DAC capacitance = 51.2pF VSS Legend CPIN = VT = leakage= RIC = SS = CHOLD =(DAC) 6V 5V VDD 4V 3V 2V 5 6 7 8 9 1011 Sampling Switch (k) DS30390B-J00-page 114 (c) 1996 Microchip Technology Inc. AC/DC http://www.microchip.comERRATA 13.2 13.3 A/D 710 71 711 72 73 73A 74 PIC16C7X 710 71 711 74A 72 73 73A 74 74A ADCON1TRISATRISEA/D TRIS() TRIS() (VOHVOL) A / D T A D A/D89.5T ADA/D T A D 4 2Tosc A/DCHS2:CHS0TRIS 8Tosc 1 ( L o w ) 32Tosc RC A / D T A D A/D ( T A D ) 2 ( A N 7 : AN0) PIC16C712.0s PIC16C7X1.6s 131132 A/DTAD 131 T AD PIC16C71 131 ADClockSource(TAD) DeviceFrequency Operation ADCS1:ADCS0 20MHz 16MHz 4MHz 1MHz 333.33kHz 2Tosc 00 100ns(2) 125ns(2) 500ns(2) 2.0us 6us 8Tosc 01 400ns(2) 500ns(2) 2.0us 8.0us 24us(3) 32Tosc 10 1.6us(2) 2.0us 8.0us 32.0us(3) 96us(3) (5 ) 11 26us(1,4) 26us(1,4) 26us(1,4) 26us(1) 26us(1) RC 1.RC 4us TAD 2. TAD 3. 4.1MHz RC 5. (LC) 132 TAD PIC16C710/711/72/73/73A/74/74A 132 ADClockSource(TAD) DeviceFrequency Operation ADCS1:ADCS0 20MHz 5MHz 1.25MHz 333.33kHz 2Tosc 00 100ns(2) 400ns(2) 1.6us 6us 8Tosc 01 400ns(2) 1.6us 6.4us 24us(3) 32Tosc 10 1.6us 6.4us 25.6us(3) 96us(3) (5 ) 11 26us(1,4) 26us(1,4) 26us(1,4) 26us(1) RC 1.RC 4us TAD 2. TAD 3. 4.1MHz RC 5. (LC) (c) 1996 Microchip Technology Inc. DS30390B-J00-page 115 PIC16C7X 13.4 AC/DC http://www.microchip.comERRATA A/D A/D 710 71 711 72 73 73A 74 74A 132133A/DRA ( V REF ) V D D A / D A / D F R C RA0 GO/DONEA/D GO/DONE ADRESA/D A D R E S ADRESA/D 2TAD2TAD 132 A/D (PIC16C710/71/711) 132 A/D (PIC16C710/71/711) BSF CLRF BCF MOVLW MOVWF BSF BSF ; ; ; ; STATUS,RP0 ADCON1 STATUS,RP0 0xC1 ADCON0 INTCON,ADIE INTCON,GIE ; ; ; ; ; ; ; Select Page 1 Configure A/D inputs Select Page 0 RC Clock, A/D is on, Channel 0 is selected Enable A/D Interrupt Enable all interrupts Ensure that the required sampling time for the selected input channel has elapsed. Then the conversion may be started. BSF : : ADCON0,GO ; Start A/D Conversion ; The ADIF bit will be set and the GO/DONE bit ; is cleared upon completion of the A/D Conversion. 133 A/D (PIC16C72/73/73A/74/74A) 133 A/D (PIC16C72/73/73A/74/74A) BSF CLRF BSF BCF MOVLW MOVWF BCF BSF BSF ; ; ; ; STATUS,RP0 ADCON1 PIE1,ADIE STATUS,RP0 0xC1 ADCON0 PIR1,ADIF INTCON,PEIE INTCON,GIE ; ; ; ; ; ; ; ; ; Select Page 1 Configure A/D inputs Enable A/D interrupts Select Page 0 RC Clock, A/D is on, Channel 0 is selected Clear A/D interrupt flag bit Enable peripheral interrupts Enable all interrupts Ensure that the required sampling time for the selected input channel has elapsed. Then the conversion may be started. BSF : : ADCON0,GO DS30390B-J00-page 116 ; Start A/D Conversion ; The ADIF bit will be set and the GO/DONE bit ; is cleared upon completion of the A/D Conversion. (c) 1996 Microchip Technology Inc. AC/DC http://www.microchip.comERRATA 13.4.1 - A / D A / D T A D ()T AD A/D( A / D ) 3 (RCRC) PIC16C7X T A D A / D ( )1344 20MHz16MHz (A/D 32T OSC )6TAD A/D2TOSC 2T OSC T A D 4 = 2Tad + NTAD + (8 - N)(2Tosc) : N = 134 44 8 134 Freq. (MHz)(1) 4-bit TAD TOSC 2Tad + NTAD + (8 - N)(2Tosc) 1 8-bit 20 1.6 s 1.6 s 16 2.0 s 2.0 s 20 50 ns 50 ns 16 62.5 ns 62.5 ns 20 10 s 16 s 16 12.5 s 20 s PIC16C71TAD 2.0s PIC16C7XTAD 1.6s (c) 1996 Microchip Technology Inc. DS30390B-J00-page 117 PIC16C7X AC/DC http://www.microchip.comERRATA 13.5 SLEEP A/D SLEEP A/D A/D 710 71 711 72 73 73A 74 74A A/DSLEEP R C S L E E P A/DSLEEP A/DRC(ADCS1:ADCS0=11) R C A / D S L E E P G O / D O N E A D R E S A / D SLEEPA/D ADON A/D 13.7 A/D(RC ) A D O N SLEEPA/D 13.8 A/DA/D A/DSLEEP A/DRC(ADCS1:ADCS0=11) SLEEPA/D GO/DONE SLEEP 13.6 A / DD / / 710 71 711 72 73 73A 74 74A A/DVDD =5V10%VREF =V DD 1 L S b A / D (VDD)5.0V (V REF ) V D D 5A RESET RESET 710 71 711 72 73 73A 74 74A A / D A D R E S A D R E S C C P 710 71 711 72 73 73A 74 PIC16C72 CCP1 74A A/DCCP2 ( P I C 1 6 C 7 2 CCP1)CCP2M3:CCP2M0(CCP2CON<3:0>)1011 A / D (ADON) A/DGO/DONE A / D A D R E S G O / D O N E ( ) A/D(ADON ) A / D A/D RC TAD TAD 8 s T A D T o s c R C I / O DS30390B-J00-page 118 (c) 1996 Microchip Technology Inc. AC/DC http://www.microchip.comERRATA 138 138 74A (Vss0.2VVDD+0.2V) Digital code output FFh PIC16C710/71/711OSC1 RA0A/DRA0 ( ) FBh 04h 03h 02h 01h 00h 256LSb (full scale) 74 255LSb 73A 4LSb 73 3LSb 72 A/D 2LSb 710 71 711 0.5LSb 1LSb 13.9 PIC16C7X Analog input voltage 13.10 710 71 711 72 73 73A 74 74A A / D (V AIN)1LSb( VREF /256)(138) 139 139 A/D ADON =0 ADON =0? Acquire Selected Channel GO = 0? Yes No A/D Clock = RC ? Yes Start of A/D Conversion Delayed 1 Instruction Cycle No Device in Yes SLEEP? SLEEP Yes Instruction? No Abort Conversion GO = 0 ADIF = 0 Finish Conversion GO = 0 ADIF = 1 No Finish Conversion GO = 0 ADIF = 1 Finish Conversion GO = 0 ADIF = 1 Wake-up Yes From Sleep? Wait 2 TAD No SLEEP Power-down A/D Wait 2 TAD Stay in Sleep Power-down A/D Wait 2 TAD (c) 1996 Microchip Technology Inc. DS30390B-J00-page 119 AC/DC http://www.microchip.comERRATA PIC16C7X 133 A/D PIC16C710/71/711 133 A/D Bit7 Bit6 Bit5 Bit4 Bit3 Bit2 Bit1 Bit0 GIE ADIE T0IE INTE RBIE T0IF INTF RBIF 0Bh/8Bh INTCON 89h ADRES 08h ADCON0 ADCS1 ADCS0 CHS1 CHS0 GO/DONE ADIF 88h ADCON1 PCFG1 05h PORTA RA4 RA3 RA2 RA1 RA0 POR BOR 0000000x 0000000u xxxxxxxx uuuuuuuu ADON 0000000 0000000 PCFG0 00 00 x0000 u0000 85h TRISA TRISA4 TRISA3 TRISA2 TRISA1 TRISA0 11111 x=u== 0 A/D 11111 A/DResultRegister 134 A/D PIC16C72 134 A/D Bit7 Bit6 Bit5 Bit4 Bit3 Bit2 Bit1 Bit0 POR BOR GIE PEIE T0IE INTE RBIE T0IF INTF RBIF 0000000x 0000000u 0Bh/8Bh INTCON 0Ch PIR1 ADIF SSPIF CCP1IF TMR2IF TMR1IF 00000 00000 8Ch PIE1 ADIE SSPIE CCP1IE TMR2IE TMR1IE 00000 00000 1Eh ADRES xxxxxxxx uuuuuuuu 1Fh ADCON0 ADCS1 ADCS0 CHS2 CHS1 CHS0 GO/DONE ADON 0000000 0000000 9Fh ADCON1 PCFG2 PCFG1 PCFG0 000 000 05h PORTA RA5 RA4 RA3 RA2 RA1 RA0 0x0000 000000 111111 111111 A/DResultRegister 85h TRISA TRISA5 TRISA4 TRISA3 TRISA2 TRISA1 TRISA0 x=u== 0 A/D 135 A/D PIC16C73/73A/74/74A 135 A/D Bit7 Bit6 Bit5 Bit4 Bit3 Bit2 Bit1 Bit0 POR BOR GIE PEIE T0IE INTE RBIE T0IF INTF RBIF 0000000x 0000000u 00000000 0Bh/8Bh INTCON 0Ch PIR1 PSPIF(1) ADIF RCIF TXIF SSPIF CCP1IF TMR2IF TMR1IF 00000000 8Ch PIE1 PSPIE(1) ADIE RCIE TXIE SSPIE CCP1IE TMR2IE TMR1IE 00000000 00000000 0Dh PIR2 CCP2IF 0 0 8Dh PIE2 CCP2IE 0 0 1Eh ADRES xxxxxxxx uuuuuuuu 1Fh ADCON0 ADCS1 ADCS0 CHS2 CHS1 CHS0 GO/DONE ADON 0000000 0000000 9Fh ADCON1 PCFG2 PCFG1 PCFG0 000 000 05h PORTA RA5 RA4 RA3 RA2 RA1 RA0 0x0000 000000 85h TRISA TRISA5 TRISA4 TRISA3 TRISA2 TRISA1 TRISA0 111111 111111 09h PORTE RE2 RE1 RE0 xxx uuu A/DResultRegister 89h TRISE IBF OBF IBOV PSPMODE TRISE2 TRISE1 TRISE0 0000111 0000111 x=u== 0 A/D 1:PSPIEPSPIFPIC16C73/73A DS30390B-J00-page 120 (c) 1996 Microchip Technology Inc. AC/DC http://www.microchip.comERRATA 14.0 CPU CPU 710 71 711 72 73 73A 74 74A PIC16CXX OSC (POR) (PWRT) PIC16C7X (PWRT) 7 2 m s ( ) 2 S L E E P SLEEP RC LP 14.1 (OST) (BOR) 710 71 711 72 73 73A 74 74A (WDT) SLEEP ID PIC16CXX RC 2 (OST) 0 ) ) 2007h 2 0 0 7 h / ( 2 0 0 0 h 3FFFh) 141 PIC16C71 141 PIC16C71 - - - - - - - - - CP0 PWRTE WDTE bit13 bit 13-5: bit 4: bit 3: bit 2: bit 1-0: F0SC1 F0SC0 Register: CONFIG bit0 Address 2007h 1 CP0: 1= 0=00h3Fh PWRTE PWRTE: 1= 0= WDTE WDTE: 1=WDT 0=WDT FOSC1:FOSC0 FOSC1:FOSC0: 11=RC 10=HS 01=XT 00=LP (c) 1996 Microchip Technology Inc. DS30390B-J00-page 121 AC/DC http://www.microchip.comERRATA PIC16C7X 142 PIC16C710/711 142 CP0 CP0 CP0 CP0 CP0 CP0 CP0 BODEN CP0 CP0 PWRTE WDTE F0SC1 F0SC0 bit13 bit0 bit 13-7: 5-4: bit 6: bit 3: bit 2: bit 1-0: Register: CONFIG Address 2007h CP0:(2) 1= 0=00h3Fh BODEN:(1) 1=BOR 0=BOR PWRTE:(1) 1=PWRT 0=PWRT WDTE: 1=WDT 0=WDT FOSC1:FOSC0: 11=RC 10=HS 01=XT 00=LP 1 PWRTE(PWRT) 2 CP0 143 PIC16C73/74 PIC16C73/74 - - - - - - - - CP1 CP0 PWRTE WDTE F0SC1 F0SC0 bit13 bit 13-5: bit 4: bit 3: bit 2: bit 1-0: bit0 Register: CONFIG Address 2007h 1 CP1:CP0: 11= 10= 01=3/4 00= PWRTE: 1= 0= WDTE: 1=WDT 0=WDT FOSC1:FOSC0: 11=RC 10=HS 01=XT 00=LP DS30390B-J00-page 122 (c) 1996 Microchip Technology Inc. AC/DC http://www.microchip.comERRATA PIC16C7X 144 PIC16C72/73A/74A 144 PIC16C72/73A/74A CP1 CP0 CP1 CP0 CP1 CP0 - BODEN CP1 CP0 PWRTE WDTE F0SC1 F0SC0 bit3 bit0 bit 13-8 5-4: bit 7: bit 6: bit 3: bit 2: bit 1-0: Register: CONFIG Address 2007h (2) CP1:CP0: 11= 10= 01=3/4 00= : 1 BODEN:(1) 1=BOR 0=BOR PWRTE: (1) 1=PWRT 0=PWRT WDTE: 1=WDT 0=WDT FOSC1:FOSC0: 11=RC 10=HS 01=XT 00=LP 1PWRTE(PWRT) 2 CP1:CP0 14.2 145 145 // (HS XT LP OSC )) (HS XT LP OSC 710 71 711 72 73 73A 74 74A OSC1 14.2.1 PIC16CXX4 2(FOSC1FOSC0) LP XT/ HS/ RC/ (2) C1 XTAL RF C2 To internal logic SLEEP PIC16CXX RF OSC2 (2) Note1 To internal logic C1C2141142143144 1 AT 2 PIC16C710/71/711OSC2 OSC1 14.2.2/ XTLPHS ()OSC1/CLKIN O S C 2 / C L K O U T ( 1 4 5 ) PIC16CXX XTLPHS O S C 1 / C L K I N (146) (c) 1996 Microchip Technology Inc. 1 4 6 (HS XT LP OSC ) (HS LP OSC ) Clock from ext. system OSC1 PIC16CXX Open OSC2 DS30390B-J00-page 123 PIC16C7X AC/DC http://www.microchip.comERRATA 141 PIC16C71 141 PIC16C71 143 PIC16C710/711/72/73/73A/74/74A 143 PIC16C710/711/72/73/73A/74/74A : Mode : Mode XT HS Freq OSC1 OSC2 455kHz 2.0MHz 4.0MHz 8.0MHz 16.0MHz 47100pF 1568pF 1568pF 1568pF 1047pF 47100pF 1568pF 1568pF 1568pF 1047pF C1 C2 HS : 455kHz 2.0MHz 4.0MHz 8.0MHz 16.0MHz 68100pF 1568pF 1568pF 1068pF 1022pF 68100pF 1568pF 1568pF 1068pF 1022pF C1 C2 : 0.3% 0.5% 0.5% 0.5% 0.5% 142 PIC16C71 PIC16C71 XT OSC2 455kHz PanasonicEFOA455K04B 2.0MHz MurataErieCSA2.00MG 4.0MHz MurataErieCSA4.00MG 8.0MHz MurataErieCSA8.00MT 16.0MHz MurataErieCSA16.00MX Mode HS OSC1 : LP XT Freq 455kHz PanasonicEFOA455K04B 2.0MHz MurataErieCSA2.00MG 4.0MHz MurataErieCSA4.00MG 8.0MHz MurataErieCSA8.00MT 16.0MHz MurataErieCSA16.00MX 144 PIC16C710/711/72/73/73A/74/74A 144 PIC16C710/711/72/73/73A/74/74A Freq OSC1 OSC2 Mode Freq OSC1 32kHz 200kHz 100kHz 500kHz 1MHz 2MHz 4MHz 8MHz 20MHz 3368pF 1547pF 47100pF 2068pF 1568pF 1547pF 1533pF 1547pF 1547pF 3368pF 1547pF 47100pF 2068pF 1568pF 1547pF 1533pF 1547pF 1547pF LP 32kHz(1) 200kHz 100kHz 500kHz 1MHz 2MHz 4MHz 8MHz 20MHz 1547pF 1533pF 47100pF 2068pF 1568pF 1547pF 1533pF 1547pF 1547pF 0.3% 0.5% 0.5% 0.5% 0.5% XT HS : OSC2 1547pF 1533pF 47100pF 2068pF 1568pF 1547pF 1533pF 1547pF 1547pF XT HS R s XT HS R s 1 VDD >4. 5V C1= C2 30p F DS30390B-J00-page 124 (c) 1996 Microchip Technology Inc. AC/DC http://www.microchip.comERRATA 14.2.4RC 14.2.3 T T L T T L 147 74AS04 1 8 0 4 . 7 k 1 0 k 74AS04 1 4 7 +5V 4.7k 74AS04 PIC16CXX 74AS04 CLKIN 10k XTAL R C (Rext)(Cext) Cext R C 1 4 9 R / C PIC16CXX 2.2kRext R e x t ( 1 M ) Rext3k100k (Cext=0pF) 20pF P C B R C R ( R R C ) C ( R C RCV DD Rext/CextV DD 10k 20pF 20pF 148 1 8 0 330k 4OSC2/CLKOUT (35 ) 149 R CC 149 VDD Rext 1 4 8 330k 74AS04 0.1uF OSC1 74AS04 Internal clock Cext Vss PIC16CXX To Other Devices 330k 74AS04 PIC16C7X OSC2/CLKOUT PIC16CXX Fosc/4 CLKIN XTAL (c) 1996 Microchip Technology Inc. DS30390B-J00-page 125 PIC16C7X 14.3 AC/DC http://www.microchip.comERRATA 1410 710 71 711 72 73 73A 74 74A 1410 PIC16C710/711/72/73A/74AMCLR PIC16CXX (POR) WDTMCLRLow MCLR SLEEPMCLR WDT() (BOR)(PIC16C710/711/72/ 73A/74A) P O R (POR)MCLRWDT SLEEPMCLR(BOR) W D T TOPD147148 1410 External Reset MCLR WDT Module VDD rise detect WDT SLEEP Time-out Reset Power-on Reset VDD Brown-out Reset(2) S BODEN OST/PWRT OST Chip_Reset R 10-bit Ripple counter OSC1 On-chip(1) RC OSC Q PWRT 10-bit Ripple counter Enable PWRT Enable OST 1 CLKINRC 2 PIC16C710/711/72/73A/74A 145146 DS30390B-J00-page 126 (c) 1996 Microchip Technology Inc. AC/DC http://www.microchip.comERRATA 14.4 (POR) (POR) (PWRT) (PWRT) (OST) (OST) (BOR) 710 71 711 72 73 73A 74 PIC16C7X V DD DC 14.4.3(OST) 74A 14.4.1 (POR) VDD(1.5V2.1V) PORMCLRVDD( R C V DD A N 6 0 7 14.4.2(PWRT) P O R 72ms RCPWRT PWRTVDD PWRT/ (OST)PWRT 1024OSC1 OSTXTLPHS S L E E P 14.4.4 (BOR) 710 71 711 72 73 73A 74 74A BODEN ( / ) ( ) V D D 3 5 4.0V(3.8V4.2V) VDD354.0V V DD B V D D 72ms V DD BV DD V D DBV D D 72ms 1 4 1 1 1411 1411 VDD BVDD Max. BVDD Min. Internal Reset 72ms VDD BVDD Max. BVDD Min. Internal Reset <72ms 72ms VDD BVDD Max. BVDD Min. Internal Reset (c) 1996 Microchip Technology Inc. 72ms DS30390B-J00-page 127 AC/DC http://www.microchip.comERRATA PIC16C7X 14.4.5 14.4.6 /(PCON) 710 71 711 PORPWRT O S T PWRT PWRTRC 1 4 1 2 1 4 1 3 1 4 1 4 72 73 73A 74 74A /PCON PIC16C73PIC16C74 0 BORBOR BORBOR B O R BODEN) P O R PORMCLR MCLR ( 1 4 1 3 ) PIC16CXX 149 1 4 1 0 145 (PIC16C71/73/74) 145 (PIC16C71/73/74) OscillatorConfiguration Powerup XT,HS,LP RC WakeupfromSLEEP PWRTE=1 PWRTE=0 72ms+1024Tosc 72ms 1024Tosc 1024Tosc 146 (PIC16C710/711/72/73A/74A) 146 (PIC16C710/711/72/73A/74A) OscillatorConfiguration XT,HS,LP RC Powerup PWRTE=0 PWRTE=1 72ms+1024Tosc 72ms 1024Tosc Brownout WakeupfromSLEEP 72ms+1024Tosc 72ms 1024Tosc (PIC16C71/73/74) 147: (PIC16C71/73/74) POR (1) TO PD 0 1 1 0 0 x POR TO 0 x 0 POR PD 1 0 1 WDT 1 0 0 WDT 1 u u MCLR 1 1 0 SLEEP MCLR SLEEP :u= x= 1: PORPIC16C71 148: (PIC16C710/711/72/73A/74A) (PIC16C710/711/72/73A/74A) POR TO PD 0 x 1 0 x 0 0 x x 1 0 x 1 1 0 1 1 0 1 1 1 1 1 1 :u=x= BOR 1 x 0 x 1 0 1 0 DS30390B-J00-page 128 PORTO PORPD WDT WDT MCLR SLEEP MCLR SLEEP (c) 1996 Microchip Technology Inc. AC/DC http://www.microchip.comERRATA PIC16C7X 1 4 99 Condition Program Counter 000h STATUS Register 00011xxx PCON Register PCON Register PCON Register PIC16C710/711 PIC16C73/74 PIC16C72/73A/74A 0x 0 0x MCLR 000h 000uuuuu uu u uu SLEEPMCLR 000h 00010uuu uu u uu WDT 000h 00001uuu uu u uu WDT PC+1 uuu00uuu uu u uu 000h 00011uuu u0 N/A u0 u uu (1) uuu10uuu uu SLEEP PC+1 u=x== 0 1GIE PC(0004h) 1 4 1 0 Register W INDF TMR0 PCL STATUS FSR PORTA PORTB PORTC PORTD PORTE PCLATH INTCON PIR1 PIR2 TMR1L TMR1H T1CON 1 2 3 ApplicableDevices PoweronReset, BrownoutReset MCLRResets WDTReset Wakeupvia WDTor Interrupt 710 71 711 72 73 73A 74 74A xxxxxxxx uuuuuuuu uuuuuuuu 710 71 711 72 73 73A 74 74A N/A N/A N/A 710 71 711 72 73 73A 74 74A xxxxxxxx uuuuuuuu uuuuuuuu (2) 710 71 711 72 73 73A 74 74A 0000h 0000h PC+1 (3) (3) 710 71 711 72 73 73A 74 74A 00011xxx 000qquuu uuuqquuu 710 71 711 72 73 73A 74 74A xxxxxxxx uuuuuuuu uuuuuuuu 710 71 711 72 73 73A 74 74A x0000 uuuuu uuuuu 710 71 711 72 73 73A 74 74A 0x0000 uuuuuu uuuuuu 710 71 711 72 73 73A 74 74A xxxxxxxx uuuuuuuu uuuuuuuu 710 71 711 72 73 73A 74 74A xxxxxxxx uuuuuuuu uuuuuuuu 710 71 711 72 73 73A 74 74A xxxxxxxx uuuuuuuu uuuuuuuu 710 71 711 72 73 73A 74 74A xxx uuu uuu 710 71 711 72 73 73A 74 74A 00000 00000 uuuuu (1) 710 71 711 72 73 73A 74 74A 0000000x 0000000u uuuuuuuu 710 71 711 72 73 73A 74 74A 00000 00000 uuuuu(1) (1) 710 71 711 72 73 73A 74 74A 0000000 0000000 uuuuuuu (1) 710 71 711 72 73 73A 74 74A 00000000 00000000 uuuuuuuu (1) 710 71 711 72 73 73A 74 74A 0 0 u 710 71 711 72 73 73A 74 74A xxxxxxxx uuuuuuuu uuuuuuuu 710 71 711 72 73 73A 74 74A xxxxxxxx uuuuuuuu uuuuuuuu 710 71 711 72 73 73A 74 74A 000000 uuuuuu uuuuuu u=x== 0 q= INTCONPIR1PIR2() GIEPC(0004h) 149 (c) 1996 Microchip Technology Inc. DS30390B-J00-page 129 PIC16C7X AC/DC http://www.microchip.comERRATA 1 4 1 0 Register ApplicableDevices PoweronReset, BrownoutReset MCLRResets WDTReset Wakeupvia WDTor Interrupt TMR2 710 71 711 72 73 73A 74 74A 00000000 00000000 uuuuuuuu T2CON 710 71 711 72 73 73A 74 74A 0000000 0000000 uuuuuuu SSPBUF 710 71 711 72 73 73A 74 74A xxxxxxxx uuuuuuuu uuuuuuuu SSPCON 710 71 711 72 73 73A 74 74A 00000000 00000000 uuuuuuuu CCPR1L 710 71 711 72 73 73A 74 74A xxxxxxxx uuuuuuuu uuuuuuuu CCPR1H 710 71 711 72 73 73A 74 74A xxxxxxxx uuuuuuuu uuuuuuuu CCP1CON 710 71 711 72 73 73A 74 74A 000000 000000 uuuuuu RCSTA 710 71 711 72 73 73A 74 74A 000000x 000000x uuuuuuu TXREG 710 71 711 72 73 73A 74 74A 00000000 00000000 uuuuuuuu RCREG 710 71 711 72 73 73A 74 74A 00000000 00000000 uuuuuuuu CCPR2L 710 71 711 72 73 73A 74 74A xxxxxxxx uuuuuuuu uuuuuuuu CCPR2H 710 71 711 72 73 73A 74 74A xxxxxxxx uuuuuuuu uuuuuuuu CCP2CON 710 71 711 72 73 73A 74 74A 00000000 00000000 uuuuuuuu ADRES 710 71 711 72 73 73A 74 74A xxxxxxxx uuuuuuuu uuuuuuuu ADCON0 710 71 711 72 73 73A 74 74A 0000000 0000000 uuuuuuu 710 71 711 72 73 73A 74 74A 0000000 0000000 uuuuuuu OPTION 710 71 711 72 73 73A 74 74A 11111111 11111111 uuuuuuuu TRISA 710 71 711 72 73 73A 74 74A 11111 11111 uuuuu 710 71 711 72 73 73A 74 74A 111111 111111 uuuuuu TRISB 710 71 711 72 73 73A 74 74A 11111111 11111111 uuuuuuuu TRISC 710 71 711 72 73 73A 74 74A 11111111 11111111 uuuuuuuu TRISD 710 71 711 72 73 73A 74 74A 11111111 11111111 uuuuuuuu TRISE 710 71 711 72 73 73A 74 74A 0000111 0000111 uuuuuuu PIE1 710 71 711 72 73 73A 74 74A 00000 00000 uuuuu 710 71 711 72 73 73A 74 74A 0000000 0000000 uuuuuuu 710 71 711 72 73 73A 74 74A 00000000 00000000 uuuuuuuu PIE2 710 71 711 72 73 73A 74 74A 0 0 u PCON 710 71 711 72 73 73A 74 74A 0 u u 710 71 711 72 73 73A 74 74A 0u uu uu PR2 710 71 711 72 73 73A 74 74A 11111111 11111111 11111111 SSPADD 70 71 71A 72 73 73A 74 74A 00000000 00000000 uuuuuuuu SSPSTAT 70 71 71A 72 73 73A 74 74A 000000 000000 uuuuuu TXSTA 70 71 71A 72 73 73A 74 74A 0000010 0000010 uuuuuuu SPBRG 70 71 71A 72 73 73A 74 74A 00000000 00000000 uuuuuuuu ADCON1 70 71 71A 72 73 73A 74 74A 00 00 uu 1 2 3 70 71 71A 72 73 73A 74 74A 00 00 uu u=x== 0 q= INTCONPIR1PIR2() GIEPC(0004h) 149 DS30390B-J00-page 130 (c) 1996 Microchip Technology Inc. AC/DC http://www.microchip.comERRATA PIC16C7X 1 4 1 2 (( M C L R V D D )) VDD MCLR INTERNAL POR TPWRT PWRT TIME-OUT TOST OST TIME-OUT INTERNAL RESET 1 4 1 3 (( M C L R V D D )) VDD MCLR INTERNAL POR TPWRT PWRT TIME-OUT TOST OST TIME-OUT INTERNAL RESET 1 4 1 44 ( M C L R V DD ) ( ) VDD MCLR INTERNAL POR TPWRT PWRT TIME-OUT TOST OST TIME-OUT INTERNAL RESET (c) 1996 Microchip Technology Inc. DS30390B-J00-page 131 PIC16C7X AC/DC http://www.microchip.comERRATA 1 4 1 5 V D D 1 4 1 6 VDD VDD D R VDD 33k R1 MCLR 10k C PIC16CXX : V D D VDD D 2 R<40k 3 ( E S D ) (EOS)MCLR/Vpp R 1 1 0 0 1 k CMCLR MCLR 40k PIC16CXX 1 V DD(Vz+0.7V) Vz= 2 PIC16C710/711/72/73A/74A 3 1 4 1 7 VDD VDD R1 Q1 MCLR R2 40k PIC16CXX 1 Q1VDD V DD * R1 = 0 .7 V R1+ R2 2 PIC16C710/711/72/73A/74A 3 DS30390B-J00-page 132 (c) 1996 Microchip Technology Inc. AC/DC http://www.microchip.comERRATA PIC16C7X 14.5 710 71 711 72 73 73A 74 74A PIC16C7X12 RB0/INT TMR0 PORTB(RB7RB4) A/D TMR1 TMR2 CCP1 CCP2 USART USART / (INTCON) / GIE G I E (INTCON<7>)() ( ) G I E G I E G I E "returnfrominterrupt"RETFIE GIE R B 0 / I N T R B T M R 0 INTCON P I R 1 P I R 2 P I E 1 , P I E 2 INTCON 710 710 710 710 710 710 710 710 710 710 710 710 (c) 1996 Microchip Technology Inc. 711 711 711 711 711 711 711 711 711 711 711 711 72 72 72 72 72 72 72 72 72 72 72 72 73 73 73 73 73 73 73 73 73 73 73 73 73A 73A 73A 73A 73A 73A 73A 73A 73A 73A 73A 73A 74 74 74 74 74 74 74 74 74 74 74 74 74A 74A 74A 74A 74A 74A 74A 74A 74A 74A 74A 74A INT/PORTB 14222 G I E PIC16C71PIC16C73PIC16C74 ( G I E ) G I E RETFIE 1. 2. 3. GIE RETFIE GIE GIE LOOP G I E 0 0 0 4 h P C 71 71 71 71 71 71 71 71 71 71 71 71 BCF INTCON,GIE ;DisableGlobal ; Interrupts BTFSC INTCON,GIE ;GlobalInterrupts ; Disabled? GOTO LOOP ;NO,tryagain : ;Yes,continue ; withprogram ; flow DS30390B-J00 - page 133 AC/DC http://www.microchip.comERRATA PIC16C7X 1418 PIC16C710/71/711 1418 T0IF T0IE Wakeup (If in SLEEP mode) INTF INTE Interrupt to CPU RBIF RBIE ADIF ADIE GIE 1419 PIC16C72 1419 TMR1F TMR1E T0IE T0IF INTE INTF TMR2IF TMR2IE Wakeup (If in SLEEP mode) Interrupt to CPU RBIE RBIF ADIF ADIE PEIE PEIF GIE CCP1IF CCP1IE SSPIF SSPIE 1420 PIC16C73/73A 1420 TMR1F TMR1E T0IE T0IF TMR2IF TMR2IE INTE INTF CCP1IF CCP1IE CCP2IF CCP2IE ADIF ADIE Wakeup (If in SLEEP mode) Interrupt to CPU RBIE RBIF PEIE PEIF GIE TXIF TXIE RCIF RCIE SSPIF SSPIE DS30390B-J00 - page 134 (c) 1996 Microchip Technology Inc. AC/DC http://www.microchip.comERRATA PIC16C7X 1421 PIC16C74/74A 1421 TMR1F TMR1E Wakeup (If in SLEEP mode) T0IE T0IF TMR2IF TMR2IE INTE INTF CCP1IF CCP1IE Interrupt to CPU RBIE RBIF CCP2IF CCP2IE PEIE ADIF ADIE PEIF GIE TXIF TXIE RCIF RCIE SSPIF SSPIE PSPIF PSPIE 1422 INT 1422 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 (INTCON<1>) 5 Interrupt Latency 2 GIE bit (INTCON<7>) INSTRUCTION FLOW PC PC PC+1 PC+1 0004h 0005h Instruction fetched Inst(PC) Inst(PC+1) - Inst(0004h) Inst(0005h) Instruction executed Inst(PC-1) Inst(PC) Dummy Cycle Dummy Cycle Inst(0004h) Note: 1. INTE Q1 2. 3 4TcyTcy= InstPC2 3. CLKOUT RC 4. INT AC 5. INTF Q4Q1 (c) 1996 Microchip Technology Inc. DS30390B-J00 - page 135 PIC16C7X AC/DC http://www.microchip.comERRATA 14.5.1INT RB0/INTINTEDG (OPTION<6>)=1INTEDG=0 R B 0 / I N T INTF(OPTION<1>) INTE(INTCON<4>) INTF I N T I N T E G I E 14.8 14.5.2TMR0 TMR0 FFh 00h T0IF INTCON<2>T0IEINTCON<5> 7.0 14.5.3PORTB PORTB<7:4> RBIFINTCON<0> RBIEINTCON<4> 5.2 PIC16C71PIC16C73PIC16C74 Q 2 I / O R B I F 14.6 710 71 711 72 73 73A 74 74A CPU PC W STATUS 141 WSTATUS / W WTEMP WTEMP 0 1 0 a)W 0 1) b)STATUS ( 0) c)PCLATH ( 0) d)FSR ( 0) e) f)FSR g)PCLATH d)STATUS d)W 141 STATUS W STATUS MOVWF SWAPF CLRF MOVWF MOVF MOVWF CLRF MOVF MOVWF : : : MOVF MOVWF MOVF MOVWF SWAPF W_TEMP STATUS,W STATUS STATUS_TEMP PCLATH, W PCLATH_TEMP PCLATH FSR, W FSR_TEMP FSR_TEMP, W FSR PCLATH_TEMP, W PCLATH STATUS_TEMP,W MOVWF SWAPF SWAPF STATUS W_TEMP,F W_TEMP,W ; Copy W to TEMP register, could be bank one or zero ; Swap status to be saved into W ; bank 0, regardless of current bank, Clears IRP,RP1,RP0 ; Save status to bank zero STATUS_TEMP register ; Only required if using pages 1, 2 and/or 3 ; Save PCLATH into W ; Page zero, regardless of current page ; Copy FSR to W ; Copy FSR from W to FSR_TEMP (ISR) DS30390B-J00 - page 136 ; Restore FSR ; Move W to FSR ; Restore PCLATH ; Move W into PCLATH ; Swap STATUS_TEMP register into W ; (sets bank to original state) ; Move W into STATUS register ; Swap W_TEMP ; Swap W_TEMP into W (c) 1996 Microchip Technology Inc. AC/DC http://www.microchip.comERRATA 14.7 PIC16C7X WDT) W 710 71 711 72 73 73A 74 74A RC OSC1/CLKIN RC CPU OSC1/OSC2 SLEEP CPU WDT WDT WDT WDTE 14.1 14.7.1 18ms VDD DC OPTION 1: 128 2.3 CLRWDTSLEEP WDT STATUS TO 14.7.2 VDD = = WDT WDT W D T W CLEWDT C 1423: From TMR0 Clock Source (Figure 7-6) 0 Postscaler 1 WDT Timer M U X 8 PS2:PS0 8 - to - 1 MUX PSA WDT Enable Bit To TMR0 (Figure 7-6) 0 1 PSA MUX WDT Time-out Note: RTETRSPSAPS0PS2 OPTION 1424: Bit7 Bit6 Bit5 Bit4 Bit3 Bit2 Bit1 Bit0 2007h Config.bits (1) BODEN(1) CP1 CP0 PWRTE(1) WDTE FOSC1 FOSC0 81h OPTION RBPU INTEDG T0CS T0SE PSA PS2 PS1 PS0 141,142,143,144 (c) 1996 Microchip Technology Inc. DS30390B-J00 - page 137 PIC16C7X 14.8 AC/DC http://www.microchip.comERRATA SLEEP) S 710 71 711 72 73 73A 74 74A S L E E P W D T PDSTATUS<3>) TOSTATUS<> I/OSLEEP H i L o w / H i L o w A / D T 0 C K I P O R T B M C L R ( V I H M C ) 14.8.1 SLEEP S L E E P MCLR WDT INTPORTB M C L R S T A T U S TOPD P D S L E E P T O W D T S L E E P TMR1 SSPStart/Stop SSPSPI/I2C) CCP / A/DRC TMR1 USARTTXRX SLEEPQ DS30390B-J00 - page 138 SLEEP PC+1 GIE GIE SLEEPGIE SLEEP 0004h SLEEP SLEEP NOP 14.8.2 GIE=0 SLEEP SLEEP NOP WDT TO PD SLEEP SLEEP WDTTO PD SLEEP NOP PD PD SLEEP NOP WDT SLEEP CLRWDT (c) 1996 Microchip Technology Inc. AC/DC http://www.microchip.comERRATA PIC16C7X 1 4 2 5 S L E E P S 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 T OST(2) CLKOUT 3 INT pin INTF flag (INTCON<1>) Interrupt Latency (Note2) GIE bit (INTCON<7>) Processor in SLEEP INSTRUCTION FLOW PC PC PC+1 PC+2 PC+2 PC+2 Instruction fetched Inst(PC) = SLEEP Inst(PC+1) Inst(PC+2) Instruction executed Inst(PC-1) SLEEP Inst(PC+1) Dummy cycle 0004h 0005h Inst(0004h) Inst(0005h) Dummy cycle Inst(0004h) Notes: 1. XTHS LP 2. tost=1024toscRC 3. GIE=1 GIE=0 4. CLKOUT 14.9 // 710 71 711 72 73 73A 74 74A Microchip 14.10 I D 710 71 711 72 73 73A 74 74A 2 0 0 0 h 2 0 0 3 h I D / I D 14.11 710 71 711 72 73 73A 74 74A PIC16CXXPC P C (c) 1996 Microchip Technology Inc. RB6/RB7LowMCLRVPP) V I LV I H H / R B 6 R B 7 R B 6 / R B 7 / / P C ) 0 0 h 1 4 PIC16C6X/7X Programming Specifications (#DS30228) 1426: External Connection Signals To Normal Connections PIC16XX +5V V DD 0V V SS V PP MCLR/V PP CLK RB6 RB7 Data I/O VDD To Normal Connections DS30390B-J00 - page 139 PIC16C7X DS30390B-J00 - page 140 AC/DC http://www.microchip.comERRATA (c) 1996 Microchip Technology Inc. AC/DC http://www.microchip.comERRATA PIC16C7X 15.0 710 71 711 72 73 73A 74 74A 3 PIC16CXX14 OPCODE 1 2 152PIC16CXX 1 5 1 OPCODE f d d W d 1 b f k 8 1 1 1 2 2NOP 1 4 4 M H z 1 s 2s 152MPASM 1 5 1 3 16 0xhh PIC16CXX OPTIONTRIS 151: OPCODE OPCODE f W b k x d label TOS PC PCLATH GIE WDT TO PD dest [] () <> 0x000x7F () =01 x=0 d=0W d=1f d=1 W (c) 1996 Microchip Technology Inc. h16 151: 13 8 7 6 0 OPCODE d f(FILE #) d = 0 for destination W d=0:W d=1:f d = 1 for destination f f:7 f = 7-bit file register address Bit-oriented file register operations 13 10 9 7 6 0 OPCODE b(BIT #) f(FILE #) bb:3 = 3-bit bit address ff:7 = 7-bit file register address Literal and control operations 13 8 OPCODE 7 0 k (LITERAL) k =k:8 8-bit immediate value. Literal and control operations CALL,GOTO 13 11 10 OPCODE 0 k (LITERAL) k =k:11 8-bit immediate value. DS30390B-J00 - page 141 PIC16C7X AC/DC http://www.microchip.comERRATA 152: 14 OPCODE O msb lsb ADDWF ANDWF CLRF CLRW COMF DECF DECFSZ INCF INCFSZ IORWF MOVF MOVWF NOP RLF RRF SUBWF SWAPF XORWF f, d f, d f f, d f, d f, d f, d f, d f, d f, d f f, d f, d f, d f, d f, d Add W and f AND W and f Clear f Clear W Complement f Decrement f Decrement f, Skip if 0 Increment f Increment f, Skip if 0 Inclusive OR W and f Move f Move W to f No Operation Rotate left f through carry Rotate right f through carry Subtract W from f Swap halves f Exclusive OR W and f 1 1 1 1 1 1 1 (2) 1 1 (2) 1 1 1 1 1 1 1 1 1 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0111 0101 0001 0001 1001 0011 1011 1010 1111 0100 1000 0000 0000 1101 1100 0010 1110 0110 dfff dfff 1fff 0xxx dfff dfff dfff dfff dfff dfff dfff 1fff 0xx0 dfff dfff dfff dfff dfff ffff ffff ffff xxxx ffff ffff ffff ffff ffff ffff ffff ffff 0000 ffff ffff ffff ffff ffff 1 1 1 (2) 1 (2) 01 01 01 01 00bb 01bb 10bb 11bb bfff bfff bfff bfff ffff ffff ffff ffff 1 1 2 1 2 1 1 2 2 2 1 1 1 11 11 10 00 10 11 11 00 11 00 00 11 11 111x 1001 0kkk 0000 1kkk 1000 00xx 0000 01xx 0000 0000 110x 1010 kkkk kkkk kkkk 0110 kkkk kkkk kkkk 0000 kkkk 0000 0110 kkkk kkkk kkkk kkkk kkkk 0100 kkkk kkkk kkkk 1001 kkkk 1000 0011 kkkk kkkk C, DC, Z Z Z Z Z Z Z Z Z C C C, DC, Z Z 1, 2 1, 2 2 1, 2 1, 2 1, 2, 3 1, 2 1, 2, 3 1, 2 1, 2 1, 2 1, 2 1, 2 1, 2 1, 2 BCF BSF BTFSC BTFSS f, b f, b f, b f, b Bit Clear f Bit Set f Bit Test f, Skip if Clear Bit Test f, Skip if Set 1, 2 1, 2 3 3 ADDLW ANDLW CALL CLRWDT GOTO IORLW MOVLW RETFIE RETLW RETURN SLEEP SUBLW XORLW k k k k k k k k k Add literal to W AND literal to W Call subroutine Clear watchdog timer Go to address Inclusive OR literal to W Move literal to W Return from interrupt Return with literal in W Return from subroutine Go into standby mode Subtract W from literal Excl. OR literal to W C, DC, Z Z TO, PD Z TO, PD C, DC, Z Z 1.I/OMOVF PORTB1 1 0 2. TMR0d=1TMR0 3. P C 2 2 NOP DS30390B-J00 - page 142 (c) 1996 Microchip Technology Inc. AC/DC http://www.microchip.comERRATA 15.1 PIC16C7X ADDLW Add Literal to W ANDLW AND Literal and W Syntax: Operands: Operation: StatusAffected: Encoding: Description: [label] ADDLW k 0k255 (W)+kW C,DC,Z 11 111X kkkk kkkk W 8 k W 1 1 ADDLW 0x15 W = 0x10 W = 0x25 Syntax: Operands: Operation: StatusAffected: Encoding: Description: [ label] ANDLW k 0k255 (W).AND.(k)W Z 11 1001 kkkk kkkk W 8 k A N D W 1 1 ANDLW 0x5F W = 0xA3 W = 0x03 ADD W to f ANDWF Words: Cycles: Example: ADDWF [label] ADDWF f,d 0f127 d[0,1] Operation: (W)+(f)(dest) StatusAffected: C,DC,Z Encoding: 00 0111 dfff ffff Description: W f d = 0 W d = 1 f Words: 1 Cycles: 1 Example: ADDWF FSR,0 W = 0x17 FSR = 0xC2 W = 0xD9 FSR = 0xC2 Syntax: Operands: (c) 1996 Microchip Technology Inc. Words: Cycles: Example: AND W with f [label] ANDWF f,d 0f127 d[0,1] Operation: (W).AND.(f)(dest) StatusAffected: Z Encoding: 00 0101 dfff ffff Description: W f A N D d=0 W d = 1 f Words: 1 Cycles: 1 Example: ANDWF FSR,1 W = 0x17 FSR = 0xC2 W = 0x17 FSR = 0x02 Syntax: Operands: DS30390B-J00 - page 143 PIC16C7X BCF AC/DC http://www.microchip.comERRATA Bit Clear f [label]BCF f,b 0f127 0b7 Operation: 0(f) StatusAffected: None Encoding: 01 00bb bfff Description: f b Words: 1 Cycles: 1 Example: BCF FLAGREG,7 FLAGREG= 0xC7 FLAGREG= 0x47 BTFSC Syntax: Operands: BSF Bit Test, skip if Clear [label] BTFSC f,b 0f127 0b7 Operation: skipif(f)=0 StatusAffected: None Encoding: 01 10bb bfff ffff Description: f b 0 b 0 2 NOP Words: 1 Cycles: 1(2) Example: HERE BTFSCFLAG,1 FALSE GOTOPROCESSCODE TRUE PC=HERE ifFLAG<1>=0, PC=TRUE ifFLAG<1>=1, PC=FALSE Syntax: Operands: ffff 0 Bit Set f [label]BSF f,b 0f127 0b7 Operation: 1(f) StatusAffected: None Encoding: 01 01bb bfff Description: f b Words: 1 Cycles: 1 Example: BSF FLAGREG,7 FLAGREG= 0x0A FLAGREG= 0x8A Syntax: Operands: DS30390B-J00 - page 144 ffff 1 (c) 1996 Microchip Technology Inc. AC/DC http://www.microchip.comERRATA BTFSS Bit Test, skip if Set CLRF PIC16C7X Clear f [label] BTFSS f,b 0f127 0b7 Operation: skipif(f)=1 StatusAffected: None Encoding: 01 11bb bfff ffff Description: f b 1 b 0 2 NOP Words: 1 Cycles: 1(2) Example: HERE BTFSSFLAG,1 FALSE GOTOPROCESSCODE TRUE PC=HERE ifFLAG<1>=0, PC=FALSE ifFLAG<1>=1, PC=TRUE [label]CLRF f 0f127 00h(f) 1Z StatusAffected: Z Encoding: 00 0001 1fff ffff Description: f Z Words: 1 Cycles: 1 Example: CLRF FLAGREG FLAGREG =0x5A FLAGREG =0x00 Z=1 CALL CLRW Syntax: Operands: Subroutine Call [label]CALL k 0k2047 (PC)+1TOS, kPC<10:0>, (PCLATH<4:3>)PC<12:11>; StatusAffected: None Encoding: 10 0kkk kkkk kkkk Description: PC+1 1 1 P C < 1 0 : 0 > PCLATHPC C A L L 2 Words: 1 Cycles: 2 Example: HERE CALL THERE PC = HERE PC = THERE TOS = HERE Syntax: Operands: Operation: (c) 1996 Microchip Technology Inc. Syntax: Operands: Operation: Clear W Register [label]CLRW None 00h(W) 1Z StatusAffected: Z Encoding: 00 0001 0XXX XXXX Description: W Z e r o Z Words: 1 Cycles: 1 Example: CLRW W = 0x5A W = 0x00 Z = 1 Syntax: Operands: Operation: DS30390B-J00 - page 145 PIC16C7X CLRWDT AC/DC http://www.microchip.comERRATA Clear Watchdog Timer DECF Decrement f [label]CLRWDT None 00hWDT 0WDTprescaler, 1TO 1PD StatusAffected: TO,PD Encoding: 00 0000 0110 0100 Description: W D T TOPD Words: 1 Cycles: 1 Example: CLRWDT WDTcounter =? WDTcounter =0x00 WDTprescaler =0 TO =0 PD =0 [label]DECF f,d 0f127 d[0,1] Operation: (f)1(dest) StatusAffected: Z Encoding: 00 0011 dfff ffff Description: f ( 1 ) d=0 W d=1 f Words: 1 Cycles: 1 Example: DECF CNT,1 CNT = 0x01 Z = 0 CNT = 0x00 Z = 1 COMF DECFSZ Syntax: Operands: Operation: Complement f [label]COMF f,d 0f127 d[0,1] Operation: (f)(dest) StatusAffected: Z Encoding: 00 1001 dfff ffff Description: f d=0 W d=1 f Words: 1 Cycles: 1 Example: COMF REG1,0 REG1 = 0x13 REG1 = 0x13 W = 0xEC Syntax: Operands: DS30390B-J00 - page 146 Syntax: Operands: Decrement f, skip if 0 [label]DECFSZf,d 0f127 d[0,1] Operation: (f)1d;skipifresult=0 StatusAffected: None Encoding: 00 1011 dfff ffff Description: f ( 1 ) d=0W d=1 f 0 N O P Words: 1 Cycles: 1(2) Example: HERE DECFSZ CNT,1 GOTO LOOP CONTINUE PC= HERE CNT=CNT1 ifCNT=0,PC=CONTINUE ifCNT=0,PC=HERE+1 Syntax: Operands: (c) 1996 Microchip Technology Inc. AC/DC http://www.microchip.comERRATA GOTO Unconditional Branch INCFSZ PIC16C7X Increment f, skip if 0 [label]GOTO k 0k2047 kPC<10:0> PCLATH<4:3>PC<12:11> StatusAffected: None Encoding: 10 1kkk kkkk kkkk Description: 1 1 PC<10:0> PCLATH<4:3>PC G O T O 2 Words: 1 Cycles: 2 Example: GOTOTHERE PC = THERE [label]INCFSZ f,d 0f127 d[0,1] Operation: (f)+1(dest),skipifresult=0 StatusAffected: None Encoding: 00 1111 dfff ffff Description: f ( + 1 ) d=0 W d=1 f 0 N O P INCFSZ2 Words: 1 Cycles: 1(2) Example: HERE INCFSZCNT,1 GOTOLOOP CONTINUE PC= HERE CNT=CNT+1 ifCNT=0, PC= CONTINUE ifCNT=0, PC= HERE+1 INCF IORLW Inclusive OR Literal with W Syntax: Operands: Operation: StatusAffected: Encoding: Description: [label]IORLW k 0k255 (W).OR.(k)(W) Z 11 1000 kkkk kkkk W 8 k O RW 1 1 IORLW 0x35 W = 0x9A W = 0xBF Z = 0 Syntax: Operands: Operation: Increment f [label]INCF f,d 0f127 d[0,1] Operation: (f)+1(dest) StatusAffected: Z Encoding: 00 1010 dfff ffff Description: f ( + 1 ) d=0 W d=1 f Words: 1 Cycles: 1 Example: INCF CNT,1 CNT = 0xFF Z = 0 CNT = 0x00 Z = 1 Syntax: Operands: (c) 1996 Microchip Technology Inc. Syntax: Operands: Words: Cycles: Example: DS30390B-J00 - page 147 PIC16C7X IORWF AC/DC http://www.microchip.comERRATA Inclusive OR W with f MOVF Move f [label]IORWF f,d 0f127 d[0,1] Operation: (W).OR.(f)(dest) StatusAffected: Z Encoding: 00 0100 dfff ffff Description: W f O R d = 0 Wd=1 f Words: 1 Cycles: 1 Example: IORWF RESULT,0 BeforeInstruction RESULT = 0x13 W = 0x91 AfterInstruction RESULT = 0x13 W = 0x93 Z = 0 [label]MOVF f,d 0f127 d[0,1] Operation: (f)(dest) StatusAffected: Z Encoding: 00 1000 dfff ffff Description: f d d=0 W d = 1 f Z Words: 1 Cycles: 1 Example: MOVF FSR,0 W = valueinFSRregister Z = 1 MOVLW Move Literal to W MOVWF Move W to f Syntax: Operands: Operation: StatusAffected: Encoding: Description: [label]MOVLWk 0k255 k(W) None 11 00XX kkkk kkkk 8 k W " x x 0 0 1 1 MOVLW 0x5A W = 0x5A Syntax: Operands: Operation: StatusAffected: Encoding: Description: [label]MOVWF f 0f127 (W)(f) None 00 0000 1fff W f 1 1 MOVWF OPTION OPTION = 0xFF W = 0x4F OPTION = 0x4F W = 0x4F Syntax: Operands: Words: Cycles: Example: DS30390B-J00 - page 148 Syntax: Operands: Words: Cycles: Example: ffff (c) 1996 Microchip Technology Inc. AC/DC http://www.microchip.comERRATA NOP No Operation RETFIE Syntax: Operands: Operation: StatusAffected: Encoding: Description: Words: Cycles: Example: [label]NOP None Nooperation None 00 0000 0XX0 1 1 NOP Syntax: Operands: Operation: OPTION Load Option Register RETLW Syntax: Operands: Operation: StatusAffected: Encoding: Description: [label]OPTION None WOPTION None 00 0000 0110 0010 WOPTION PIC16C5X OPTION 1 1 Syntax: Operands: Operation: Words: Cycles: Example: 0000 P I C 1 6 C X X P (c) 1996 Microchip Technology Inc. PIC16C7X Return from Interrupt [label] RETFIE None TOSPC, 1GIE StatusAffected: None Encoding: 00 0000 0000 1001 Description: T O S P C G I E G I E INTCON<7>RETFIE 2 Words: 1 Cycles: 2 Example: RETFIE PC = TOS GIE = 1 Return Literal to W [label]RETLW k 0k255 k(W); TOSPC StatusAffected: None Encoding: 11 01xx kkkk kkkk Description: 8 k W 2 Words: 1 Cycles: 2 Example: CALLTABLE;Wcontainstable ;offsetvalue ;Wnowhastablevalue TABLE ADDWFPC ;W=offset RETLWk1 ;Begintable RETLWk2 ; RETLWkn ;Endoftable W = 0x07 W = valueofk8 DS30390B-J00 - page 149 PIC16C7X AC/DC http://www.microchip.comERRATA RETURN Return from Subroutine RRF Syntax: Operands: Operation: StatusAffected: Encoding: Description: [label]RETURN None TOSPC None 00 0000 0000 1000 T O S 2 1 2 RETURN PC = TOS [label]RRF f,d 0f127 d[0,1] Operation: StatusAffected: C Encoding: 00 1100 dfff ffff Description: f 1 d=0 W d=1 f Words: Cycles: Example: RLF Rotate Left f through Carry [label]RLF f,d 0f127 d[0,1] Operation: StatusAffected: C Encoding: 00 1101 dfff ffff Description: f 1 d=0 W d=1 f Syntax: Operands: C Words: Cycles: Example: Register f 1 1 RLFREG1,0 REG1 = C = 11100110 0 REG1 = W = C = 11100110 11001100 1 DS30390B-J00 - page 150 Rotate Right f through Carry Syntax: Operands: C Words: Cycles: Example: Register f 1 1 RRFREG1,0 REG1 = C = 11100110 0 REG1 = W = C = 11100110 01110011 0 SLEEP [label]SLEEP None 00hWDT, 0WDTprescaler, 1TO, 0PD StatusAffected: TO,PD Encoding: 00 0000 0110 0011 Description: P D T O S L E E P S L E E P Words: 1 Cycles: 1 Example: SLEEP Syntax: Operands: Operation: (c) 1996 Microchip Technology Inc. AC/DC http://www.microchip.comERRATA PIC16C7X SUBLW Subtract W from Literal SUBWF Syntax: Operands: Operation: StatusAffected: Encoding: Description: [label]SUBLW k 0k255 k(W)(W) C,DC,Z 11 110X kkkk kkkk 8 k W 2 W 1 1 SUBLW0x02 W = 1 C = ? W = 1 C = 1; [label]SUBWFf,d 0f127 d[0,1] Operation: (f)(W)(dest) StatusAffected: C,DC,Z Encoding: 00 0010 dfff ffff Description: f W 2 d=0Wd=1 f Words: 1 Cycles: 1 Example1: SUBWF REG1,1 REG1 =3 W =2 C =? REG1 =1 W =2 C =1; Example2: REG1 =2 W =2 C =? REG1 =0 W =2 C =1; Example3: REG1 =1 W =2 C =? REG1 =0xFF W =2 C =0; Words: Cycles: Example1: Example2: W = 2 C = ? W = 0 C = 1; Example3: W = 3 C = ? W = 0xFF C = 0; (c) 1996 Microchip Technology Inc. Subtract W from f Syntax: Operands: DS30390B-J00 - page 151 PIC16C7X SWAPF AC/DC http://www.microchip.comERRATA Swap Nibbles in f XORLW Exclusive OR literal with W [label]SWAPF f,d 0f127 d[0,1] Operation: f<0:3>d<4:7>, f<4:7>d<0:3> StatusAffected: None Encoding: 00 1110 dfff ffff Description: f d=0 W d=1 f Words: 1 Cycles: 1 Example: SWAPF REG,0 REG = 0xA5 REG = 0xA5 W = 0x5A Syntax: Operands: Operation: StatusAffected: Encoding: Description: [label]XORLW k 0f255 (W).XOR.k(W) Z 11 1010 kkkk kkkk W 8 k X O R W 1 1 XORLW 0xAF W = 0xB5 W = 0x1A TRIS Load TRIS Register XORWF Syntax: Operands: Operation: StatusAffected: Encoding: Description: [label]TRIS f 5f7 (W)TRISregisterf; None 00 0000 0110 0fff PIC16C5X TRIS 1 1 [label]XORWF f,d 0f127 d[0,1] Operation: (W).XOR.(f)(dest) StatusAffected Z Encoding: 00 0110 dfff ffff Description: W f XORd=0 W d = 1 f Words: 1 Cycles: 1 Example: XORWF REG,1 REG = 0xAF W = 0xB5 REG = 0x1A W = 0xB5 Syntax: Operands: Words: Cycles: Example: P I C 1 6 C X X P DS30390B-J00 - page 152 Words: Cycles: Example: Exclusive OR W with f Syntax: Operands: (c) 1996 Microchip Technology Inc. AC/DC http://www.microchip.comERRATA PIC16C7X 16.0 16.1 PIC16/17 PICMASTER PROMATE PICSTART PICDEM1 PICDEM2 MPASM MPSIM C(MPC) (fuzzyTECHMP) 16.2PICMASTER: MPLABIDE PICMASTER PIC16C5X PIC16CXXPIC17CXX PICMASTERMPLAB (IDE) PICMASTER PIC16C5XPIC16CXX PIC17CXX (c) 1996 Microchip Technology Inc. PICMASTER PC486( ) Windows3.x PICMASTER 4 P C Windows PICMASTER PICMASTER P C Windows (DDE)DDE Windows PICMASTER WindowsPICMASTER PC (PIC16CXXPIC17CXX ) PICMASTER161 DS30390B-J00 - page 153 DS30390B-J00 - page 154 SW007002 SW007002 SW007002 SW007002 SW007002 SW007002 SW007002 SW007002 PIC16C62,62A,64,64A PIC16C620,621,622 PIC16C63,65,65A 73,73A,74,74A PIC16C642,662 PIC16C710,711 PIC16C72 PIC16C84 PIC16F83,84 SW006005 SW006005 SW006005 SW006005 SW006005 SW006005 SW006005 SW006005 SW006005 SW006005 SW006005 SW006005 SW006005 SW006005 MPLABC SW006006 SW006006 SW006006 SW006006 SW006006 SW006006 SW006006 SW006006 SW006006 SW006006 MPDriveWay DV005001/ DV005002 DV005001/ DV005002 DV005001/ DV005002 DV005001/ DV005002 EM177007 EM167031 EM167029 EM167029 EM167025 EM167027 DV005001/ DV005002 EM1670365 EM167025 EM167023 EM167025 EM167033 EM167015 EM147001 EM167015 PICMASTER DV005001/ DV005002 DV005001/ DV005002 DV005001/ DV005002 DV005001/ DV005002 DV005001/ DV005002 fuzzyTECH Explorer/ Edition ICEPIC EM167206 EM167204 EM167202 EM167203 EM167201 MPLAB PROMATEII PICMASTER(ICE)4.5V5.5VEM167015,EM17700720MHz10MHz SW007002 SW007002 PIC16C554,556,558 PIC17C42A,43,44 SW007002 PIC16C52,54,54A, 55,56,57,58A SW007002 SW007002 PIC14C000 PIC16C923,924 SW007002 MPLAB PIC12C508,509 DV007003 DV007003 DV007003 DV007003 DV007003 DV007003 DV007003 DV007003 DV007003 DV007003 DV007003 DV007003 DV007003 DV007003 PROMATEII DV003001 DV003001 DV003001 DV003001 DV003001 DV003001 DV003001 DV003001 DV003001 DV003001 DV003001 DV003001 DV003001 DV003001 PICSTART Plus PIC16C7X AC/DC http://www.microchip.comERRATA 161 (c) 1996 Microchip Technology Inc. AC/DC http://www.microchip.comERRATA PIC16C7X 16.3 PRO MATE: 16.3 MATE: 16.4 PICSTART 16.4 PICSTART PROMATEPC PROMATEVDDVPP V DD min VDD max LCD PICSTART COM(RS 232)PCPC P I C S T A R T P PROMATE PIC16C5XPIC16CXXPIC17CXX PCPROMATECOM (RS232)PCPC V DD minVDDmaxVPP (Intel6) PROMATE PROMATEPIC16C5XPIC16CXX PIC17CXX (c) 1996 Microchip Technology Inc. 16 5 PICDEM1 PIC16/17 16 PIC16/17 PICDEM1Microchip PIC16C5X (PIC16C54PIC16C58A)PIC16C62X PIC16C71XPIC16F8XPIC17C42PIC17C43 PIC17C44 PROMATE PICSTART16BPICDEM1 PICDEM1 PICMASTER RS232 PORTB 8LED DS30390B-J00 - page 155 PIC16C7X AC/DC http://www.microchip.comERRATA 16 6 PICDEM2 PIC16CXX 16 PICDEM2 PIC16CXX PICDEM2PIC16C62PIC16C64PIC16C65 PIC16C73PIC16C74 PROMATEPICSTART 16CPICDEM2 PICMASTER PICDEM2 RS232 I 2 C EEPROMLCD 16.7 MPLAB 16.7 MPLAB8 MPLAB Windows DS30390B-J00 - page 156 MPLAB ( C ) ( ) PIC16/17( ) DDE PC 4 MicrochipMPLAB 16.8 (MPASM) 16.8 (MPASM) MPASMPC PIC16C5XPIC16CXX PIC17CXX MPASM Microchip MPASMMicrochip (PICMASTER) MPASM Microchip Microchip ( ) 16()108 (c) 1996 Microchip Technology Inc. AC/DC http://www.microchip.comERRATA MPASMPIC16/17 MPASM ( ) 1 16.9 (MPLAB 16.9 (MPLAB (MPLAB SIM) MPSIMPC PIC16/ 1 7 / MPLABSIM (c) 1996 Microchip Technology Inc. PIC16C7X MPLABCMPASM 16.10 C (MPLABC) 16.10 (MPLABC) MPC C' MicrochipPIC16/17 PICMASTER (PICMASTER 1.13) 1 6 . 1 1 (fuzzyTECHMP) fuzzyTECHMP M P fuzzyTECHMP MicrochipfuzzyLAB DS30390B-J00 - page 157 PIC16C7X AC/DC http://www.microchip.comERRATA 1 5 9 2 6 66 1 2 DS30390B-J00 - page 158 (c) 1996 Microchip Technology Inc. AC/DC http://www.microchip.comERRATA PIC16C7X 2 8 3 3 1 00 2 3 (c) 1996 Microchip Technology Inc. DS30390B-J00 - page 309 PIC16C7X AC/DC http://www.microchip.comERRATA 2 8 3 3 1 0 2 3 DS30390B-J00 - page 310 (c) 1996 Microchip Technology Inc. AC/DC http://www.microchip.comERRATA PIC16C7X PARTNO.XXX/XXXXX QTP,SQTP,ROM JW PQ TQ SO SP SJ P L =CERDIP =MQFP(MetricPQFP) =TQFP(ThinQuadFlatpack) =SOIC =Skinnyplasticccarrier =SkinnyCERDIP =PDIP =PLCC I E =0-70(TforTape/Reel) =40-+85(SforTape/Reel) =40-+125 04 04 10 20 =200KHz(PIC16C7X04) =4MHz =10MHz =20MHz PIC16C7X :VDD=4.06.0V PIC16C7XT:VDD=4.06.0V(Tape/Reel) PIC16LC7X:VDD=2.56.0V PIC16LC7XT:VDD=2.56.0V(Tape/Reel) (c) 1996 Microchip Technology Inc. a)PIC16C71104/P301 PDIP MHz QTP#301 b)PIC16LC73A04I/SO SOIC MHz c)PIC16C74A10E/P PDIP 10MHz DS30390B-J00 - page 311 PIC16C7X AC/DC http://www.microchip.comERRATA MicrochipTechnologyInc. 2355WestChandlerBlvd. Chandler,AZ852246199 Tel6027867200Fax6027867277 6027867627 Webhttp//www.microchip.com MicrochipTechnology Unit406ofShanghaiGoldenBridgeBldg. 2077Yan'anRoadWest,HongiaoDistrict Shanghai,PeoplesRepublicofChina Tel862162755700 Fax011862162755060 ArizonaMicrochipTechnologyLtd. Unit6,TheCourtyard MeadowBank,FurlongRoad BourneEnd,BuckinghamshireSL85AJ Tel441628850303 Fax441628850178 MicrochipTechnology RM3801B,TowerTwo Metroplaza 223HingFongRoad KwaiFong,N.T.HongKong Tel85224011200Fax85224013431 ArizonaMicrochipTechnologySARL ZoneIndustrielledelaBonde 2RueduBuissonauxFraises 91300MassyFrance Tel33169536320 Fax33169309079 MicrochipTechnology No.6,Legacy,ConventRoad Bangalore560025India Tel91805263148Fax91805599840 ArizonaMicrochipTechnologyGmbH GustavHeinemannRing125 D81739Muenchen,Germany Tel49896271440 Fax498962714444 MicrochipTechnologyInc. 500SugarMillRoad,Suite200B Atlanta,GA30350 Tel7706400034Fax7706400307 MicrochipTechnologyInc. 5MountRoyalAvenue Marlborough,MA01752 Tel5084809990Fax5084808575 MicrochipTechnologyInc. 333PierceRoad,Suite180 Itasca,IL60143 Tel7082850071Fax7082850075 MicrochipTechnologyInc. 14651DallasParkway,Suite816 Dallas,TX752408809 Tel9729917177Fax9729918588 MicrochipTechnologyInc. Suite150 TwoPrestigePlace Miamisburg,OH45342 Tel5132911654Fax5132919175 MicrochipTechnologyInc. 18201VonKarman,Suite1090 Irvine,CA92612 Tel7142631888Fax7142631338 MicrochipTechnology 1681,YoungboBldg.3Floor SamsungDong,Kangnamku, Seoul,Korea Tel8225547200Fax8225585934 MicrochipTechnology 200MiddleRoad #1003PrimeCentre Singapore188980 Tel653348870Fax653348850 MicrochipTechnology 10F1C207 TungHuaNorthRoad Taipei,Taiwan,ROC Tel88627177175Fax88625450139 ArizonaMicrochipTechnologySRL CentroDirezionaleColleonePasTaurus 1VialeColleoni1 20041AgrateBrianza MilanItaly Tel39396899939Fax39396899883 Inc. 222 31820BenexS16F Tel0454716166Fax0454716122 9/3/96 MicrochipTechnologyInc. 150MotorParkway,Suite416 Hauppauge,NY11788 Tel5162735305Fax5162735335 MicrochipTechnologyInc. 2107NorthFirstStreet,Suite590 SanJose,CA95131 Tel4084367950Fax4084367955 MicrochipTechnologyInc. 5925AirportRoad,Suite200 Mississauga,OntarioL4V1W1,Canada Tel9054056279Fax9054056253 1996,MicrochipTechnologyIncorporated,USA MicrochipTechnologyIncorporated Microchip Microchip Microchip MicrochipTechnologyInc. DS30390B-J00 - page 312 (c) 1996 Microchip Technology Inc.