PIC16F1937-E/MV Microchip Technology, PIC16F1937-E/MV Datasheet

14KB Flash, 512B RAM, 256B EEPROM, LCD, 1.8-5.5V 40 UQFN 5x5x0.5mm TUBE

PIC16F1937-E/MV

Manufacturer Part Number
PIC16F1937-E/MV
Description
14KB Flash, 512B RAM, 256B EEPROM, LCD, 1.8-5.5V 40 UQFN 5x5x0.5mm TUBE
Manufacturer
Microchip Technology
Series
PIC® XLP™ 16Fr
Datasheet

Specifications of PIC16F1937-E/MV

Processor Series
PIC16F
Core
PIC
Program Memory Type
Flash
Program Memory Size
14 KB
Data Ram Size
256 B
Interface Type
MI2C, SPI, EUSART
Number Of Timers
5
Operating Supply Voltage
1.8 V to 5.5 V
Maximum Operating Temperature
+ 125 C
Mounting Style
SMD/SMT
Package / Case
UQFN-40
Development Tools By Supplier
MPLAB IDE Software
Minimum Operating Temperature
- 40 C
Core Processor
PIC
Core Size
8-Bit
Speed
32MHz
Connectivity
I²C, LIN, SPI, UART/USART
Peripherals
Brown-out Detect/Reset, LCD, POR, PWM, WDT
Number Of I /o
36
Eeprom Size
256 x 8
Ram Size
512 x 8
Voltage - Supply (vcc/vdd)
1.8 V ~ 5.5 V
Data Converters
A/D 14x10b
Oscillator Type
Internal
Operating Temperature
-40°C ~ 125°C
Lead Free Status / Rohs Status
 Details
PIC16(L)F1934/6/7
Data Sheet
28/40/44-Pin Flash-Based, 8-Bit
CMOS Microcontrollers with
LCD Driver and nanoWatt XLP Technology
 2008-2011 Microchip Technology Inc.
DS41364E

Related parts for PIC16F1937-E/MV

PIC16F1937-E/MV Summary of contents

Page 1

... LCD Driver and nanoWatt XLP Technology  2008-2011 Microchip Technology Inc. PIC16(L)F1934/6/7 28/40/44-Pin Flash-Based, 8-Bit CMOS Microcontrollers with Data Sheet DS41364E ...

Page 2

... PICtail, REAL ICE, rfLAB, Select Mode, Total Endurance, TSHARC, UniWinDriver, 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

... Flash-Based, 8-Bit CMOS Microcontrollers with LCD Driver with nanoWatt XLP Technology Devices Included In This Data Sheet: • PIC16F1934 • PIC16LF1934 • PIC16F1936 • PIC16LF1936 • PIC16F1937 • PIC16LF1937 Other PIC16(L)F193X Devices Available: • PIC16(L)F1933 (DS41575) • PIC16(L)F1938/9 (DS41574) PIC16(L)F193X devices referred to in this Note: data sheet apply to PIC16(L)F1934/6/7 ...

Page 4

... PIC16(L)F193X Family Types PIC16F1934 4096 256 256 PIC16LF1934 PIC16F1936 8192 256 512 PIC16LF1936 PIC16F1937 8192 256 512 PIC16LF1937 COM3 and SEG15 share the same physical pin on PIC16(L)F1936, therefore, SEG15 is not available when using 1/4 Note 1: multiplex displays. DS41364E-page ...

Page 5

