PIC16F688-E/SL Microchip Technology, PIC16F688-E/SL Datasheet
![IC MCU PIC FLASH 4KX14 14SOIC](/photos/6/59/65933/150-14-soic_sml.jpg)
PIC16F688-E/SL
Specifications of PIC16F688-E/SL
Related parts for PIC16F688-E/SL
PIC16F688-E/SL Summary of contents
Page 1
... Microchip Technology Inc. PIC16F688 Data Sheet 14-Pin Flash-Based, 8-Bit CMOS Microcontrollers with nanoWatt Technology DS41203E ...
Page 2
... 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
... 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 © 2009 Microchip Technology Inc. PIC16F688 Low-Power Features: • Standby Current 2.0V, typical • Operating Current μ kHz, 2.0V, typical - 220 μ ...
Page 4
... Program Memory Device Flash (words) PIC16F688 4096 Pin Diagram (PDIP, SOIC, TSSOP) 14-pin PDIP, SOIC, TSSOP RA5/T1CKI/OSC1/CLKIN RA4/AN3/T1G/OSC2/CLKOUT RA3/MCLR/V RC5/RX/DT RC4/C2OUT/TX/CK RC3/AN7 TABLE 1: PIC16F688 14-PIN SUMMARY (PDIP, SOIC, TSSOP) I/O Pin Analog Comparators RA0 13 AN0/ULPWU C1IN+ RA1 12 AN1 C1IN- RA2 11 AN2 ...
Page 5
... Pin Diagram (QFN) 16-pin QFN RA5/T1CKI/OSC1/CLKIN RA4/AN3/T1G/OSC2/CLKOUT RA3/MCLR/V RC5/RX/DT TABLE 2: PIC16F688 16-PIN SUMMARY (QFN) I/O Pin Analog Comparators RA0 12 AN0/ULPWU C1IN+ RA1 11 AN1 C1IN- RA2 10 AN2 C1OUT RA3 3 — RA4 2 AN3 RA5 1 — RC0 9 AN4 C2IN+ RC1 8 AN5 C2IN- RC2 7 AN6 ...
Page 6
... PIC16F688 Table of Contents 1.0 Device Overview ......................................................................................................................................................................... 5 2.0 Memory Organization .................................................................................................................................................................. 7 3.0 Clock Sources ........................................................................................................................................................................... 21 4.0 I/O Ports .................................................................................................................................................................................... 33 5.0 Timer0 Module .......................................................................................................................................................................... 45 6.0 Timer1 Module with Gate Control.............................................................................................................................................. 49 7.0 Comparator Module................................................................................................................................................................... 55 8.0 Analog-to-Digital Converter (A/D) Module ................................................................................................................................. 65 9.0 Data EEPROM and Flash Program Memory Control ................................................................................................................ 77 10.0 Enhanced Universal Asynchronous Receiver Transmitter (EUSART) ...................................................................................... 83 11 ...
Page 7
... DEVICE OVERVIEW The PIC16F688 is covered by this data sheet available in 14-pin PDIP, SOIC, TSSOP and QFN packages. Figure 1-1 shows a block diagram of the PIC16F688 device. Table 1-1 shows the pinout description. FIGURE 1-1: PIC16F688 BLOCK DIAGRAM Configuration Flash Program Memory Program ...
Page 8
... PIC16F688 TABLE 1-1: PIC16F688 PINOUT DESCRIPTION Name Function RA0/AN0/C1IN+/ICSPDAT/ULPWU RA0 AN0 C1IN+ ICSPDAT ULPWU RA1/AN1/C1IN-/V /ICSPCLK RA1 REF AN1 C1IN- V ICSPCLK RA2/AN2/T0CKI/INT/C1OUT RA2 AN2 T0CKI INT C1OUT RA3/MCLR/V RA3 PP MCLR V RA4/AN3/T1G/OSC2/CLKOUT RA4 AN3 T1G OSC2 CLKOUT RA5/T1CKI/OSC1/CLKIN RA5 T1CKI OSC1 ...
Page 9
... Program Memory Organization The PIC16F688 has a 13-bit program counter capable of addressing program memory space. Only the first (0000h-01FFF) for the PIC16F688 is physically implemented. Accessing a location above these boundaries will cause a wrap-around within the first space. The Reset vector is at 0000h and the interrupt vector is at 0004h (see Figure 2-1) ...
Page 10
... PIC16F688 FIGURE 2-2: PIC16F688 SPECIAL FUNCTION REGISTERS File Address (1) Indirect addr. 00h Indirect addr. TMR0 01h OPTION_REG 81h PCL 02h PCL STATUS 03h STATUS FSR 04h FSR PORTA 05h TRISA 06h PORTC 07h TRISC 08h 09h PCLATH 0Ah PCLATH INTCON 0Bh ...
Page 11
... TABLE 2-1: PIC16F688 SPECIAL REGISTERS SUMMARY BANK 0 Addr Name Bit 7 Bit 6 Bank 0 00h INDF Addressing this location uses contents of FSR to address data memory (not a physical register) 01h TMR0 Timer0 Module’s register 02h PCL Program Counter’s (PC) Least Significant Byte 03h ...
Page 12
... PIC16F688 TABLE 2-2: PIC16F688 SPECIAL FUNCTION REGISTERS SUMMARY BANK 1 Addr Name Bit 7 Bit 6 Bank 1 80h INDF Addressing this location uses contents of FSR to address data memory (not a physical register) 81h OPTION_REG RAPU INTEDG 82h PCL Program Counter’s (PC) Least Significant Byte 83h ...
Page 13
... TABLE 2-3: PIC16F688 SPECIAL REGISTERS SUMMARY BANK 2 Addr Name Bit 7 Bit 6 Bank 2 100h INDF Addressing this location uses contents of FSR to address data memory (not a physical register) 101h TMR0 Timer0 Module’s register 102h PCL Program Counter’s (PC) Least Significant Byte 103h ...
Page 14
... PIC16F688 TABLE 2-4: PIC16F688 SPECIAL FUNCTION REGISTERS SUMMARY BANK 3 Addr Name Bit 7 Bit 6 Bank 3 180h INDF Addressing this location uses contents of FSR to address data memory (not a physical register) 181h OPTION_REG RAPU INTEDG 182h PCL Program Counter’s (PC) Least Significant Byte 183h ...
Page 15
... Set Summary”). Note 1: The C and DC bits operate as a Borrow and Digit Borrow out bit, respectively, in subtraction. R-1 R-1 R/W Unimplemented bit, read as ‘0’ ‘0’ = Bit is cleared (1) (1) PIC16F688 bits (see Section 12.0 R/W-x R/W-x (1) ( bit Bit is unknown DS41203E-page 13 ...
Page 16
... PIC16F688 2.2.2.2 OPTION Register The OPTION register is a readable and writable register, which contains various control bits to configure: • Timer0/WDT prescaler • External RA2/INT interrupt • Timer0 • Weak pull-ups on PORTA REGISTER 2-2: OPTION_REG: OPTION REGISTER R/W-1 R/W-1 R/W-1 RAPU INTEDG ...
Page 17
... GIE of the INTCON register. 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 INTE RAIE T0IF U = Unimplemented bit, read as ‘0’ ‘0’ = Bit is cleared (1) (2) PIC16F688 R/W-0 R/W-x INTF RAIF bit Bit is unknown DS41203E-page 15 ...
Page 18
... PIC16F688 2.2.2.4 PIE1 Register The PIE1 register contains the interrupt enable bits, as shown in Register 2-4. REGISTER 2-4: PIE1: PERIPHERAL INTERRUPT ENABLE REGISTER 1 R/W-0 R/W-0 R/W-0 EEIE ADIE RCIE bit 7 Legend Readable bit W = Writable bit -n = Value at POR ‘1’ = Bit is set bit 7 ...
Page 19
... GIE bit of the INTCON register. 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 C2IF C1IF OSFIF U = Unimplemented bit, read as ‘0’ ‘0’ = Bit is cleared PIC16F688 R-0 R/W-0 TXIF TMR1IF bit Bit is unknown DS41203E-page 17 ...
Page 20
... PIC16F688 2.2.2.6 PCON Register The Power Control (PCON) register (see Register 2-6) contains flag bits to differentiate between a: • Power-on Reset (POR) • Brown-out Reset (BOR) • Watchdog Timer Reset (WDT) • External MCLR Reset The PCON register also controls the Ultra Low-Power Wake-up and software enable of the BOR ...
Page 21
... Table Read” (DS00556). © 2009 Microchip Technology Inc. 2.3.2 STACK The PIC16F688 family has an 8-level x 13-bit wide hardware stack (see Figure 2-1). The stack space is not part of either program or data space and the Stack Pointer is not readable or writable. The PC is PUSHed onto the stack when a CALL instruction is executed or an interrupt causes a branch ...
Page 22
... Writing to the INDF register indirectly results operation (although Status bits may be affected). An effective 9-bit address is obtained by concatenating the 8-bit FSR register and the IRP bit of the STATUS register, as shown in Figure 2-4. FIGURE 2-4: DIRECT/INDIRECT ADDRESSING PIC16F688 Direct Addressing From Opcode RP1 RP0 6 ...
Page 23
... MHz 111 INTOSC 4 MHz 110 2 MHz 101 1 MHz 100 500 kHz 011 250 kHz 010 125 kHz 001 31 kHz 000 Power-up Timer (PWRT) Watchdog Timer (WDT) Fail-Safe Clock Monitor (FSCM) PIC16F688 /4 output OSC FOSC<2:0> SCS<0> System Clock (CPU and Peripherals) DS41203E-page 21 ...
Page 24
... PIC16F688 3.2 Oscillator Control The Oscillator Control (OSCCON) register (Figure 3-1) controls the system clock and frequency selection options. The OSCCON register contains the following bits: • Frequency selection bits (IRCF) • Frequency Status bits (HTS, LTS) • System clock control bits (OSTS, SCS) ...
Page 25
... Upon restarting the external clock, the device will resume operation time had elapsed. © 2009 Microchip Technology Inc. PIC16F688 3.4 External Clock Modes 3.4.1 OSCILLATOR START-UP TIMER (OST) ...
Page 26
... PIC16F688 3.4.3 LP, XT, HS MODES The LP, XT and HS modes support the use of quartz crystal resonators or ceramic resonators connected to OSC1 and OSC2 (Figure 3-3). The mode selects a low, medium or high gain setting of the internal inverter- amplifier to support various resonator types and speed. LP Oscillator mode selects the lowest gain setting of the internal inverter-amplifier ...
Page 27
... System Clock Source (SCS) bit of the OSCCON register to ‘1’ or enable Two-Speed Start-up by setting the IESO bit in the Configuration Word register (CONFIG) to ‘1’. The HF Internal Oscillator (HTS) bit of the OSCCON register indicates whether the HFINTOSC is stable or not. PIC16F688 (High-Frequency Internal (Low-Frequency Internal See Section 11.0 “ ...
Page 28
... PIC16F688 3.5.2.1 OSCTUNE Register The HFINTOSC is factory calibrated but can be adjusted in software by writing to the OSCTUNE register (Register 3-2). The default value of the OSCTUNE register is ‘0’. The value is a 5-bit two’s complement number. REGISTER 3-2: OSCTUNE: OSCILLATOR TUNING REGISTER U-0 ...
Page 29
... 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. © 2009 Microchip Technology Inc. PIC16F688 3.5.5 HF AND LF INTOSC CLOCK SWITCH TIMING When switching between the LFINTOSC and the HFINTOSC, the new oscillator may already be shut down to save power (see Figure 3-6) ...
Page 30
... PIC16F688 FIGURE 3-6: INTERNAL OSCILLATOR SWITCH TIMING ( HFINTOSC LFINTOSC (FSCM and WDT disabled) HFINTOSC LFINTOSC ≠ 0 IRCF <2:0> System Clock Note 1: When going from LF to HF. HFINTOSC LFINTOSC (Either FSCM or WDT enabled) HFINTOSC LFINTOSC ≠ IRCF <2:0> System Clock LFINTOSC HFINTOSC LFINTOSC ...
Page 31
... OSTS bit of the OSCCON register to remain clear. © 2009 Microchip Technology Inc. PIC16F688 When the oscillator module is configured for LP modes, the Oscillator Start-up Timer (OST) is enabled (see Section 3.4.1 “Oscillator Start-up Timer (OST)”). The OST will suspend program execution until 1024 oscillations are counted ...
Page 32
... PIC16F688 3.7.3 CHECKING TWO-SPEED CLOCK STATUS Checking the state of the OSTS bit of the OSCCON 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 register (CONFIG), or the internal oscillator. FIGURE 3-7: TWO-SPEED START-UP ...
Page 33
... Fail-Safe circuit is not active Clock during oscillator start-up (i.e., after exiting Failure Detected Reset or Sleep). After an appropriate amount of time, the user should check the OSTS bit of the OSCCON register to verify the oscillator start-up and that the system clock completed. PIC16F688 switchover has successfully DS41203E-page 31 ...
Page 34
... PIC16F688 FIGURE 3-9: FSCM TIMING DIAGRAM Sample Clock System Clock Output Clock Monitor Output (Q) OSCFIF Note: The system clock is normally at a much higher frequency than the sample clock. The relative frequencies in this example have been chosen for clarity. TABLE 3-2: SUMMARY OF REGISTERS ASSOCIATED WITH CLOCK SOURCES ...
Page 35
... U = Unimplemented bit, read as ‘0’ ‘0’ = Bit is cleared R/W-1 R-1 R/W-1 TRISA4 TRISA3 TRISA2 U = Unimplemented bit, read as ‘0’ ‘0’ = Bit is cleared PIC16F688 ; ;Init PORTA ;Set RA<2:0> to ;digital I/O ; ;digital I/O ;Set RA<3:2> as inputs ;and set RA<5:4,1:0> ;as outputs R/W-0 ...
Page 36
... PIC16F688 4.2 Additional Pin Functions Every PORTA pin on the PIC16F688 has an interrupt- on-change option and a weak pull-up option. PORTA also provides an Ultra Low-Power Wake-up option. The next three sections describe these functions. 4.2.1 ANSEL REGISTER The ANSEL register is used to configure the Input mode of an I/O pin to analog ...
Page 37
... WPUA2 U = Unimplemented bit, read as ‘0’ ‘0’ = Bit is cleared R/W-0 R/W-0 R/W-0 IOCA4 IOCA3 IOCA2 U = Unimplemented bit, read as ‘0’ ‘0’ = Bit is cleared PIC16F688 R/W-1 R/W-1 WPUA1 WPUA0 bit Bit is unknown R/W-0 R/W-0 IOCA1 IOCA0 bit Bit is unknown ...
Page 38
... PIC16F688 4.2.4 ULTRA LOW-POWER WAKE-UP The Ultra Low-Power Wake-up (ULPWU) on RA0 allows a slow falling voltage to generate an interrupt- on-change on RA0 without excess current consump- tion. The mode is selected by setting the ULPWUE bit of the PCON register. This enables a small current sink which can be used to discharge a capacitor on RA0. ...
Page 39
... A/D • an analog input to the comparator • an analog input to the Ultra Low-Power Wake-up • In-Circuit Serial Programming™ data (1) Analog Input Mode V DD Weak RAPU - + ULP 0 1 (1) Analog Vss Input Mode ULPWUE PORTA PIC16F688 V DD I/O PIN V SS DS41203E-page 37 ...
Page 40
... PIC16F688 4.2.5.2 RA1/AN1/C1IN-/V /ICSPCLK REF Figure 4-2 shows the diagram for this pin. The RA1 pin is configurable to function as one of the following: • a general purpose I/O • an analog input for the A/D • an analog input to the comparator • a voltage reference input for the A/D • ...
Page 41
... TRISA RD TRISA RD PORTA IOCA RD IOCA Interrupt-on- change To T1G To A/D Converter Note 1: CLK modes are XT, HS, LP, LPTMR1 and CLKOUT Enable. 2: With CLKOUT option. 3: Analog Input mode is ANSEL. PIC16F688 BLOCK DIAGRAM OF RA4 (3) Analog Input Mode (1) CLK Modes Weak RAPU Oscillator Circuit OSC1 V DD ...
Page 42
... PIC16F688 4.2.5.6 RA5/T1CKI/OSC1/CLKIN Figure 4-6 shows the diagram for this pin. The RA5 pin is configurable to function as one of the following: • a general purpose I/O • a Timer1 clock input • a crystal/resonator connection • a clock input DS41203E-page 40 FIGURE 4-6: BLOCK DIAGRAM OF RA5 INTOSC Mode ...
Page 43
... PSA PS2 PS1 RA4 RA3 RA2 RA1 TRISA4 TRISA3 TRISA2 TRISA1 TRISA0 WPUA4 — WPUA2 WPUA1 WPUA0 PIC16F688 Value on Value on Bit 0 all other POR, BOR Resets ANS0 1111 1111 1111 1111 CM0 0000 0000 0000 0000 BOR --01 --qq --0u --uu RAIF 0000 000x ...
Page 44
... PIC16F688 4.3 PORTC PORTC is a general purpose I/O port consisting of 6 bidirectional pins. The pins can be configured for either digital I/O or analog input to A/D converter or compara- tor. For specific information about individual functions such as the EUSART or the A/D converter, refer to the appropriate section in this data sheet ...
Page 45
... I/O • an analog input for the A/D Converter FIGURE 4-8: Data Bus PORTC I/O Pin Q TRISC TRISC RD PORTC To A/D Converter Note 1: Analog Input mode comes from ANSEL. PIC16F688 BLOCK DIAGRAM OF RC2 AND RC3 V DD I/O Pin V SS Analog Input (1) Mode DS41203E-page 43 ...
Page 46
... PIC16F688 4.3.5 RC4/C2OUT/TX/CK Figure 4-9 shows the diagram for this pin. The RC4 is configurable to function as one of the following: • a general purpose I/O • a digital output from the comparator • a digital I/O for the EUSART FIGURE 4-9: BLOCK DIAGRAM OF RC4 (1) USART Select ...
Page 47
... The incrementing edge is determined by the T0SE bit of the OPTION register. Counter mode is selected by setting the T0CS bit of the OPTION register to ‘1’. 8-bit Prescaler PSA 8 PS<2:0> 16-bit 16 PSA WDTPS<3:0> PIC16F688 Data Bus 8 1 Sync TMR0 2 Tcy 0 Set Flag bit T0IF on Overflow 1 WDT ...
Page 48
... PIC16F688 5.1.3 SOFTWARE PROGRAMMABLE PRESCALER A single software programmable prescaler is available for use with either Timer0 or the Watchdog Timer (WDT), but not both simultaneously. The prescaler assignment is controlled by the PSA bit of the OPTION register. To assign the prescaler to Timer0, the PSA bit must be cleared to a ‘0’. ...
Page 49
... Bit 4 Bit 3 Bit 2 Bit 1 INTE RAIE T0IF INTF T0SE PSA PS2 PS1 PIC16F688 R/W-1 R/W-1 PS2 PS1 PS0 bit Bit is unknown Value on Value on Bit 0 all other POR, BOR Resets xxxx xxxx uuuu uuuu RAIF 0000 000x 0000 000x ...
Page 50
... PIC16F688 6.0 TIMER1 MODULE WITH GATE CONTROL The Timer1 module is a 16-bit timer/counter with the following features: • 16-bit timer/counter register pair (TMR1H:TMR1L) • Programmable internal or external clock source • 3-bit prescaler • Optional LP oscillator • Synchronous or asynchronous operation • Timer1 gate (count enable) via comparator or T1G pin • ...
Page 51
... 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. © 2009 Microchip Technology Inc. PIC16F688 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. The timer continues to increment asynchronous to the internal phase clocks ...
Page 52
... PIC16F688 6.7 Timer1 Interrupt The Timer1 register pair (TMR1H:TMR1L) increments to FFFFh and rolls over to 0000h. When Timer1 rolls over, the Timer1 interrupt flag bit of the PIR1 register is set. To enable the interrupt on rollover, you must set these bits: • Timer1 interrupt enable bit of the PIE1 register • ...
Page 53
... TMR1GE bit must be set to use either T1G pin or C2OUT, as selected by the T1GSS bit of the CM2CON1 register Timer1 gate source. © 2009 Microchip Technology Inc. R/W-0 R/W-0 R/W-0 T1CKPS0 T1OSCEN T1SYNC U = Unimplemented bit, read as ‘0’ ‘0’ = Bit is cleared (1) (2) /4) PIC16F688 R/W-0 R/W-0 TMR1CS TMR1ON bit Bit is unknown DS41203E-page 51 ...
Page 54
... PIC16F688 TABLE 6-1: SUMMARY OF REGISTERS ASSOCIATED WITH TIMER1 Name Bit 7 Bit 6 Bit 5 CMCON1 — — — INTCON GIE PEIE T0IE PIE1 EEIE ADIE RCIE PIR1 EEIF ADIF RCIF TMR1H Holding Register for the Most Significant Byte of the 16-bit TMR1 Register TMR1L ...
Page 55
... Output synchronization to Timer1 clock input • Programmable voltage reference Note: Only Comparator C2 can be linked to Timer1. © 2009 Microchip Technology Inc. PIC16F688 7.1 Comparator Overview A comparator is shown in Figure 7-1 along with the relationship between the analog input levels and the digital output. When the analog voltage at V ...
Page 56
... PIC16F688 FIGURE 7-2: COMPARATOR C1 OUTPUT BLOCK DIAGRAM C1INV C1 Note 1: Q1 and Q3 are phases of the four-phase system clock ( held high during Sleep mode. FIGURE 7-3: COMPARATOR C2 OUTPUT BLOCK DIAGRAM C2INV C2 Note 1: Comparator output is latched on falling edge of Timer1 clock source and Q3 are phases of the four-phase system clock ( held high during Sleep mode ...
Page 57
... Pins configured as digital inputs will convert as an analog input, according to the input specification. and V . The SS and Analog levels on any pin defined as a digital input, may cause the input buffer to consume more current than is specified ≈ 0. LEAKAGE ≈ 0. ±500 nA Vss PIC16F688 To ADC Input DS41203E-page 55 ...
Page 58
... PIC16F688 7.2 Comparator Configuration There are eight modes of operation for the comparator. The CM<2:0> bits of the CMCON0 register are used to select these modes as shown in Figure 7-5. I/O lines change as a function of the mode and are designated as follows: • Analog function (A): digital input buffer is disabled • ...
Page 59
... CM<2:0> = 110 A C1IN- C1OUT C1 D C1OUT(pin) A C2IN- C2OUT C2 A C2IN+ D C2OUT(pin) CV Module REF Comparators Off (Lowest Power) CM<2:0> = 111 I/O C1IN- C1OUT I/O C1IN+ I/O C2IN- C2OUT I/O C2IN+ CIS = Comparator Input Switch (CMCON0<3> Comparator Digital Output PIC16F688 C1OUT C2OUT (1) Off C2OUT C2 V ...
Page 60
... PIC16F688 7.3 Comparator Control The CMCON0 register (Register 7-1) provides access to the following comparator features: • Mode selection • Output state • Output polarity • Input switch 7.3.1 COMPARATOR OUTPUT STATE Each comparator state can always be read internally via the associated CxOUT bit of the CMCON0 register. ...
Page 61
... See the Comparator and Voltage Reference specifications in Section 14.0 “Electrical Specifications” for more details. © 2009 Microchip Technology Inc. PIC16F688 7.5 Comparator Interrupt Operation The comparator interrupt flag is set whenever there is a change in the output value of the comparator. ...
Page 62
... PIC16F688 FIGURE 7-6: COMPARATOR INTERRUPT TIMING W/O CMCON0 READ OUT Set CMIF (level) CMIF FIGURE 7-7: COMPARATOR INTERRUPT TIMING WITH CMCON0 READ OUT Set CMIF (level) CMIF cleared by CMCON0 read reset by software Note change in the CM1CON0 register (CxOUT) occurs when a read operation is ...
Page 63
... Two common reference comparators with outputs 111 = Comparators off. CxIN pins are configured as digital I/O © 2009 Microchip Technology Inc. R/W-0 R/W-0 R/W-0 C1INV CIS CM2 U = Unimplemented bit, read as ‘0’ ‘0’ = Bit is cleared - PIC16F688 R/W-0 R/W-0 CM1 CM0 bit Bit is unknown DS41203E-page 61 ...
Page 64
... PIC16F688 7.8 Comparator C2 Gating Timer1 This feature can be used to time the duration or interval of analog events. Clearing the T1GSS bit of the CMCON1 register will enable Timer1 to increment based on the output of Comparator C2. This requires that Timer1 is on and gating is enabled. See Section 6.0 “Timer1 Module with Gate Control” for details ...
Page 65
... Voltage Reference can be found in Section 14.0 “Electrical Specifications”. U-0 R/W-0 R/W-0 — VR3 U = Unimplemented bit, read as ‘0’ ‘0’ = Bit is cleared drain and REF SS = (VR<3:0>/24 (VR<3:0>/32 PIC16F688 CV OUTPUT VOLTAGE REF × = (VR<3:0>/24 × (VR<3:0> V /32 / cannot be realized due to SS ...
Page 66
... PIC16F688 FIGURE 7-8: COMPARATOR VOLTAGE REFERENCE BLOCK DIAGRAM 16-1 Analog MUX VREN REF Comparator 2 Input 1 0 (1) VR<3:0> TABLE 7-2: SUMMARY OF REGISTERS ASSOCIATED WITH THE COMPARATOR AND VOLTAGE REFERENCE MODULES Name Bit 7 Bit 6 Bit 5 ANSEL ANS7 ANS6 ANS5 CMCON0 C2OUT C1OUT C2INV CMCON1 — ...
Page 67
... REF RA2/AN2 RA4/AN3 RC0/AN4 RC1/AN5 RC2/AN6 RC3/AN7 © 2009 Microchip Technology Inc. (ADC) allows V DD VCFG = 0 V REF VCFG = 1 000 001 A/D 010 GO/DONE 011 100 ADFM 101 110 ADON 111 V SS CHS PIC16F688 Left Justify 1 = Right Justify 10 ADRESH ADRESL DS41203E-page 65 ...
Page 68
... PIC16F688 8.1 ADC Configuration When configuring and using the ADC the following functions must be considered: • Port configuration • Channel selection • ADC voltage reference selection • ADC conversion clock source • Interrupt control • Results formatting 8.1.1 PORT CONFIGURATION The ADC can be used to convert both analog and digital signals ...
Page 69
... ADRESH and ADRESL registers are loaded, GO bit is cleared, ADIF bit is set, Holding capacitor is connected to analog input PIC16F688 ) OSC 4 MHz 1 MHz (2) 2.0 μs 500 ns 1.0 μs (2) 4.0 μs 2.0 μs 8.0 μs (3) 4.0 μs 16.0 μs (3) 8.0 μs 32.0 μs (3) (3) 16.0 μs 64.0 μ ...
Page 70
... PIC16F688 8.1.5 INTERRUPTS The ADC module allows for the ability to generate an interrupt upon completion of an Analog-to-Digital Conversion. The ADC interrupt flag is the ADIF bit in the PIR1 register. The ADC interrupt enable is the ADIE bit in the PIE1 register. The ADIF bit must be cleared in software ...
Page 71
... SLEEP instruction causes the present conver- RC sion to be aborted and the ADC module is turned off, although the ADON bit remains set. © 2009 Microchip Technology Inc. PIC16F688 8.2.5 A/D CONVERSION PROCEDURE This is an example procedure for using the ADC to perform an Analog-to-Digital Conversion: 1 ...
Page 72
... PIC16F688 EXAMPLE 8-1: A/D CONVERSION ;This code block configures the ADC ;for polling, Vdd reference, Frc clock ;and AN0 input. ; ;Conversion start & polling for completion ; are included. ; BANKSEL ADCON1 ; MOVLW B’01110000’ ;ADC Frc clock MOVWF ADCON1 ; BANKSEL TRISA ; BSF TRISA,0 ...
Page 73
... CHS1 CHS0 U = Unimplemented bit, read as ‘0’ ‘0’ = Bit is cleared R/W-0 U-0 U-0 ADCS0 — — Unimplemented bit, read as ‘0’ ‘0’ = Bit is cleared PIC16F688 R/W-0 R/W-0 GO/DONE ADON bit Bit is unknown U-0 U-0 — — bit Bit is unknown ...
Page 74
... PIC16F688 REGISTER 8-3: ADRESH: ADC RESULT REGISTER HIGH (ADRESH) ADFM = 0 R/W-x R/W-x R/W-x ADRES9 ADRES8 ADRES7 bit 7 Legend Readable bit W = Writable bit -n = Value at POR ‘1’ = Bit is set bit 7-0 ADRES<9:2>: ADC Result Register bits Upper 8 bits of 10-bit conversion result REGISTER 8-4: ...
Page 75
... Ω Ω 10k ln(0.0004885 0. 50°C- 25°C /°C ΜS ) has no effect on the equation, since it cancels itself out not discharged after each conversion. HOLD PIC16F688 Ω 5. Temperature Coefficient charged to within 1/2 lsb CHOLD charge response to V CHOLD APPLIED DS41203E-page 73 ...
Page 76
... PIC16F688 FIGURE 8-4: ANALOG INPUT MODEL ANx Rs C PIN Legend Input Capacitance PIN V = Threshold Voltage Leakage current at the pin due to LEAKAGE various junctions R = Interconnect Resistance Sampling Switch C = Sample/Hold Capacitance HOLD FIGURE 8-5: ADC TRANSFER FUNCTION 3FFh 3FEh 3FDh 3FCh 3FBh 004h ...
Page 77
... TXIF RA4 RA3 RA2 RA1 RC4 RC3 RC2 RC1 TRISA4 TRISA3 TRISA2 TRISA1 TRISC4 TRISC3 TRISC2 TRISC1 PIC16F688 Value on Value on Bit 0 all other POR, BOR Resets ADON 00-0 0000 00-0 0000 — -000 ---- -000 ---- ANS0 1111 1111 1111 1111 xxxx xxxx ...
Page 78
... PIC16F688 NOTES: DS41203E-page 76 © 2009 Microchip Technology Inc. ...
Page 79
... EEPROM memory and read the program memory. When code-protected, the device programmer can no longer access data or program memory. © 2009 Microchip Technology Inc. PIC16F688 9.1 EEADR and EEADRH Registers The EEADR and EEADRH registers can address maximum of 256 bytes of data EEPROM maximum of 4K words of program EEPROM ...
Page 80
... PIC16F688 REGISTER 9-1: EEDAT: EEPROM DATA REGISTER R/W-0 R/W-0 R/W-0 EEDAT7 EEDAT6 EEDAT5 bit 7 Legend Readable bit W = Writable bit -n = Value at POR ‘1’ = Bit is set bit 7-0 EEDATn: Byte Value to Write to or Read from Data EEPROM bits REGISTER 9-2: EEADR: EEPROM ADDRESS REGISTER ...
Page 81
... 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 © 2009 Microchip Technology Inc. U-0 R/W-x R/W-0 — WRERR WREN U = Unimplemented bit, read as ‘0’ ‘0’ = Bit is cleared PIC16F688 R/S-0 R/S bit Bit is unknown DS41203E-page 79 ...
Page 82
... PIC16F688 9.1.2 READING THE DATA EEPROM MEMORY To read a data memory location, the user must write the address to the EEADR register, clear the EEPGD control bit of the EECON1 register, and then set control bit RD of the EECON1 register. The data is available in the very next cycle, in the EEDAT register; therefore, it can be read in the next instruction ...
Page 83
... Byte of Program Address to read ; ;Point to PROGRAM memory ;EE Read ;First instruction after BSF EECON1,RD executes normally ;Any instructions here are ignored as program ;memory is read in second cycle after BSF EECON1, Byte of Program Memory ; ; Byte of Program EEDAT ; ;Bank 0 PIC16F688 instruction on the next DS41203E-page 81 ...
Page 84
... PIC16F688 FIGURE 9-1: FLASH PROGRAM MEMORY READ CYCLE EXECUTION Flash ADDR Flash Data INSTR (PC) INSTR( BSF EECON1,RD executed here executed here RD bit EEDATH EEDAT Register EERHLT TABLE 9-1: SUMMARY OF REGISTERS ASSOCIATED WITH DATA EEPROM Name Bit 7 Bit 6 Bit 5 EECON1 EEPGD — ...
Page 85
... Block diagrams of the EUSART transmitter and receiver are shown in Figure 10-1 and Figure 10-2. Data Bus TXREG Register 8 MSb (8) • • • Transmit Shift Register (TSR) TRMT TX9 x16 x64 TX9D PIC16F688 TXIE Interrupt TXIF TX/CK pin LSb Pin Buffer 0 and Control SPEN DS41203E-page 83 ...
Page 86
... PIC16F688 FIGURE 10-2: EUSART RECEIVE BLOCK DIAGRAM SPEN RX/DT pin Pin Buffer and Control Baud Rate Generator BRG16 + 1 Multiplier SYNC SPBRGH SPBRG BRGH BRG16 The operation of the EUSART module is controlled through three registers: • Transmit Status and Control (TXSTA) • Receive Status and Control (RCSTA) • ...
Page 87
... To use interrupts when transmitting data, set the TXIE bit only when there is more data to send. Clear the TXIE interrupt enable bit upon writing the last character of the transmission to the TXREG. EUSART and PIC16F688 Transmitting Data immediately following the Stop bit Transmit Interrupt Flag DS41203E-page 85 ...
Page 88
... PIC16F688 10.1.1.4 TSR Status The TRMT bit of the TXSTA register indicates the status of the TSR register. This is a read-only bit. The TRMT bit is set when the TSR register is empty and is cleared when a character is transferred to the TSR register from the TXREG. The TRMT bit remains clear until all bits have been shifted out of the TSR register ...
Page 89
... BRG4 BRG3 BRG2 BRG1 BRG12 BRG11 BRG10 BRG9 TRISC4 TRISC3 TRISC2 TRISC1 SYNC SENDB BRGH TRMT PIC16F688 Value on Value on Bit 0 all other POR, BOR Resets ABDEN 01-0 0-00 01-0 0-00 0000 000x 0000 000x RAIF TMR1IE 0000 0000 0000 0000 0000 0000 ...
Page 90
... PIC16F688 10.1.2 EUSART ASYNCHRONOUS RECEIVER The Asynchronous mode would typically be used in RS-232 systems. The receiver block diagram is shown in Figure 10-2. The data is received on the RX/DT pin and drives the data recovery block. The data recovery block is actually a high-speed shifter operating at 16 times the baud rate, whereas the serial Receive Shift Register (RSR) operates at the bit rate ...
Page 91
... FIFO buffer, the RX9D data bit must be read before reading the 8 Least Significant bits from the RCREG. © 2009 Microchip Technology Inc. PIC16F688 10.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 92
... PIC16F688 10.1.2.8 Asynchronous Reception Set-up: 1. Initialize the SPBRGH, SPBRG register pair and the BRGH and BRG16 bits to achieve the desired baud rate (see Section 10.3 “EUSART Baud Rate Generator (BRG)”). 2. Enable the serial port by setting the SPEN bit. The SYNC bit must be clear for asynchronous operation ...
Page 93
... BRG4 BRG3 BRG2 BRG1 BRG12 BRG11 BRG10 BRG9 TRISC4 TRISC3 TRISC2 TRISC1 SYNC SENDB BRGH TRMT PIC16F688 Value on Value on Bit 0 all other POR, BOR Resets ABDEN 01-0 0-00 01-0 0-00 0000 000x 0000 000x RAIF TMR1IE 0000 0000 0000 0000 0000 0000 ...
Page 94
... PIC16F688 10.2 Clock Accuracy with Asynchronous Operation The factory calibrates the internal oscillator block output (INTOSC). However, the INTOSC frequency may drift temperature changes, and this DD directly affects the asynchronous baud rate. Two methods may be used to adjust the baud rate clock, but both require a reference clock source of some kind ...
Page 95
... This can be address/data bit or a parity bit and must be calculated by user firmware. © 2009 Microchip Technology Inc. R/W-0 R/W-0 R-0 CREN ADDEN FERR U = Unimplemented bit, read as ‘0’ ‘0’ = Bit is cleared PIC16F688 (1) R-0 R-x OERR RX9D bit Bit is unknown DS41203E-page 93 ...
Page 96
... PIC16F688 REGISTER 10-3: BAUDCTL: BAUD RATE CONTROL REGISTER R-0 R-1 U-0 ABDOVF RCIDL — bit 7 Legend Readable bit W = Writable bit -n = Value at POR ‘1’ = Bit is set bit 7 ABDOVF: Auto-Baud Detect Overflow bit Asynchronous mode Auto-baud timer overflowed 0 = Auto-baud timer did not overflow Synchronous mode: Don’ ...
Page 97
... Bit 3 Bit 2 Bit 1 SCKP BRG16 — WUE CREN ADDEN FERR OERR BRG4 BRG3 BRG2 BRG1 BRG12 BRG11 BRG10 BRG9 SYNC SENDB BRGH TRMT PIC16F688 CALCULATING BAUD RATE ERROR of 16 MHz, desired baud rate OSC -------------------------------------------------------------------- - ( ) 64 [SPBRGH:SPBRG -------------------------------------------- - Desired Baud Rate X = --------------------------------------------- 1 – 64 16000000 ...
Page 98
... PIC16F688 TABLE 10-5: BAUD RATES FOR ASYNCHRONOUS MODES F = 20.000 MHz OSC BAUD SPBRG RATE Actual % Actual value Rate Error (decimal) 300 — — — 1200 1221 1.73 255 2400 2404 0.16 129 9600 9470 -1.36 32 10417 10417 0.00 29 10286 19.2k 19.53k 1 ...
Page 99
... PIC16F688 F = 1.000 MHz OSC SPBRG SPBRG Actual % value value Rate Error (decimal) (decimal) — 300 0.16 207 103 1202 0. 2404 0. — ...
Page 100
... PIC16F688 TABLE 10-5: BAUD RATES FOR ASYNCHRONOUS MODES (CONTINUED) SYNC = 0, BRGH = 1, BRG16 = 1 or SYNC = 1, BRG16 = 20.000 MHz OSC BAUD SPBRG RATE Actual % Actual value Rate Error (decimal) 300 300.0 0.00 16665 1200 1200 -0.01 4166 2400 2400 0.02 2082 9600 9597 -0 ...
Page 101
... During the ABD sequence, SPBRG and SPBRGH registers are both used as a 16-bit counter, independent of BRG16 setting. Edge #1 Edge #2 Edge #3 bit 1 bit 3 Start bit 0 bit 2 bit 4 XXh XXh PIC16F688 “Auto-Wake-up on BRG COUNTER CLOCK RATES BRG Base BRG ABD Clock Clock F /64 F /512 OSC OSC ...
Page 102
... PIC16F688 10.3.2 AUTO-BAUD OVERFLOW During the course of automatic baud detection, the ABDOVF bit of the BAUDCTL register will be set if the baud rate counter overflows before the fifth rising edge is detected on the RX pin. The ABDOVF bit indicates that the counter has exceeded the maximum count that can fit in the 16 bits of the SPBRGH:SPBRG register pair ...
Page 103
... Note that following a Break character, the user will typically want to enable the Auto-Baud Detect feature. For both methods, the user can set the ABDEN bit of the BAUDCTL register before placing the EUSART in Sleep mode. PIC16F688 Auto Cleared Note 1 DS41203E-page 101 ...
Page 104
... PIC16F688 FIGURE 10-9: SEND BREAK CHARACTER SEQUENCE Write to TXREG Dummy Write BRG Output (Shift Clock) TX (pin) Start bit TXIF bit (Transmit interrupt Flag) TRMT bit (Transmit Shift Reg. Empty Flag) SENDB Sampled Here SENDB (send Break control bit) DS41203E-page 102 bit 0 ...
Page 105
... Clock polarity is selected with the SCKP bit of the BAUDCTL register. Setting the SCKP bit sets © 2009 Microchip Technology Inc. PIC16F688 the clock Idle state as high. When the SCKP bit is set, the data changes on the falling edge of each clock. Clearing the SCKP bit sets the Idle state as low. When the SCKP bit is cleared, the data changes on the rising edge of each clock ...
Page 106
... PIC16F688 FIGURE 10-10: SYNCHRONOUS TRANSMISSION RX/DT bit 0 bit 1 pin Word 1 TX/CK pin (SCKP = 0) TX/CK pin (SCKP = 1) Write to TXREG Reg Write Word 1 Write Word 2 TXIF bit (Interrupt Flag) TRMT bit ‘1’ TXEN bit Note: Sync Master mode, SPBRG = 0, continuous transmission of two 8-bit words. ...
Page 107
... 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. © 2009 Microchip Technology Inc. PIC16F688 10.4.1.8 Synchronous Master Reception Set- up: 1. Initialize the SPBRGH, SPBRG register pair for the appropriate baud rate ...
Page 108
... PIC16F688 FIGURE 10-12: SYNCHRONOUS RECEPTION (MASTER MODE, SREN) RX/DT bit 0 pin TX/CK pin (SCKP = 0) TX/CK pin (SCKP = 1) Write to bit SREN SREN bit ‘0’ CREN bit RCIF bit (Interrupt) Read RXREG Note: Timing diagram demonstrates Sync Master mode with bit SREN = 1 and bit BRGH = 0. ...
Page 109
... OERR BRG4 BRG3 BRG2 BRG1 BRG12 BRG11 BRG10 BRG9 TRISC4 TRISC3 TRISC2 TRISC1 SYNC SENDB BRGH TRMT PIC16F688 Synchronous Slave Transmission Set-up: by writing the Least Value on Value on Bit 0 all other POR, BOR Resets ABDEN 01-0 0-00 01-0 0-00 0000 000x 0000 000x ...
Page 110
... PIC16F688 10.4.2.3 EUSART Synchronous Slave Reception The operation of the Synchronous Master and Slave modes is identical (Section 10.4.1.5 “Synchronous Master Reception”), with the following exceptions: • Sleep • CREN bit is always set, therefore the receiver is never Idle • SREN bit, which is a “don’t care” in Slave mode A character may be received while in Sleep mode by setting the CREN bit prior to entering Sleep ...
Page 111
... SPECIAL FEATURES OF THE CPU The PIC16F688 has a host of features intended to maximize system reliability, minimize cost through elimination of external components, power-saving features and offer code protection. These features are: • Reset - Power-on Reset (POR) - Power-up Timer (PWRT) - Oscillator Start-up Timer (OST) - Brown-out Reset (BOR) • ...
Page 112
... PIC16F688 11.1 Configuration Bits The Configuration bits can be programmed (read as ‘0’), or left unprogrammed (read as ‘1’) to select various device configurations as shown in Register 11-1. These bits are mapped in program memory location 2007h. Note: Address 2007h is beyond the user program memory space. It belongs to the special ...
Page 113
... When MCLR is asserted in INTOSC or RC mode, the internal clock oscillator is disabled. © 2009 Microchip Technology Inc. Reserved FCMEN (4) PWRTE WDTE FOSC2 P = Programmable’ ‘0’ = Bit is cleared (1) (2) (3) DD PIC16F688 (1) (1) IESO BOREN1 BOREN0 bit 8 FOSC1 FOSC0 bit Unimplemented bit, read as ‘0’ Bit is unknown DS41203E-page 111 ...
Page 114
... PIC16F688 11.2 Reset The PIC16F688 differentiates between various kinds of Reset: a) Power-on Reset (POR) b) WDT Reset during normal operation c) WDT Reset during Sleep d) MCLR Reset during normal operation e) MCLR Reset during Sleep f) Brown-out Reset (BOR) Some registers are not affected in any Reset condition; ...
Page 115
... For additional information, refer to Application Note AN607, “Power-up Trouble Shooting” (DS00607). 11.2.2 MCLR PIC16F688 has a noise filter in the MCLR Reset path. The filter will detect and ignore small pulses. It should be noted that a WDT Reset does not drive MCLR pin low. ...
Page 116
... PIC16F688 11.2.4 BROWN-OUT RESET (BOR) The BOREN0 and BOREN1 bits in the Configuration Word register selects one of four BOR modes. Two modes have been added to allow software or hardware control of the BOR enable. When BOREN<1:0> = 01, the SBOREN bit of the PCON register enables/disables the BOR, allowing controlled in software. By selecting BOREN< ...
Page 117
... Then, bringing MCLR high will begin execution immediately (see Figure 11-5). This is useful for testing purposes or to synchronize more than one PIC16F688 device operating in parallel. Table 11-5 shows the Reset conditions for some special registers, while Table 11-4 shows the Reset conditions for all the registers ...
Page 118
... PIC16F688 FIGURE 11-4: TIME-OUT SEQUENCE ON POWER-UP (DELAYED MCLR MCLR Internal POR PWRT Time-out OST Time-out Internal Reset FIGURE 11-5: TIME-OUT SEQUENCE ON POWER-UP (DELAYED MCLR MCLR Internal POR PWRT Time-out OST Time-out Internal Reset FIGURE 11-6: TIME-OUT SEQUENCE ON POWER-UP (MCLR WITH MCLR ...
Page 119
... PIC16F688 Wake-up from Sleep through Interrupt Wake-up from Sleep through WDT Time-out uuuu uuuu uuuu uuuu uuuu uuuu ( (4) uuuq quuu uuuu uuuu ...
Page 120
... PIC16F688 TABLE 11-4: INITIALIZATION CONDITION FOR REGISTERS (CONTINUED) Power-on Register Address Reset OSCCON 8Fh -110 q000 OSCTUNE 90h ---0 0000 ANSEL 91h 1111 1111 WPUA 95h --11 -111 IOCA 96h --00 0000 EEDATH 97h --00 0000 EEADRH 98h ---- 0000 VRCON 99h 0-0- 0000 EEDAT 9Ah ...
Page 121
... Interrupts The PIC16F688 has multiple sources of interrupt: • External Interrupt RA2/INT • TMR0 Overflow Interrupt • PORTA Change Interrupts • 2 Comparator Interrupts • A/D Interrupt • Timer1 Overflow Interrupt • EEPROM Data Write Interrupt • Fail-Safe Clock Monitor Interrupt • EUSART Receive and Transmit interrupts ...
Page 122
... PIC16F688 11.3.1 RA2/INT INTERRUPT External interrupt on RA2/INT pin is edge-triggered; either rising if the INTEDG bit of the OPTION register is set, or falling if the INTEDG bit is clear. When a valid edge appears on the RA2/INT pin, the INTF bit of the INTCON register is set. This interrupt can be disabled by clearing the INTE control bit of the INTCON register ...
Page 123
... Dummy Cycle . Synchronous latency = where Bit 4 Bit 3 Bit 2 Bit 1 INTE RAIE T0IF INTF C2IE C1IE OSFIE TXIE C2IF C1IF OSFIF TXIF PIC16F688 0004h 0005h Inst (0004h) Inst (0005h) Inst (0004h) = instruction cycle time. CY Value on Value on Bit 0 all other POR, BOR Resets ...
Page 124
... Store the Status register • Execute the ISR code • Restore the Status (and Bank Select Bit register) • Restore the W register Note: The PIC16F688 normally does not require saving the PCLATH. computed GOTO’s are used in the ISR and the main code, the PCLATH must be saved and restored in the ISR ...
Page 125
... WDT. Setting the bit will enable it and clearing the bit will disable it. The PSA and PS<2:0> bits of the OPTION register have the same function as in previous versions of the PIC16F688 family of microcontrollers. See Section 5.0 “Timer0 Module” for more information. 0 From TMR0 Clock Source ...
Page 126
... PIC16F688 REGISTER 11-2: WDTCON: WATCHDOG TIMER CONTROL REGISTER U-0 U-0 U-0 — — — bit 7 Legend Readable bit W = Writable bit -n = Value at POR ‘1’ = Bit is set bit 7-5 Unimplemented: Read as ‘0’ bit 4-1 WDTPS<3:0>: Watchdog Timer Period Select bits Bit Value = Prescale Rate ...
Page 127
... SLEEP instruction, it may be possible for flag bits to become set before the SLEEP instruction completes. To determine whether a SLEEP instruction executed, test the PD bit. If the PD bit is set, the SLEEP instruction was executed as a NOP. To ensure that the WDT is cleared, a CLRWDT instruction should be executed before a SLEEP instruction. PIC16F688 DS41203E-page 125 ...
Page 128
... PIC16F688 FIGURE 11-10: WAKE-UP FROM SLEEP THROUGH INTERRUPT OSC1 (4) CLKOUT INT pin INTF flag (INTCON<1>) GIE bit (INTCON<7>) Instruction Flow Instruction Inst( Inst(PC) = Sleep Fetched Instruction Sleep Inst( Executed Note 1: XT Oscillator mode assumed 1024 T (drawing not to scale). This delay does not apply to EC and RC Oscillator modes. ...
Page 129
... PIC16F688 device. The IHH Programming debugging adapter is the only source of the ICD device. When the ICD pin on the PIC16F688 ICD device is held low, the In-Circuit Debugger functionality is enabled. This function allows simple debugging functions when used with MPLAB ICD 2. When the microcontroller has this feature enabled, some of the resources are not available for general use ...
Page 130
... PIC16F688 NOTES: DS41203E-page 128 © 2009 Microchip Technology Inc. ...
Page 131
... INSTRUCTION SET SUMMARY The PIC16F688 instruction set is highly orthogonal and is comprised of three basic categories: • Byte-oriented operations • Bit-oriented operations • Literal and control operations Each PIC16 instruction is a 14-bit word divided into an opcode, which specifies the instruction type and one or more operands, which further specify the operation of the instruction ...
Page 132
... PIC16F688 TABLE 12-2: PIC16F684 INSTRUCTION SET Mnemonic, Description Operands BYTE-ORIENTED FILE REGISTER OPERATIONS ADDWF f, d Add W and f ANDWF f, d AND W with f CLRF f Clear f CLRW – Clear W COMF f, d Complement f DECF f, d Decrement f DECFSZ f, d Decrement f, Skip if 0 INCF f, d Increment f INCFSZ ...
Page 133
... Operands: Operation: Status Affected: Description: BTFSC Syntax: k Operands: Operation: Status Affected: Description: f,d PIC16F688 Bit Clear f [ label ] BCF f,b 0 ≤ f ≤ 127 0 ≤ b ≤ → (f<b>) None Bit ‘b’ in register ‘f’ is cleared. Bit Set f [ label ] BSF f,b 0 ≤ f ≤ 127 0 ≤ ...
Page 134
... PIC16F688 BTFSS Bit Test f, Skip if Set Syntax: [ label ] BTFSS f,b 0 ≤ f ≤ 127 Operands: 0 ≤ b < 7 Operation: skip if (f<b> Status Affected: None Description: If bit ‘b’ in register ‘f’ is ‘0’, the next instruction is executed. If bit ‘b’ is ‘1’, then the next ...
Page 135
... The contents of register ‘f’ are incremented. If ‘d’ is ‘0’, the result is placed in the W register. If ‘d’ is ‘1’, the result is placed back in register ‘f’. © 2009 Microchip Technology Inc. PIC16F688 INCFSZ Increment f, Skip if 0 Syntax: [ label ] INCFSZ f,d 0 ≤ ...
Page 136
... PIC16F688 MOVF Move f Syntax: [ label ] MOVF f,d 0 ≤ f ≤ 127 Operands: d ∈ [0,1] (f) → (dest) Operation: Status Affected: Z Description: The contents of register f is moved to a destination dependent upon the status destination is W register the destination is file register f itself useful to test a file register since status flag Z is affected ...
Page 137
... This is a two-cycle instruction. Words: 1 Cycles: 2 Example: RETFIE After Interrupt PC = TOS GIE = 1 © 2009 Microchip Technology Inc. PIC16F688 RETLW Return with literal in W Syntax: [ label ] RETLW k 0 ≤ k ≤ 255 Operands: k → (W); Operation: TOS → PC Status Affected: None Description: The W register is loaded with the eight bit literal ‘ ...
Page 138
... PIC16F688 RLF Rotate Left f through Carry Syntax: [ label ] RLF f,d 0 ≤ f ≤ 127 Operands: d ∈ [0,1] Operation: See description below Status Affected: C Description: The contents of register ‘f’ are rotated one bit to the left through the Carry flag. If ‘d’ is ‘0’, the result is placed in the W register. If ‘ ...
Page 139
... If ‘d’ is ‘0’, the result is placed in the W register. If ‘d’ is ‘1’, the result is placed in register ‘f’. © 2009 Microchip Technology Inc. PIC16F688 XORLW Exclusive OR literal with W Syntax: [ label ] XORLW k 0 ≤ k ≤ 255 Operands: (W) .XOR. k → ...
Page 140
... PIC16F688 NOTES: DS41203E-page 138 © 2009 Microchip Technology Inc. ...
Page 141
... MPLAB PM3 Device Programmer - PICkit™ 2 Development Programmer • Low-Cost Demonstration and Development Boards and Evaluation Kits © 2009 Microchip Technology Inc. PIC16F688 13.1 MPLAB Integrated Development Environment Software The MPLAB IDE software brings an ease of software development previously unseen in the 8/16-bit micro- controller market ...
Page 142
... PIC16F688 13.2 MPASM Assembler The MPASM Assembler is a full-featured, universal macro assembler for all PIC MCUs. The MPASM Assembler generates relocatable object files for the MPLINK Object Linker, Intel files, MAP files to detail memory usage and symbol reference, absolute LST files that contain source lines and generated machine code and COFF files for debugging ...
Page 143
... PC via an RS-232 or USB cable. ® Flash DSCs The MPLAB PM3 has high-speed communications and optimized algorithms for quick programming of large memory devices and incorporates an SD/MMC card for file storage and secure data applications. PIC16F688 run-time development tool, TM (ICSP TM ...
Page 144
... PIC16F688 13.11 PICSTART Plus Development Programmer The PICSTART Plus Development Programmer is an easy-to-use, low-cost, prototype programmer. It connects to the PC via a COM (RS-232) port. MPLAB Integrated Development Environment software makes using the programmer simple and efficient. The PICSTART Plus Development Programmer supports most PIC devices in DIP packages pins. ...
Page 145
... This is a stress rating only and functional operation of the device at those or any other conditions above those indicated in the operation listings of this specification is not implied. Exposure above maximum rating conditions for extended periods may affect device reliability. © 2009 Microchip Technology Inc. ........................................................................... -0. )...............................................................................................................± ).........................................................................................................± – ∑ DIS PIC16F688 + 0.3V ∑ {( ∑(V – DS41203E-page 143 ...
Page 146
... PIC16F688 FIGURE 14-1: PIC16F688 VOLTAGE-FREQUENCY GRAPH, ≤ ≤ -40°C T +125°C A 5.5 5.0 4.5 4.0 3.5 3.0 2.5 2.0 0 Note 1: The shaded region indicates the permissible combinations of voltage and frequency. FIGURE 14-2: HFINTOSC FREQUENCY ACCURACY OVER DEVICE V 125 2.0 2.5 DS41203E-page 144 ...
Page 147
... DC Characteristics: PIC16F688 -I (Industrial) PIC16F688 -E (Extended) DC CHARACTERISTICS Param Sym Characteristic No. V Supply Voltage DD D001 D001C D001D D002* V RAM Data Retention DR (1) Voltage D003 V V Start Voltage to POR DD ensure internal Power-on Reset signal D004 Rise Rate to ensure VDD DD internal Power-on Reset signal * These parameters are characterized but not tested ...
Page 148
... PIC16F688 14.2 DC Characteristics: PIC16F688 -I (Industrial) PIC16F688 -E (Extended) Standard Operating Conditions (unless otherwise stated) DC CHARACTERISTICS Operating temperature Param Device Characteristics No. (1, 2) D010 Supply Current ( D011* D012 D013* D014 D015 D016* D017 D018 D019 * These parameters are characterized but not tested. † Data in “Typ” column is at 5.0V, 25°C unless otherwise stated. These parameters are for design guidance only and are not tested ...
Page 149
... DC Characteristics: PIC16F688-I (Industrial) Standard Operating Conditions (unless otherwise stated) DC CHARACTERISTICS Operating temperature Param Device Characteristics No. D020 Power-down Base (2) Current D021 D022 D023 D024 D025* D026 D027 * These parameters are characterized but not tested. † Data in “Typ” column is at 5.0V, 25°C unless otherwise stated. These parameters are for design guidance only and are not tested ...
Page 150
... PIC16F688 14.4 DC Characteristics: PIC16F688-E (Extended) Standard Operating Conditions (unless otherwise stated) DC CHARACTERISTICS Operating temperature Param Device Characteristics No. D020E Power-down Base (2) Current ( D021E D022E D023E D024E D025E* D026E D027E * These parameters are characterized but not tested. † Data in “Typ” column is at 5.0V, 25°C unless otherwise stated. These parameters are for design guidance only and are not tested ...
Page 151
... Higher leakage current may be measured at different input voltages. 4: See Section 9.0 “Data EEPROM and Flash Program Memory Control” for additional information. 5: Including OSC2 in CLKOUT mode. © 2009 Microchip Technology Inc. PIC16F688 -I (Industrial) PIC16F688 -E (Extended) Standard Operating Conditions (unless otherwise stated) -40°C ≤ T Operating temperature -40°C ≤ T Min Typ† ...
Page 152
... Higher leakage current may be measured at different input voltages. 4: See Section 9.0 “Data EEPROM and Flash Program Memory Control” for additional information. 5: Including OSC2 in CLKOUT mode. DS41203E-page 150 PIC16F688 -I (Industrial) PIC16F688 -E (Extended) (Continued) Standard Operating Conditions (unless otherwise stated) -40°C ≤ T Operating temperature -40°C ≤ T Min Typ† ...
Page 153
... PDIP package 31.0 C/W 14-pin SOIC package 31.7 C/W 14-pin TSSOP package 2.6 C/W 16-pin QFN 4x0.9mm package 150 C For derated power calculations — — INTERNAL (NOTE 1) = Σ (I — — DER (NOTE DER PIC16F688 Conditions + P / INTERNAL Σ )/θ DS41203E-page 151 ...
Page 154
... PIC16F688 14.7 Timing Parameter Symbology The timing parameter symbols have been created with one of the following formats: 1. TppS2ppS 2. TppS T F Frequency Lowercase letters (pp) and their meanings CCP1 ck CLKOUT SDI do SDO dt Data in io I/O PORT mc MCLR Uppercase letters and their meanings Fall ...
Page 155
... AC Characteristics: PIC16F688 (Industrial, Extended) FIGURE 14-4: CLOCK TIMING Q4 OSC1/CLKIN OSC2/CLKOUT (LP, XT, HS Modes) OSC2/CLKOUT (CLKOUT Mode) TABLE 14-1: CLOCK OSCILLATOR TIMING REQUIREMENTS Standard Operating Conditions (unless otherwise stated) -40°C ≤ T Operating temperature Param Sym Characteristic No. OS01 F External CLKIN Frequency OSC (1) Oscillator Frequency ...
Page 156
... PIC16F688 TABLE 14-2: OSCILLATOR PARAMETERS Standard Operating Conditions (unless otherwise stated) -40°C ≤ T Operating Temperature A Param Sym Characteristic No. OS06 T Internal Oscillator Switch WARM (3) when running OS07 T Fail-Safe Sample Clock SC (1) Period OS08 HF Internal Calibrated OSC HFINTOSC Frequency OS09* LF Internal Uncalibrated OSC ...
Page 157
... Typ† (1) — — (1) — — (1) — — ( 200 ns — OSC — — ↑ (Q2 cycle) 20 — OSC (2) — 15 — 10 (2) — 28 — — T — CY OSC PIC16F688 Execute Q3 OS12 OS18 New Value Max Units Conditions 5. 5. — 5.0V DD — 5.0V DD — 2.0V ...
Page 158
... PIC16F688 FIGURE 14-6: RESET, WATCHDOG TIMER, OSCILLATOR START-UP TIMER AND POWER-UP TIMER TIMING V DD MCLR Internal POR 33 PWRT Time-out OSC Start-Up Time (1) Internal Reset Watchdog Timer (1) Reset I/O pins Note 1: Asserted low. FIGURE 14-7: BROWN-OUT RESET TIMING AND CHARACTERISTICS BOR (Device in Brown-out Reset) ...
Page 159
... All specified values and V must be capacitively decoupled as close to the device PIC16F688 Conditions μ 5V, -40°C to +85°C DD μ 5V, -40°C to +85° ...
Page 160
... PIC16F688 FIGURE 14-8: TIMER0 AND TIMER1 EXTERNAL CLOCK TIMINGS T0CKI T1CKI TMR0 or TMR1 TABLE 14-5: TIMER0 AND TIMER1 EXTERNAL CLOCK REQUIREMENTS Standard Operating Conditions (unless otherwise stated) -40°C ≤ T ≤ +125°C Operating Temperature A Param Sym Characteristic No. 40 T0CKI High Pulse Width ...
Page 161
... Min Typ† Max — V /24 — DD — V /32 — DD ± 1/2 — — ± 1/2 — — — 2k — — — 10 PIC16F688 Max Units Comments ± 1.5)/ – 1 — dB 600 ns (NOTE 1) 1000 ns μ 1.5)/ mV. DD Units Comments ...
Page 162
... PIC16F688 TABLE 14-8: PIC16F688 A/D CONVERTER (ADC) CHARACTERISTICS Standard Operating Conditions (unless otherwise stated) -40°C ≤ T Operating temperature A Param Sym Characteristic No. AD01 N Resolution R AD02 E Integral Error IL AD03 E Differential Error DL AD04 E Offset Error OFF AD07 E Gain Error GN (1) AD06 V Reference Voltage REF ...
Page 163
... TABLE 14-9: PIC16F688 A/D CONVERSION REQUIREMENTS Standard Operating Conditions (unless otherwise stated) -40°C ≤ T Operating temperature A Param Sym Characteristic No. AD130* T A/D Clock Period AD A/D Internal RC Oscillator Period AD131 T Conversion Time CNV (not including (1) Acquisition Time) AD132* T Acquisition Time ACQ AD133* T Amplifier Settling Time ...
Page 164
... OSC Q4 A/D CLK A/D Data ADRES ADIF GO AD132 Sample Note 1: If the A/D clock source is selected as RC, a time of T SLEEP instruction to be executed. FIGURE 14-10: PIC16F688 A/D CONVERSION TIMING (SLEEP MODE) BSF ADCON0, GO AD134 ( OSC Q4 A/D CLK A/D Data ADRES ADIF GO ...
Page 165
... MHz 2 MHz 4 MHz © 2009 Microchip Technology Inc. vs. F OVER V (EC MODE) OSC DD 6 MHz 8 MHz 10 MHz 12 MHz F OSC PIC16F688 DD 5.5V 5.0V 4.0V 3.0V 2.0V 14 MHz 16 MHz 18 MHz 20 MHz DS41203E-page 163 ...
Page 166
... Microchip Technology Inc. vs. F OVER V (EC MODE) OSC DD EC Mode 6 MHz 8 MHz 10 MHz 12 MHz F OSC vs. F OVER V (HS MODE) OSC DD 4.0V 3.5V 3.0V 10 MHz 16 MHz F OSC PIC16F688 5.5V 5.0V 4.0V 3.0V 2.0V 14 MHz 16 MHz 18 MHz 20 MHz 5.5V 5,0V 4.5V 20 MHz DS41203E-page 164 ...
Page 167
... Microchip Technology Inc. vs. F OVER V (HS MODE) OSC DD 4.0V 3.5V 3.0V 10 MHz 16 MHz F OSC vs. V OVER F (XT MODE) DD OSC 4 MHz 1 MHz 3 3 (V) DD PIC16F688 5.5V 5.0V 4.5V 20 MHz 4.5 5 5.5 DS41203E-page 165 ...
Page 168
... Microchip Technology Inc. vs. V OVER F (XT MODE) DD OSC 4 MHz 1 MHz 3 3 (V) DD vs. V OVER F (EXTRC MODE) DD OSC 4 MHz 1 MHz 3 3 (V) DD PIC16F688 4.5 5 5.5 4.5 5 5.5 DS41203E-page 166 ...
Page 169
... Maximum: Mean (Worst-case Temp) + 3σ (-40°C to 125° 2.0 2.5 © 2009 Microchip Technology Inc. vs. V (EXTRC MODE MHz 1 MHz 3 3 (V) DD (LFINTOSC MODE, 31 kHz) OSC LFINTOSC Mode, 31KHZ Maximum Typical 3.0 3.5 4.0 V (V) DD PIC16F688 4.5 5 5.5 4.5 5.0 5.5 DS41203E-page 167 ...
Page 170
... Microchip Technology Inc. 32 kHz Maximum 32 kHz Typical 3 3 (V) DD vs. F OVER V (HFINTOSC MODE) OSC DD HFINTOSC 500 kHz 1 MHz 2 MHz V (V) DD PIC16F688 4.5 5 5.5 5.5V 5.0V 4.0V 3.0V 2.0V 4 MHz 8 MHz DS41203E-page 168 ...
Page 171
... Microchip Technology Inc. vs. F OVER V (HFINTOSC MODE) OSC DD 500 kHz 1 MHz 2 MHz V (V) DD vs. V (SLEEP MODE, ALL PERIPHERALS DISABLED) DD Typical (Sleep Mode all Peripherals Disabled) 3.0 3.5 4.0 V (V) DD PIC16F688 5.5V 5.0V 4.0V 3.0V 2.0V 4 MHz 8 MHz 4.5 5.0 5.5 DS41203E-page 169 ...
Page 172
... Microchip Technology Inc. vs. V (SLEEP MODE, ALL PERIPHERALS DISABLED) DD Maximum (Sleep Mode all Peripherals Disabled) Max. 125°C Max. 85°C 3.0 3.5 4.0 V (V) DD vs. V (BOTH COMPARATORS ENABLED Maximum Typical 3.0 3.5 4.0 V (V) DD PIC16F688 4.5 5.0 5.5 4.5 5.0 5.5 DS41203E-page 170 ...
Page 173
... FIGURE 15-17: TYPICAL WDT I 3.0 2.5 2.0 1.5 1.0 0.5 0.0 2.0V 2.5V © 2009 Microchip Technology Inc. OVER TEMPERATURE DD Maximum Typical 3.5 4.0 4.5 V (V) DD vs. V (25° 3.0V 3.5V 4.0V V (V) DD PIC16F688 5.0 5.5 4.5V 5.0V 5.5V DS41203E-page 171 ...
Page 174
... Microchip Technology Inc. vs. V OVER TEMPERATURE PD DD Max. 125°C Max. 85°C 3.0V 3.5V 4.0V V (V) DD OVER TEMPERATURE DD Max. (125°C) Max. (85°C) Typical Minimum 3.0 3.5 4.0 V (V) DD PIC16F688 4.5V 5.0V 5.5V 4.5 5.0 5.5 DS41203E-page 172 ...
Page 175
... Microchip Technology Inc. Vdd = 5V Maximum Typical Minimum 25°C 85°C Temperature (°C) OVER TEMPERATURE (HIGH RANGE) DD High Range Max. 125°C Max. 85°C Typical 3.0 3.5 4.0 V (V) DD PIC16F688 125°C 4.5 5.0 5.5 DS41203E-page 173 ...
Page 176
... OVER TEMPERATURE (LOW RANGE) DD Max. 125°C Max. 85°C Typical 3.0 3.5 4 3.0V) DD (VDD = 3V, -40×C TO 125×C) Typical 25°C Min. -40°C 6.5 7.0 7.5 8.0 I (mA) OL PIC16F688 4.5 5.0 5.5 Max. 125°C Max. 85°C 8.5 9.0 9.5 10.0 DS41203E-page 174 ...
Page 177
... Microchip Technology Inc. = 5.0V) DD Max. 125°C Max. 85°C Typ. 25°C Min. -40°C 6.5 7.0 7.5 8.0 8.5 I (mA 3.0V) DD -1.5 -2.0 -2.5 I (mA) OH PIC16F688 9.0 9.5 10.0 Max. -40°C Typ. 25°C Min. 125°C -3.0 -3.5 -4.0 DS41203E-page 175 ...
Page 178
... I (mA) OH vs. V OVER TEMPERATURE IN DD (TTL Input, -40×C TO 125×C) Max. -40°C Typ. 25°C Min. 125°C 3.0 3.5 4.0 4.5 V (V) DD PIC16F688 Max. -40°C Typ. 25°C Min. 125°C -4.0 -4.5 -5.0 5.0 5.5 DS41203E-page 176 ...
Page 179
... Input, -40×C TO 125×C) 3.0 3.5 4.0 V (V) DD OVER TEMPERATURE (32 kHz) DD Max. 125°C Max. 85°C Typ. 25°C 3.0 3.5 4.0 V (V) DD PIC16F688 OVER TEMPERATURE DD V Max. 125° Min. -40° Max. -40° Min. 125°C IL 4.5 5.0 5.5 4.5 5 ...
Page 180
... V- input = Transition from V 400 300 200 100 0 2.0 © 2009 Microchip Technology Inc. + 100 2.5 4 100 2.5 4.0 V (V) DD PIC16F688 Max. 125°C Max. 85°C Typ. 25°C Min. -40°C 5.5 Max. 125°C Max. 85°C Typ. 25°C Min. -40°C 5.5 DS41203E-page 178 ...
Page 181
... Typical: Statistical Mean @25°C Maximum: Mean (Worst-case Temp) + 3σ (-40°C to 125°C) 3.0 3.5 4.0 V (V) DD OVER TEMPERATURE DD Typical: Statistical Mean @25°C Maximum: Mean (Worst-case Temp) + 3σ (-40°C to 125°C) 3.0 3.5 4.0 4.5 V (V) DD PIC16F688 4.5 5.0 5.5 5.0 5.5 DS41203E-page 179 ...
Page 182
... Typical: Statistical Mean @25°C Maximum: Mean (Worst-case Temp) + 3σ (-40°C to 125°C) 3.5 4.0 4.5 V (V) DD OVER TEMPERATURE DD -40C to +85C Typical: Statistical Mean @25°C Maximum: Mean (Worst-case Temp) + 3σ (-40°C to 125°C) 3.5 4.0 4.5 V (V) DD PIC16F688 5.0 5.5 5.0 5.5 DS41203E-page 180 ...
Page 183
... Microchip Technology Inc. OVER TEMPERATURE DD -40C to +85C Typical: Statistical Mean @25°C Maximum: Mean (Worst-case Temp) + 3σ (-40°C to 125°C) 3.5 4.0 V (V) DD 3.0 3.5 4.0 4.5 V (V) DD PIC16F688 4.5 5.0 5.5 (25°C) DD 5.0 5.5 DS41203E-page 181 ...
Page 184
... TYPICAL HFINTOSC FREQUENCY CHANGE OVER DEVICE 2.0 2.5 FIGURE 15-39: TYPICAL HFINTOSC FREQUENCY CHANGE vs 2.0 2.5 © 2009 Microchip Technology Inc. 3.0 3.5 4.0 V (V) DD 3.0 3.5 4.0 4.5 V (V) DD PIC16F688 (85°C) DD 4.5 5.0 5.5 (125°C) DD 5.0 5.5 DS41203E-page 182 ...
Page 185
... FIGURE 15-40: TYPICAL HFINTOSC FREQUENCY CHANGE vs 2.0 2.5 © 2009 Microchip Technology Inc. 3.0 3.5 4.0 4.5 V (V) DD PIC16F688 (-40°C) DD 5.0 5.5 DS41203E-page 183 ...
Page 186
... NOTES: © 2009 Microchip Technology Inc. PIC16F688 DS41203E-page 184 ...
Page 187
... For PIC device marking beyond this, certain price adders apply. Please check with your Microchip Sales Office. For QTP devices, any special marking adders are included in QTP price. © 2009 Microchip Technology Inc. PIC16F688 Example PIC16F688 e 3 -I/P 0610017 Example ...
Page 188
... PIC16F688 16.2 Package Details The following sections give the technical details of the packages. /HDG 3ODVWLF 'XDO ,Q /LQH 3 ± 1RWH N NOTE 1RWHV DS41203E-page 186 PLO %RG\ >3', © 2009 Microchip Technology Inc. ...
Page 189
... A1 0.10 E 6.00 BSC E1 3.90 BSC D 8.65 BSC h 0.25 L 0.40 L1 1.04 REF φ 0° c 0.17 b 0.31 α 5° β 5° PIC16F688 h α c β MAX 14 – 1.75 – – – 0.25 – 0.50 – 1.27 – 8° – 0.25 – 0.51 – 15° ...
Page 190
... PIC16F688 1RWH DS41203E-page 188 © 2009 Microchip Technology Inc. ...
Page 191
... A2 0.80 1.00 A1 0.05 – E 6.40 BSC E1 4.30 4.40 D 4.90 5.00 L 0.45 0.60 L1 1.00 REF φ 0° – c 0.09 – b 0.19 – Microchip Technology Drawing C04-087B PIC16F688 φ L MAX 1.20 1.05 0.15 4.50 5.10 0.75 8° 0.20 0.30 DS41203E-page 189 ...
Page 192
... PIC16F688 For the most current package drawings, please see the Microchip Packaging Specification located at Note: http://www.microchip.com/packaging DS41203E-page 190 © 2009 Microchip Technology Inc. ...
Page 193
... N NOTE 1 BOTTOM VIEW A3 Units MILLIMETERS Dimension Limits MIN 0. 2.50 b 0.25 L 0.30 K 0.20 PIC16F688 NOM MAX 16 0.65 BSC 0.90 1.00 0.02 0.05 0.20 REF 4.00 BSC 2.65 2.80 4.00 BSC 2.65 2.80 0.30 0.35 0.40 0.50 – – Microchip Technology Drawing C04-127B ...
Page 194
... PIC16F688 1RWH DS41203E-page 192 © 2009 Microchip Technology Inc. ...
Page 195
... Microchip Technology Inc. PIC16F688 APPENDIX B: MIGRATING FROM OTHER PIC DEVICES This discusses some of the issues in migrating from other PIC devices to the PIC16F6XX family of devices. B.1 PIC16F676 to PIC16F688 TABLE B-1: FEATURE COMPARISON Feature PIC16F676 Max Operating Speed 20 MHz Max Program Memory 1024 ...
Page 196
... PIC16F688 NOTES: DS41203E-page 194 © 2009 Microchip Technology Inc. ...
Page 197
... EUSART Receive ....................................................... 84 EUSART Transmit ...................................................... 83 External RC Mode....................................................... 25 Fail-Safe Clock Monitor (FSCM) ................................. 31 In-Circuit Serial Programming Connections.............. 127 Interrupt Logic ........................................................... 120 MCLR Circuit............................................................. 113 On-Chip Reset Circuit ............................................... 112 PIC16F688.................................................................... 5 RA1 Pins ..................................................................... 38 RA2 Pin....................................................................... 38 RA3 Pin....................................................................... 39 RA4 Pin....................................................................... 39 © 2009 Microchip Technology Inc. PIC16F688 RA5 Pin ...................................................................... 40 RC0 and RC1 Pins ...
Page 198
... PIC16F688 Specifications ............................................................ 159 CONFIG Register.............................................................. 111 Configuration Bits.............................................................. 110 CPU Features ................................................................... 109 Customer Change Notification Service ............................. 199 Customer Notification Service........................................... 199 Customer Support ............................................................. 199 D Data EEPROM Memory ...................................................... 77 Associated Registers .................................................. 82 Reading....................................................................... 80 Writing ......................................................................... 80 Data Memory......................................................................... 7 DC and AC Characteristics Graphs and Tables ................................................... 163 DC Characteristics Extended and Industrial ...
Page 199
... PCL and PCLATH ............................................................... 19 Computed GOTO........................................................ 19 Stack ........................................................................... 19 PCON Register ........................................................... 18, 115 PICSTART Plus Development Programmer ..................... 142 PIE1 Register ...................................................................... 16 Pin Diagram ...................................................................... 2, 3 Pinout Description PIC16F688.................................................................... 6 PIR1 Register...................................................................... 17 PORTA................................................................................ 33 Additional Pin Functions ............................................. 34 © 2009 Microchip Technology Inc. PIC16F688 ANSEL Register ................................................. 34 Interrupt-on-Change ........................................... 34 Ultra Low-Power Wake-up............................ 34, 36 Weak Pull-up ...
Page 200
... PIC16F688 RCSTA (Receive Status and Control)......................... 93 Reset Values............................................................. 117 Reset Values (Special Registers) ............................. 118 Special Function Register Map ..................................... 8 Special Register Summary ........................................... 9 STATUS ...................................................................... 13 T1CON ........................................................................ 51 TRISA (Tri-State PORTA) ........................................... 33 TRISC (Tri-State PORTC) .......................................... 42 TXSTA (Transmit Status and Control) ........................ 92 VRCON (Voltage Reference Control) ......................... 63 WDTCON (Watchdog Timer Control)........................ 124 WPUA (Weak Pull-Up PORTA) ...