PIC16F916T-I/SS Microchip Technology, PIC16F916T-I/SS Datasheet

no-image

PIC16F916T-I/SS

Manufacturer Part Number
PIC16F916T-I/SS
Description
IC,MICROCONTROLLER,8-BIT,PIC CPU,CMOS,SSOP,28PIN,PLASTIC
Manufacturer
Microchip Technology
Series
PIC® 16Fr

Specifications of PIC16F916T-I/SS

Rohs Compliant
YES
Core Processor
PIC
Core Size
8-Bit
Speed
20MHz
Connectivity
I²C, SPI, UART/USART
Peripherals
Brown-out Detect/Reset, LCD, POR, PWM, WDT
Number Of I /o
24
Program Memory Size
14KB (8K x 14)
Program Memory Type
FLASH
Eeprom Size
256 x 8
Ram Size
352 x 8
Voltage - Supply (vcc/vdd)
2 V ~ 5.5 V
Data Converters
A/D 5x10b
Oscillator Type
Internal
Operating Temperature
-40°C ~ 85°C
Package / Case
28-SSOP
Lead Free Status / RoHS Status
Lead free / RoHS Compliant
For Use With
MA160011 - DAUGHTER BOARD PICDEM LCD 16F91X
Lead Free Status / RoHS Status
Lead free / RoHS Compliant

Available stocks

Company
Part Number
Manufacturer
Quantity
Price
Part Number:
PIC16F916T-I/SS
Manufacturer:
MICROCHIP
Quantity:
12 000
Part Number:
PIC16F916T-I/SS
0
PIC16F913/914/916/917/946
Data Sheet
28/40/44/64-Pin Flash-Based,
8-Bit CMOS Microcontrollers with
LCD Driver and nanoWatt Technology
© 2007 Microchip Technology Inc.
DS41250F

Related parts for PIC16F916T-I/SS

PIC16F916T-I/SS Summary of contents

Page 1

... PIC16F913/914/916/917/946 8-Bit CMOS Microcontrollers with LCD Driver and nanoWatt Technology © 2007 Microchip Technology Inc. 28/40/44/64-Pin Flash-Based, Data Sheet DS41250F ...

Page 2

... Select Mode, Smart Serial, SmartTel, Total Endurance, UNI/O, WiperLock and ZENA are trademarks of Microchip Technology Incorporated in the U.S.A. and other countries. SQTP is a service mark of Microchip Technology Incorporated in the U.S.A. All other trademarks mentioned herein are property of their respective companies. ...

Page 3

... Multiplexed Master Clear with pull-up/input pin • Programmable code protection • High-Endurance Flash/EEPROM cell: - 100,000 write Flash endurance - 1,000,000 write EEPROM endurance - Flash/Data EEPROM retention: > 40 years © 2007 Microchip Technology Inc. PIC16F913/914/916/917/946 Low-Power Features: • Standby Current: - <100 nA @ 2.0V, typical • Operating Current μ ...

Page 4