... SEG2/CLKIN/OSC1/RA7 CAP (2) SEG1/V /CLKOUT/OSC2/RA6 (1) P2B /T1CKI/T1OSO/RC0 (1) (1) P2A /CCP2 /T1OSI/RC1 SEG3/P1A/CCP1/RC2 SEG6/SCL/SCK/RC3 Pin function is selectable via the APFCON register. Note 1: PIC16F1936 devices only. 2:  2008-2011 Microchip Technology Inc. PIC16(L)F1934/6/7 PIC16(L)F1936) ( RB7/ICSPDAT/ICDDAT/SEG13 28 1 RB6/ICSPCLK/ICDCLK/SEG14 27 2 RB5/AN13/CPS5/P2B RB4/AN11/CPS4/P1D/COM0 4 RB3/AN9/C12IN2-/CPS3/CCP2 RB2/AN8/CPS2/P1B/VLCD2 ...

Page 6

... SEG5 /V /SS /SRNQ/CPS7/C2OUT /AN4/RA5 CAP SEG2/CLKIN/OSC1/RA7 (2) SEG1/V /CLKOUT/OSC2/RA6 CAP Pin function is selectable via the APFCON register. Note 1: PIC16F1936 devices only. 2: DS41364E-page 6 PIC16(L)F1936 PIC16(L)F1936 4 18 PIC16LF1936 RC7/RX/DT/P3B/SEG8 15 (1) (1) RB3/AN9/C12IN2-/CPS3/CCP2 /P2A /VLCD3 RB2/AN8/CPS2/P1B/VLCD2 RB1/AN10/C12IN3-/CPS1/P1C/VLCD1 RB0/AN12/CPS0/CCP4/SRI/INT/SEG0 DD SS  2008-2011 Microchip Technology Inc. ...

Page 7

... DD Vss 8, 5, — — — Pin functions can be moved using the APFCON register. Note 1: PIC16F1936 devices only. 2:  2008-2011 Microchip Technology Inc. PIC16(L)F1934/6/7 — — — (1) SRNQ (1) — — — — — — — — — — ...

Page 8

... Note 1: PIC16F1934/7 devices only. 2: DS41364E-page /AN4/RA5 7 34 /AN5/RE0 RB7/ICSPDAT/ICDDAT/SEG13 RB6/ICSPCLK/ICDCLK/SEG14 (1) (1) (1) RB5/AN13/CPS5/CCP3 /P3A /T1G /COM1 RB4/AN11/CPS4/COM0 RB3/AN9/C12IN2-/CPS3/CCP2 (1) (1) /P2A /VLCD3 RB2/AN8/CPS2/VLCD2 RB1/AN10/C12IN3-/CPS1/VLCD1 RB0/AN12/CPS0/SRI/INT/SEG0 RD7/CPS15/P1D/SEG20 RD6/CPS14/P1C/SEG19 RD5/CPS13/P1B/SEG18 RD4/CPS12/P2D/SEG17 RC7/RX/DT/SEG8 RC6/TX/CK/SEG9 RC5/SDO/SEG10 RC4/SDI/SDA/T1G (1) /SEG11 RD3/CPS11/P2C/SEG16 RD2/CPS10/P2B (1)  2008-2011 Microchip Technology Inc. ...

Page 9

... Pin Diagram – 40-Pin UQFN 5X5 ( 40-pin UQFN SEG8/DT/RX/RC7 SEG17/P2D/CPS12/RD4 SEG18/P1B/CPS13/RD5 SEG19/P1C/CPS14/RD6 SEG20/P1D/CPS15/RD7 SEG0/SRI/INT/CPS0/AN12/RB0 VLCD1/C12IN3-/CPS1/AN10/RB1 VLCD2/CPS2/AN8/RB2 Pin function is selectable via the APFCON register. Note 1: PIC16F1934/7 devices only. 2:  2008-2011 Microchip Technology Inc. PIC16(L)F1934/6/7 PIC16(L)F1934/ RC0/T1OSO/T1CKI/P2B 2 29 RA6/OSC2/CLKOUT RA7/OSC1/CLKIN/SEG2 PIC16F1934 PIC16LF1934/7 ...

Page 10

... Pin function is selectable via the APFCON register. Note 1: PIC16F1934/7 devices only. 2: DS41364E-page 10 1 RA6/OSC2/CLKOUT RA7/OSC1/CLKIN/SEG2 PIC16F1934 PIC16LF1934/7 7 RE2/AN7/CCP5/SEG23 27 8 RE1/AN6/P3B/SEG22 26 9 RE0/AN5/CCP3 25 10 RA5/AN4/C2OUT RA4/C1OUT/CPS6/T0CKI/SRQ/SEG4 (2) /SEG1 CAP (1) (1) /P3A /SEG21 (1) (1) (1) (2) /CPS7/SRNQ /SS /V /SEG5 CAP  2008-2011 Microchip Technology Inc. ...

Page 11

... PIC16(L)F1934/7) 44-Pin TQFP ( 44-pin TQFP SEG8/DT/RX/RC7 SEG17/P2D/CPS12/RD4 SEG18/P1B/CPS13/RD5 SEG19/P1C/CPS14/RD6 SEG20/P1D/CPS15/RD7 SEG0/INT/SRI/CPS0/AN12/RB0 VLCD1/CPS1/C12IN3-/AN10/RB1 VLCD2/CPS2/AN8/RB2 (1) (1) VLCD3/P2A /CPS3/C12IN2-/AN9/RB3 /CCP2 Pin function is selectable via the APFCON register. Note 1: PIC16F1934/7 devices only. 2:  2008-2011 Microchip Technology Inc. PIC16(L)F1934/6 RC0/T1OSO/T1CKI/P2B RA6/OSC2/CLKOUT/V RA7/OSC1/CLKIN/SEG2 PIC16F1934 PIC16LF1934/7 ...

Page 12

... SEG19 — — — — SEG20 — — — — SEG21 — — — — SEG22 — — — — SEG23 — — — — — — Y MCLR/V PP — — — — — — — —  2008-2011 Microchip Technology Inc. ...

Page 13

... Appendix A: Data Sheet Revision History.......................................................................................................................................... 459 ® Appendix B: Migrating From Other PIC Devices.............................................................................................................................. 459 Index .................................................................................................................................................................................................. 461 The Microchip Web Site ..................................................................................................................................................................... 469 Customer Change Notification Service .............................................................................................................................................. 469 Customer Support .............................................................................................................................................................................. 469 Reader Response .............................................................................................................................................................................. 470 Product Identification System ............................................................................................................................................................ 471  2008-2011 Microchip Technology Inc. PIC16(L)F1934/6/7 DS41364E-page 13 ...

Page 14

... 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 DS41364E-page 14 to receive the most current information on all of our products.  2008-2011 Microchip Technology Inc. ...

Page 15

... ECCP3 CCP4 CCP5 Comparators C1 C2 Operational Amplifiers OPA1 OPA2 Master Synchronous Serial Ports MSSP1 Timers Timer0 Timer1 Timer2 Timer4 Timer6  2008-2011 Microchip Technology Inc. PIC16(L)F1934/6/7 of the shows the ● ● ● ● ● ● ● ● ● ● ● ● ...

Page 16

... LCD ECCP1 ECCP2 See applicable chapters for more information on peripherals. Note 1: DS41364E-page 16 Program Flash Memory CPU Figure 2-1 Timer1 Timer2 Timer4 Timer6 MSSP ECCP3 CCP4 CCP5 EEPROM RAM PORTA PORTB PORTC PORTD PORTE Comparators EUSART  2008-2011 Microchip Technology Inc. ...

Page 17

... Pin function is selectable via the APFCON register. Note 1: PIC16F1934/6/7 devices only. 2: PIC16(L)F1936 devices only. 3: PORTD is available on PIC16(L)F1934/7 devices only. 4: RE<2:0> are available on PIC16(L)F1934/7 devices only. 5:  2008-2011 Microchip Technology Inc. PIC16(L)F1934/6/7 Input Output Type Type TTL CMOS General purpose I/O. AN — ...

Page 18

... Comparator negative input. AN — Capacitive sensing input 3. ST CMOS Capture/Compare/PWM2. — CMOS PWM output. AN — LCD analog input. = Schmitt Trigger input with CMOS levels I Description OD = Open Drain 2 2 C™ = Schmitt Trigger input with I C levels  2008-2011 Microchip Technology Inc. ...

Page 19

... Pin function is selectable via the APFCON register. Note 1: PIC16F1934/6/7 devices only. 2: PIC16(L)F1936 devices only. 3: PORTD is available on PIC16(L)F1934/7 devices only. 4: RE<2:0> are available on PIC16(L)F1934/7 devices only. 5:  2008-2011 Microchip Technology Inc. PIC16(L)F1934/6/7 Input Output Type Type TTL CMOS General purpose I/O. Individually controlled interrupt-on-change. Individually enabled pull-up. AN — ...

Page 20

... LCD analog output. ST CMOS General purpose I/O. AN — Capacitive sensing input 13. — CMOS PWM output. — AN LCD analog output. = Schmitt Trigger input with CMOS levels I Description OD = Open Drain 2 2 C™ = Schmitt Trigger input with I C levels  2008-2011 Microchip Technology Inc. ...

Page 21

... Pin function is selectable via the APFCON register. Note 1: PIC16F1934/6/7 devices only. 2: PIC16(L)F1936 devices only. 3: PORTD is available on PIC16(L)F1934/7 devices only. 4: RE<2:0> are available on PIC16(L)F1934/7 devices only. 5:  2008-2011 Microchip Technology Inc. PIC16(L)F1934/6/7 Input Output Type Type ST CMOS General purpose I/O. AN — Capacitive sensing input 14. ...

Page 22

... PIC16(L)F1934/6/7 NOTES: DS41364E-page 22  2008-2011 Microchip Technology Inc. ...

Page 23

... Section 3.5 “Indirect Addressing” 2.4 Instruction Set There are 49 instructions for the enhanced mid-range CPU to support the features of the CPU. See Section 29.0 “Instruction Set Summary” details.  2008-2011 Microchip Technology Inc. PIC16(L)F1934/6/7 Saving”, for more for more DS41364E-page 23 ...

Page 24

... FSR reg Power-up Timer Oscillator Start-up Timer ALU ALU ALU Power- Reset Watchdog W reg Timer Brown-out Reset  2008-2011 Microchip Technology Inc RAM Addr 9 Indirect Addr 12 FSR0 Reg FSR reg FSR reg STATUS Reg STATUS reg STATUS reg MUX MUX MUX ...

Page 25

... DEVICE SIZES AND ADDRESSES Device / PIC16F1934 PIC16LF1934 / PIC16F1936 PIC16LF1936 / PIC16F1937 PIC16LF1937  2008-2011 Microchip Technology Inc. PIC16(L)F1934/6/7 The following features are associated with access and control of program memory and data memory: • PCL and PCLATH • Stack • Indirect Addressing 3.1 ...

Page 26

... AND STACK FOR 8KW PARTS PC<14:0> 15 Stack Level 0 Stack Level 1 Stack Level 15 Reset Vector 0000h Interrupt Vector 0004h 0005h Page 0 07FFh 0800h Page 1 0FFFh 1000h Page 2 17FFh 1800h Page 3 1FFFh 2000h Rollover to Page 0 Rollover to Page 3 7FFFh  2008-2011 Microchip Technology Inc. ...

Page 27

... THE CONSTANT The BRW instruction makes this type of table very sim- ple to implement. If your code must remain portable with previous generations of microcontrollers, then the BRW instruction is not available so the older table read method must be used.  2008-2011 Microchip Technology Inc. PIC16(L)F1934/6/7 DS41364E-page 27 ...

Page 28

... PCL • STATUS • FSR0 Low • FSR0 High • FSR1 Low • FSR1 High • BSR • WREG • PCLATH • INTCON The core registers are the first 12 Note: addresses of every data memory bank. “Indirect  2008-2011 Microchip Technology Inc. ...

Page 29

... Note 1: second operand. For rotate (RRF, RLF) instructions, this bit is loaded with either the high-order or low-order bit of the source register.  2008-2011 Microchip Technology Inc. PIC16(L)F1934/6/7 For example, CLRF STATUS will clear the upper three bits and set the Z bit. This leaves the STATUS register 3-1, contains: as ‘ ...

Page 30

... DEVICE MEMORY MAPS The memory maps for the device family are as shown in Table 3-2. TABLE 3-2: Device PIC16F1934 PIC16LF1934 PIC16F1936 PIC16LF1936 Section 3.5.2 PIC16F1937 PIC16LF1937 MEMORY MAP TABLES Banks Table No. 0-7 Table 3-3 8-15 Table 3-4,Table 3-10 16-23 Table 3-7 23-31 ...

Page 31

TABLE 3-3: PIC16(L)F1934 MEMORY MAP, BANKS 0-7 BANK 0 BANK 1 000h INDF0 080h INDF0 100h 001h INDF1 081h INDF1 101h 002h PCL 082h PCL 102h 003h STATUS 083h STATUS 103h 004h FSR0L 084h FSR0L 104h 005h FSR0H 085h FSR0H ...

Page 32

TABLE 3-4: PIC16(L)F1934 MEMORY MAP, BANKS 8-15 BANK 8 BANK 9 INDF0 INDF0 400h 480h 500h INDF1 INDF1 401h 481h 501h PCL PCL 402h 482h 502h STATUS STATUS 403h 483h 503h FSR0L FSR0L 404h 484h 504h FSR0H FSR0H 405h 485h ...

Page 33

TABLE 3-5: PIC16(L)F1936/1937 MEMORY MAP, BANKS 0-7 BANK 0 BANK 1 000h INDF0 080h INDF0 100h 001h INDF1 081h INDF1 101h 002h PCL 082h PCL 102h 003h STATUS 083h STATUS 103h 004h FSR0L 084h FSR0L 104h 005h FSR0H 085h FSR0H ...

Page 34

TABLE 3-6: PIC16(L)F1936/1937 MEMORY MAP, BANKS 8-15 BANK 8 BANK 9 INDF0 INDF0 400h 480h 500h INDF1 INDF1 401h 481h 501h PCL PCL 402h 482h 502h STATUS STATUS 403h 483h 503h FSR0L FSR0L 404h 484h 504h FSR0H FSR0H 405h 485h ...

Page 35

TABLE 3-7: PIC16(L)F1934/6/7 MEMORY MAP, BANKS 16-23 BANK 16 BANK 17 800h INDF0 880h INDF0 900h 801h INDF1 881h INDF1 901h 802h PCL 882h PCL 902h 803h STATUS 883h STATUS 903h 804h FSR0L 884h FSR0L 904h 805h FSR0H 885h FSR0H ...

Page 36

TABLE 3-8: PIC16(L)F1934/6/7 MEMORY MAP, BANKS 24-31 BANK 24 BANK 25 C00h INDF0 C80h INDF0 D00h C01h INDF1 C81h INDF1 D01h C02h PCL C82h PCL D02h C03h STATUS C83h STATUS D03h C04h FSR0L C84h FSR0L D04h C05h FSR0H C85h FSR0H ...

Page 37

... Unimplemented Read as ‘0’ 7EFh = Unimplemented data memory locations, read Legend: as ‘0’.  2008-2011 Microchip Technology Inc. PIC16(L)F1934/6/7 TABLE 3-10: PIC16(L)F1934/7 MEMORY MAP, BANK 15 Bank 15 LCDCON 791h LCDPS 792h LCDREF 793h LCDCST 794h ...

Page 38

... STKPTR FEEh TOSL FEFh TOSH = Unimplemented data memory locations, read Legend: as ‘0’. DS41364E-page 38 3.2.6 SPECIAL FUNCTION REGISTERS SUMMARY The Special Function Register Summary for the device family are as follows: Device Bank( PIC16(L)F1934/6 9-14 15 16-30 31  2008-2011 Microchip Technology Inc. Page No ...

Page 39

... The upper byte of the program counter is not directly accessible. PCLATH is a holding register for the PC<14:8>, whose contents are transferred Note 1: to the upper byte of the program counter. These registers can be addressed from any bank. 2: These registers/bits are not implemented on PIC16(L)F1936 devices, read as ‘0’. 3: Unimplemented, read as ‘1’. 4:  2008-2011 Microchip Technology Inc. PIC16(L)F1934/6/7 Bit 5 Bit 4 Bit 3 Bit 2 — — ...

Page 40

... SCS<1:0> 0011 1-00 0011 1-00 LFIOFR HFIOFS 00q0 0q0- qqqq qq0- xxxx xxxx uuuu uuuu xxxx xxxx uuuu uuuu GO/DONE ADON -000 0000 -000 0000 ADPREF1 ADPREF0 0000 -000 0000 -000 — —  2008-2011 Microchip Technology Inc. ...

Page 41

... The upper byte of the program counter is not directly accessible. PCLATH is a holding register for the PC<14:8>, whose contents are transferred Note 1: to the upper byte of the program counter. These registers can be addressed from any bank. 2: These registers/bits are not implemented on PIC16(L)F1936 devices, read as ‘0’. 3: Unimplemented, read as ‘1’. 4:  2008-2011 Microchip Technology Inc. PIC16(L)F1934/6/7 Bit 5 Bit 4 Bit 3 Bit 2 — — ...

Page 42

... OERR RX9D 0000 000x 0000 000x TRMT TX9D 0000 0010 0000 0010 WUE ABDEN 01-0 0-00 01-0 0-00  2008-2011 Microchip Technology Inc. ...

Page 43

... The upper byte of the program counter is not directly accessible. PCLATH is a holding register for the PC<14:8>, whose contents are transferred Note 1: to the upper byte of the program counter. These registers can be addressed from any bank. 2: These registers/bits are not implemented on PIC16(L)F1936 devices, read as ‘0’. 3: Unimplemented, read as ‘1’. 4:  2008-2011 Microchip Technology Inc. PIC16(L)F1934/6/7 Bit 5 Bit 4 Bit 3 Bit 2 — — ...

Page 44

... PSS2BD<1:0> 0000 0000 0000 0000 STR2B STR2A ---0 0001 ---0 0001 C1TSEL1 C1TSEL0 0000 0000 0000 0000 C5TSEL<1:0> ---- --00 ---- --00  2008-2011 Microchip Technology Inc. ...

Page 45

... The upper byte of the program counter is not directly accessible. PCLATH is a holding register for the PC<14:8>, whose contents are transferred Note 1: to the upper byte of the program counter. These registers can be addressed from any bank. 2: These registers/bits are not implemented on PIC16(L)F1936 devices, read as ‘0’. 3: Unimplemented, read as ‘1’. 4:  2008-2011 Microchip Technology Inc. PIC16(L)F1934/6/7 Bit 5 Bit 4 Bit 3 Bit 2 — — ...

Page 46

... IOCBP1 IOCBP0 0000 0000 0000 0000 IOCBN1 IOCBN0 0000 0000 0000 0000 IOCBF1 IOCBF0 0000 0000 0000 0000 — — — — — — — — — — — — — — — — — —  2008-2011 Microchip Technology Inc. ...

Page 47

... The upper byte of the program counter is not directly accessible. PCLATH is a holding register for the PC<14:8>, whose contents are transferred Note 1: to the upper byte of the program counter. These registers can be addressed from any bank. 2: These registers/bits are not implemented on PIC16(L)F1936 devices, read as ‘0’. 3: Unimplemented, read as ‘1’. 4:  2008-2011 Microchip Technology Inc. PIC16(L)F1934/6/7 Bit 5 Bit 4 Bit 3 Bit 2 — — ...

Page 48

... INTF IOCIF 0000 0000 0000 0000 — —  2008-2011 Microchip Technology Inc. ...

Page 49

... The upper byte of the program counter is not directly accessible. PCLATH is a holding register for the PC<14:8>, whose contents are transferred Note 1: to the upper byte of the program counter. These registers can be addressed from any bank. 2: These registers/bits are not implemented on PIC16(L)F1936 devices, read as ‘0’. 3: Unimplemented, read as ‘1’. 4:  2008-2011 Microchip Technology Inc. PIC16(L)F1934/6/7 Bit 5 Bit 4 Bit 3 Bit 2 — — ...

Page 50

... COM2 COM2 SEG17 SEG16 xxxx xxxx uuuu uuuu COM2 COM2 SEG1 SEG0 xxxx xxxx uuuu uuuu COM3 COM3 SEG9 SEG8 xxxx xxxx uuuu uuuu COM3 COM3 SEG17 SEG16 xxxx xxxx uuuu uuuu COM3 COM3 — —  2008-2011 Microchip Technology Inc. ...

Page 51

... The upper byte of the program counter is not directly accessible. PCLATH is a holding register for the PC<14:8>, whose contents are transferred Note 1: to the upper byte of the program counter. These registers can be addressed from any bank. 2: These registers/bits are not implemented on PIC16(L)F1936 devices, read as ‘0’. 3: Unimplemented, read as ‘1’. 4:  2008-2011 Microchip Technology Inc. PIC16(L)F1934/6/7 Bit 5 Bit 4 Bit 3 Bit 2 — — ...

Page 52

... Microchip Technology Inc. ...

Page 53

... GOTO method, care should be exercised if the table location crosses a PCL memory boundary (each 256-byte block). Refer to Application Note AN556, “Implementing a Table Read” (DS00556).  2008-2011 Microchip Technology Inc. PIC16(L)F1934/6/7 3.3.3 COMPUTED FUNCTION CALLS A computed function CALL allows programs to maintain tables of functions and provide another way to execute state machines or look-up tables ...

Page 54

... Stack Overflow/Underflow Reset is disabled, the TOSH/TOSL registers will 0x05 return the contents of stack address 0x0F. 0x04 0x03 0x02 0x01 0x00 0x1F 0x0000 STKPTR = 0x1F through Figure 3-8 for examples Stack Reset Disabled (STVREN = 0) Stack Reset Enabled (STVREN = 1)  2008-2011 Microchip Technology Inc. ...

Page 55

... FIGURE 3-6: ACCESSING THE STACK EXAMPLE 2 TOSH:TOSL FIGURE 3-7: ACCESSING THE STACK EXAMPLE 3 TOSH:TOSL  2008-2011 Microchip Technology Inc. PIC16(L)F1934/6/7 0x0F 0x0E 0x0D 0x0C 0x0B 0x0A 0x09 This figure shows the stack configuration after the first CALL or a single interrupt. 0x08 ...

Page 56

... Return Address Overflow/Underflow Reset is enabled, a Reset will occur and location 0x00 will 0x06 Return Address not be overwritten. 0x05 Return Address 0x04 Return Address 0x03 Return Address 0x02 Return Address 0x01 Return Address 0x00 Return Address STKPTR = 0x10  2008-2011 Microchip Technology Inc. ...

Page 57

... FIGURE 3-9: INDIRECT ADDRESSING FSR Address Range Not all memory regions are completely implemented. Consult device memory tables for memory limits. Note:  2008-2011 Microchip Technology Inc. PIC16(L)F1934/6/7 0x0000 0x0000 Traditional Data Memory 0x0FFF 0x0FFF 0x1000 Reserved 0x1FFF 0x2000 Linear Data Memory ...

Page 58

... FIGURE 3-10: TRADITIONAL DATA MEMORY MAP Direct Addressing From Opcode 4 BSR 6 0 Location Select Bank Select 0000 0x00 0x7F Bank 0 Bank 1 Bank 2 DS41364E-page 58 Indirect Addressing 0 7 FSRxH Bank Select 0001 0010 1111 Bank FSRxL 0 Location Select  2008-2011 Microchip Technology Inc. ...

Page 59

... FSRnL Location Select 0x2000 0x29AF  2008-2011 Microchip Technology Inc. PIC16(L)F1934/6/7 3.5.3 PROGRAM FLASH MEMORY To make constant data access easier, the entire program Flash memory is mapped to the upper half of the FSR address space. When the MSB of FSRnH is set, the lower 15 bits are the address in program memory which will be accessed through INDF ...

Page 60

... PIC16(L)F1934/6/7 NOTES: DS41364E-page 60  2008-2011 Microchip Technology Inc. ...

Page 61

... These are implemented as Configuration Word 1 at 8007h and Configuration Word 2 at 8008h. The DEBUG bit in Configuration Word 2 is Note: managed automatically development tools including debuggers and programmers. For normal device operation, this bit should be maintained as a ‘1’.  2008-2011 Microchip Technology Inc. PIC16(L)F1934/6/7 by device DS41364E-page 61 ...

Page 62

... Value when blank or after Bulk Erase (1) (2) (3) Pin Function Select bit pin function is MCLR; Weak pull-up enabled. pin function is digital input; MCLR internally disabled; Weak pull-up under control of WPUE3 (1) R/P-1/1 R/P-1/1 CPD CP bit 7 R/P-1/1 R/P-1/1 FOSC1 FOSC0 bit 0  2008-2011 Microchip Technology Inc. ...

Page 63

... Enabling Brown-out Reset does not automatically enable Power-up Timer. Note 1: The entire data EEPROM will be erased when the code protection is turned off during an erase. 2: The entire program memory will be erased when the code protection is turned off. 3:  2008-2011 Microchip Technology Inc. PIC16(L)F1934/6/7 DS41364E-page 63 ...

Page 64

... BORV STVREN R/P-1/1 U-1 U-1 (2) — — Unimplemented bit, read as ‘1’ Value when blank or after Bulk Erase (1) must be used for programming PP (3) (2) pin CAP R/P-1/1 U-1 PLLEN — bit 7 R/P-1/1 R/P-1/1 WRT1 WRT0 bit 0  2008-2011 Microchip Technology Inc. ...

Page 65

... See Section 4.5 “Device ID and Revision ID” information on accessing these memory locations. For more information on checksum calculation, see the “PIC16F193X/LF193X/PIC16F194X/LF194X/PIC16LF 190X Memory Programming Specification” (DS41397).  2008-2011 Microchip Technology Inc. PIC16(L)F1934/6/7 “Write such as for more ...

Page 66

... W = Writable bit -n = Value at POR ‘1’ = Bit is set bit 13-5 DEV<8:0>: Device ID bits 100011010 = PIC16F1934 100011011 = PIC16F1936 100011100 = PIC16F1937 100100010 = PIC16LF1934 100100011 = PIC16LF1936 100100100 = PIC16LF1937 bit 4-0 REV<4:0>: Revision ID bits These bits are used to identify the revision. This location cannot be written. ...

Page 67

... XT, HS modes) and switch automatically to the internal oscillator. • Oscillator Start-up Timer (OST) ensures stability of crystal oscillator sources  2008-2011 Microchip Technology Inc. PIC16(L)F1934/6/7 The oscillator module can be configured in one of eight clock modes. 1. ECL – External Clock Low-Power mode (0 MHz to 0 ...

Page 68

... WDT, PWRT, Fail-Safe Clock Monitor Two-Speed Start-up and other modules Sleep CPU and T1OSC Peripherals Clock Control FOSC<2:0> SCS<1:0> Clock Source Option for other modules  2008-2011 Microchip Technology Inc. ...

Page 69

... Configuration Word 1: • High power, 4-32 MHz (FOSC = 111) • Medium power, 0.5-4 MHz (FOSC = 110) • Low power, 0-0.5 MHz (FOSC = 101)  2008-2011 Microchip Technology Inc. PIC16(L)F1934/6/7 The Oscillator Start-up Timer (OST) is disabled when EC mode is selected. Therefore, there is no delay in operation after a Power-on Reset (POR) or wake-up from Sleep ...

Page 70

... SPLLEN is ignored. CERAMIC RESONATOR OPERATION ( MODE) ® PIC MCU OSC1/CLKIN To Internal Logic R (3) ( Sleep F OSC2/CLKOUT R S (1) ) may be required for S varies with the Oscillator mode F P Oscillator Start-up Timer (OST) Section 5.4 Mode”). 4X PLL  2008-2011 Microchip Technology Inc. ) ...

Page 71

... MS1V-T1K 32.768 kHz Tuning Fork Crystal to a PIC16F690/SS” (DS91097) • AN1288, “Design Practices for Low-Power External Oscillators” (DS01288)  2008-2011 Microchip Technology Inc. PIC16(L)F1934/6/7 5.2.1.6 The external Resistor-Capacitor (RC) modes support the use of an external RC circuit. This allows the designer maximum flexibility in frequency choice while keeping costs to a minimum when clock accuracy is not required ...

Page 72

... OSCSTAT register indicates when the MFINTOSC is running and can be utilized. (Register 5-3). Figure 5-1). One of nine Section 5.2.2.7 “Internal for more information. Internal Oscillator Figure 5-1). One of nine Section 5.2.2.7 “Internal for more information.  2008-2011 Microchip Technology Inc. ...

Page 73

... Watchdog Timer (WDT) • Fail-Safe Clock Monitor (FSCM) The Low-Frequency Internal Oscillator Ready bit (LFIOFR) of the OSCSTAT register indicates when the LFINTOSC is running and can be utilized.  2008-2011 Microchip Technology Inc. PIC16(L)F1934/6/7 5.2.2.5 Internal Oscillator Frequency Selection The system clock speed can be selected via software using the Internal Oscillator Frequency Select bits 5-3) ...

Page 74

... If the internal oscillator speed is switched between two clocks of the same source, there is no start-up delay before the new frequency is selected. Clock switching time delays are shown in Table 5-1. Start-up delay specifications are located in the oscillator tables in the applicable Specifications Chapter.  2008-2011 Microchip Technology Inc. Electrical ...

Page 75

... IRCF <3:0> System Clock LFINTOSC HFINTOSC/MFINTOSC LFINTOSC Start-up Time HFINTOSC/ MFINTOSC IRCF <3:0> System Clock  2008-2011 Microchip Technology Inc. PIC16(L)F1934/6/7 Start-up Time 2-cycle Sync 0 2-cycle Sync  LFINTOSC turns off unless WDT or FSCM is enabled 2-cycle Sync  ...

Page 76

... The Timer1 Oscillator Ready (T1OSCR) bit of the OSCSTAT register indicates whether the Timer1 oscillator is ready to be used. After the T1OSCR bit is set, the SCS bits can be configured to select the Timer1 oscillator. Start-up or Section 21.0 for more  2008-2011 Microchip Technology Inc. ...