... LCD Timers (segment CCP 8/16-bit drivers 2 2/1 RB7/ICSPDAT/ICDDAT/SEG13 RB6/ICSPCLK/ICDCK/SEG14 RB5/COM1 RB4/COM0 RB3/SEG3 RB2/SEG2 RB1/SEG1 RB0/INT/SEG0 RD7/SEG20 RD6/SEG19 RD5/SEG18 RD4/SEG17 RC7/RX/DT/SDI/SDA/SEG8 RC6/TX/CK/SCK/SCL/SEG9 RC5/T1CKI/CCP1/SEG10 RC4/T1G/SDO/SEG11 RD3/SEG16 RD2/CCP2 © 2007 Microchip Technology Inc. ...

Page 5

... Note 1: Pull-up enabled only with external MCLR configuration. © 2007 Microchip Technology Inc. PIC16F913/914/916/917/946 Timers CCP AUSART SSP — — — — — — — — — — — — ...

Page 6

... RC0/VLCD1 RC1/VLCD2 RC2/VLCD3 RC3/SEG6 28-pin QFN RA2/AN2/C2+/V -/COM2 REF RA3/AN3/C1+/V +/COM3/SEG15 REF RA4/C1OUT/T0CKI/SEG4 RA5/AN4/C2OUT/SS/SEG5 V SS RA7/OSC1/CLKIN/T1OSI RA6/OSC2/CLKOUT/T1OSO DS41250F-page PIC16F913/916 RB7/ICSPDAT/ICDDAT/SEG13 RB6/ICSPCLK/ICDCK/SEG14 RB5/COM1 RB4/COM0 RB3/SEG3 RB2/SEG2 RB1/SEG1 RB0/INT/SEG0 RC7/RX/DT/SDI/SDA/SEG8 RC6/TX/CK/SCK/SCL/SEG9 RC5/T1CKI/CCP1/SEG10 RC4/T1G/SDO/SEG11 RB3/SEG3 RB2/SEG2 RB1/SEG1 RB0/INT/SEG0 RC7/RX/DT/SDI/SDA/SEG8 © 2007 Microchip Technology Inc. ...

Page 7

... Note 1: Pull-up enabled only with external MCLR configuration. © 2007 Microchip Technology Inc. PIC16F913/914/916/917/946 Timers CCP AUSART SSP — — — — — — — — — — — — ...

Page 8

... IOC Y ICSPCLK/ICDCK IOC Y ICSPDAT/ICDDAT — — — — — — — — — — — — — — — — — — — — — — — — (1) — Y MCLR/V PP — — — — — — © 2007 Microchip Technology Inc. ...

Page 9

... Pin Diagrams – PIC16F914/917, 44-Pin 44-pin TQFP RC7/RX/DT/SDI/SDA/SEG8 1 RD4/SEG17 2 RD5/SEG18 3 RD6/SEG19 4 RD7/SEG20 RB0/SEG0/INT 8 RB1/SEG1 9 RB2/SEG2 10 RB3/SEG3 11 44-pin QFN RC7/RX/DT/SDI/SDA/SEG8 © 2007 Microchip Technology Inc. PIC16F913/914/916/917/946 NC 33 RC0/VLCD1 32 RA6/OSC2/CLKOUT/T1OSO 31 RA7/OSC1/CLKIN/T1OSI PIC16F914/917 RE2/AN7/SEG23 27 RE1/AN6/SEG22 26 RE0/AN5/SEG21 25 RA5/AN4/C2OUT/SS/SEG5 24 23 RA4/C1OUT/T0CKI/SEG4 1 RD4/SEG17 2 RD5/SEG18 3 RD6/SEG19 4 RD7/SEG20 5 V PIC16F914/917 ...

Page 10

... Y MCLR/V PP — — — — — — — — — — NC — — NC — — NC — — NC © 2007 Microchip Technology Inc. ...

Page 11

... Note 1: Pull-up enabled only with external MCLR configuration. © 2007 Microchip Technology Inc. PIC16F913/914/916/917/946 Timers CCP AUSART SSP — — — — — — — — — — — — ...

Page 12

... Pin Diagram – PIC16F946 64-pin TQFP RD6/SEG19 1 RD7/SEG20 2 RG0/SEG36 3 RG1/SEG37 4 RG2/SEG38 5 RG3/SEG39 6 RG4/SEG40 7 RG5/SEG41 RF0/SEG32 11 RF1/SEG33 12 RF2/SEG34 13 RF3/SEG35 14 RB0/INT/SEG0 15 RB1/SEG1 DS41250F-page PIC16F946 RF7/SEG31 47 RF6/SEG30 46 RF5/SEG29 45 RF4/SEG28 44 RE7/SEG27 43 RE6/SEG26 RE5/SEG25 RA6/OSC2/CLKOUT/T1OSO 39 RA7/OSC1/CLKIN/T1OSI RE4/SEG24 36 RE3/MCLR RE2/AN7/SEG23 34 RE1/AN6/SEG22 RE0/AN5/SEG21 33 © 2007 Microchip Technology Inc. ...

Page 13

... SEG32 — RF1 12 — SEG33 — RF2 13 — SEG34 — Note 1: Pull-up enabled only with external MCLR configuration. © 2007 Microchip Technology Inc. PIC16F913/914/916/917/946 Timers CCP AUSART SSP — — — — — — — — — — — — ...

Page 14

... AV DD — — — — — — — — — — — — — — — — — — © 2007 Microchip Technology Inc. ...

Page 15

... When contacting a sales office, please specify which device, revision of silicon and data sheet (include literature number) you are using. Customer Notification System Register on our web site at www.microchip.com to receive the most current information on all of our products. © 2007 Microchip Technology Inc. PIC16F913/914/916/917/946 DS41250F-page 13 ...

Page 16

... PIC16F913/914/916/917/946 NOTES: DS41250F-page 14 © 2007 Microchip Technology Inc. ...

Page 17

... Start-up Timer Control OSC1/CLKIN Power-on Timing OSC2/CLKOUT Watchdog Generation Brown-out Internal Oscillator Block V DD Timer0 Timer1 Comparators CCP1 © 2007 Microchip Technology Inc. PIC16F913/914/916/917/946 INT 8 Data Bus RAM 256/352 bytes File Registers RAM Addr 9 (PMR) Addr MUX Indirect 7 Addr 8 FSR Reg ...

Page 18

... RB1 RB2 RB3 RB4 RB5 RB6 RB7 PORTC RC0 RC1 RC2 RC3 RC4 RC5 RC6 RC7 PORTD RD0 RD1 RD2 RD3 RD4 RD5 RD6 RD7 PORTE RE0 RE1 RE2 RE3/MCLR Data EEPROM 256 bytes PLVD LCD © 2007 Microchip Technology Inc. ...

Page 19

... Watchdog Timer Timing OSC2/CLKOUT Generation Brown-out Reset Internal Oscillator Block Timer0 Timer1 Comparators CCP1 CCP2 © 2007 Microchip Technology Inc. PIC16F913/914/916/917/946 INT 8 Data Bus RAM 336 x 8 bytes File Registers RAM Addr 9 (PMR) Addr MUX Indirect 7 8 Addr FSR Reg STATUS Reg ...

Page 20

... Timer1 oscillator input. TTL CMOS General purpose I/O. Individually enabled pull-up. ST — External interrupt pin. — AN LCD analog output. CMOS = CMOS compatible input or output ST = Schmitt Trigger input with CMOS levels P XTAL = Crystal Description OD = Open Drain = Power © 2007 Microchip Technology Inc. ...

Page 21

... COM3 is available on RA3 for the PIC16F913/916 and on RD0 for the PIC16F914/917 and PIC16F946. 2: Pins available on PIC16F914/917 and PIC16F946 only. 3: Pins available on PIC16F946 only Schmitt trigger inputs have special input levels. © 2007 Microchip Technology Inc. PIC16F913/914/916/917/946 Input Output Type Type TTL CMOS General purpose I/O. Individually enabled pull-up. — ...

Page 22

... Analog input Channel 7. — AN LCD analog output. ST — Digital input only. ST — Master Clear with internal pull-up. HV — Programming voltage. CMOS = CMOS compatible input or output ST = Schmitt Trigger input with CMOS levels P XTAL = Crystal Description OD = Open Drain = Power © 2007 Microchip Technology Inc. ...

Page 23

... COM3 is available on RA3 for the PIC16F913/916 and on RD0 for the PIC16F914/917 and PIC16F946. 2: Pins available on PIC16F914/917 and PIC16F946 only. 3: Pins available on PIC16F946 only Schmitt trigger inputs have special input levels. © 2007 Microchip Technology Inc. PIC16F913/914/916/917/946 Input Output Type Type ST CMOS General purpose I/O. — ...

Page 24

... Pins available on PIC16F946 only Schmitt trigger inputs have special input levels. DS41250F-page 22 Input Output Type Type P — Ground reference for microcontroller. CMOS = CMOS compatible input or output ST = Schmitt Trigger input with CMOS levels P XTAL = Crystal Description OD = Open Drain = Power © 2007 Microchip Technology Inc. ...

Page 25

... CALL, RETURN RETFIE, RETLW Stack Level 1 Stack Level 2 Stack Level 8 Reset Vector Interrupt Vector Page 0 On-chip Program Memory Page 1 © 2007 Microchip Technology Inc. PIC16F913/914/916/917/946 FIGURE 2-2: CALL, RETURN RETFIE, RETLW On-chip Program Memory 0000h 0004h 0005h 07FFh 0800h 0FFFh ...

Page 26

... The Special Function Registers can be classified into two sets: core and peripheral. The Special Function Registers associated with the “core” are described in this section. Those related to the operation of the peripheral features are described in the section of that peripheral feature. DS41250F-page 24 © 2007 Microchip Technology Inc. ...

Page 27

... Bytes accesses 70h-7Fh 7Fh Bank 0 Bank 1 Unimplemented data memory locations, read as ‘0’. Note 1: Not a physical register the PIC16F913, unimplemented data memory locations, read as ‘0’. © 2007 Microchip Technology Inc. PIC16F913/914/916/917/946 File File Address Address (1) (1) 80h Indirect addr. 100h ...

Page 28

... OPTION_REG 181h PCL 182h STATUS 183h FSR 184h 185h TRISB 186h 187h 188h 189h PCLATH 18Ah INTCON 18Bh EECON1 18Ch (1) EECON2 18Dh Reserved 18Eh Reserved 18Fh 190h General Purpose (2) Register 96 Bytes 1EFh accesses 1F0h 70h-7Fh 1FFh Bank 3 © 2007 Microchip Technology Inc. ...

Page 29

... General Register Purpose Register 80 Bytes 96 Bytes accesses 70h-7Fh 7Fh Bank 0 Bank 1 Unimplemented data memory locations, read as ‘0’. Note 1: Not a physical register. © 2007 Microchip Technology Inc. PIC16F913/914/916/917/946 File File Address Address (1) (1) 80h Indirect addr. 100h TMR0 101h 82h PCL ...

Page 30

... CCP1M0 212,226 --00 0000 OERR RX9D 131,226 0000 000x 130,226 0000 0000 128,227 0000 0000 213,227 xxxx xxxx 213,227 xxxx xxxx CCP2M0 212,227 --00 0000 182,227 xxxx xxxx ADON 180,227 0000 0000 © 2007 Microchip Technology Inc. ...

Page 31

... PIC16F914/917 and PIC16F946 only, forced ‘0’ on PIC16F913/916. 4: The value of the OSTS bit is dependent on the value of the Configuration Word (CONFIG) of the device. See Section 4.2 “Oscillator Control”. 5: Bit is read-only; TRISE3 = 1 always. © 2007 Microchip Technology Inc. PIC16F913/914/916/917/946 Bit 5 Bit 4 Bit 3 Bit 2 ...

Page 32

... COM3 COM3 SEG9 SEG8 147,228 xxxx xxxx COM3 COM3 SEG17 SEG16 147,228 xxxx xxxx COM3 COM3 SE1 SE0 147,228 0000 0000 SE9 SE8 147,228 0000 0000 SE17 SE16 147,228 0000 0000 — — © 2007 Microchip Technology Inc. ...

Page 33

... Note 1: Other (non Power-up) Resets include MCLR Reset and Watchdog Timer Reset during normal operation. 2: This register is only initialized by a POR or BOR reset and is unchanged by other Resets. 3: PIC16F946 only. © 2007 Microchip Technology Inc. PIC16F913/914/916/917/946 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 T0CS ...

Page 34

... Note 1: The C and DC bits operate as Borrow and Digit Borrow out bits, respectively, in subtraction. R-1 R Unimplemented bit, read as ‘0’ ‘0’ = Bit is cleared (ADDWF, ADDLW, SUBLW, SUBWF instructions) Status bits (see Section 17.0 R/W-x R/W-x R/W-x (1) ( bit Bit is unknown (1) (1) © 2007 Microchip Technology Inc. ...

Page 35

... Microchip Technology Inc. PIC16F913/914/916/917/946 Note: To achieve a 1:1 prescaler assignment for Timer0, assign the prescaler to the WDT by setting PSA bit of the OPTION register to ‘1’. See Section 6.3 “Timer1 Prescaler”. R/W-1 ...

Page 36

... User software should ensure the appropri- ate interrupt flag bits are clear prior to enabling an interrupt. R/W-0 R/W-0 R/W-0 (1) (2) INTE RBIE T0IF U = Unimplemented bit, read as ‘0’ ‘0’ = Bit is cleared (1) (2) R/W-0 R/W-x INTF RBIF bit Bit is unknown © 2007 Microchip Technology Inc. ...

Page 37

... Disables the Timer2 to PR2 match interrupt bit 0 TMR1IE: Timer1 Overflow Interrupt Enable bit 1 = Enables the Timer1 overflow interrupt 0 = Disables the Timer1 overflow interrupt © 2007 Microchip Technology Inc. PIC16F913/914/916/917/946 Note: Bit PEIE of the INTCON register must be set to enable any peripheral interrupt. ...

Page 38

... PIC16F914/PIC16F917/PIC16F946 only. DS41250F-page 36 Note: Bit PEIE of the INTCON register must be set to enable any peripheral interrupt. R/W-0 U-0 R/W-0 LCDIE — LVDIE U = Unimplemented bit, read as ‘0’ ‘0’ = Bit is cleared (1) U-0 R/W-0 (1) — CCP2IE bit Bit is unknown © 2007 Microchip Technology Inc. ...

Page 39

... No Timer2 to PR2 match occurred bit 0 TMR1IF: Timer1 Overflow Interrupt Flag bit 1 = The TMR1 register overflowed (must be cleared in software The TMR1 register did not overflow © 2007 Microchip Technology Inc. PIC16F913/914/916/917/946 Note: Interrupt flag bits are set when an interrupt condition occurs, regardless of the state of its corresponding enable bit or the global enable bit, GIE of the INTCON register ...

Page 40

... User software appropriate interrupt flag bits are clear prior to enabling an interrupt. R/W-0 U-0 R/W-0 LCDIF — LVDIF U = Unimplemented bit, read as ‘0’ ‘0’ = Bit is cleared (1) should ensure the U-0 R/W-0 (1) — CCP2IF bit Bit is unknown © 2007 Microchip Technology Inc. ...

Page 41

... BOR: Brown-out Reset Status bit Brown-out Reset occurred Brown-out Reset occurred (must be set in software after a Power-on Reset or Brown-out Reset occurs) Note 1: Set BOREN<1:0> the Configuration Word register for this bit to control the BOR. © 2007 Microchip Technology Inc. PIC16F913/914/916/917/946 R/W-1 U-0 U-0 SBOREN — ...

Page 42

... ORG 900h SUB1_P1 : : RETURN RETLW and RETFIE instruc- Therefore, manipulation of the CALL OF A SUBROUTINE IN PAGE 1 FROM PAGE 0 ;Select page 1 ;(800h-FFFh) ;Call subroutine in ;page 1 (800h-FFFh) ;page 1 (800h-FFFh) ;called subroutine ;page 1 (800h-FFFh) ;return to ;Call subroutine ;in page 0 ;(000h-7FFh) © 2007 Microchip Technology Inc. ...

Page 43

... From Opcode RP1 RP0 6 Bank Select Location Select 00h Data Memory 7Fh Bank 0 Note: For memory map detail, see Figures 2-3 and 2-4. © 2007 Microchip Technology Inc. PIC16F913/914/916/917/946 EXAMPLE 2-2: MOVLW MOVWF BANKISEL NEXT CLRF INCF BTFSS GOTO CONTINUE 0 IRP ...

Page 44

... PIC16F913/914/916/917/946 NOTES: DS41250F-page 42 © 2007 Microchip Technology Inc. ...

Page 45

... Setting a pin to an analog input automatically disables the digital input circuitry, weak pull-ups, and interrupt-on-change if available. The corresponding TRIS bit must be set to Input mode in order to allow external control of the voltage on the pin. 2: PIC16F914/PIC16F917/PIC16F946 only. © 2007 Microchip Technology Inc. PIC16F913/914/916/917/946 3.1 ANSEL Register The ANSEL register (Register 3-1) is used to configure the Input mode of an I/O pin to analog ...

Page 46

... Bit is cleared INITIALIZING PORTA ; ;Init PORTA ; ;Set RA<2:0> to ;digital I/O ;Make all PORTA digital I/O ;Set RA<7:4> as inputs ;and set RA<3:0> as outputs R/W-x R/W-x RA1 RA0 bit Bit is unknown R/W-1 R/W-1 TRISA1 TRISA0 bit Bit is unknown © 2007 Microchip Technology Inc. ...

Page 47

... FIGURE 3-1: BLOCK DIAGRAM OF RA0 Data Bus D WR PORTA CK Data Latch D WR TRISA CK TRIS Latch RD TRISA RD PORTA SEG12 © 2007 Microchip Technology Inc. PIC16F913/914/916/917/946 Analog Input or SE12 and LCDEN SE12 and LCDEN SE12 and LCDEN To A/D Converter and Comparator V DD I/O Pin ...

Page 48

... Data Bus D WR PORTA CK Data Latch D WR TRISA CK TRIS Latch RD TRISA RD PORTA SEG7 DS41250F-page Analog Input or SE7 and LCDEN SE7 and LCDEN SE7 and LCDEN To A/D Converter and Comparator V DD I/O Pin V SS TTL Input Buffer © 2007 Microchip Technology Inc. ...

Page 49

... FIGURE 3-3: BLOCK DIAGRAM OF RA2 Data Bus D WR PORTA CK Data Latch D WR TRISA CK TRIS Latch RD TRISA RD PORTA COM2 To A/D Converter and Comparator To A/D Module V © 2007 Microchip Technology Inc. PIC16F913/914/916/917/946 LMUX<1:0> LCDEN and LMUX<1:0> LCDEN and LMUX<1:0> Input REF V DD I/O Pin ...

Page 50

... PIC16F913/916 only. 2: For the PIC16F913/916, the LCDMODE_EN = LCDEN and (SE15 or LMUX<1:0> = 11). For the PIC16F914/917 and PIC16F946, the LCDMODE_EN = LCDEN and SE15. DS41250F-page Analog Input or LCDMODE_EN (2) LCDMODE_EN (2) LCDMODE_EN or SEG15 + Input REF V DD I/O Pin V SS (2) TTL Input Buffer © 2007 Microchip Technology Inc. ...

Page 51

... BLOCK DIAGRAM OF RA4 CM<2:0> = 110 or 101 Data Bus D WR PORTA CK Data Latch D WR TRISA CK TRIS Latch RD TRISA RD PORTA T0CKI SEG4 © 2007 Microchip Technology Inc. PIC16F913/914/916/917/946 C1OUT SE4 and LCDEN SE4 and LCDEN Schmitt Trigger SE4 and LCDEN V DD I/O Pin ...

Page 52

... Data Bus D WR PORTA CK Data Latch D WR TRISA CK TRIS Latch RD TRISA RD PORTA To SS Input SEG5 To A/D Converter DS41250F-page 50 C2OUT Analog Input or SE5 and LCDEN Input Buffer SE5 and LCDEN SE5 and LCDEN V DD I/O Pin V SS TTL © 2007 Microchip Technology Inc. ...

Page 53

... BLOCK DIAGRAM OF RA6 CLKOUT (F Data Bus PORTA CK Q Data Latch TRISA CK Q TRIS Latch F = 00x, 010 OSC or T1OSCEN RD TRISA RD PORTA © 2007 Microchip Technology Inc. PIC16F913/914/916/917/946 F = 1x1 OSC From OSC1 /4) OSC 00x, 010 OSC or T1OSCEN Input Buffer Oscillator Circuit V DD I/O Pin V ...

Page 54

... LMUX0 0001 0011 0001 0011 SE0 0000 0000 uuuu uuuu SE8 0000 0000 uuuu uuuu RA0 xxxx xxxx uuuu uuuu SSPM0 0000 0000 0000 0000 TMR1ON 0000 0000 uuuu uuuu TRISA0 1111 1111 1111 1111 © 2007 Microchip Technology Inc. ...

Page 55

... MOVLW 0FFh ;Set RB<7:0> as inputs MOVWF TRISB ; © 2007 Microchip Technology Inc. PIC16F913/914/916/917/946 3.4 Additional PORTB Pin Functions RB<7:6> are used as data and clock signals, respectively, for both serial programming and the in-circuit debugger features on the device. Also, RB0 can be configured as an external interrupt input ...

Page 56

... R/W-0 U-0 U-0 IOCB4 — — Unimplemented bit, read as ‘0’ ‘0’ = Bit is cleared R/W-x R/W-x RB1 RB0 bit Bit is unknown R/W-1 R/W-1 TRISB1 TRISB0 bit Bit is unknown U-0 U-0 — — bit Bit is unknown © 2007 Microchip Technology Inc. ...

Page 57

... WPUB<7:0>: Weak Pull-up Register bits 1 = Pull-up enabled 0 = Pull-up disabled Note 1: Global RBPU must be enabled for individual pull-ups to be enabled. 2: The weak pull-up device is automatically disabled if the pin is in Output mode (TRISx<7:0> = 0). © 2007 Microchip Technology Inc. PIC16F913/914/916/917/946 R/W-1 R/W-1 R/W-1 WPUB4 WPUB3 WPUB2 U = Unimplemented bit, read as ‘ ...

Page 58

... Figure 3-9 shows the diagram for this pin. The RB3 pin is configurable to function as one of the following: • a general purpose I/O • an analog output for the LCD SE<3:0> SE<3:0> and LCDEN TTL Input Buffer SE<3:0> and LCDEN Schmitt Trigger SE0 and LCDEN Weak P Pull-up I/O Pin V SS © 2007 Microchip Technology Inc. ...

Page 59

... FIGURE 3-10: BLOCK DIAGRAM OF RB4 RBPU Data Bus WR PORTB WR TRISB RD TRISB RD PORTB WR IOC RD IOC Set RBIF Interrupt-on Change From other RB<7:4> pins R Write ‘0’ to RBIF COM0 © 2007 Microchip Technology Inc. PIC16F913/914/916/917/946 LCDEN WPUB<4> Data Latch TRIS Latch LCDEN LCDEN LCDEN V ...

Page 60

... Change From other RB<7:4> pins R Write ‘0’ to RBIF COM1 DS41250F-page 58 ≠ LCDEN and LMUX<1:0> LCDEN and LMUX<1:0> LCDEN and ≠ LMUX<1:0> 00 ≠ LCDEN and LMUX<1:0> Weak P Pull-up I/O Pin V SS ≠ 00 TTL Input Buffer PORTB © 2007 Microchip Technology Inc. ...

Page 61

... WR PORTB WR TRISB RD TRISB RD PORTB WR IOC RD IOC Set RBIF Interrupt-on Change From other RB<7:4> pins R Write ‘0’ to RBIF ICSPCLK SEG14 © 2007 Microchip Technology Inc. PIC16F913/914/916/917/946 Data Latch D Q SE14 and LCDEN CK TRIS Latch Program Mode/ICD Schmitt Trigger Program Mode or ICD Mode or (SE14 and LCDEN) ...

Page 62

... RBPU SE13 and LCDEN Data Latch TRIS Latch 0 1 SE13 and LCDEN Program Mode/ICD Schmitt Trigger Program Mode or ICD Mode or (SE13 and LCDEN) SE13 and LCDEN V DD Weak P Pull- I/O Pin V SS TTL Input Buffer PORTB © 2007 Microchip Technology Inc. ...

Page 63

... Shaded cells are not used by PORTB. Note 1: This register is only initialized by a POR or BOR reset and is unchanged by other Resets. 2: Configuration Word register bit DEBUG <12> is also associated with PORTB. See Register 16-1 for more details. © 2007 Microchip Technology Inc. PIC16F913/914/916/917/946 Bit 4 Bit 3 Bit 2 Bit 1 ...

Page 64

... TRISC3 TRISC2 U = Unimplemented bit, read as ‘0’ ‘0’ = Bit is cleared INITIALIZING PORTC ; ;Init PORTC ; ;Set RC<7:0> as inputs ; ; ;Disable VLCD<3:1> ;inputs on RC<2:0> R/W-x R/W-x RC1 RC0 bit Bit is unknown R/W-1 R/W-1 TRISC1 TRISC0 bit Bit is unknown © 2007 Microchip Technology Inc. ...

Page 65

... WR TRISC Q CK TRIS Latch RD TRISC RD PORTC VLCD1 © 2007 Microchip Technology Inc. PIC16F913/914/916/917/946 3.5.1.3 RC2/VLCD3 Figure 3-16 shows the diagram for this pin. The RC2 pin is configurable to function as one of the following: • a general purpose I/O • an analog input for the LCD bias voltage ≠ ...

Page 66

... Data Bus PORTC Q CK Data Latch TRISC Q CK TRIS Latch RD TRISC RD PORTC VLCD3 DS41250F-page 64 ≠ (VLCDEN and LMUX<1:0> 00) ≠ (LCDEN and LMUX<1:0> 00) VLCDEN Schmitt Trigger LCDEN V DD I/O Pin V SS Schmitt Trigger V DD I/O Pin V SS © 2007 Microchip Technology Inc. ...

Page 67

... LCD FIGURE 3-17: BLOCK DIAGRAM OF RC3 Data Bus PORTC Q CK Data Latch TRISC Q CK TRIS Latch RD TRISC RD PORTC SEG6 and LCDEN © 2007 Microchip Technology Inc. PIC16F913/914/916/917/946 SE6 and LCDEN Schmitt Trigger SE6 and LCDEN V DD I/O Pin V SS DS41250F-page 65 ...

Page 68

... FIGURE 3-18: BLOCK DIAGRAM OF RC4 PORT/SDO Select Data Bus PORTC CK Q Data Latch TRISC CK Q TRIS Latch RD TRISC RD PORTC Timer1 Gate SEG11 DS41250F-page 66 SDO 0 1 SE11 and LCDEN SE11 and LCDEN V DD I/O Pin V SS Schmitt Trigger © 2007 Microchip Technology Inc. ...

Page 69

... Select) and CCPMX CCP1 Data Out Data Bus PORTC CK Q Data Latch TRISC CK Q TRIS Latch RD TRISC SE10 and LCDEN RD PORTC Timer1 Clock Input SEG10 © 2007 Microchip Technology Inc. PIC16F913/914/916/917/946 0 1 Schmitt Trigger SE10 and LCDEN V DD I/O Pin V SS DS41250F-page 67 ...

Page 70

... If all three data output sources are enabled, the following priority order will be used: • USART data (highest) • SSP data • PORT data (lowest) DS41250F-page 68 (1) SE9 and LCDEN SE9 and LCDEN V DD I/O Pin V SS Schmitt Trigger © 2007 Microchip Technology Inc. ...

Page 71

... SE8 and LCDEN SEG8 Note 1: If all three data output sources are enabled, the following priority order will be used: • USART data (highest) • SSP data • PORT data (lowest) © 2007 Microchip Technology Inc. PIC16F913/914/916/917/946 0 1 SE8 and LCDEN Schmitt Trigger ...

Page 72

... SE0 0000 0000 uuuu uuuu SE8 0000 0000 uuuu uuuu RC0 xxxx xxxx uuuu uuuu RX9D 0000 000x 0000 000x SSPM0 0000 0000 0000 0000 TMR1ON 0000 0000 uuuu uuuu TRISC0 1111 1111 1111 1111 © 2007 Microchip Technology Inc. ...

Page 73

... W = Writable bit -n = Value at POR ‘1’ = Bit is set bit 7-0 TRISD<7:0>: PORTD Tri-State Control bits 1 = PORTD pin configured as an input (tri-stated PORTD pin configured as an output © 2007 Microchip Technology Inc. PIC16F913/914/916/917/946 EXAMPLE 3-4: BANKSEL PORTD CLRF PORTD BANKSEL TRISD MOVLW ...

Page 74

... I/O • an analog output for the LCD 3.6.1.8 RD7/SEG20 Figure 3-25 shows the diagram for this pin. The RD7 pin is configurable to function as one of the following: • a general purpose I/O • an analog output for the LCD © 2007 Microchip Technology Inc. ...

Page 75

... COM3 FIGURE 3-23: BLOCK DIAGRAM OF RD1 Data Bus PORTD CK Q Data Latch TRISD CK Q TRIS Latch RD TRISD RD PORTD © 2007 Microchip Technology Inc. PIC16F913/914/916/917/946 LCDEN and LMUX<1:0> LCDEN and LMUX<1:0> Schmitt Trigger V DD I/O Pin V SS Schmitt Trigger V DD RD1 Pin V ...

Page 76

... CCP2 Input FIGURE 3-25: BLOCK DIAGRAM OF RD<7:3> Data Bus PORTD CK Q Data Latch TRISD CK Q TRIS Latch RD TRISD RD PORTD SE<20:16> and LCDEN SEG<20:16> DS41250F-page Schmitt Trigger SE<20:16> and LCDEN Schmitt Trigger V DD I/O Pin I/O Pin V SS © 2007 Microchip Technology Inc. ...

Page 77

... RD6 RD5 (1) TRISD TRISD7 TRISD6 TRISD5 Legend unknown unchanged unimplemented locations read as ‘0’. Shaded cells are not used by PORTD. Note 1: PIC16F914/917 and PIC16F946 only. © 2007 Microchip Technology Inc. PIC16F913/914/916/917/946 Bit 4 Bit 3 Bit 2 Bit 1 CCP2Y CCP2M3 CCP2M2 CCP2M1 VLCDEN CS1 ...

Page 78

... Bit is cleared INITIALIZING PORTE ; ;Init PORTE ; ;Set RE<3:0> as inputs ; ;Make RE<2:0> as I/O’s R/W-x R/W-x R/W-x (2,4) (2,4) (2,4) RE2 RE1 RE0 bit Bit is unknown R/W-1 R/W-1 R/W-1 (2,4) (2,4) (2,4) TRISE1 TRISE0 bit Bit is unknown © 2007 Microchip Technology Inc. ...

Page 79

... Figure 3-28 shows the diagram for this pin. The RE5/SEG25 pin is configurable to function as one of the following: • a general purpose I/O • an analog output for the LCD © 2007 Microchip Technology Inc. PIC16F913/914/916/917/946 3.7.1.7 RE6/SEG26 Figure 3-28 shows the diagram for this pin. The ...

Page 80

... FIGURE 3-27: BLOCK DIAGRAM OF RE3 MCLR circuit Programming mode Data Bus RD TRISE RD PORTE DS41250F-page 78 Analog Mode or SEG<23:21> and LCDEN Schmitt and LCDEN Trigger MCLR Filter HV Detect MCLRE I/O Pin Schmitt Trigger Buffer Input Pin Schmitt Trigger Buffer © 2007 Microchip Technology Inc. ...

Page 81

... FIGURE 3-28: BLOCK DIAGRAM OF RE<7:4> (PIC16F946 ONLY) Data Bus PORTE CK Q Data Latch TRISE CK Q TRIS Latch RD TRISE RD PORTE SEG<27:24> and LCDEN SEG<27:24> AN<7:5> © 2007 Microchip Technology Inc. PIC16F913/914/916/917/946 Analog Mode or SEG<27:24> and LCDEN Schmitt Trigger V DD I/O Pin V SS DS41250F-page 79 ...

Page 82

... ANS0 1111 1111 1111 1111 LMUX0 0001 0011 0001 0011 SE16 0000 0000 uuuu uuuu SE24 uuuu uuuu 0000 0000 (2) (2) RE0 xxxx xxxx uuuu uuuu (2) (2) TRISE0 1111 1111 1111 1111 © 2007 Microchip Technology Inc. ...

Page 83

... Value at POR ‘1’ = Bit is set bit 7-0 TRISF<7:0>: PORTF Tri-State Control bits 1 = PORTF pin configured as an input (tri-stated PORTF pin configured as an output Note 1: PIC16F946 only. © 2007 Microchip Technology Inc. PIC16F913/914/916/917/946 EXAMPLE 3-6: BANKSEL PORTF CLRF PORTF BANKSEL TRISF MOVLW ...

Page 84

... I/O • an analog output for the LCD 3.8.1.8 RF7/SEG31 Figure 3-29 shows the diagram for this pin. The RF7 pin is configurable to function as one of the following: • a general purpose I/O • an analog output for the LCD © 2007 Microchip Technology Inc. ...

Page 85

... RF5 (1) TRISF TRISF7 TRISF6 TRISF5 Legend unknown unchanged, – = unimplemented locations read as ‘0’. Shaded cells are not used by PORTF. Note 1: PIC16F946 only. © 2007 Microchip Technology Inc. PIC16F913/914/916/917/946 SE<35:28> and LCDEN Schmitt Trigger SE<35:28> and LCDEN Bit 4 Bit 3 Bit 2 Bit 1 ...

Page 86

... R/W-1 R/W-1 R/W-1 TRISG4 TRISG3 TRISG2 U = Unimplemented bit, read as ‘0’ ‘0’ = Bit is cleared INITIALIZING PORTG ; ;Init PORTG ; ;Set RG<5:0> as inputs ; R/W-x R/W-x RG1 RG0 bit Bit is unknown R/W-1 R/W-1 TRISG1 TRISG0 bit Bit is unknown © 2007 Microchip Technology Inc. ...

Page 87

... WR TRISG CK Q TRIS Latch RD TRISG RD PORTG SEG<41:36> © 2007 Microchip Technology Inc. PIC16F913/914/916/917/946 3.9.1.4 RG3/SEG39 Figure 3-30 shows the diagram for this pin. The RG3 pin is configurable to function as one of the following: • a general purpose I/O • an analog output for the LCD 3 ...

Page 88

... SE41 RG4 RG3 RG2 RG1 TRISG4 TRISG3 TRISG2 TRISG1 (1) Value on all Value on Bit 0 other POR, BOR Resets LMUX0 0001 0011 0001 0011 SE32 0000 0000 uuuu uuuu SE40 ---- --00 ---- --uu RG0 --xx xxxx --uu uuuu TRISG0 --11 1111 --11 1111 © 2007 Microchip Technology Inc. ...

Page 89

... External Oscillator OSC2 Sleep OSC1 Internal Oscillator HFINTOSC 8 MHz LFINTOSC 31 kHz © 2007 Microchip Technology Inc. PIC16F913/914/916/917/946 The Oscillator module can be configured in one of eight clock modes – External clock with I/O on OSC2/CLKOUT – 32 kHz Low-Power Crystal mode – Medium Gain Crystal or Ceramic Resonator Oscillator mode ...

Page 90

... Bit resets to ‘0’ with Two-Speed Start-up and LP selected as the Oscillator mode or Fail-Safe mode is enabled. DS41250F-page 88 R/W-0 R-1 R-0 (1) IRCF0 OSTS HTS U = Unimplemented bit, read as ‘0’ ‘0’ = Bit is cleared (1) R-0 R/W-0 LTS SCS bit Bit is unknown © 2007 Microchip Technology Inc. ...

Page 91

... Upon restarting the external clock, the device will resume operation time had elapsed. © 2007 Microchip Technology Inc. PIC16F913/914/916/917/946 4.4 External Clock Modes 4 ...

Page 92

... Devices” (DS00826) ® Oscillator Design” (DS00849) ® Oscillator Analysis and Design” (DS00943) (DS00949) CERAMIC RESONATOR OPERATION ( MODE) ® PIC MCU OSC1/CLKIN To Internal Logic ( Sleep F OSC2/CLKOUT ( may be required for S varies with the Oscillator mode F P © 2007 Microchip Technology Inc. ) ...

Page 93

... The user also needs to take into account variation due to tolerance of external RC components used. © 2007 Microchip Technology Inc. PIC16F913/914/916/917/946 4.5 Internal Clock Modes The Oscillator module has two independent, internal oscillators that can be configured or selected as the system clock source ...

Page 94

... Watchdog Timer (WDT), Fail-Safe Clock Monitor (FSCM) and peripherals, are not affected by the change in frequency. R/W-0 R/W-0 R/W-0 TUN4 TUN3 TUN2 U = Unimplemented bit, read as ‘0’ ‘0’ = Bit is cleared R/W-0 R/W-0 TUN1 TUN0 bit Bit is unknown © 2007 Microchip Technology Inc. ...

Page 95

... Following any Reset, the IRCF<2:0> bits of the OSCCON register are set to ‘110’ and the frequency selection is set to 4 MHz. The user can modify the IRCF bits to select a different frequency. © 2007 Microchip Technology Inc. PIC16F913/914/916/917/946 4.5.5 HF AND LF INTOSC CLOCK SWITCH TIMING ...

Page 96

... IRCF <2:0> System Clock LFINTOSC HFINTOSC LFINTOSC Start-up Time 2-cycle Sync HFINTOSC = 0 IRCF <2:0> System Clock DS41250F-page 94 Start-up Time 2-cycle Sync = 0 2-cycle Sync = 0 0 LFINTOSC turns off unless WDT or FSCM is enabled ≠ 0 Running Running Running © 2007 Microchip Technology Inc. ...

Page 97

... Executing a SLEEP instruction will abort the oscillator start-up time and will cause the OSTS bit of the OSCCON register to remain clear. © 2007 Microchip Technology Inc. PIC16F913/914/916/917/946 When the Oscillator module is configured for LP modes, the Oscillator Start-up Timer (OST) is enabled (see Section 4.4.1 “Oscillator Start-up Timer (OST)” ...

Page 98

... FOSC<2:0> bits in the Configuration Word register (CONFIG), or the internal oscillator. FIGURE 4-7: TWO-SPEED START-UP HFINTOSC T T OST OSC1 1022 1023 0 1 OSC2 Program Counter System Clock DS41250F-page © 2007 Microchip Technology Inc. ...

Page 99

... The internal clock source chosen by the FSCM is determined by the IRCF<2:0> bits of the OSCCON register. This allows the internal oscillator to be configured before a failure occurs. © 2007 Microchip Technology Inc. PIC16F913/914/916/917/946 4.8.3 FAIL-SAFE CONDITION CLEARING The Fail-Safe condition is cleared after a Reset, executing a SLEEP instruction or toggling the SCS bit of the OSCCON register ...

Page 100

... POR, BOR (1) Resets FOSC0 — — RBIF 0000 000x 0000 000x SCS -110 x000 -110 x000 TUN0 ---0 0000 ---u uuuu CCP2IE 0000 -0-0 0000 -0-0 CCP2IF 0000 -0-0 0000 -0-0 TMR1ON 0000 0000 0000 0000 © 2007 Microchip Technology Inc. ...

Page 101

... T0SE, T0CS, PSA, PS<2:0> are bits in the Option register. 2: SWDTEN and WDTPS<3:0> are bits in the WDTCON register. 3: WDTE bit is in the Configuration Word register. © 2007 Microchip Technology Inc. PIC16F913/914/916/917/946 5.1 Timer0 Operation When used as a timer, the Timer0 module can be used as either an 8-bit timer or an 8-bit counter ...

Page 102

... T0CKI input and the Timer0 register is accom- plished by sampling the prescaler output on the Q2 and Q4 cycles of the internal phase clocks. Therefore, the high and low periods of the external clock source must meet the timing requirements Section 19.0 “Electrical Specifications” © 2007 Microchip Technology Inc. as shown in ...

Page 103

... RBPU INTEDG T0CS TRISA TRISA7 TRISA6 TRISA5 TRISA4 TRISA3 TRISA2 TRISA1 TRISA0 1111 1111 1111 1111 Legend Unimplemented locations, read as ‘0’ unchanged unknown. Shaded cells are not used by the Timer0 module. © 2007 Microchip Technology Inc. PIC16F913/914/916/917/946 R/W-1 R/W-1 T0SE PSA U = Unimplemented bit, read as ‘ ...

Page 104

... Clock Source F /4 OSC T1CKI pin TMR1ON To C2 Comparator Module Timer1 Clock ( TMR1L 1 To LCD Module T1SYNC ( Prescaler OSC Internal 0 Clock T1CKPS<1:0> TMR1CS SYNCC2OUT TMR1CS 0 1 TMR1GE T1GINV Synchronized clock input (3) Synchronize det 2 T1G 1 (4) 0 T1GSS © 2007 Microchip Technology Inc. ...

Page 105

... Note: The oscillator requires a start-up and stabilization time before use. Thus, T1OSCEN should be set and a suitable delay observed prior to enabling Timer1. © 2007 Microchip Technology Inc. PIC16F913/914/916/917/946 6.5 Timer1 Operation in Asynchronous Counter Mode If control bit T1SYNC of the T1CON register is set, the external clock input is not synchronized ...

Page 106

... Clock Source for LCD Module The Timer1 oscillator can be used to provide a clock for the LCD module. This clock may be configured to remain running during Sleep. For more information, see Section 10.0 “Liquid Crys- tal Display (LCD) Driver Module”. © 2007 Microchip Technology Inc. ...

Page 107

... Stops Timer1 Note 1: T1GINV bit inverts the Timer1 gate logic, regardless of source. 2: TMR1GE bit must be set to use either T1G pin or C2OUT, as selected by the T1GSS bit of the CMCON1 register Timer1 gate source. © 2007 Microchip Technology Inc. PIC16F913/914/916/917/946 R/W-0 R/W-0 R/W-0 T1CKPS0 ...

Page 108

... Bit 0 all other POR, BOR Resets C2SYNC ---- --10 ---- --10 RBIF 0000 000x 0000 000x TMR1IE 0000 0000 0000 0000 TMR1IF 0000 0000 0000 0000 xxxx xxxx uuuu uuuu xxxx xxxx uuuu uuuu TMR1ON 0000 0000 uuuu uuuu © 2007 Microchip Technology Inc. ...

Page 109

... OSC 1:1, 1:4, 1:16 2 T2CKPS<1:0> © 2007 Microchip Technology Inc. PIC16F913/914/916/917/946 The TMR2 and PR2 registers are both fully readable and writable. On any Reset, the TMR2 register is set to 00h and the PR2 register is set to FFh. Timer2 is turned on by setting the TMR2ON bit in the T2CON register to a ‘ ...

Page 110

... Value on Value on Bit 0 all other POR, BOR Resets RBIF 0000 000x 0000 000x TMR1IE 0000 0000 0000 0000 TMR1IF 0000 0000 0000 0000 1111 1111 1111 1111 0000 0000 0000 0000 T2CKPS0 -000 0000 -000 0000 © 2007 Microchip Technology Inc. ...

Page 111

... Timer1 gate (count enable) • Output synchronization to Timer1 clock input • Programmable voltage reference Note: Only Comparator C2 can be linked to Timer1. © 2007 Microchip Technology Inc. PIC16F913/914/916/917/946 8.1 Comparator Overview A comparator is shown in Figure 8-1 along with the relationship between the analog input levels and the digital output ...

Page 112

... RD CMCON0 D Q Q3*RD CMCON0 EN CL Reset OSC C2SYNC D Q Timer1 (1) clock source CMCON0 D Q Q3*RD CMCON0 EN CL Reset OSC To C1OUT pin To Data Bus Set C1IF bit ). To SYNCC2OUT 0 To C2OUT pin 1 To Data Bus Set C2IF bit ). © 2007 Microchip Technology Inc. ...

Page 113

... Source Impedance Analog Voltage Threshold Voltage T © 2007 Microchip Technology Inc. PIC16F913/914/916/917/946 Note 1: When reading a PORT register, all pins configured as analog inputs will read as a ‘0’. Pins configured as digital inputs will convert as an analog input, according to the input specification. . The analog ...

Page 114

... TRIS bit set to ‘1’ to disable the digital output driver. Pins denoted as “D” should have the corresponding TRIS bit set to ‘0’ to enable the digital output driver. Note: Comparator interrupts should be disabled during a Comparator mode change to prevent unintended interrupts. DS41250F-page 112 © 2007 Microchip Technology Inc. ...

Page 115

... IN I/O C1IN C2IN C2IN+ Legend Analog Input, ports always reads ‘0’ I/O = Normal port I/O © 2007 Microchip Technology Inc. PIC16F913/914/916/917/946 Two Independent Comparators CM<2:0> = 100 A C1IN- Off (Read as ‘0’) A C1IN+ A C2IN- Off (Read as ‘0’) A C2IN+ One Independent Comparator with Reference Option CM< ...

Page 116

... See Figures 8-6 and 8-7 b) Clear the CxIF interrupt flag. A persistent mismatch condition will preclude clearing the CxIF interrupt flag. Reading CMCON0 will end the mismatch condition and allow the CxIF bit to be cleared. all writes include a read © 2007 Microchip Technology Inc. ...

Page 117

... Allow about 1 μs for bias settling then clear the mismatch condition and interrupt flags before enabling comparator interrupts. © 2007 Microchip Technology Inc. PIC16F913/914/916/917/946 8.6 Operation During Sleep The comparator, if enabled before entering Sleep mode, remains active during Sleep ...

Page 118

... Two comparators with outputs and common reference 111 = Comparators off. CxIN pins are configured as digital I/O DS41250F-page 116 R/W-0 R/W-0 R/W-0 C1INV CIS CM2 U = Unimplemented bit, read as ‘0’ ‘0’ = Bit is cleared - R/W-0 R/W-0 CM1 CM0 bit Bit is unknown © 2007 Microchip Technology Inc. ...

Page 119

... Output is synchronized with falling edge of Timer1 clock 0 = Output is asynchronous Note 1: Refer to Section 6.6 “Timer1 Gate”. 2: Refer to Figure 8-3. © 2007 Microchip Technology Inc. PIC16F913/914/916/917/946 8.9 Synchronizing Comparator C2 Output to Timer1 The output of Comparator C2 can be synchronized with Timer1 by setting the C2SYNC bit of the CMCON1 register ...

Page 120

... Bit is cleared drain and REF SS = (VR<3:0>/24 (VR<3:0>/32 OUTPUT VOLTAGE REF = (VR<3:0>/24) × × (VR<3:0> V /32 / cannot be realized due module current. REF derived and DD output changes with fluctuations in REF R/W-0 R/W-0 VR2 VR1 VR0 bit Bit is unknown . © 2007 Microchip Technology Inc. ...

Page 121

... TRISA TRISA7 TRISA6 TRISA5 TRISA4 TRISA3 TRISA2 VRCON VREN — VRR Legend unknown unchanged unimplemented, read as ‘0’. Shaded cells are not used for comparator. © 2007 Microchip Technology Inc. PIC16F913/914/916/917/946 16 Stages VREN VR<3:0> = 0000 VRR Note 1: Care should be taken to ensure V within the comparator common mode input range. See Section 19.0 “ ...

Page 122

... PIC16F913/914/916/917/946 NOTES: DS41250F-page 120 © 2007 Microchip Technology Inc. ...

Page 123

... Multiplier x4 SYNC 1 SPBRG BRGH x © 2007 Microchip Technology Inc. PIC16F913/914/916/917/946 The AUSART module includes the following capabilities: • Full-duplex asynchronous transmit and receive • Two-character input buffer • One-character output buffer • Programmable 8-bit or 9-bit character length Synchronous • Address detection in 9-bit mode (AUSART) • ...

Page 124

... These registers are detailed in Register 9-1 and Register 9-2 respectively. DS41250F-page 122 SPEN MSb Data Stop Recovery F OSC ÷ x16 x64 FERR CREN OERR RSR Register LSb • • • ( START RX9 FIFO RX9D RCREG Register 8 Data Bus RCIF Interrupt RCIE © 2007 Microchip Technology Inc. ...

Page 125

... The LCD SEG9 function must be disabled by clearing the SE9 bit of the LCDSE1 register, if the TX/CK pin is shared with the LCD peripheral. © 2007 Microchip Technology Inc. PIC16F913/914/916/917/946 Note 1: When the SPEN bit is set the RX/DT I/O pin is automatically configured as an input, ...

Page 126

... TX9D data bit. 7. Load 8-bit data into the TXREG register. This will start the transmission. bit 0 bit 1 bit 7/8 Word 1 bit 0 bit 1 bit 7/8 Word Stop bit Start bit bit 0 Stop bit Word 2 Word 2 Transmit Shift Reg. © 2007 Microchip Technology Inc. ...

Page 127

... TRISC7 TRISC6 TRISC5 TXREG AUSART Transmit Data Register TXSTA CSRC TX9 TXEN Legend unknown unimplemented read as ‘0’. Shaded cells are not used for Asynchronous Transmission. © 2007 Microchip Technology Inc. PIC16F913/914/916/917/946 Bit 4 Bit 3 Bit 2 Bit 1 INTE RBIE T0IF INTF VLCDEN ...

Page 128

... PEIE peripheral interrupt enable bit of the INTCON register • GIE global interrupt enable bit of the INTCON register The RCIF interrupt flag bit of the PIR1 register will be set when there is an unread character in the FIFO, regardless of the state of interrupt enable bits. © 2007 Microchip Technology Inc. ...

Page 129

... FIFO. When reading 9-bit data from the receive FIFO buffer, the RX9D data bit must be read before reading the 8 Least Significant bits from the RCREG. © 2007 Microchip Technology Inc. PIC16F913/914/916/917/946 9.1.2.7 Address Detection A special Address Detection mode is available for use when multiple receivers share the same transmission line, such as in RS-485 systems ...

Page 130

... If the device has been addressed, clear the ADDEN bit to allow all received data into the receive buffer and generate interrupts. Start bit 7/8 bit 7/8 Stop Stop bit bit 0 bit bit Word 2 Word 1 RCREG RCREG Start bit Stop bit 7/8 bit © 2007 Microchip Technology Inc. ...

Page 131

... SSPOV SSPEN TRISC TRISC7 TRISC6 TRISC5 TXSTA CSRC TX9 TXEN Legend unknown unimplemented read as ‘0’. Shaded cells are not used for Asynchronous Reception. © 2007 Microchip Technology Inc. PIC16F913/914/916/917/946 Bit 4 Bit 3 Bit 2 Bit 1 INTE RBIE T0IF INTF VLCDEN CS1 CS0 ...

Page 132

... Can be address/data bit or a parity bit. Note 1: SREN/CREN overrides TXEN in Sync mode. DS41250F-page 130 R/W-0 U-0 R/W-0 (1) SYNC — BRGH U = Unimplemented bit, read as ‘0’ ‘0’ = Bit is cleared (1) R-1 R/W-0 TRMT TX9D bit Bit is unknown © 2007 Microchip Technology Inc. ...

Page 133

... OERR: Overrun Error bit 1 = Overrun error (can be cleared by clearing bit CREN overrun error bit 0 RX9D: Ninth bit of Received Data This can be address/data bit or a parity bit and must be calculated by user firmware. © 2007 Microchip Technology Inc. PIC16F913/914/916/917/946 R/W-0 R/W-0 R-0 CREN ...

Page 134

... Baud Rate Formula F /[64 (n+1)] OSC F /[16 (n+1)] OSC F /[4 (n+1)] OSC Value on Value on Bit 0 all other POR, BOR Resets RX9D 0000 000x 0000 000x BRG0 0000 0000 0000 0000 TX9D 0000 -010 0000 -010 © 2007 Microchip Technology Inc. ...

Page 135

... Microchip Technology Inc. PIC16F913/914/916/917/946 SYNC = 0, BRGH = 18.432 MHz F = 11.0592 MHz OSC OSC SPBRG % Actual % value Rate Error Rate Error (decimal) — — ...

Page 136

... MHz OSC SPBRG SPBRG Actual % value value Rate Error (decimal) (decimal) — 300 0.16 207 103 1202 0. 2404 0. — — — 11 10417 0.00 5 — — — — — — — — — — — — © 2007 Microchip Technology Inc. ...

Page 137

... One clock cycle is generated for each data bit. Only as many clock cycles are gener- ated as there are data bits. © 2007 Microchip Technology Inc. PIC16F913/914/916/917/946 9.3.1.2 Synchronous Master Transmission Data is transferred out of the device on the RX/DT pin ...

Page 138

... TMR1IF 0000 0000 0000 0000 RX9D 0000 000x 0000 000x BRG0 0000 0000 0000 0000 SSPM0 0000 0000 0000 0000 TRISC0 1111 1111 1111 1111 0000 0000 0000 0000 TX9D 0000 -010 0000 -010 © 2007 Microchip Technology Inc. ...

Page 139

... CREN is clear then the error is cleared by reading RCREG. If the overrun occurred when the CREN bit is set then the error condition is cleared by either clearing the CREN bit of the RCSTA register. © 2007 Microchip Technology Inc. PIC16F913/914/916/917/946 9.3.1.7 Receiving 9-bit Characters The AUSART supports 9-bit character reception. When ...

Page 140

... TMR1IE 0000 0000 0000 0000 TMR1IF 0000 0000 0000 0000 0000 0000 0000 0000 RX9D 0000 000X 0000 000X SSPM0 0000 0000 0000 0000 TRISC0 1111 1111 1111 1111 TX9D 0000 -010 0000 -010 © 2007 Microchip Technology Inc. ...

Page 141

... CSRC TX9 TXEN Legend unknown unimplemented read as ‘0’. Shaded cells are not used for Synchronous Slave Transmission. © 2007 Microchip Technology Inc. PIC16F913/914/916/917/946 If two words are written to the TXREG and then the SLEEP instruction is executed, the following will occur: 1. The first character will immediately transfer to the TSR register and transmit ...

Page 142

... TMR1IE 0000 0000 0000 0000 TMR1IF 0000 0000 0000 0000 0000 0000 0000 0000 RX9D 0000 000X 0000 000X SSPM0 0000 0000 0000 0000 TRISC0 1111 1111 1111 1111 TX9D 0000 -010 0000 -010 © 2007 Microchip Technology Inc. ...

Page 143

... Upon waking from Sleep, the instruction following the SLEEP instruction will be executed. If the GIE global interrupt enable bit of the INTCON register is also set, then the Interrupt Service Routine at address 004h will be called. © 2007 Microchip Technology Inc. PIC16F913/914/916/917/946 9.4.2 SYNCHRONOUS TRANSMIT DURING SLEEP ...

Page 144

... PIC16F913/914/916/917/946 NOTES: DS41250F-page 142 © 2007 Microchip Technology Inc. ...

Page 145

... Segment Enable PIC16F913/916 2 PIC16F914/917 3 PIC16F946 6 © 2007 Microchip Technology Inc. PIC16F913/914/916/917/946 The LCDCON register (Register 10-1) controls the operation of the LCD driver module. The LCDPS register (Register 10-2) configures the LCD clock source prescaler and the type of waveform; Type-A or Type-B. The LCDSE configure the functions of the port pins ...

Page 146

... COM3 and SEG15 share the same physical pin on the PIC16F913/916, therefore SEG15 is not available when using 1/4 multiplex displays. DS41250F-page 144 SEG<41:0> LCDDATAx MUX Registers LCDCON (3) COM<3:0> LCDPS To I/O Pads LCDSEn Clock Source Select and Prescaler ( (1) To I/O Pads (1) © 2007 Microchip Technology Inc. ...

Page 147

... Note 1: On PIC16F913/916 devices, COM3 and SEG15 are shared on one pin, limiting the device from driving 64 pixels. © 2007 Microchip Technology Inc. PIC16F913/914/916/917/946 R/W-1 R/W-0 R/W-0 VLCDEN CS1 CS0 U = Unimplemented bit, read as ‘0’ ‘0’ = Bit is cleared ...

Page 148

... DS41250F-page 146 R-0 R/W-0 R/W-0 WA LP3 LP2 U = Unimplemented bit, read as ‘0’ ‘0’ = Bit is cleared © 2007 Microchip Technology Inc. R/W-0 R/W-0 LP1 LP0 bit Bit is unknown ...

Page 149

... Legend Readable bit W = Writable bit -n = Value at POR ‘1’ = Bit is set bit 7-0 SEGx-COMy: Pixel On bits 1 = Pixel on (dark Pixel off (clear) © 2007 Microchip Technology Inc. PIC16F913/914/916/917/946 R/W-0 R/W-0 R/W-0 SEn SEn SEn U = Unimplemented bit, read as ‘0’ ‘0’ = Bit is cleared ...

Page 150

... LCD Driver ( LCD LCD LCD Bias 1 Connections for External R-ladder Static Bias 1/2 Bias 10 kΩ 1/3 Bias 10 kΩ and 1/2 V and 1 2 Static 1/2 Bias 1/3 Bias Bias — 1 — 1 © 2007 Microchip Technology Inc. ...

Page 151

... LCDDATAx registers to the respective common and segment signals. Any LCD pixel location not being used for display can be used as general purpose RAM. © 2007 Microchip Technology Inc. PIC16F913/914/916/917/946 10.7 LCD Frame Frequency The rate at which the COM and SEG outputs change is called the LCD frame frequency ...

Page 152

... LCD CLOCK GENERATION F ÷8192 OSC T1OSC 32 kHz ÷32 Crystal Osc. LFINTOSC ÷32 Nominal = 31 kHz CS<1:0> (LCDCON<3:2>) DS41250F-page 150 Static ÷4 1/2 ÷2 4-bit Prog Presc 1/3, 1/4 LP<3:0> (LCDPS<3:0>) LMUX<1:0> (LCDCON<1:0>) © 2007 Microchip Technology Inc. ÷ Ring Counter LMUX<1:0> (LCDCON<1:0>) ...

Page 153

... FIGURE 10-4: LCD SEGMENT MAPPING WORKSHEET (SHEET © 2007 Microchip Technology Inc. PIC16F913/914/916/917/946 DS41250F-page 151 ...

Page 154

... PIC16F913/914/916/917/946 FIGURE 10-5: LCD SEGMENT MAPPING WORKSHEET (SHEET DS41250F-page 152 © 2007 Microchip Technology Inc. ...

Page 155

... FIGURE 10-6: TYPE-A/TYPE-B WAVEFORMS IN STATIC DRIVE COM0 COM0-SEG0 COM0-SEG1 © 2007 Microchip Technology Inc. PIC16F913/914/916/917/946 The LCDs can be driven by two types of waveform: Type-A and Type-B. In Type-A waveform, the phase changes within each common type, whereas in Type-B waveform, the phase changes on each frame boundary ...

Page 156

... PIC16F913/914/916/917/946 FIGURE 10-7: TYPE-A WAVEFORMS IN 1/2 MUX, 1/2 BIAS DRIVE COM1 COM0 COM0-SEG0 COM0-SEG1 DS41250F-page 154 COM0 COM1 SEG0 SEG1 1 Frame © 2007 Microchip Technology Inc. ...

Page 157

... FIGURE 10-8: TYPE-B WAVEFORMS IN 1/2 MUX, 1/2 BIAS DRIVE COM1 COM0 COM0-SEG0 COM0-SEG1 © 2007 Microchip Technology Inc. PIC16F913/914/916/917/946 COM0 COM1 SEG0 SEG1 2 Frames DS41250F-page 155 ...

Page 158

... PIC16F913/914/916/917/946 FIGURE 10-9: TYPE-A WAVEFORMS IN 1/2 MUX, 1/3 BIAS DRIVE COM1 COM0 COM0-SEG0 COM0-SEG1 DS41250F-page 156 COM0 COM1 SEG0 SEG1 1 Frame © 2007 Microchip Technology Inc. ...

Page 159

... FIGURE 10-10: TYPE-B WAVEFORMS IN 1/2 MUX, 1/3 BIAS DRIVE COM1 COM0 COM0-SEG0 COM0-SEG1 © 2007 Microchip Technology Inc. PIC16F913/914/916/917/946 COM0 COM1 SEG0 SEG1 2 Frames DS41250F-page 157 ...

Page 160

... PIC16F913/914/916/917/946 FIGURE 10-11: TYPE-A WAVEFORMS IN 1/3 MUX, 1/2 BIAS DRIVE COM2 COM1 COM0 COM0-SEG0 COM0-SEG1 DS41250F-page 158 COM0 COM1 COM2 SEG0 SEG2 SEG1 Frame © 2007 Microchip Technology Inc. ...

Page 161

... FIGURE 10-12: TYPE-B WAVEFORMS IN 1/3 MUX, 1/2 BIAS DRIVE COM2 COM1 COM0 COM0-SEG0 COM0-SEG1 © 2007 Microchip Technology Inc. PIC16F913/914/916/917/946 COM0 COM1 COM2 SEG0 SEG1 Frames DS41250F-page 159 ...

Page 162

... PIC16F913/914/916/917/946 FIGURE 10-13: TYPE-A WAVEFORMS IN 1/3 MUX, 1/3 BIAS DRIVE COM2 COM1 COM0 COM0-SEG0 COM0-SEG1 DS41250F-page 160 COM0 COM1 COM2 SEG0 SEG2 SEG1 Frame © 2007 Microchip Technology Inc. ...

Page 163

... FIGURE 10-14: TYPE-B WAVEFORMS IN 1/3 MUX, 1/3 BIAS DRIVE COM2 COM1 COM0 COM0-SEG0 COM0-SEG1 © 2007 Microchip Technology Inc. PIC16F913/914/916/917/946 COM0 COM1 COM2 SEG0 SEG1 Frames DS41250F-page 161 ...

Page 164

... PIC16F913/914/916/917/946 FIGURE 10-15: TYPE-A WAVEFORMS IN 1/4 MUX, 1/3 BIAS DRIVE COM3 COM2 COM1 COM0 COM0-SEG0 COM0-SEG1 DS41250F-page 162 COM0 COM1 COM2 COM3 SEG0 SEG1 1 Frame © 2007 Microchip Technology Inc. ...

Page 165

... FIGURE 10-16: TYPE-B WAVEFORMS IN 1/4 MUX, 1/3 BIAS DRIVE COM3 COM2 COM1 COM0 COM0-SEG0 COM0-SEG1 © 2007 Microchip Technology Inc. PIC16F913/914/916/917/946 COM0 COM1 COM2 COM3 SEG0 SEG1 2 Frames DS41250F-page 163 ...

Page 166

... The interrupt is not generated when the Type-A waveform is selected and when the Type-B with no multiplex (static) is selected. LCD Interrupt Occurs 2 Frames T FWR Frame Boundary /2 CY /4) – ns) FRAME CY /4) – ns) FRAME CY Controller Accesses Next Frame Data FINT Frame Boundary © 2007 Microchip Technology Inc. ...

Page 167

... Microchip Technology Inc. PIC16F913/914/916/917/946 Table 10-5 shows the status of the LCD module during a Sleep while using each of the three available clock ...

Page 168

... PIC16F913/914/916/917/946 FIGURE 10-18: SLEEP ENTRY/EXIT WHEN SLPEN = 1 COM0 COM1 COM2 SEG0 2 Frames SLEEP Instruction Execution DS41250F-page 166 Wake-up © 2007 Microchip Technology Inc ...

Page 169

... LCDCON register. 10.12 Disabling the LCD Module To disable the LCD module, write all ‘0’s to the LCDCON register. © 2007 Microchip Technology Inc. PIC16F913/914/916/917/946 10.13 LCD Current Consumption When using the LCD module the current consumption consists of the following three factors: 1 ...

Page 170

... COM2 SEG40 ---- --xx ---- --uu COM2 SEG24 xxxx xxxx uuuu uuuu COM3 SEG32 xxxx xxxx uuuu uuuu COM3 SEG40 ---- --xx ---- --uu COM3 LP0 0000 0000 0000 0000 SE0 0000 0000 uuuu uuuu SE8 0000 0000 uuuu uuuu © 2007 Microchip Technology Inc. ...

Page 171

... Shaded cells are not used by the LCD module. Note 1: These pins may be configured as port pins, depending on the oscillator mode selected. 2: PIC16F914/917 and PIC16F946 only. 3: PIC16F946 only. © 2007 Microchip Technology Inc. PIC16F913/914/916/917/946 Bit 4 Bit 3 Bit 2 Bit 1 SE20 SE19 ...

Page 172

... PIC16F913/914/916/917/946 NOTES: DS41250F-page 170 © 2007 Microchip Technology Inc. ...

Page 173

... PLVD OPERATION V DD PLVD Trip Point LVDIF Set by Hardware © 2007 Microchip Technology Inc. PIC16F913/914/916/917/946 The PLVD module includes the following capabilities: • Eight programmable trip points • Interrupt on falling V • Stable reference indication • Operation during Sleep A Block diagram of the PLVD module is shown in Figure 11-1 ...

Page 174

... LVDIE and PEIE bits are set, the device will wake from Sleep and execute the next instruction. If the GIE bit is also set, the program will call the Interrupt Service Routine upon completion of the first instruction after waking from Sleep. © 2007 Microchip Technology Inc. ...

Page 175

... IRVST PIE2 OSFIE C2IE C1IE PIR2 OSFIF C2IF C1IF Legend unknown unimplemented read as ‘0’. Shaded cells are not used by the PLVD module. © 2007 Microchip Technology Inc. PIC16F913/914/916/917/946 R/W-0 U-0 R/W-1 (1) LVDEN — LVDL2 U = Unimplemented bit, read as ‘0’ ‘0’ = Bit is cleared ...

Page 176

... PIC16F913/914/916/917/946 NOTES: DS41250F-page 174 © 2007 Microchip Technology Inc. ...

Page 177

... RE0/AN5 RE1/AN6 RE2/AN7 CHS Note 1: These channels are only available on PIC16F914/917 and PIC16F946 devices. © 2007 Microchip Technology Inc. PIC16F913/914/916/917/946 The ADC voltage reference is software selectable to be either internally generated or externally supplied. The ADC can generate an interrupt upon completion of (ADC) allows a conversion ...

Page 178

... Section 19.0 “Electrical Specifications” for more information. Table 12-1 gives examples of appropriate ADC clock selections. Note: Unless using the F , any changes in the RC system clock frequency will change the ADC clock frequency, adversely affect the ADC result. © 2007 Microchip Technology Inc periods AD specification AD which may ...

Page 179

... Sleep and resume in-line code execution, the global interrupt must be disabled. If the global interrupt is enabled, execution will switch to the Interrupt Service Routine. Please see Section 12.1.5 “Interrupts” for more information. © 2007 Microchip Technology Inc. PIC16F913/914/916/917/946 ) V . DEVICE OPERATING FREQUENCIES (VDD > 3.0V ...

Page 180

... ADC timing the user’s responsibility to ensure that the ADC timing requirements are met. See Section 15.0 “Capture/Compare/PWM (CCP) Module” for more information. ADRESL bit 0 Unimplemented: Read as ‘0’ LSB bit 0 RC clock source is selected, the RC © 2007 Microchip Technology Inc. ...

Page 181

... Note 1: The global interrupt can be disabled if the user is attempting to wake-up from Sleep and resume in-line code execution. 2: See Section 12.3 “A/D Acquisition Requirements”. © 2007 Microchip Technology Inc. PIC16F913/914/916/917/946 EXAMPLE 12-1: ;This code block configures the ADC ;for polling, Vdd reference, Frc clock ...

Page 182

... ADC is enabled 0 = ADC is disabled and consumes no operating current Note 1: Not available on 28-pin devices. DS41250F-page 180 R/W-0 R/W-0 R/W-0 CHS2 CHS1 CHS0 U = Unimplemented bit, read as ‘0’ ‘0’ = Bit is cleared R/W-0 R/W-0 GO/DONE ADON bit Bit is unknown © 2007 Microchip Technology Inc. ...

Page 183

... RC 100 = F /4 OSC 101 = F /16 OSC 110 = F /64 OSC bit 3-0 Unimplemented: Read as ‘0’ © 2007 Microchip Technology Inc. PIC16F913/914/916/917/946 R/W-0 U-0 U-0 ADCS0 — — Unimplemented bit, read as ‘0’ ‘0’ = Bit is cleared U-0 U-0 — ...

Page 184

... U = Unimplemented bit, read as ‘0’ ‘0’ = Bit is cleared R/W-x R/W-x ADRES3 ADRES2 bit Bit is unknown R/W-x R/W-x — — bit Bit is unknown R/W-x R/W-x ADRES9 ADRES8 bit Bit is unknown R/W-x R/W-x ADRES1 ADRES0 bit Bit is unknown © 2007 Microchip Technology Inc. ...

Page 185

... REF 2: The charge holding capacitor (C 3: The maximum recommended impedance for analog sources is 10 kΩ. This is required to meet the pin leakage specification. © 2007 Microchip Technology Inc. PIC16F913/914/916/917/946 an A/D acquisition must be done before the conversion can be started. To calculate the minimum acquisition time, Equation 12-1 may be used ...

Page 186

... REF DS41250F-page 184 0.6V T ≤ PIN LEAKAGE ( 0.6V T Full-Scale Range 1 LSB ideal Zero-Scale REF Transition Sampling Switch SS Rss HOLD REF Sampling Switch (kΩ) 1 LSB ideal Full-Scale Transition Analog Input Voltage © 2007 Microchip Technology Inc. ...

Page 187

... TRISA5 TRISB TRISB7 TRISB6 TRISB5 TRISE TRISE7 TRISE6 TRISE5 Legend unknown unchanged, — = unimplemented read as ‘0’. Shaded cells are not used for ADC module. © 2007 Microchip Technology Inc. PIC16F913/914/916/917/946 Bit 4 Bit 3 Bit 2 Bit 1 CHS2 CHS1 CHS0 GO/DONE ADCS0 — ...

Page 188

... PIC16F913/914/916/917/946 NOTES: DS41250F-page 186 © 2007 Microchip Technology Inc. ...

Page 189

... EEPROM memory and read the program memory. When code-protected, the device programmer can no longer access data or program memory. © 2007 Microchip Technology Inc. PIC16F913/914/916/917/946 13.1 EEADRL and EEADRH Registers The EEADRL and EEADRH registers can address maximum of 256 bytes of data EEPROM maximum of 8K words of program Flash ...

Page 190

... U = Unimplemented bit, read as ‘0’ ‘0’ = Bit is cleared R/W-0 R/W-0 EEDATL1 EEDATL0 bit Bit is unknown R/W-0 R/W-0 EEADRL1 EEADRL0 bit Bit is unknown R/W-0 R/W-0 EEDATH1 EEDATH0 bit Bit is unknown R/W-0 R/W-0 EEDATH1 EEDATH0 bit Bit is unknown © 2007 Microchip Technology Inc. ...

Page 191

... Write cycle to the data EEPROM is complete bit 0 RD: Read Control bit 1 = Initiates a memory read (the RD is cleared in hardware and can only be set, not cleared, in software Does not initiate a memory read © 2007 Microchip Technology Inc. PIC16F913/914/916/917/946 U-0 R/W-x R/W-0 — WRERR WREN U = Unimplemented bit, read as ‘ ...

Page 192

... DATA ;memory BSF EECON1,WREN ;Enable writes BCF INTCON,GIE ;Disable INTs. MOVLW 55h ; MOVWF EECON2 ;Write 55h MOVLW AAh ; MOVWF EECON2 ;Write AAh BSF EECON1,WR ;Set WR bit to ;begin write BSF INTCON,GIE ;Enable INTs. BCF EECON1,WREN ;Disable writes © 2007 Microchip Technology Inc. ...

Page 193

... NOP NOP ; BANKSEL EEDATL MOVF EEDATL, W MOVWF DATAL MOVF EEDATH, W MOVWF DATAH © 2007 Microchip Technology Inc. PIC16F913/914/916/917/946 on the next ; ;MS Byte of Program Address to read ;LS Byte of Program Address to read ; ;Point to PROGRAM memory ;EE Read ;Any instructions here are ignored as program ;memory is read in second cycle after BSF ...

Page 194

... POR, BOR Resets RBIF 0000 000x 0000 000x TMR1IE 0000 0000 0000 0000 TMR1IF 0000 0000 0000 0000 ---0 0000 ---0 0000 EEADRL0 0000 0000 0000 0000 RD 0--- x000 ---- q000 ---- ---- ---- ---- EEDATH0 --00 0000 --00 0000 EEDATL0 0000 0000 0000 0000 © 2007 Microchip Technology Inc. ...

Page 195

... Specifications” for information on PORTC). If read-write-modify instructions, such as BSF, are performed on the TRISC register while the SS pin is high, this will cause the TRISC<4> bit to be set, thus disabling the SDO output. © 2007 Microchip Technology Inc. PIC16F913/914/916/917/946 FIGURE 14-1: Read SDI/SDA bit 0 ...

Page 196

... Transmit (I C mode only Transmit in progress, SSPBUF is full 0 = Transmit complete, SSPBUF is empty DS41250F-page 194 R Unimplemented bit, read as ‘0’ ‘0’ = Bit is cleared 2 C mode only mode only mode only) R-0 R-0 R bit Bit is unknown © 2007 Microchip Technology Inc. ...

Page 197

... Reserved 1101 = Reserved 2 1110 = I C Slave mode, 7-bit address with Start and Stop bit interrupts enabled 2 1111 = I C Slave mode, 10-bit address with Start and Stop bit interrupts enabled © 2007 Microchip Technology Inc. PIC16F913/914/916/917/946 R/W-0 R/W-0 R/W-0 (2) (2) CKP ...

Page 198

... SSPBUF register. Additionally, the SSP STATUS register (SSPSTAT) indicates the various status conditions. completed ; ;Has data been received(transmit complete)? ;No ; ;WREG reg = contents of SSPBUF ;Save in user RAM, if data is meaningful ;W reg = contents of TXDATA ;New data to xmit © 2007 Microchip Technology Inc. ...

Page 199

... Serial Input Buffer (SSPBUF) Shift Register (SSPSR) LSb MSb Processor 1 © 2007 Microchip Technology Inc. PIC16F913/914/916/917/946 14.4 Typical Connection Figure 14-2 shows a typical connection between two microcontrollers. The master controller (Processor 1) initiates the data transfer by sending the SCK signal. Data is shifted out of both shift registers on their programmed clock edge and latched on the opposite edge of the clock ...

Page 200

... SMP bit. The time when the SSPBUF is loaded with the received data is shown. bit 2 bit 5 bit 4 bit 1 bit 3 bit 2 bit 5 bit 4 bit 1 bit Clock Modes bit 0 bit 0 bit 0 bit 0 Next Q4 Cycle after Q2↓ © 2007 Microchip Technology Inc. ...

Related keywords