Page 77

... Any clock source LFINTOSC Any clock source Timer1 Oscillator PLL inactive PLL active PLL inactive. Note 1:  2008-2011 Microchip Technology Inc. PIC16(L)F1934/6/7 5.4.1 TWO-SPEED START-UP MODE CONFIGURATION Two-Speed Start-up mode is configured by the following settings: • IESO (of the Configuration Word Inter- nal/External Switchover bit (Two-Speed Start-up mode enabled). • ...

Page 78

... DS41364E-page 78 5.4.3 CHECKING TWO-SPEED CLOCK STATUS Checking the state of the OSTS bit of the OSCSTAT register will confirm if the microcontroller is running from the external clock source, as defined by the FOSC<2:0> bits in the Configuration Word 1, or the internal oscillator  2008-2011 Microchip Technology Inc. ...

Page 79

... The internal clock source chosen by the FSCM is determined by the IRCF<3:0> bits of the OSCCON register. This allows the internal oscillator to be configured before a failure occurs.  2008-2011 Microchip Technology Inc. PIC16(L)F1934/6/7 5.5.3 FAIL-SAFE CONDITION CLEARING The Fail-Safe condition is cleared after a Reset, executing a SLEEP instruction or changing the SCS bits of the OSCCON register ...

Page 80

... Output Clock Monitor Output (Q) OSCFIF The system clock is normally at a much higher frequency than the sample clock. The relative frequencies in Note: this example have been chosen for clarity. DS41364E-page 80 Oscillator Failure Test Test Failure Detected Test  2008-2011 Microchip Technology Inc. ...

Page 81

... SCS<1:0>: System Clock Select bits 1x = Internal oscillator block 01 = Timer1 oscillator 00 = Clock determined by FOSC<2:0> in Configuration Word 1. Duplicate frequency derived from HFINTOSC. Note 1:  2008-2011 Microchip Technology Inc. PIC16(L)F1934/6/7 R/W-1/1 R/W-1/1 IRCF<3:0> Unimplemented bit, read as ‘0’ -n/n = Value at POR and BOR/Value at all other Resets Section 5.2.2.1 “ ...

Page 82

... HFIOFS: High-Frequency Internal Oscillator Stable bit 1 = HFINTOSC is at least 0.5% accurate 0 = HFINTOSC is not 0.5% accurate DS41364E-page 82 R-0/q R-0/q R-q/q HFIOFR HFIOFL MFIOFR U = Unimplemented bit, read as ‘0’ -n/n = Value at POR and BOR/Value at all other Resets q = Conditional  2008-2011 Microchip Technology Inc. R-0/0 R-0/q LFIOFR HFIOFS bit 0 ...

Page 83

... Shaded cells are not used by clock sources. Legend: PIC16F1934/6/7 only. Note 1:  2008-2011 Microchip Technology Inc. PIC16(L)F1934/6/7 R/W-0/0 R/W-0/0 R/W-0/0 TUN<5:0> Unimplemented bit, read as ‘0’ -n/n = Value at POR and BOR/Value at all other Resets ...

Page 84

... PIC16(L)F1934/6/7 NOTES: DS41364E-page 84  2008-2011 Microchip Technology Inc. ...

Page 85

... SIMPLIFIED BLOCK DIAGRAM OF ON-CHIP RESET CIRCUIT Programming Mode Exit RESET Instruction Stack Overflow/Underflow Reset Stack Pointer External Reset MCLRE MCLR Sleep WDT Time-out Power-on Reset V DD Brown-out Reset BOR Enable  2008-2011 Microchip Technology Inc. PIC16(L)F1934/6/7 PWRT Zero 64 ms LFINTOSC PWRTEN Device Reset DS41364E-page 85 ...

Page 86

... V for a DD BOR , the device BORDC for more information. Device Device Operation upon Operation upon wake- up from release of POR Sleep (1) Waits for BOR ready Waits for BOR ready Begins immediately Begins immediately Begins immediately level. DD  2008-2011 Microchip Technology Inc. ...

Page 87

... If BOREN <1:0> in Configuration Word BOR Enabled 0 = BOR Disabled bit 6-1 Unimplemented: Read as ‘0’ bit 0 BORRDY: Brown-out Reset Circuit Ready Status bit 1 = The Brown-out Reset circuit is active 0 = The Brown-out Reset circuit is inactive  2008-2011 Microchip Technology Inc. PIC16(L)F1934/6/7 (1) T PWRT < T PWRT PWRT (1) T ...

Page 88

... Upon bringing MCLR high, the device will begin execution immediately (see is useful for testing purposes or to synchronize more than one device operating in parallel. Section 10.0 Table 6-4 for Timer configuration. See for more information. Figure 6-3). This  2008-2011 Microchip Technology Inc. ...

Page 89

... FIGURE 6-3: RESET START-UP SEQUENCE V DD Internal POR Power-Up Timer MCLR Internal RESET Oscillator Modes External Crystal Oscillator Start-Up Timer Oscillator F OSC Internal Oscillator Oscillator F OSC External Clock (EC) CLKIN F OSC  2008-2011 Microchip Technology Inc. PIC16(L)F1934/6/7 T PWRT T MCLR T OST DS41364E-page 89 ...

Page 90

... Program Counter 0000h ---1 1000 0000h ---u uuuu 0000h ---1 0uuu 0000h ---0 uuuu ---0 0uuu 0000h ---1 1uuu ( ---1 0uuu 0000h ---u uuuu 0000h ---u uuuu 0000h ---u uuuu Condition STATUS PCON Register Register 00-- 110x uu-- 0uuu uu-- 0uuu uu-- uuuu uu-- uuuu 00-- 11u0 uu-- uuuu uu-- u0uu 1u-- uuuu u1-- uuuu  2008-2011 Microchip Technology Inc. ...

Page 91

... A Power-on Reset occurred (must be set in software after a Power-on Reset occurs) bit 0 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)  2008-2011 Microchip Technology Inc. PIC16(L)F1934/6/7 6-2. U-0 R/W/HC-1/q R/W/HC-1/q — ...

Page 92

... Other (non Power-up) Resets include MCLR Reset and Watchdog Timer Reset during normal operation. Note 1: DS41364E-page 92 Bit 5 Bit 4 Bit 3 Bit 2 — — — — — — RMCLR RI — WDTPS<4:0> Register Bit 1 Bit 0 on Page — BORRDY 87 POR BOR SWDTEN 113  2008-2011 Microchip Technology Inc. ...

Page 93

... A block diagram of the interrupt logic is shown in Figure 7-1. FIGURE 7-1: INTERRUPT LOGIC IOCBNx RBx IOCBPx Q4Q1 Q4Q1  2008-2011 Microchip Technology Inc. PIC16(L)F1934/6/7 Q4Q1 Edge Detect Data Bus = Write IOCBFx CK From all other IOCBFx individual Pin Detectors Q4Q1 To Data Bus IOCBFx IOCIE IOC Interrupt ...

Page 94

... The latency for synchronous interrupts instruction cycles. For asynchronous interrupts, the latency instruction cycles, depending on when the interrupt occurs. See and Figure 7-3 for more details.  2008-2011 Microchip Technology Inc. Figure 7-2 ...

Page 95

... PC PC Execute 2 Cycle Instruction at PC Interrupt GIE PC Execute 3 Cycle Instruction at PC Interrupt GIE PC Execute 3 Cycle Instruction at PC  2008-2011 Microchip Technology Inc. PIC16(L)F1934/6/7 Interrupt Sampled during Q1 PC+1 0004h Inst(PC) NOP NOP PC+1/FSR New PC/ 0004h ADDR PC+1 Inst(PC) NOP NOP FSR ADDR ...

Page 96

... For minimum width of INT pulse, refer to AC specifications in the applicable Electrical Specifications Chapter. 5: INTF is enabled to be set any time during the Q4-Q1 cycles. DS41364E-page (1) (2) Interrupt Latency Inst ( — Dummy Cycle Dummy Cycle Inst (PC) . Synchronous latency = 3 0004h 0005h Inst (0004h) Inst (0005h) Inst (0004h) , where T = instruction cycle time  2008-2011 Microchip Technology Inc. ...

Page 97

... Shadow register should be modified and the value will be restored when exiting the ISR. The Shadow registers are available in Bank 31 and are readable and writable. Depending on the user’s appli- cation, other registers may also need to be saved.  2008-2011 Microchip Technology Inc. PIC16(L)F1934/6/7 DS41364E-page 97 ...

Page 98

... User software should ensure the appropri- ate interrupt flag bits are clear prior to enabling an interrupt. R/W-0/0 R/W-0/0 R/W-0/0 INTE IOCIE TMR0IF U = Unimplemented bit, read as ‘0’ -n/n = Value at POR and BOR/Value at all other Resets  2008-2011 Microchip Technology Inc. R/W-0/0 R-0/0 INTF IOCIF bit 0 ...

Page 99

... 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  2008-2011 Microchip Technology Inc. PIC16(L)F1934/6/7 Bit PEIE of the INTCON register must be Note: set to enable any peripheral interrupt. ...

Page 100

... Bit PEIE of the INTCON register must be Note: set to enable any peripheral interrupt. R/W-0/0 R/W-0/0 R/W-0/0 EEIE BCLIE LCDIE U = Unimplemented bit, read as ‘0’ -n/n = Value at POR and BOR/Value at all other Resets  2008-2011 Microchip Technology Inc. U-0 R/W-0/0 — CCP2IE bit 0 ...

Page 101

... TMR4IE: TMR4 to PR4 Match Interrupt Enable bit 1 = Enables the TMR4 to PR4 Match interrupt 0 = Disables the TMR4 to PR4 Match interrupt bit 0 Unimplemented: Read as ‘0’  2008-2011 Microchip Technology Inc. PIC16(L)F1934/6/7 Bit PEIE of the INTCON register must be Note: set to enable any peripheral interrupt. ...

Page 102

... R-0/0 R/W-0/0 R/W-0/0 TXIF SSPIF CCP1IF U = Unimplemented bit, read as ‘0’ -n/n = Value at POR and BOR/Value at all other Resets  2008-2011 Microchip Technology Inc. should ensure the R/W-0/0 R/W-0/0 TMR2IF TMR1IF bit 0 ...

Page 103

... Unimplemented: Read as ‘0’ bit 0 CCP2IF: CCP2 Interrupt Flag bit 1 = Interrupt is pending 0 = Interrupt is not pending  2008-2011 Microchip Technology Inc. PIC16(L)F1934/6/7 Interrupt flag bits are set when an interrupt Note: condition occurs, regardless of the state of its corresponding enable bit or the Global Enable bit, GIE, of the INTCON register ...

Page 104

... R/W-0/0 R/W-0/0 R/W-0/0 CCP3IF TMR6IF — Unimplemented bit, read as ‘0’ -n/n = Value at POR and BOR/Value at all other Resets  2008-2011 Microchip Technology Inc. should ensure the R/W-0/0 R/W-0/0 TMR4IF — bit 0 ...

Page 105

... CCP5IE PIR1 TMR1GIF ADIF PIR2 OSFIF C2IF PIR3 — CCP5IF Legend: — = unimplemented location, read as ‘0’. Shaded cells are not used by Interrupts.  2008-2011 Microchip Technology Inc. PIC16(L)F1934/6/7 Bit 5 Bit 4 Bit 3 Bit 2 TMR0IE INTE IOCIE TMR0IF PSA RCIE TXIE ...

Page 106

... PIC16(L)F1934/6/7 NOTES: DS41364E-page 106  2008-2011 Microchip Technology Inc. ...

Page 107

... Shaded cells are not used by LDO. Legend: PIC16F1934/6/7 only. Note 1:  2008-2011 Microchip Technology Inc. PIC16(L)F1934/6/7 On power-up, the external capacitor will load the LDO voltage regulator. To prevent erroneous operation, the device is held in Reset while a constant current source charges the external capacitor ...

Page 108

... PIC16(L)F1934/6/7 NOTES: DS41364E-page 108  2008-2011 Microchip Technology Inc. ...

Page 109

... Section 17.0 “Digital-to-Analog Con- and verter (DAC) Module” Section 14.0 “Fixed Volt- for more information on these age Reference (FVR)” modules.  2008-2011 Microchip Technology Inc. PIC16(L)F1934/6/7 9.1 Wake-up from Sleep The device can wake-up from Sleep through one of the following events: 1. ...

Page 110

... Dummy Cycle Inst(0004h) Register on Bit 1 Bit 0 Page INTF IOCIF 98 IOCBF1 IOCBF0 152 IOCBN1 IOCBN0 152 IOCBP1 IOCBP0 152 TMR2IE TMR1IE 99 — CCP2IE 100 TMR4IE — 101 TMR2IF TMR1IF 102 — CCP2IF 103 TMR4IF — 104 SWDTEN 113  2008-2011 Microchip Technology Inc. ...

Page 111

... Configurable time-out period is from 256 seconds (typical) • Multiple Reset conditions • Operation during Sleep FIGURE 10-1: WATCHDOG TIMER BLOCK DIAGRAM WDTE<1:0> SWDTEN WDTE<1:0> WDTE<1:0> Sleep  2008-2011 Microchip Technology Inc. PIC16(L)F1934/6/7 23-bit Programmable LFINTOSC Prescaler WDT WDTPS<4:0> WDT Time-out DS41364E-page 111 ...

Page 112

... STATUS register are changed to indicate the event. See WDT Mode Section 3.0 “Memory Organization” register (Register 3-1) for more information. Active Active Disabled Active Disabled Disabled  2008-2011 Microchip Technology Inc. Section 5.0 “Oscillator for more and STATUS WDT Cleared Cleared until the end of OST Unaffected ...

Page 113

... SWDTEN: Software Enable/Disable for Watchdog Timer bit If WDTE<1:0> = 00: This bit is ignored. If WDTE<1:0> WDT is turned WDT is turned off If WDTE<1:0> = 1x: This bit is ignored.  2008-2011 Microchip Technology Inc. PIC16(L)F1934/6/7 R/W-1/1 R/W-0/0 R/W-1/1 WDTPS<4:0> Unimplemented bit, read as ‘0’ -m/n = Value at POR and BOR/Value at all other Resets ...

Page 114

... Bit 3 Bit 2 IRCF<3:0> — — WDTPS<4:0> Bit 13/5 Bit 12/4 Bit 11/3 Bit 10/2 FCMEN IESO CLKOUTEN PWRTE WDTE<1:0> Register Bit 1 Bit 0 on Page SCS<1:0> SWDTEN 113 Register Bit 9/1 Bit 8/0 on Page BOREN<1:0> CPD 62 FOSC<2:0>  2008-2011 Microchip Technology Inc. ...

Page 115

... When code-protected, the CPU may continue to read and write the data EEPROM memory and Flash program memory.  2008-2011 Microchip Technology Inc. PIC16(L)F1934/6/7 11.1 EEADRL and EEADRH Registers The EEADRH:EEADRL register pair can address maximum of 256 bytes of data EEPROM maximum of 32K words of program memory ...

Page 116

... CPU is able to read and write data to the data EEPROM recommended to code-protect the pro- gram memory when code-protecting data memory. This prevents anyone from replacing your program with a program that will access the contents of the data EEPROM.  2008-2011 Microchip Technology Inc. (Register 5-1) ...

Page 117

... FLASH PROGRAM MEMORY READ CYCLE EXECUTION Flash ADDR Flash Data INSTR (PC) BSF EECON1,RD INSTR( executed here executed here RD bit EEDATH EEDATL Register EERHLT  2008-2011 Microchip Technology Inc. PIC16(L)F1934/6/7 EEADRH,EEADRL PC+3 INSTR ( EEDATH,EEDATL INSTR ( INSTR( Forced NOP executed here executed here INSTR ( INSTR( ...

Page 118

... NOPs. This prevents the user from executing a two-cycle instruction after the RD bit is set. 2: Flash program memory can be read regardless of the setting of the CP bit. Number of Write Latches/ Boundary 8 words, EEADRL<2:0> = 000 instruction on the next  2008-2011 Microchip Technology Inc. ...

Page 119

... Initiate read NOP ; Executed NOP ; Ignored BSF INTCON,GIE ; Restore interrupts MOVF EEDATL,W ; Get LSB of word MOVWF PROG_DATA_LO ; Store in user location MOVF EEDATH,W ; Get MSB of word MOVWF PROG_DATA_HI ; Store in user location  2008-2011 Microchip Technology Inc. PIC16(L)F1934/6/7 (Figure 11-1) (Figure 11-1) DS41364E-page 119 ...

Page 120

... The initial address is loaded into the EEADRH:EEADRL register pair; the eight words of data are loaded using indirect addressing. The code sequence Note: Example 11-5 must be repeated multiple times to fully program an erased program memory row.  2008-2011 Microchip Technology Inc. provided in ...

Page 121

... EEADRL<2:0> = 000 EEADRL<2:0> = 001 Buffer Register  2008-2011 Microchip Technology Inc. PIC16(L)F1934/6/7 continue to run. The processor does not stall when LWLO = 1, loading the write latches. After the write cycle, the processor will resume operation with the third instruction after the EECON1 write instruction. ...

Page 122

... Write AAh ; Set WR bit to begin erase ; Any instructions here are ignored as processor ; halts to begin erase sequence ; Processor will stop here and wait for erase complete. ; after erase processor continues with 3rd instruction ; Disable writes ; Enable interrupts  2008-2011 Microchip Technology Inc. ...

Page 123

... EECON2 MOVLW 0AAh MOVWF EECON2 BSF EECON1,WR NOP NOP BCF EECON1,WREN BSF INTCON,GIE  2008-2011 Microchip Technology Inc. PIC16(L)F1934/6/7 ; Disable ints so required sequences will execute properly ; Bank 3 ; Load initial address ; ; ; ; Load initial data address ; ; ; Point to program memory ; Not configuration space ; Enable writes ...

Page 124

... Refer to Table When read access is initiated on an address outside the parameters listed in register pair is cleared. Function Read Access User IDs Yes Yes Yes Figure 11-1) Figure 11-1) 11-2. Table 11-2, the EEDATH:EEDATL Write Access Yes No No  2008-2011 Microchip Technology Inc. ...

Page 125

... EEPROM WRITE VERIFY BANKSEL EEDATL ; MOVF EEDATL, W ;EEDATL not changed ;from previous write BSF EECON1, RD ;YES, Read the ;value written XORWF EEDATL BTFSS STATUS, Z ;Is data the same GOTO WRITE_ERR ;No, handle error : ;Yes, continue  2008-2011 Microchip Technology Inc. PIC16(L)F1934/6/7 DS41364E-page 125 ...

Page 126

... U = Unimplemented bit, read as ‘0’ -n/n = Value at POR and BOR/Value at all other Resets R/W-0/0 R/W-0/0 R/W-0/0 EEADR<14:8> Unimplemented bit, read as ‘0’ -n/n = Value at POR and BOR/Value at all other Resets  2008-2011 Microchip Technology Inc. R/W-x/u R/W-x/u bit 0 R/W-x/u R/W-x/u bit 0 R/W-0/0 ...

Page 127

... RD: Read Control bit 1 = Initiates an program Flash or data EEPROM read. Read takes one cycle cleared in hardware. The RD bit can only be set (not cleared) in software Does not initiate a program Flash or data EEPROM data read.  2008-2011 Microchip Technology Inc. PIC16(L)F1934/6/7 R/W/HC-0/0 R/W-x/q R/W-0/0 ...

Page 128

... EEADRH<6:0 EEDATL<7:0> EEDATH<5:0> INTE IOCIE TMR0IF EEIE BCLIE LCDIE C1IF EEIF BCLIF LCDIF W-0/0 W-0/0 W-0/0 bit 0 Register on Bit 1 Bit 0 Page WR RD 127 115* 126 126 126 126 INTF IOCIF 98 — CCP2IE 100 — CCP2IF 103  2008-2011 Microchip Technology Inc. ...

Page 129

... Disabling the input buffer prevents analog signal levels on the pin between a logic high and low from causing excessive current in the logic input circuitry. A simplified model of a generic I/O port, without the interfaces to other peripherals, is shown in  2008-2011 Microchip Technology Inc. PIC16(L)F1934/6/7 FIGURE 12-1: D Write LATx ...

Page 130

... CCP3/P3A output • Timer1 Gate • SR Latch SRNQ output • Comparator C2 output These bits have no effect on the values of any TRIS register. PORT and TRIS overrides will be routed to the correct pin. The unselected pin will be unaffected. DS41364E-page 130  2008-2011 Microchip Technology Inc. ...

Page 131

... SSSEL: SS Input Pin Selection bit function is on RA5/AN4/C2OUT/SRNQ/SS/CPS7/SEG5 function is on RA0/AN0/C12IN0-/C2OUT/SRNQ/SS/SEG12/V bit 0 CCP2SEL: CCP2 Input/Output Pin Selection bit 0 = CCP2/P2A function is on RC1/T1OSI/CCP2/P2A 1 = CCP2/P2A function is on RB3/AN9/C12IN2-/CPS3/CCP2/P2A/VLCD3  2008-2011 Microchip Technology Inc. PIC16(L)F1934/6/7 R/W-0/0 R/W-0/0 R/W-0/0 P2BSEL SRNQSEL C2OUTSEL U = Unimplemented bit, read as ‘ ...

Page 132

... CLKOUT (enabled by Config. Word) SEG1 (LCD) RA6 RA7 OSC1/CLKIN (enabled by Config. Word) SEG2 (LCD) RA7 Priority listed from highest to lowest. Note 1: 12-2. Table 12-2. PORTA OUTPUT PRIORITY (1) Function Priority CAP (enabled by Config. Word) CAP (enabled by Config. Word) CAP  2008-2011 Microchip Technology Inc. ...

Page 133

... Bit is cleared bit 7-0 LATA<7:0>: PORTA Output Latch Value bits Writes to PORTA are actually written to corresponding LATA register. Reads from PORTA register is return Note 1: of actual I/O pin values.  2008-2011 Microchip Technology Inc. PIC16(L)F1934/6/7 R/W-x/u R/W-x/u R/W-x/u RA4 ...

Page 134

... DS41364E-page 134 R/W-1/1 R/W-1/1 R/W-1/1 ANSA4 ANSA3 ANSA2 U = Unimplemented bit, read as ‘0’ -n/n = Value at POR and BOR/Value at all other Resets (1) . Digital input buffer disabled.  2008-2011 Microchip Technology Inc. R/W-1/1 R/W-1/1 ANSA1 ANSA0 bit 0 ...

Page 135

... MCLRE 13:8 — — CONFIG2 7:0 — — — = unimplemented location, read as ‘0’. Shaded cells are not used by PORTA. Legend: PIC16F1934/6/7 only. Note 1:  2008-2011 Microchip Technology Inc. PIC16(L)F1934/6/7 Bit 5 Bit 4 Bit 3 Bit 2 CHS<4:0> ADCS<2:0> — ADNREF ANSA5 ANSA4 ANSA3 ...

Page 136

... The ANSELB bits default to the Analog Note: mode after Reset. To use any pins as digital general purpose or peripheral inputs, the corresponding ANSEL bits must be initialized to ‘0’ by user software. Section 13.0 (Register 12-9) is used to  2008-2011 Microchip Technology Inc. ...

Page 137

... RB5 COM1 P2B, 28-pin only CCP3/P3A RB5 RB6 ICSPCLK (Programming) ICDCLK (enabled by Config. Word) SEG14 (LCD) RB6 RB7 ICSPDAT (Programming) ICDDAT (enabled by Config. Word) SEG13 (LCD) RB7 Priority listed from highest to lowest. Note 1:  2008-2011 Microchip Technology Inc. PIC16(L)F1934/6/7 (1) DS41364E-page 137 ...

Page 138

... Value at POR and BOR/Value at all other Resets R/W-x/u R/W-x/u R/W-x/u LATB4 LATB3 LATB2 U = Unimplemented bit, read as ‘0’ -n/n = Value at POR and BOR/Value at all other Resets (1)  2008-2011 Microchip Technology Inc. R/W-x/u R/W-x/u RB1 RB0 bit 0 R/W-1/1 R/W-1/1 TRISB1 TRISB0 ...

Page 139

... Pull-up enabled 0 = Pull-up disabled Global WPUEN bit of the OPTION_REG register must be cleared for individual pull-ups to be enabled. Note 1: The weak pull-up device is automatically disabled if the pin is in configured as an output. 2:  2008-2011 Microchip Technology Inc. PIC16(L)F1934/6/7 R/W-1/1 R/W-1/1 R/W-1/1 ANSB4 ANSB3 ANSB2 U = Unimplemented bit, read as ‘ ...

Page 140

... IOCBN1 IOCBN0 152 IOCBF1 IOCBF0 152 LATB2 LATB1 LATB0 138 LMUX<1:0> 329 SE2 SE1 SE0 333 SE10 SE9 SE8 333 PS<2:0> 193 RB2 RB1 RB0 138 T1GSS<1:0> 204 TRISB2 TRISB1 TRISB0 138 WPUB2 WPUB1 WPUB0 139  2008-2011 Microchip Technology Inc. ...

Page 141

... The user should ensure the bits in the TRISC register are maintained set when using them as analog inputs. I/O pins configured as analog input always read ‘0’.  2008-2011 Microchip Technology Inc. PIC16(L)F1934/6/7 12.4.1 PORTC FUNCTIONS AND OUTPUT PRIORITIES Each PORTC pin is multiplexed with other functions ...

Page 142

... Value at POR and BOR/Value at all other Resets R/W-x/u R/W-x/u R/W-x/u LATC4 LATC3 LATC2 U = Unimplemented bit, read as ‘0’ -n/n = Value at POR and BOR/Value at all other Resets (1)  2008-2011 Microchip Technology Inc. R/W-x/u R/W-x/u RC1 RC0 bit 0 R/W-1/1 R/W-1/1 TRISC1 TRISC0 ...

Page 143

... SMP CKE T1CON TMR1CS<1:0> TXSTA CSRC TX9 TRISC TRISC7 TRISC6 x = unknown unchanged unimplemented locations read as ‘0’. Shaded cells are not used by PORTC. Legend:  2008-2011 Microchip Technology Inc. PIC16(L)F1934/6/7 Bit 5 Bit 4 Bit 3 Bit 2 T1GSEL P2BSEL SRNQSEL C2OUTSEL DCxB<1:0> CCPxM<3:0> LATC5 ...

Page 144

... Function Priority COM3 (LCD) RD0 CCP4 (CCP) RD1 P2B (CCP) RD2 SEG16 (LCD) P2C (CCP) RD3 SEG17 (LCD) P2D (CCP) RD4 SEG18 (LCD) P1B (CCP) RD5 SEG19 (LCD) P1C (CCP) RD6 SEG20 (LCD) P1D (CCP) RD7  2008-2011 Microchip Technology Inc. ...

Page 145

... LATD<7:0>: PORTD Output Latch Value bits Writes to PORTD are actually written to corresponding LATD register. Reads from PORTD register is Note 1: return of actual I/O pin values. PORTD implemented on PIC16(L)F1934/7 devices only. 2:  2008-2011 Microchip Technology Inc. PIC16(L)F1934/6/7 (1) R/W-x/u R/W-x/u R/W-x/u RD4 ...

Page 146

... TRISD5 TRISD4 TRISD3 TRISD2 (2) R/W-1/1 R/W-1/1 ANSD1 ANSD0 bit 0 (1) Register on Bit 1 Bit 0 Page ANSD1 ANSD0 146 234 CPSOUT T0XCS 323 324 LATD1 LATD0 145 LMUX<1:0> 329 SE17 SE16 333 RD1 RD0 145 TRISD1 TRISD0 145  2008-2011 Microchip Technology Inc. ...

Page 147

... Note: mode after Reset. To use any pins as digital general purpose or peripheral inputs, the corresponding ANSEL bits must be initialized to ‘0’ by user software.  2008-2011 Microchip Technology Inc. PIC16(L)F1934/6/7 12.6.2 PORTE FUNCTIONS AND OUTPUT PRIORITIES Each PORTD pin is multiplexed with other functions. The ...

Page 148

... Value at POR and BOR/Value at all other Resets (1) (2) U-0 U-1 R/W-1 (1) TRISE2 — — Unimplemented bit, read as ‘0’ -n/n = Value at POR and BOR/Value at all other Resets (1)  2008-2011 Microchip Technology Inc. R/W-x/u R/W-x/u (1) (1) RE1 RE0 bit 0 R/W-1 R/W-1 (1) (1) TRISE1 ...

Page 149

... When setting a pin to an analog input, the corresponding TRIS bit must be set to Input mode in order to Note 1: allow external control of the voltage on the pin. ANSELE register is not implemented on the PIC16(L)F1936. Read as ‘0’ 2:  2008-2011 Microchip Technology Inc. PIC16(L)F1934/6/7 U-0 U-0 R/W-x/u LATE2 — ...

Page 150

... Register Bit 1 Bit 0 on Page 163 GO/DONE ADON (1) (1) (1) 149 ANSE1 ANSE0 234 149 (1) (1) (1) LATE1 LATE0 LMUX<1:0> 329 333 SE17 SE16 (1) (1) (1) RE1 RE0 148 148 (1) (1) (1) TRISE1 TRISE0 — — 150  2008-2011 Microchip Technology Inc. ...

Page 151

... R RBx IOCBPx  2008-2011 Microchip Technology Inc. PIC16(L)F1934/6/7 13.3 Interrupt Flags The IOCBFx bits located in the IOCBF register are status flags that correspond to the interrupt-on-change pins of PORTB expected edge is detected on an appropriately enabled pin, then the status flag for that pin will be set, and an interrupt will be generated if the IOCIE bit is set ...

Page 152

... Value at POR and BOR/Value at all other Resets R/W/HS-0/0 IOCBF4 IOCBF3 IOCBF2 U = Unimplemented bit, read as ‘0’ -n/n = Value at POR and BOR/Value at all other Resets HS - Bit is set in hardware  2008-2011 Microchip Technology Inc. R/W-0/0 R/W-0/0 IOCBP1 IOCBP0 bit 0 R/W-0/0 R/W-0/0 IOCBN1 ...

Page 153

... IOCBF7 IOCBF6 IOCBN IOCBN7 IOCBN6 IOCBP IOCBP7 IOCBP6 TRISB7 TRISB6 TRISB Legend: — = unimplemented location, read as ‘0’. Shaded cells are not used by Interrupt-on-Change.  2008-2011 Microchip Technology Inc. PIC16(L)F1934/6/7 Bit 5 Bit 4 Bit 3 Bit 2 ANSB5 ANSB4 ANSB3 ANSB2 TMR0IE INTE IOCIE ...

Page 154

... PIC16(L)F1934/6/7 NOTES: DS41364E-page 154  2008-2011 Microchip Technology Inc. ...

Page 155

... Each FIGURE 14-1: VOLTAGE REFERENCE BLOCK DIAGRAM ADFVR<1:0> CDAFVR<1:0> FVREN FVRRDY  2008-2011 Microchip Technology Inc. PIC16(L)F1934/6/7 amplifier can be configured to amplify the reference voltage by 1x 4x, to produce the three possible voltage levels. The ADFVR<1:0> bits of the FVRCON register are , with 1.024V, used to enable and configure the gain amplifier settings for the reference supplied to the ADC module ...

Page 156

... Value at POR and BOR/Value at all other Resets q = Value depends on condition (1) (3) (3) (Low Range) (High Range for additional information. Bit 5 Bit 4 Bit 3 Bit 2 TSEN TSRNG CDAFVR<1:0> R/W-0/0 R/W-0/0 ADFVR<1:0> bit 0 (2) (2) (2) (2) Register Bit 1 Bit 0 on page ADFVR<1:0> 156  2008-2011 Microchip Technology Inc. ...

Page 157

... Temperature Sensor DAC FVR Buffer1 CHS<4:0> Note 1: When ADON = 0, all multiplexer inputs are disconnected. 2: Not available on PIC16(L)F1936.  2008-2011 Microchip Technology Inc. PIC16(L)F1934/6/7 The ADC can generate an interrupt upon completion of a conversion. This interrupt can be used to wake-up the device from Sleep. (ADC) ...

Page 158

... ADC clock selections. Unless using the F Note: system clock frequency will change the ADC adversely affect the ADC result. Section 15.2 AD Figure 15-2. specifica- AD Table 15-1 gives exam- , any changes in the RC clock frequency, which may  2008-2011 Microchip Technology Inc. ...

Page 159

... Sleep mode. FIGURE 15-2: ANALOG-TO-DIGITAL CONVERSION Conversion starts Holding capacitor is disconnected from analog input (typically 100 ns) Set GO bit  2008-2011 Microchip Technology Inc. PIC16(L)F1934/6 DEVICE OPERATING FREQUENCIES AD S Device Frequency (F Device Frequency (F 20 MHz 16 MHz (2) (2) (2) 100 ns 125 ns (2) (2) (2) 200 ns ...

Page 160

... ADCON1 register controls the output format. Figure 15-3 shows the two output formats. for more ADRESH LSB bit 0 bit 7 10-bit A/D Result MSB bit 0 bit 7 10-bit A/D Result ADRESL bit 0 Unimplemented: Read as ‘0’ LSB bit 0  2008-2011 Microchip Technology Inc. ...

Page 161

... A device Reset forces all registers to their Note: Reset state. Thus, the ADC module is turned off and any pending conversion is terminated.  2008-2011 Microchip Technology Inc. PIC16(L)F1934/6/7 15.2.4 ADC OPERATION DURING SLEEP The ADC module can operate during Sleep. This requires the ADC clock source to be set to the F option ...

Page 162

... ADRESL MOVF ADRESL,W MOVWF RESULTLO A/D CONVERSION ; ;clock ;Vdd and Vss Vref ; ;Set RA0 to input ; ;Set RA0 to analog ; ;Turn ADC On ;Acquisiton delay ;No, test again ; ;Read upper 2 bits ;store in GPR space ; ;Read lower 8 bits ;Store in GPR space  2008-2011 Microchip Technology Inc. ...

Page 163

... Section 14.0 “Fixed Voltage Reference (FVR)” See 3: Section 16.0 “Temperature Indicator Module” Not available on the PIC16(L)F1936. 4:  2008-2011 Microchip Technology Inc. PIC16(L)F1934/6/7 R/W-0/0 R/W-0/0 R/W-0/0 CHS<4:0> Unimplemented bit, read as ‘0’ -n/n = Value at POR and BOR/Value at all other Resets ...

Page 164

... R/W-0/0 — ADNREF U = Unimplemented bit, read as ‘0’ -n/n = Value at POR and BOR/Value at all other Resets SS (1) - pin REF DD (1) + pin REF + pin as the source of the positive reference, be aware that a REF  2008-2011 Microchip Technology Inc. R/W-0/0 R/W-0/0 ADPREF<1:0> bit 0 (1) ...

Page 165

... Bit is set ‘0’ = Bit is cleared bit 7-6 ADRES<1:0>: ADC Result Register bits Lower 2 bits of 10-bit conversion result bit 5-0 Reserved: Do not use.  2008-2011 Microchip Technology Inc. PIC16(L)F1934/6/7 R/W-x/u R/W-x/u R/W-x/u ADRES<9:2> Unimplemented bit, read as ‘0’ -n/n = Value at POR and BOR/Value at all other Resets ...

Page 166

... U = Unimplemented bit, read as ‘0’ -n/n = Value at POR and BOR/Value at all other Resets R/W-x/u R/W-x/u R/W-x/u ADRES<7:0> Unimplemented bit, read as ‘0’ -n/n = Value at POR and BOR/Value at all other Resets  2008-2011 Microchip Technology Inc. R/W-x/u R/W-x/u ADRES<9:8> bit 0 R/W-x/u R/W-x/u bit 0 ...

Page 167

... 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.  2008-2011 Microchip Technology Inc. PIC16(L)F1934/6/7 source impedance is decreased, the acquisition time may be decreased. After the analog input channel is selected (or changed), an A/D acquisition must be done before the conversion can be started ...

Page 168

... V - REF DS41364E-page 168 V DD Sampling Switch  0.  Rss R IC LEAKAGE (1) I  0. Full-Scale Range 0.5 LSB Zero-Scale Full-Scale Transition V REF Transition HOLD REF Sampling Switch (k) Analog Input Voltage 1.5 LSB +  2008-2011 Microchip Technology Inc. ...

Page 169

... Shaded cells are not Legend: used for ADC module. Unimplemented, read as ‘1’. Note 1: These registers/bits are not implemented on PIC16(L)F1936 devices, read as ‘0’. 2:  2008-2011 Microchip Technology Inc. PIC16(L)F1934/6/7 Bit 5 Bit 4 Bit 3 Bit 2 CHS<4:0> ...

Page 170

... PIC16(L)F1934/6/7 NOTES: DS41364E-page 170  2008-2011 Microchip Technology Inc. ...

Page 171

... The low range is selected by clearing the TSRNG bit of the FVRCON register. The low range generates a lower voltage drop and thus, a lower bias voltage is needed to operate the circuit. The low range is provided for low voltage operation.  2008-2011 Microchip Technology Inc. PIC16(L)F1934/6/7 FIGURE 16-1: 16.2 Minimum Operating V ...

Page 172

... PIC16(L)F1934/6/7 NOTES: DS41364E-page 172  2008-2011 Microchip Technology Inc. ...

Page 173

... DAC output value. The value of the individual resistors within the ladder can be found in the applicable Electrical Specifications chapter.  2008-2011 Microchip Technology Inc. PIC16(L)F1934/6/7 17.1 Output Voltage Selection The DAC has 32 voltage level ranges. The 32 levels are set with the DACR< ...

Page 174

... VOLTAGE REFERENCE OUTPUT BUFFER EXAMPLE ® PIC MCU DAC R Module Voltage Reference Output Impedance DS41364E-page 174 Digital-to-Analog Converter (DAC) V SOURCE + Steps SOURCE - + DACOUT – DACR<4:0> 5 DAC (To Comparator, CPS and ADC Modules) DACOUT DACOE Buffered DAC Output  2008-2011 Microchip Technology Inc. ...

Page 175

... DAC is disabled. • DAC output voltage is removed from the DACOUT pin. • The DACR<4:0> range select bits are cleared.  2008-2011 Microchip Technology Inc. PIC16(L)F1934/6/7 This is also the method used to output the voltage level from the FVR to an output pin. See “ ...

Page 176

... Value at POR and BOR/Value at all other Resets Bit 5 Bit 4 Bit 3 Bit 2 TSEN TSRNG CDAFVR<1:0> DACOE — DACPSS<1:0> — DACR<4:0> U-0 R/W-0/0 — DACNSS bit 0 R/W-0/0 R/W-0/0 bit 0 Register Bit 1 Bit 0 on page ADFVR<1:0> 156 — DACNSS 176 176  2008-2011 Microchip Technology Inc. ...

Page 177

... When the analog voltage at V less than the analog voltage the output of the IN comparator is a digital low level. When the analog voltage greater than the analog voltage the output of the comparator is a digital high level. IN  2008-2011 Microchip Technology Inc. PIC16(L)F1934/6/7 FIGURE 18- ...

Page 178

... Output of comparator can be frozen during debugging. 3: DS41364E-page 178 (1) Interrupt Interrupt C POL ( CxHYS D (from Timer1) T1CLK CxINTP det Set CxIF CxINTN det C OUT X To Data Bus Q MC OUT X To ECCP PWM Logic C SYNC TRIS bit C OUT Timer1 or SR Latch SYNCC OUT X  2008-2011 Microchip Technology Inc. ...

Page 179

... The internal output of the comparator is latched with each instruction cycle. Unless otherwise specified, external outputs are not latched.  2008-2011 Microchip Technology Inc. PIC16(L)F1934/6/7 18.2.3 COMPARATOR OUTPUT POLARITY Inverting the output of the comparator is functionally equivalent to swapping the comparator inputs. The ...

Page 180

... Section 14.0 “Fixed Voltage Reference (FVR)” for more information on the Fixed Voltage Reference module. See Section 17.0 “Digital-to-Analog for more information on the DAC input (DAC) Module” signal. Any time the comparator is disabled (CxON = 0), all comparator inputs are disabled.  2008-2011 Microchip Technology Inc. Converter ...

Page 181

... ECCP Auto-Shutdown mode.  2008-2011 Microchip Technology Inc. PIC16(L)F1934/6/7 18.10 Analog Input Connection Considerations A simplified circuit for an analog input is shown in Figure 18-3 ...

Page 182

... Legend Input Capacitance PIN I = Leakage Current at the pin due to various junctions LEAKAGE R = Interconnect Resistance Source Impedance Analog Voltage Threshold Voltage T Note 1: See the applicable Electrical Specifications Chapter. DS41364E-page 182 V DD  0. (1) LEAKAGE  0. Vss  2008-2011 Microchip Technology Inc. To Comparator ...

Page 183

... CxSYNC: Comparator Output Synchronous Mode bit 1 = Comparator output to Timer1 and I/O pin is synchronous to changes on Timer1 clock source. Output updated on the falling edge of Timer1 clock source Comparator output to Timer1 and I/O pin is asynchronous.  2008-2011 Microchip Technology Inc. PIC16(L)F1934/6/7 R/W-0/0 U-0 R/W-1/1 ...

Page 184

... Value at POR and BOR/Value at all other Resets SS U-0 U-0 U-0 — — Unimplemented bit, read as ‘0’ -n/n = Value at POR and BOR/Value at all other Resets R/W-0/0 R/W-0/0 CxNCH<1:0> — bit 0 R-0/0 R-0/0 MC2OUT MC1OUT — bit 0  2008-2011 Microchip Technology Inc. ...

Page 185

... TRISA7 TRISA6 TRISB TRISB7 TRISB6 ANSELA — — ANSELB — — — = unimplemented location, read as ‘0’. Shaded cells are unused by the comparator module. Legend:  2008-2011 Microchip Technology Inc. PIC16(L)F1934/6/7 Bit 5 Bit 4 Bit 3 Bit 2 C1OE C1POL --- C1SP C2OE C2POL — ...

Page 186

... PIC16(L)F1934/6/7 NOTES: DS41364E-page 186  2008-2011 Microchip Technology Inc. ...

Page 187

... Enabling both the Set and Reset inputs Note: from any one source at the same time may result in indeterminate operation, as the Reset dominance cannot be assured.  2008-2011 Microchip Technology Inc. PIC16(L)F1934/6/7 19.2 Latch Output The SRQEN and SRNQEN bits of the SRCON0 regis- ter control the Q and Q latch outputs ...

Page 188

... SRCLK SRRCKE (3) SYNCC2OUT SRRC2E (3) SYNCC1OUT SRRC1E and simultaneously Note 1: Pulse generator causes a 1 Q-state pulse width. 2: Name denotes the connection point at the comparator output. 3: DS41364E-page 188 SRLEN SRQEN S Q SRQ SR (1) Latch R Q SRNQ SRLEN SRNQEN  2008-2011 Microchip Technology Inc. ...

Page 189

... Pulse set input for 1 Q-clock period effect on set input. bit 0 SRPR: Pulse Reset Input of the SR Latch bit 1 = Pulse Reset input for 1 Q-clock period effect on Reset input. Set only, always reads back ‘ 0 ’. Note 1:  2008-2011 Microchip Technology Inc. PIC16(L)F1934/6 MHz MHz OSC OSC 39 ...

Page 190

... ANSA5 ANSA4 ANSA3 ANSA2 SRQEN SRNQEN SRSC2E SRSC1E SRRPE SRRCKE SRRC2E SRRC1E TRISA5 TRISA4 TRISA3 TRISA2 R/W-0/0 R/W-0/0 SRRC2E SRRC1E bit 0 Register Bit 1 Bit 0 on Page ANSA1 ANSA0 134 SRPS SRPR 189 190 TRISA1 TRISA0 133  2008-2011 Microchip Technology Inc. ...

Page 191

... From CPSCLK 1 TMR0CS TMR0SE T0XCS  2008-2011 Microchip Technology Inc. PIC16(L)F1934/6/7 When TMR0 is written, the increment is inhibited for two instruction cycles immediately following the write. The value written to the TMR0 register Note: can be adjusted, in order to account for the two instruction cycle delay when TMR0 is written ...

Page 192

... Electrical Specifications Chapter. 20.1.6 OPERATION DURING SLEEP Timer0 cannot operate while the processor is in Sleep mode. The contents of the TMR0 register will remain unchanged while the processor is in Sleep mode. DS41364E-page 192  2008-2011 Microchip Technology Inc. ...

Page 193

... Timer0 Module Register TRISA TRISA7 TRISA6 — = Unimplemented location, read as ‘0’. Shaded cells are not used by the Timer0 module. Legend: * Page provides register information.  2008-2011 Microchip Technology Inc. PIC16(L)F1934/6/7 R/W-1/1 R/W-1/1 R/W-1/1 TMR0SE PSA U = Unimplemented bit, read as ‘0’ ...

Page 194

... PIC16(L)F1934/6/7 NOTES: DS41364E-page 194  2008-2011 Microchip Technology Inc. ...

Page 195

... T1CKI Note 1: ST Buffer is high speed type when using T1CKI. 2: Timer1 register increments on rising edge. 3: Synchronize does not operate while in Sleep.  2008-2011 Microchip Technology Inc. PIC16(L)F1934/6/7 • Gate Toggle Mode • Gate Single-pulse Mode • Gate Value Status • Gate Event Interrupt Figure 21 block diagram of the Timer1 module ...

Page 196

... T1CKI is high then Timer1 is enabled (TMR1ON=1) when T1CKI is low. T1OSCEN Instruction Clock (F OSC x System Clock (F ) OSC x External Clocking on T1CKI Pin 0 External Clocking on T1CKI Pin 0 Capacitive Sensing Oscillator x internal clock source is selected, the system clock or they can run Clock Source /4)  2008-2011 Microchip Technology Inc. ...

Page 197

... When switching from synchronous to Note: asynchronous operation possible to skip an increment. When switching from asynchronous to synchronous operation possible to produce an additional increment.  2008-2011 Microchip Technology Inc. PIC16(L)F1934/6/7 21.5.1 READING AND WRITING TIMER1 IN ASYNCHRONOUS COUNTER MODE Reading TMR1H or TMR1L while the timer is running from an external asynchronous clock will ensure a valid read (taken care of in hardware) ...

Page 198

... TMR1GIF flag bit in the PIR1 register will be set. If the TMR1GIE bit in the PIE1 register is set, then an interrupt will be recognized. The TMR1GIF flag bit operates even when the Timer1 gate is not enabled (TMR1GE bit is cleared).  2008-2011 Microchip Technology Inc. Figure 21-5 for timing details. Figure 21-6 for timing ...

Page 199

... TMR1 Enabled Note 1: Arrows indicate counter increments Counter mode, a falling edge must be registered by the counter prior to the first incrementing rising edge of the clock.  2008-2011 Microchip Technology Inc. PIC16(L)F1934/6/7 Timer1 oscillator will continue to operate in Sleep regardless of the T1SYNC bit setting. ...

Page 200

... PIC16(L)F1934/6/7 FIGURE 21-3: TIMER1 GATE ENABLE MODE TMR1GE T1GPOL T1G_IN T1CKI T1GVAL TIMER1 N FIGURE 21-4: TIMER1 GATE TOGGLE MODE TMR1GE T1GPOL T1GTM T1G_IN T1CKI T1GVAL TIMER1 DS41364E-page 200  2008-2011 Microchip Technology Inc ...

Related keywords