PIC16LF723A-E/MV Microchip Technology, PIC16LF723A-E/MV Datasheet
![no-image](/images/manufacturer_photos/0/4/439/microchip_technology_sml.jpg)
PIC16LF723A-E/MV
Specifications of PIC16LF723A-E/MV
Related parts for PIC16LF723A-E/MV
PIC16LF723A-E/MV Summary of contents
Page 1
... Microchip Technology Inc. PIC16F/LF722A/723A 28-Pin Flash Microcontrollers with nanoWatt XLP Technology Data Sheet DS41417A ...
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 Microcontrollers with nanoWatt XLP Technology Devices Included In This Data Sheet: PIC16F722A/723A Devices: • PIC16F722A • PIC16F723A PIC16LF722A/723A Devices: • PIC16LF722A • PIC16LF723A High-Performance RISC CPU: • Only 35 Instructions to Learn: - All single-cycle instructions except branches • Operating Speed – 20 MHz oscillator/clock input - DC – 200 ns instruction cycle • ...
Page 4
... PIC16F/LF722A/723A Program Memory SRAM Device Flash (bytes) (words) PIC16F722A/ 2048 128 PIC16LF722A PIC16F723A/ 4096 192 PIC16LF723A DS41417A-page 4 8-bit A/D I/Os Interrupts AUSART (ch Yes Yes Timers CCP 8/16-bit 2 2/1 2 2/1 2010 Microchip Technology Inc. ...
Page 5
... CCP1/RC2 SCL/SCK/RC3 QFN, UQFN AN2/RA2 V /AN3/RA3 REF T0CKI/CPS6/RA4 CAP (3) (2) V /SS /CPS7/AN4/RA5 V SS CLKIN/OSC1/RA7 CAP (3) V /CLKOUT/OSC2/RA6 Note 1: CCP2 pin location may be selected as RB3 or RC1 pin location may be selected as RA5 or RA0. 3: PIC16F722A/723A devices only. 2010 Microchip Technology Inc. PIC16F/LF722A/723A ...
Page 6
... IOC Y — IOC Y ICSPCLK/ICDCLK IOC Y ICSPDAT/ICDDAT — — — — — — — — — — — — — — — — — — — — — — — — (1) — Y MCLR/V PP — — — — 2010 Microchip Technology Inc. ...
Page 7
... Appendix A: Data Sheet Revision History......................................................................................................................................... 273 ® Appendix B: Migrating From Other PIC Devices............................................................................................................................. 273 The Microchip Web Site .................................................................................................................................................................... 281 Customer Change Notification Service ............................................................................................................................................. 281 Customer Support ............................................................................................................................................................................. 281 Reader Response ............................................................................................................................................................................. 282 Product Identification System ............................................................................................................................................................ 283 2010 Microchip Technology Inc. PIC16F/LF722A/723A DS41417A-page 7 ...
Page 8
... When contacting a sales office, please specify which device, revision of silicon and data sheet (include literature number) you are using. Customer Notification System Register on our web site at www.microchip.com to receive the most current information on all of our products. DS41417A-page 8 2010 Microchip Technology Inc. ...
Page 9
... DEVICE OVERVIEW The PIC16F/LF722A/723A devices are covered by this data sheet. They are available in 28-pin packages. Figure 1-1 shows a block diagram PIC16F/LF722A/723A devices. Table 1-1 shows the pinout descriptions. 2010 Microchip Technology Inc. PIC16F/LF722A/723A of the DS41417A-page 9 ...
Page 10
... RC3 RC4 RC5 RC6 RC7 PORTE RE3 SDI/ SCK/ SDI/ SCK/ SDI/ SCK/ SDO SDO SDO SDA SCL SDA SCL SDA SCL Synchronous Synchronous Synchronous Serial Port Serial Port Serial Port Capacitive Sensing Module CPS7 CPS6 2010 Microchip Technology Inc. ...
Page 11
... RB3/AN9/CPS3/CCP2 RB3 AN9 CPS3 CCP2 Legend Analog input or output CMOS = CMOS compatible input or output TTL = TTL compatible input High Voltage XTAL = Crystal levels 2010 Microchip Technology Inc. PIC16F/LF722A/723A Input Output Type Type TTL CMOS General purpose I/O. AN — A/D Channel 0 input. ...
Page 12
... General purpose input. ST — Master Clear with internal pull-up. HV — Programming voltage. Power — Positive supply. Power — Ground reference. = Schmitt Trigger input with CMOS levels I Description OD = Open Drain 2 2 C™= Schmitt Trigger input with I C 2010 Microchip Technology Inc. ...
Page 13
... The PIC16F722A/723A devices have an internal low dropout voltage regulator. An external capacitor must be connected to one of the available V Section 5.0 “Low Dropout (LDO) Voltage Regulator”. The PIC16LF722A/723A devices do not have the voltage regulator and therefore no external capacitor is required. 2010 Microchip Technology Inc. PIC16F/LF722A/723A pins to stabilize the regulator. For more information, see CAP ...
Page 14
... PIC16F/LF722A/723A NOTES: DS41417A-page 14 2010 Microchip Technology Inc. ...
Page 15
... RETFIE, RETLW Stack Level 1 Stack Level 2 Stack Level 8 RESET Vector Interrupt Vector On-chip Program Page 0 Memory Wraps to Page 0 Wraps to Page 0 Wraps to Page 0 2010 Microchip Technology Inc. PIC16F/LF722A/723A FIGURE 2-2: CALL, RETURN RETFIE, RETLW On-chip Program Memory 0000h 0004H 0005h 07FFh 0800h ...
Page 16
... The Special Function Registers can be classified into two sets: core and peripheral. The Special Function Registers associated with the “core” are described in this section. Those related to the operation of the peripheral features are described in the section of that peripheral feature. 2010 Microchip Technology Inc. ...
Page 17
... Purpose Register 32 Bytes General Purpose Register 96 Bytes Accesses 70h-7Fh 7Fh Bank 0 Bank 1 Legend: = Unimplemented data memory locations, read as ‘0’ Not a physical register. 2010 Microchip Technology Inc. PIC16F/LF722A/723A (*) (*) 80h Indirect addr. 100h 81h TMR0 101h 82h PCL 102h 83h STATUS ...
Page 18
... PCLATH 18Ah INTCON 18Bh PMCON1 18Ch Reserved 18Dh Reserved 18Eh Reserved 18Fh 190h 191h 192h 193h 194h 195h 196h 197h 198h 199h 19Ah 19Bh 19Ch 19Dh 19Eh 19Fh 1A0h 1EFh Accesses 1F0h 70h-7Fh 1FFh Bank 3 2010 Microchip Technology Inc. ...
Page 19
... These registers can be addressed from any bank. 3: Accessible only when SSPM<3:0> = 1001. Accessible only when SSPM<3:0> 1001 This bit is always ‘1’ as RE3 is input only. 2010 Microchip Technology Inc. PIC16F/LF722A/723A Bit 5 Bit 4 Bit 3 Bit 2 RP0 TO PD ...
Page 20
... IOCB1 IOCB0 58,35 0000 0000 — — TRMT TX9D 142,35 0000 -010 BRG1 BRG0 144,35 0000 0000 — — — — SSSEL CCP2SEL ---- --00 47,35 ADFVR1 ADFVR0 97,35 q0-- --00 — — ADREF1 ADREF0 93,35 0000 --00 2010 Microchip Technology Inc. ...
Page 21
... These registers can be addressed from any bank. 3: Accessible only when SSPM<3:0> = 1001. Accessible only when SSPM<3:0> 1001 This bit is always ‘1’ as RE3 is input only. 2010 Microchip Technology Inc. PIC16F/LF722A/723A Bit 5 Bit 4 Bit 3 Bit 2 RP0 — ...
Page 22
... Set Summary”). Note 1: The C and DC bits operate as Borrow and Digit Borrow out bits, respectively, in subtraction. R-1 R Unimplemented bit, read as ‘0’ ‘0’ = Bit is cleared (ADDWF, ADDLW, SUBLW, SUBWF instructions) R/W-x R/W-x R/W-x (1) ( bit Bit is unknown (1) (1) 2010 Microchip Technology Inc. ...
Page 23
... Microchip Technology Inc. PIC16F/LF722A/723A Note: To achieve a 1:1 prescaler assignment for Timer0, assign the prescaler to the WDT by setting PSA bit of the OPTION register to ‘1’. Refer to Section 12.3 “Timer1 Prescaler”. R/W-1 ...
Page 24
... Note 1: Set BOREN<1:0> the Configuration Word register for this bit to control the BOR. DS41417A-page 24 U-0 U-0 U-0 — — — Unimplemented bit, read as ‘0’ ‘0’ = Bit is cleared 2010 Microchip Technology Inc. R/W-q R/W-q POR BOR bit Bit is unknown ...
Page 25
... PUSHed eight times, the ninth PUSH overwrites the value that was stored from the first PUSH. The tenth PUSH overwrites the second PUSH (and so on). 2010 Microchip Technology Inc. PIC16F/LF722A/723A Note 1: There are no Status bits to indicate stack overflow or stack underflow conditions. ...
Page 26
... INCFFSR BTFSSFSR,4 ;all done? GOTONEXT CONTINUE 0 IRP Bank Select 180h Bank 1 Bank 2 Bank 3 INDIRECT ADDRESSING ;initialize pointer ;to RAM ;clear INDF register ;inc pointer ;no clear next ;yes continue Indirect Addressing 7 0 File Select Register Location Select 1FFh 2010 Microchip Technology Inc. ...
Page 27
... PWRT 11-bit Ripple Counter WDTOSC Note 1: Refer to the Configuration Word Register 1 (Register 8-1). 2010 Microchip Technology Inc. PIC16F/LF722A/723A Most registers are not affected by a WDT wake-up since this is viewed as the resumption of normal operation. TO and PD bits are set or cleared differently in different Reset situations, as indicated in Table 3-3. ...
Page 28
... If a Status bit is not implemented, that bit will be read as ‘0’. DS41417A-page 28 Condition (2) Program STATUS Counter Register 0000h 0001 1xxx ---- --0x 0000h 000u uuuu ---- --uu 0000h 0001 0uuu ---- --uu 0000h 0000 1uuu ---- -- uuu0 0uuu ---- --uu 0000h 0001 1uuu ---- --u0 ( uuu1 0uuu ---- --uu 2010 Microchip Technology Inc. PCON Register ...
Page 29
... If these conditions are not met, the device must be held in Reset until the operating conditions are met. For additional information, refer to Application Note AN607, “Power-up Trouble Shooting” (DS00607). 2010 Microchip Technology Inc. PIC16F/LF722A/723A 3.3 Power-up Timer (PWRT) The Power-up Timer provides a fixed 64 ms (nominal) time-out on power-up only, from POR or Brown-out Reset ...
Page 30
... Exit Sleep + System Clock = T1OSC, EXTRC, INTOSC, EXTCLK Exit Sleep + System Clock = XT, HS, LP DS41417A-page 30 From TMR0 Clock Source 0 Postscaler Divide by 1 512 0 PSA To T1G WDTE Cleared until the end of OST 2010 Microchip Technology Inc. 8 PS<2:0> TO TMR0 1 WDT Reset WDT Cleared ...
Page 31
... Reset V DD Internal Reset V DD Internal Reset Note delay only if PWRTE bit is programmed to ‘0’. 2010 Microchip Technology Inc. PIC16F/LF722A/723A If V falls below V for greater than parameter DD BOR (T ) (see Section 23.0 “Electrical Specifica- BOR tions”), the brown-out situation will reset the device. ...
Page 32
... PWRT T OSC — T PWRT Condition Power-on Reset Brown-out Reset WDT Reset WDT Wake-up MCLR Reset during normal operation MCLR Reset during Sleep may have DD Wake-up from Sleep PWRTE = 1 1024 • T 1024 • T OSC OSC — — 2010 Microchip Technology Inc. ...
Page 33
... V DD MCLR Internal POR PWRT Time-out OST Time-out Internal Reset FIGURE 3-6: TIME-OUT SEQUENCE ON POWER-UP (MCLR WITH MCLR Internal POR PWRT Time-out OST Time-out Internal Reset 2010 Microchip Technology Inc. PIC16F/LF722A/723A T PWRT T OST T PWRT T OST DD T PWRT T OST ): CASE 3 DS41417A-page 33 ...
Page 34
... Microchip Technology Inc. ...
Page 35
... When the wake-up is due to an interrupt and the GIE bit is set, the PC is loaded with the interrupt vector (0004h). 4: See Table 3-5 for Reset value for specific condition Reset was due to brown-out, then bit All other Resets will cause bit 2010 Microchip Technology Inc. PIC16F/LF722A/723A MCLR Reset/ (1) WDT Reset 1111 1111 ...
Page 36
... uuu1 0uuu = unimplemented bit, reads as ‘0’. - Bit 4 Bit 3 Bit 2 Bit 1 Bit — — — POR BOR PCON Register ---- --0x ---- --uu ---- --uu ---- --uu ---- --uu ---- --10 ---- --uu Value on Value on all other POR, BOR (1) Resets C 0001 1xxx 000q quuu ---- --qq ---- --uu 2010 Microchip Technology Inc. ...
Page 37
... IOCB5 IOC-RB6 IOCB6 IOC-RB7 IOCB7 TMR1GIF TMR1GIE 2010 Microchip Technology Inc. PIC16F/LF722A/723A The PIC16F/LF722A/723A device family has 12 interrupt sources, differentiated by corresponding interrupt enable and flag bits: • Timer0 Overflow Interrupt • External Edge Detect on INT Pin Interrupt • PORTB Change Interrupt • ...
Page 38
... See Figure 4-2 for timing details (1) (2) Interrupt Latency Inst ( — Dummy Cycle Dummy Cycle Inst (PC) . Synchronous latency = 0004h 0005h Inst (0004h) Inst (0005h) Inst (0004h) , where T = instruction cycle time. CY 2010 Microchip Technology Inc. ...
Page 39
... MOVWFSTATUS ;Move W into STATUS register SWAPFW_TEMP,F ;Swap W_TEMP SWAPFW_TEMP,W ;Swap W_TEMP into W 2010 Microchip Technology Inc. PIC16F/LF722A/723A following the ISR from using invalid data. Examples of key registers include the W, STATUS, FSR and PCLATH registers. Note: The microcontroller does not normally require saving the PCLATH register. However, if computed GOTO’ ...
Page 40
... User software should ensure the appropri- ate interrupt flag bits are clear prior to enabling an interrupt. R/W-0 R/W-0 R/W-0 (1) (2) INTE RBIE T0IF U = Unimplemented bit, read as ‘0’ ‘0’ = Bit is cleared (1) (2) R/W-0 R/W-x INTF RBIF bit Bit is unknown 2010 Microchip Technology Inc. ...
Page 41
... 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 2010 Microchip Technology Inc. PIC16F/LF722A/723A Note: Bit PEIE of the INTCON register must be set to enable any peripheral interrupt. ...
Page 42
... Disables the CCP2 interrupt DS41417A-page 42 Note: Bit PEIE of the INTCON register must be set to enable any peripheral interrupt. U-0 U-0 U-0 — — — Unimplemented bit, read as ‘0’ ‘0’ = Bit is cleared 2010 Microchip Technology Inc. U-0 R/W-0 — CCP2IE bit Bit is unknown ...
Page 43
... A Timer2 to PR2 match occurred (must be cleared in software Timer2 to PR2 match occurred bit 0 TMR1IF: Timer1 Overflow Interrupt Flag bit 1 = The TMR1 register overflowed (must be cleared in software The TMR1 register did not overflow 2010 Microchip Technology Inc. PIC16F/LF722A/723A ensure the R-0 R/W-0 ...
Page 44
... Value on Bit 1 Bit 0 all other POR, BOR Resets INTF RBIF 0000 000x 0000 000x PS1 PS0 1111 1111 1111 1111 TMR1IE 0000 0000 0000 0000 — CCP2IE ---- ---0 ---- ---0 TMR1IF 0000 0000 0000 0000 — CCP2IF ---- ---0 ---- ---0 2010 Microchip Technology Inc. ...
Page 45
... After the cap is fully charged, the device is released from Reset. For more information, refer to Section 23.0 “Electrical Specifications”. See Configuration Word 2 register (Register 8-2) for V enable bits. CAP 2010 Microchip Technology Inc. PIC16F/LF722A/723A ). pin is not CAP DS41417A-page 45 ...
Page 46
... PIC16F/LF722A/723A NOTES: DS41417A-page 46 2010 Microchip Technology Inc. ...
Page 47
... SSSEL: SS Input Pin Selection bit function is on RA5/AN4/CPS7/SS function is on RA0/AN0/SS/V bit 0 CCP2SEL: CCP2 Input/Output Pin Selection bit 0 = CCP2 function is on RC1/T1OSI/CCP2 1 = CCP2 function is on RB3/CCP2 2010 Microchip Technology Inc. PIC16F/LF722A/723A U-0 U-0 U-0 — — — Unimplemented bit, read as ‘0’ ...
Page 48
... TRISA3 TRISA2 U = Unimplemented bit, read as ‘0’ ‘0’ = Bit is cleared ; ;Init PORTA ; ;digital I/O ; ;Set RA<3:2> as inputs ;and set RA<7:4,1:0> ;as outputs R/W-x R/W-x RA1 RA0 bit Bit is unknown R/W-1 R/W-1 TRISA1 TRISA0 bit Bit is unknown 2010 Microchip Technology Inc. ...
Page 49
... Digital I/O. Pin is assigned to port or digital special function Analog input. Pin is assigned as analog input Note 1: When setting a pin to an analog input, the corresponding TRIS bit must be set to Input mode in order to allow external control of the voltage on the pin. 2010 Microchip Technology Inc. PIC16F/LF722A/723A R/W-1 R/W-1 R/W-1 ...
Page 50
... Voltage regulator capacitor pin (PIC16F722A/ 723A only) 6.2.2.8 RA7/OSC1/CLKIN Figure 6-6 shows the diagram for this pin. This pin is configurable to function as one of the following: • General purpose I/O • Crystal/resonator connection • Clock input 2010 Microchip Technology Inc. CAP ...
Page 51
... FIGURE 6-1: BLOCK DIAGRAM OF RA0 PIC16F722A/723A only To Voltage Regulator VCAPEN = 00 Data Bus PORTA TRISA RD TRISA ANSA0 RD PORTA TO SSP SS Input 2010 Microchip Technology Inc. PIC16F/LF722A/723A A/D Converter V DD I/O Pin V SS DS41417A-page 51 ...
Page 52
... RA<3:1> BLOCK DIAGRAM Data Bus PORTA TRISA RD TRISA ANSAx RD PORTA FIGURE 6-3: BLOCK DIAGRAM OF RA4 Data Bus PORTA TRISA RD TRISA ANSA4 RD PORTA To Timer0 Clock MUX To Cap Sensor DS41417A-page I/O Pin A/D Converter V DD I/O Pin V SS 2010 Microchip Technology Inc. ...
Page 53
... FIGURE 6-4: BLOCK DIAGRAM OF RA5 PIC16F722A/723A only VCAPEN = 01 Data Bus PORTA TRISA RD TRISA ANSA5 RD PORTA To SSP SS Input 2010 Microchip Technology Inc. PIC16F/LF722A/723A To Voltage Regulator To A/D Converter To Cap Sensor V DD I/O Pin V SS DS41417A-page 53 ...
Page 54
... Note 1: CLKOUT Enable = 1 when F OSC FIGURE 6-6: BLOCK DIAGRAM OF RA7 Data Bus PORTA TRISA RD TRISA OSC = INTOSC or INTOSCIO RD PORTA DS41417A-page 54 RA7/OSC1 INTOSC (No I/O Selected). RA6/OSC2 Oscillator Circuit V DD I/O Pin V SS Oscillator Circuit V DD I/O Pin V SS 2010 Microchip Technology Inc. ...
Page 55
... WCOL SSPOV SSPEN TRISA TRISA7 TRISA6 TRISA5 Legend unknown unchanged, – = unimplemented locations read as ‘0’. Shaded cells are not used by PORTA. Note 1: PIC16F722A/723A only. 2010 Microchip Technology Inc. PIC16F/LF722A/723A Bit 4 Bit 3 Bit 2 Bit 1 CHS2 CHS1 CHS0 GO/DONE ADCS0 — ...
Page 56
... When a pin change occurs at the same time as a read operation on PORTB, the RBIF flag will always be set. If multiple PORTB pins are configured for the interrupt-on-change, the user may not be able to identify which pin changed state. executing read-modify-write interrupt-on-change feature is 2010 Microchip Technology Inc. ...
Page 57
... Pull-up enabled 0 = Pull-up disabled Note 1: Global RBPU bit of the OPTION register must be cleared for individual pull-ups to be enabled. 2: The weak pull-up device is automatically disabled if the pin is in configured as an output. 2010 Microchip Technology Inc. PIC16F/LF722A/723A R/W-x R/W-x R/W-x RB4 RB3 RB2 U = Unimplemented bit, read as ‘ ...
Page 58
... Bit is cleared R/W-1 R/W-1 R/W-1 ANSB4 ANSB3 ANSB2 U = Unimplemented bit, read as ‘0’ ‘0’ = Bit is cleared (1) . Digital input buffer disabled. R/W-0 R/W-0 IOCB1 IOCB0 bit Bit is unknown R/W-1 R/W-1 ANSB1 ANSB0 bit Bit is unknown 2010 Microchip Technology Inc. ...
Page 59
... Figure 6-8 shows the diagram for this pin. This pin is configurable to function as one of the following: • General purpose I/O • Analog input for the ADC • Capacitive sensing input 2010 Microchip Technology Inc. PIC16F/LF722A/723A 6.3.4.6 RB5/AN13/CPS5/T1G Figure 6-10 shows the diagram for this pin. This pin is configurable to function as one of the following: • ...
Page 60
... PIC16F/LF722A/723A FIGURE 6-7: BLOCK DIAGRAM OF RB0 Data Bus WPUB RD WPUB PORTB TRISB RD TRISB ANSB0 RD PORTB IOCB RD IOCB Interrupt-on- Change RD PORTB To External Interrupt Logic DS41417A-page 60 RBPU A/D Converter To Cap Sensor V DD Weak V DD I/O Pin V SS 2010 Microchip Technology Inc. ...
Page 61
... FIGURE 6-8: BLOCK DIAGRAM OF RB4, RB<2:1> Data Bus WPUB RD WPUB PORTB TRISB RD TRISB ANSB<4,2,1> RD PORTB IOCB RD IOCB Interrupt-on- Change 2010 Microchip Technology Inc. PIC16F/LF722A/723A RBPU A/D Converter Cap Sensor EN RD PORTB V DD Weak V DD I/O Pin V SS DS41417A-page 61 ...
Page 62
... CK Q PORTB TRISB RD TRISB ANSB<5,3> RD PORTB IOCB RD IOCB Interrupt-on- Change (1) To CCP2 Note 1: CCP2 input is controlled by CCP2SEL in the APFCON register. DS41417A-page 62 CCP2OUT Enable RBPU CCP2OUT PORTB To A/D Converter To Cap Sensor V DD Weak V DD I/O Pin V SS 2010 Microchip Technology Inc. ...
Page 63
... FIGURE 6-10: BLOCK DIAGRAM OF RB5 Data Bus WPUB RD WPUB PORTB TRISB RD TRISB ANSB<5,3> RD PORTB IOCB RD IOCB Interrupt-on- Change To Timer1 Gate 2010 Microchip Technology Inc. PIC16F/LF722A/723A CCP2OUT Enable RBPU CCP2OUT PORTB To A/D Converter To Cap Sensor V DD Weak V DD I/O Pin V SS DS41417A-page 63 ...
Page 64
... PIC16F/LF722A/723A FIGURE 6-11: BLOCK DIAGRAM OF RB6 ICSP™ Mode Debug Data Bus WPUB RD WPUB PORTB TRISB RD TRISB RD PORTB IOCB RD IOCB Interrupt-on- Change ICSPCLK DS41417A-page 64 RBPU PORT_ICDCLK TRIS_ICDCLK PORTB V DD Weak V DD I/O Pin V SS 2010 Microchip Technology Inc. ...
Page 65
... FIGURE 6-12: BLOCK DIAGRAM OF RB7 ICSP™ Mode Debug Data Bus WPUB RD WPUB PORTB TRISB RD TRISB RD PORTB IOCB RD IOCB Interrupt-on- Change ICSPDAT_IN 2010 Microchip Technology Inc. PIC16F/LF722A/723A RBPU PORT_ICDDAT TRIS_ICDDAT PORTB V DD Weak V DD I/O Pin V SS DS41417A-page 65 ...
Page 66
... RBIF 0000 000x 0000 000X IOCB0 0000 0000 0000 0000 PS0 1111 1111 1111 1111 RB0 xxxx xxxx xxxx xxxx T1GSS0 0000 0x00 uuuu uxuu TRISB0 1111 1111 1111 1111 WPUB0 1111 1111 1111 1111 2010 Microchip Technology Inc. ...
Page 67
... TRISC<7:0>: PORTC Tri-State Control bits 1 = PORTC pin configured as an input (tri-stated PORTC pin configured as an output 2010 Microchip Technology Inc. PIC16F/LF722A/723A The TRISC register (Register 6-11) controls the PORTC pin output drivers, even when they are being used as analog inputs ...
Page 68
... Asynchronous serial output • Synchronous clock I/O DS41417A-page 68 6.4.8 RC7/RX/DT Figure 6-20 shows the diagram for this pin. This pin is configurable to function as one of the following: • General purpose I/O • Asynchronous serial input • Synchronous serial data I/O 2010 Microchip Technology Inc. ...
Page 69
... Data Bus CCP2OUT PORTC TRISC RD TRISC T1OSCEN RD PORTC (1) To CCP2 Input Note 1: CCP2 input is controlled by CCP2SEL in the APFCON register. 2010 Microchip Technology Inc. PIC16F/LF722A/723A Oscillator RC1/T1OSI RC0/T1OSO 1 0 Circuit V DD I/O Pin V SS Oscillator Circuit V DD I/O Pin V SS DS41417A-page 69 ...
Page 70
... SSPEN 2 SSPM = I C™ Mode 2 TO SSP I C™ SCL Input 2 ™ Note Schmitt Trigger has special input levels. 2 ™ Slew Rate limiting controlled by SMP bit of SSPSTAT register. DS41417A-page SSPEN I/O Pin I/O Pin (1) ™ 2010 Microchip Technology Inc. ...
Page 71
... I C Slew Rate limiting controlled by SMP bit of SSPSTAT register. FIGURE 6-18: BLOCK DIAGRAM OF RC5 SSPEN SSPM = SPI Mode Data Bus SDO PORTC D Q SDO TRISC RD TRISC RD PORTC 2010 Microchip Technology Inc. PIC16F/LF722A/723A I/O Pin (1) ™ I/O Pin V SS DS41417A-page 71 ...
Page 72
... SPEN TXEN 0 CSRC 1 SYNC To USART Sync Clock Input FIGURE 6-20: BLOCK DIAGRAM OF RC7 SPEN SYNC Data Bus USART_DT PORTC TRISC RD TRISC RD PORTC SPEN SYNC TXEN SREN CREN To USART Data Input DS41417A-page I/O Pin I/O Pin V SS 2010 Microchip Technology Inc. ...
Page 73
... T1CKPS1 T1CKPS0 T1OSCEN TXSTA CSRC TX9 TXEN TRISC TRISC7 TRISC6 TRISC5 Legend unknown unchanged unimplemented locations read as ‘0’. Shaded cells are not used by PORTB. 2010 Microchip Technology Inc. PIC16F/LF722A/723A Bit 4 Bit 3 Bit 2 — — — — DC1B0 CCP1M3 CCP1M2 ...
Page 74
... TRISE3 — — U-0 U-0 U-0 — — — bit Bit is unknown U-0 U-0 U-0 — — — bit Bit is unknown Value on Value on Bit 0 all other POR, BOR Resets — ---- x--- ---- x--- — ---- 1--- ---- 1--- 2010 Microchip Technology Inc. ...
Page 75
... FIGURE 6-21: BLOCK DIAGRAM OF RE3 ICSP™ Mode Detect In-Circuit Serial Programming™ Mode MCLR Circuit MCLR Pulse Filter Data Bus RD TRISE PORTE 2010 Microchip Technology Inc. PIC16F/LF722A/723A V DD Weak High-Voltage Detect I/O Pin V SS Power for Programming Flash DS41417A-page 75 ...
Page 76
... PIC16F/LF722A/723A NOTES: DS41417A-page 76 2010 Microchip Technology Inc. ...
Page 77
... OSC1 Internal Oscillator 500 kHz 0 32x 1 PLL PLLEN (Configuration Word 1) 2010 Microchip Technology Inc. PIC16F/LF722A/723A Clock source modes are configured by the FOSC bits in Configuration Word 1 (CONFIG1). The oscillator module can be configured for one of eight modes of operation – External Resistor-Capacitor (RC) with F /4 output on OSC2/CLKOUT ...
Page 78
... IRCF bits takes effect. This is because the old and new frequencies are derived from INTOSC via the postscaler and multiplexer. Start-up delay specifications are located in Table 23-2 in Section 23.0 “Electrical Specifications”. for more 2010 Microchip Technology Inc. ...
Page 79
... ICSS: Internal Clock Oscillator Status Stable bit (0.5% Stable MHz/500 kHz Internal Oscillator (HFIOSC) has stabilized to its maximum accuracy MHz/500 kHz Internal Oscillator (HFIOSC) has not yet reached its maximum accuracy bit 1-0 Unimplemented: Read as ‘0’ 2010 Microchip Technology Inc. PIC16F/LF722A/723A clock. The R/W-0 ...
Page 80
... Code execution continues during this shift. There is no indication that the shift has occurred. R/W-0 R/W-0 R/W-0 TUN4 TUN3 TUN2 U = Unimplemented bit, read as ‘0’ ‘0’ = Bit is cleared R/W-0 R/W-0 TUN1 TUN0 bit Bit is unknown 2010 Microchip Technology Inc. ...
Page 81
... LP mode current consumption is the least of the three modes. This mode is best suited to drive resonators with a low drive level specification, for example, tuning fork type crystals. 2010 Microchip Technology Inc. PIC16F/LF722A/723A XT Oscillator mode selects the intermediate gain setting of the internal inverter-amplifier. XT mode current consumption is the medium of the three modes ...
Page 82
... Alternate pin functions are described in Section 6.1 “Alternate Pin Function”. Output depends upon RC or RCIO clock mode. ) and capacitor (C ) values EXT EXT Value on Value on Bit 0 all other POR, BOR (1) Resets FOSC0 — — — --10 qq-- --10 qq-- TUN0 --00 0000 --uu uuuu 2010 Microchip Technology Inc. ...
Page 83
... When MCLR is asserted in INTOSC or RC mode, the internal clock oscillator is disabled. ® 4: MPLAB IDE masks unimplemented Configuration bits to ‘0’. 2010 Microchip Technology Inc. PIC16F/LF722A/723A 8.1 Configuration Words There are several Configuration Word bits that allow different oscillator and memory protection options. ...
Page 84
... U-1 VCAPEN0 — Unimplemented bit, read as ‘0’ ‘0’ = Bit is cleared pin functions are disabled. CAP (1) (1) (1) U-1 U-1 U-1 — — — bit 8 (1) (1) (1) U-1 U-1 U-1 — — — bit Bit is unknown 2010 Microchip Technology Inc. ...
Page 85
... Program/Verify mode. Only the Least Significant 7 bits of the ID locations are reported when using MPLAB IDE. “PIC16F72X/PIC16LF72X Memory Specification” (DS41332) for more information. 2010 Microchip Technology Inc. PIC16F/LF722A/723A not been Specification” See the Programming DS41417A-page 85 ...
Page 86
... PIC16F/LF722A/723A NOTES: DS41417A-page 86 2010 Microchip Technology Inc. ...
Page 87
... V REF AN0 AN1 AN2 AN3 AN4 AN5 AN6 AN7 AN8 AN9 AN10 Reserved Reserved Reserved Reserved FV REF CHS<3:0> 2010 Microchip Technology Inc. PIC16F/LF722A/723A (ADC) allows AV DD ADREF = 0x ADREF = 11 + ADREF = 10 0000 0001 0010 0011 0100 0101 0110 0111 ADC 1000 GO/DONE ...
Page 88
... Table 9-1 gives examples of appro- priate ADC clock selections. Note: Unless using the F system clock frequency will change the ADC adversely affect the ADC result external periods AD specifica any changes in the RC clock frequency, which may 2010 Microchip Technology Inc. ...
Page 89
... Sleep. FIGURE 9-2: ANALOG-TO-DIGITAL CONVERSION T Tcy Conversion Starts Holding Capacitor is Disconnected from Analog Input (typically 100 ns) Set GO/DONE bit 2010 Microchip Technology Inc. PIC16F/LF722A/723A ) V . DEVICE OPERATING FREQUENCIES AD S Device Frequency (F 20 MHz 16 MHz 8 MHz (2) (2) 100 ns 125 ns 250 ns (2) (2) ...
Page 90
... Timer1 counter resets to zero. Using the Special Event Trigger does not assure proper ADC timing the user’s responsibility to ensure that the ADC timing requirements are met. Refer to Section 15.0 “Capture/Compare/PWM (CCP) Module” for more information. 2010 Microchip Technology Inc. RC ...
Page 91
... Note 1: The global interrupt can be disabled if the user is attempting to wake-up from Sleep and resume in-line code execution. 2: Refer to Section 9.3 “A/D Acquisition Requirements”. 2010 Microchip Technology Inc. PIC16F/LF722A/723A EXAMPLE 9-1: ;This code block configures the ADC ;for polling, Vdd reference, Frc clock ...
Page 92
... ADON: ADC Enable bit 1 = ADC is enabled 0 = ADC is disabled and consumes no operating current DS41417A-page 92 R/W-0 R/W-0 R/W-0 CHS2 CHS1 CHS0 U = Unimplemented bit, read as ‘0’ ‘0’ = Bit is cleared ) REF R/W-0 R/W-0 GO/DONE ADON bit Bit is unknown 2010 Microchip Technology Inc. ...
Page 93
... Legend Readable bit W = Writable bit -n = Value at POR ‘1’ = Bit is set bit 7-0 ADRES<7:0>: ADC Result Register bits 8-bit conversion result. 2010 Microchip Technology Inc. PIC16F/LF722A/723A R/W-0 U-0 U-0 ADCS0 — — Unimplemented bit, read as ‘0’ ‘0’ = Bit is cleared ...
Page 94
... HOLD 5. Temperature Coefficient charged to within 1/2 lsb CHOLD charge response to V CHOLD APPLIED 2010 Microchip Technology Inc. ...
Page 95
... Threshold Voltage T Note 1: Refer to Section 23.0 “Electrical Specifications” FIGURE 9-4: ADC TRANSFER FUNCTION FFh FEh FDh FCh FBh 04h 03h 02h 01h 00h V SS 2010 Microchip Technology Inc. PIC16F/LF722A/723A V DD Sampling Switch 0. Rss R IC LEAKAGE (1) I 0. ...
Page 96
... ADFVR0 q0-- --00 q0-- --00 RBIF 0000 000x 0000 000x TMR1IE 0000 0000 0000 0000 TMR1IF 0000 0000 0000 0000 TRISA0 1111 1111 1111 1111 TRISB0 1111 1111 1111 1111 . Shaded cells are not used for ADC 2010 Microchip Technology Inc. ...
Page 97
... A/D Converter Fixed Voltage Reference Peripheral output is 1x (1.024V A/D Converter Fixed Voltage Reference Peripheral output is 2x (2.048V A/D Converter Fixed Voltage Reference Peripheral output is 4x (4.096V) Note 1: Fixed Voltage Reference output cannot exceed V 2010 Microchip Technology Inc. PIC16F/LF722A/723A U-0 U-0 U-0 — ...
Page 98
... PIC16F/LF722A/723A NOTES: DS41417A-page 98 2010 Microchip Technology Inc. ...
Page 99
... Oscillator T1GSS = 11 TMR1GE WDTE Low-Power WDT OSC 2010 Microchip Technology Inc. PIC16F/LF722A/723A When TMR0 is written, the increment is inhibited for two instruction cycles immediately following the write. Note: The value written to the TMR0 register can be adjusted, in order to account for the two instruction cycle delay when TMR0 is written ...
Page 100
... Synchronization can be accomplished by sampling the prescaler output on the Q2 and Q4 cycles of the instruction clock. The high and low periods of the external clocking source must meet the timing requirements as shown in Section 23.0 “Electrical Specifications”. DS41417A-page 100 2010 Microchip Technology Inc. ...
Page 101
... TMR0 Timer0 Module Register TRISA TRISA7 TRISA6 TRISA5 Legend: – implemented locations, read as ‘0’ unchanged unknown. Shaded cells are not used by the Timer0 module. 2010 Microchip Technology Inc. PIC16F/LF722A/723A R/W-1 R/W-1 R/W-1 T0SE PSA U = Unimplemented bit, read as ‘0’ ...
Page 102
... PIC16F/LF722A/723A NOTES: DS41417A-page 102 2010 Microchip Technology Inc. ...
Page 103
... 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. 2010 Microchip Technology Inc. PIC16F/LF722A/723A • Selectable Gate Source Polarity • Gate Toggle Mode • Gate Single-pulse Mode • Gate Value Status • ...
Page 104
... T1CKI is high then Timer1 is enabled (TMR1ON=1) when T1CKI is low. T1OSCEN System Clock ( OSC Instruction Clock (F x OSC Capacitive Sensing Oscillator x External Clocking on T1CKI Pin 0 Oscillator Circuit on T1OSI/T1OSO Pins 1 system clock or they can run Clock Source /4) 2010 Microchip Technology Inc. ...
Page 105
... Note: When switching from synchronous to asynchronous operation possible to skip an increment. When switching from asynchronous to synchronous operation possible to produce an additional increment. 2010 Microchip Technology Inc. PIC16F/LF722A/723A 12.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 106
... WDT is enabled, when the CLRWDT instruction is executed, and so on, Toggle mode must be used. A specific sequence is required to put the device into the correct state to capture the next WDT counter interval. 2010 Microchip Technology Inc. ...
Page 107
... This is necessary in order to control which edge is measured. Note: Enabling Toggle mode at the same time as changing the gate polarity may result in indeterminate operation. 2010 Microchip Technology Inc. PIC16F/LF722A/723A WDT Oscillator WDT Reset Enable Y Y ...
Page 108
... Timer1 can cause a Special Event Trigger to be missed. In the event that a write to TMR1H or TMR1L coincides with a Special Event Trigger from the CCP, the write will take precedence. For more information, see Section 9.2.5 “Special Event Trigger”. 2010 Microchip Technology Inc utilize OSC ...
Page 109
... FIGURE 12-3: TIMER1 GATE COUNT ENABLE MODE TMR1GE T1GPOL T1G_IN T1CKI T1GVAL TIMER1 N FIGURE 12-4: TIMER1 GATE TOGGLE MODE TMR1GE T1GPOL T1GTM T1G_IN T1CKI T1GVAL TIMER1 2010 Microchip Technology Inc. PIC16F/LF722A/723A DS41417A-page 109 ...
Page 110
... TIMER1 GATE SINGLE-PULSE MODE TMR1GE T1GPOL T1GSPM T1GGO/ Set by software DONE Counting enabled on rising edge of T1G T1G_IN T1CKI T1GVAL TIMER1 N Cleared by software TMR1GIF DS41417A-page 110 Cleared by hardware on falling edge of T1GVAL Set by hardware on falling edge of T1GVAL 2010 Microchip Technology Inc. Cleared by software ...
Page 111
... TIMER1 GATE SINGLE-PULSE AND TOGGLE COMBINED MODE TMR1GE T1GPOL T1GSPM T1GTM T1GGO/ Set by software DONE Counting enabled on rising edge of T1G T1G_IN T1CKI T1GVAL TIMER1 N Cleared by software TMR1GIF 2010 Microchip Technology Inc. PIC16F/LF722A/723A Cleared by hardware on falling edge of T1GVAL Set by hardware on falling edge of T1GVAL Cleared by software DS41417A-page 111 ...
Page 112
... TMR1ON: Timer1 On bit 1 = Enables Timer1 0 = Stops Timer1 Clears Timer1 gate flip-flop DS41417A-page 112 R/W-0 R/W-0 R/W-0 T1CKPS0 T1OSCEN T1SYNC U = Unimplemented bit, read as ‘0’ ‘0’ = Bit is cleared ) OSC /4) OSC ) OSC U-0 R/W-0 — TMR1ON bit Bit is unknown 2010 Microchip Technology Inc. ...
Page 113
... T1GSS<1:0>: Timer1 Gate Source Select bits 00 = Timer1 gate pin 01 = Timer0 Overflow output 10 = TMR2 Match PR2 output 11 = Watchdog Timer scaler overflow Watchdog Timer oscillator is turned on if TMR1GE = 1, regardless of the state of TMR1ON 2010 Microchip Technology Inc. PIC16F/LF722A/723A R/W-0 R/W-0 R-x T1GSPM T1GGO/ ...
Page 114
... RB0 xxxx xxxx xxxx xxxx xxxx xxxx uuuu uuuu xxxx xxxx uuuu uuuu TRISB0 1111 1111 1111 1111 TRISC0 1111 1111 1111 1111 TMR1ON 0000 00-0 uuuu uu-u T1GSS0 0000 0x00 uuuu uxuu 2010 Microchip Technology Inc. ...
Page 115
... OSC 1:1, 1:4, 1:16 2 T2CKPS<1:0> 2010 Microchip Technology Inc. PIC16F/LF722A/723A The TMR2 and PR2 registers are both fully readable and writable. On any Reset, the TMR2 register is set to 00h and the PR2 register is set to FFh. Timer2 is turned on by setting the TMR2ON bit in the T2CON register to a ‘ ...
Page 116
... Value on Value on Bit 0 all other POR, BOR Resets RBIF 0000 000x 0000 000x 0000 0000 0000 0000 TMR1IE 0000 0000 0000 0000 TMR1IF 1111 1111 1111 1111 0000 0000 0000 0000 T2CKPS0 -000 0000 -000 0000 2010 Microchip Technology Inc. ...
Page 117
... LP WDT WDT OSC Scaler PS<2:0> Note 1: If CPSON = 0, disabling capacitive sensing, no channel is selected. 2010 Microchip Technology Inc. PIC16F/LF722A/723A sensing module. The capacitive sensing module requires software and at least one timer resource to determine the change in frequency. Key features of this module include: • ...
Page 118
... Refer to Section 12.0 “Timer1 Module with Gate Control” for additional information. TABLE 14-1: TIMER1 ENABLE FUNCTION TMR1ON TMR1GE Timer1 Operation Count Enabled by input 1 1 2010 Microchip Technology Inc. Off Off On ...
Page 119
... This frequency should be less than the value obtained during the nominal frequency measurement. 2010 Microchip Technology Inc. PIC16F/LF722A/723A 14.5.3 FREQUENCY THRESHOLD The frequency threshold should be placed midway between the value of nominal frequency and the reduced frequency of the capacitive sensing oscillator ...
Page 120
... Timer1, any other source that wakes the part up early will cause the WDT over- flow to be delayed, affecting the value captured by Timer1. 2: Timer0 does not operate when in Sleep, and therefore cannot be used for capacitive sense measurements Sleep. DS41417A-page 120 in 2010 Microchip Technology Inc. ...
Page 121
... The T0XCS bit controls which clock external to the core/Timer0 module supplies Timer0 Timer0 Clock Source is the capacitive sensing oscillator 0 = Timer0 Clock Source is the T0CKI pin If T0CS = 0 Timer0 clock source is controlled by the core/Timer0 module and is F 2010 Microchip Technology Inc. PIC16F/LF722A/723A U-0 R/W-0 R/W-0 — ...
Page 122
... PS0 1111 1111 1111 1111 TMR1IE 0000 0000 0000 0000 TMR1IF 0000 0000 0000 0000 TMR1ON 0000 00-0 0000 00-0 T2CKPS0 -000 0000 -000 0000 TRISA0 1111 1111 1111 1111 TRISB0 1111 1111 1111 1111 2010 Microchip Technology Inc. ...
Page 123
... If CCP1 is in Capture mode and CCP2 is configured as a Special Event Trigger, CCP2 will clear Timer1, affecting the value captured on the CCP1 pin. Note: CCPRx and CCPx throughout document refer to CCPR1 or CCPR2 and CCP1 or CCP2, respectively. 2010 Microchip Technology Inc. PIC16F/LF722A/723A TABLE 15-1: CCP MODE – TIMER RESOURCES REQUIRED CCP Mode Capture Compare PWM ...
Page 124
... Note 1: A/D conversion start feature is available only on CCP2. DS41417A-page 124 R/W-0 R/W-0 R/W-0 DCxB0 CCPxM3 CCPxM2 U = Unimplemented bit, read as ‘0’ ‘0’ = Bit is cleared (1) is started if the ADC module is enabled. CCPx pin is unaffected.) R/W-0 R/W-0 CCPxM1 CCPxM0 bit Bit is unknown 2010 Microchip Technology Inc. ...
Page 125
... Counter mode for the CCP module to use the capture feature. In Asynchronous Counter mode or when Timer1 is clocked the capture operation may OSC not work. 2010 Microchip Technology Inc. PIC16F/LF722A/723A 15.1.3 SOFTWARE INTERRUPT When the Capture mode is changed, a false capture interrupt may be generated. The user should keep the CCPxIE interrupt enable bit of the PIEx register clear to avoid false interrupts ...
Page 126
... TMR1IF 0000 0000 0000 0000 CCP2IF ---- ---0 ---- ---0 TMR1ON 0000 00-0 uuuu uu-u T1GSS0 0000 0x00 0000 0x00 xxxx xxxx uuuu uuuu xxxx xxxx uuuu uuuu TRISB0 1111 1111 1111 1111 1111 1111 TRISC0 1111 1111 2010 Microchip Technology Inc. ...
Page 127
... Note: Clearing the CCPxCON register will force the CCPx compare output latch to the default low level. This is not the PORT I/O data latch. 2010 Microchip Technology Inc. PIC16F/LF722A/723A 15.2.2 TIMER1 MODE SELECTION In Compare mode, Timer1 must be running in either Timer mode or Synchronized Counter mode. The compare operation may not work in Asynchronous Counter mode ...
Page 128
... TMR1IF 0000 0000 0000 0000 CCP2IF ---- ---0 ---- ---0 TMR1ON 0000 00-0 uuuu uu-u T1GSS0 0000 0x00 0000 0x00 xxxx xxxx uuuu uuuu xxxx xxxx uuuu uuuu TRISB0 1111 1111 1111 1111 TRISC0 1111 1111 1111 1111 2010 Microchip Technology Inc. ...
Page 129
... In PWM mode, CCPRxH is a read-only register. 2010 Microchip Technology Inc. PIC16F/LF722A/723A The PWM output (Figure 15-4) has a time base (period) and a time that the output stays high (duty cycle). ...
Page 130
... When the 10-bit time base matches the CCPRxH and (refer to 2-bit latch, then the CCPx pin is cleared (refer to Figure 15-3). PULSE WIDTH = CCPRxL:CCPxCON<5:4> T (TMR2 Prescale Value) OSC = 1/F OSC DUTY CYCLE RATIO CCPRxL:CCPxCON<5:4> = ---------------------------------------------------------------------- - 4 PR2 + bits of OSC 2010 Microchip Technology Inc. ...
Page 131
... PWM frequency. Refer to Section 7.0 “Oscillator Module” for additional details. 15.3.7 EFFECTS OF RESET Any Reset will force all ports to Input mode and the CCP registers to their Reset states. 2010 Microchip Technology Inc. PIC16F/LF722A/723A EQUATION 15-4: PWM RESOLUTION Resolution = Note: ...
Page 132
... CCP2M0 --00 0000 --00 0000 xxxx xxxx uuuu uuuu xxxx xxxx uuuu uuuu 1111 1111 1111 1111 T2CKPS0 -000 0000 -000 0000 0000 0000 0000 0000 TRISB0 1111 1111 1111 1111 1111 1111 TRISC0 1111 1111 2010 Microchip Technology Inc. ...
Page 133
... Multiplier x4 SYNC 1 SPBRG BRGH x 2010 Microchip Technology Inc. PIC16F/LF722A/723A The AUSART module includes the following capabilities: • Full-duplex asynchronous transmit and receive • Two-character input buffer • One-character output buffer • Programmable 8-bit or 9-bit character length Synchronous • Address detection in 9-bit mode (AUSART) • ...
Page 134
... These registers are detailed in Register 16-1 and Register 16-2, respectively. DS41417A-page 134 MSb Data Stop Recovery F OSC ÷ x16 x64 FERR CREN OERR RSR Register LSb • • • ( START RX9 FIFO RX9D RCREG Register 8 Data Bus RCIF Interrupt RCIE 2010 Microchip Technology Inc. ...
Page 135
... RCSTA register enables the automatically configures the TX/CK I/O pin as an output. 2010 Microchip Technology Inc. PIC16F/LF722A/723A Note 1: When the SPEN bit is set the RX/DT I/O pin is automatically configured as an input, regardless of the state of the corresponding TRIS bit and whether or not the AUSART receiver is enabled ...
Page 136
... TX9D data bit. 7. Load 8-bit data into the TXREG register. This will start the transmission. bit 0 bit 1 bit 7/8 Word 1 bit 0 bit 1 bit 7/8 Word Stop bit Start bit bit 0 Stop bit Word 2 Word 2 Transmit Shift Reg. 2010 Microchip Technology Inc. ...
Page 137
... TRISC7 TRISC6 TRISC5 TXREG AUSART Transmit Data Register TXSTA CSRC TX9 TXEN Legend unknown unimplemented read as ‘0’. Shaded cells are not used for Asynchronous Transmission. 2010 Microchip Technology Inc. PIC16F/LF722A/723A Bit 4 Bit 3 Bit 2 Bit 1 INTE RBIE T0IF INTF TXIE ...
Page 138
... GIE, Global Interrupt Enable bit of the INTCON register The RCIF interrupt flag bit of the PIR1 register will be set when there is an unread character in the FIFO, regardless of the state of interrupt enable bits. Receiving Data to Section 16.1.2.4 “Receive is cleared. Refer “Receive Overrun Receive Interrupts 2010 Microchip Technology Inc. to ...
Page 139
... 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. 2010 Microchip Technology Inc. PIC16F/LF722A/723A 16.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 140
... If the device has been addressed, clear the ADDEN bit to allow all received data into the receive buffer and generate interrupts. Start bit 7/8 bit 7/8 Stop Stop bit bit 0 bit bit Word 2 Word 1 RCREG RCREG Start bit Stop bit 7/8 bit 2010 Microchip Technology Inc. ...
Page 141
... BRG6 BRG5 TRISC TRISC7 TRISC6 TRISC5 TXSTA CSRC TX9 TXEN Legend unknown unimplemented read as ‘0’. Shaded cells are not used for Asynchronous Reception. 2010 Microchip Technology Inc. PIC16F/LF722A/723A Bit 4 Bit 3 Bit 2 Bit 1 INTE RBIE T0IF INTF TXIE SSPIE CCP1IE ...
Page 142
... Can be address/data bit or a parity bit. Note 1: SREN/CREN overrides TXEN in Synchronous mode. DS41417A-page 142 R/W-0 U-0 R/W-0 (1) SYNC — BRGH U = Unimplemented bit, read as ‘0’ ‘0’ = Bit is cleared (1) R-1 R/W-0 TRMT TX9D bit Bit is unknown 2010 Microchip Technology Inc. ...
Page 143
... RX9D: Ninth bit of Received Data This can be address/data bit or a parity bit and must be calculated by user firmware. Note 1: The AUSART module automatically changes the pin from tri-state to drive as needed. Configure TRISx = 1. 2010 Microchip Technology Inc. PIC16F/LF722A/723A R/W-0 R/W-0 R-0 ...
Page 144
... Baud Rate Formula F /[64 (n+1)] OSC F /[16 (n+1)] OSC F /[4 (n+1)] OSC Value on Value on Bit 0 all other POR, BOR Resets RX9D 0000 000x 0000 000x BRG0 0000 0000 0000 0000 TX9D 0000 -010 0000 -010 2010 Microchip Technology Inc. ...
Page 145
... Microchip Technology Inc. PIC16F/LF722A/723A SYNC = 0, BRGH = 18.432 MHz F = 16.0000 MHz OSC OSC SPBRG % Actual % value Rate Error Rate Error (decimal) — — ...
Page 146
... F = 1.000 MHz OSC SPBRG SPBRG Actual % value value Rate Error (decimal) (decimal) — 300 0.16 207 191 1202 0. 2404 0. — — — 21 10417 0. — — — 3 — — — 1 — — — 2010 Microchip Technology Inc. ...
Page 147
... One clock cycle is generated for each data bit. Only as many clock cycles are generated as there are data bits. 2010 Microchip Technology Inc. PIC16F/LF722A/723A 16.3.1.2 Synchronous Master Transmission Data is transferred out of the device on the RX/DT pin ...
Page 148
... TMR1IE 0000 0000 0000 0000 TMR1IF 0000 0000 0000 0000 RX9D 0000 000x 0000 000x BRG0 0000 0000 0000 0000 TRISC0 1111 1111 1111 1111 0000 0000 0000 0000 TX9D 0000 -010 0000 -010 2010 Microchip Technology Inc. ...
Page 149
... CREN is clear then the error is cleared by reading RCREG. If the overrun occurred when the CREN bit is set then the error condition is cleared by either clearing the CREN bit of the RCSTA register. 2010 Microchip Technology Inc. PIC16F/LF722A/723A 16.3.1.7 Receiving 9-bit Characters The AUSART supports 9-bit character reception. When ...
Page 150
... POR, BOR Resets RBIF 0000 000x 0000 000x TMR1IE 0000 0000 0000 0000 TMR1IF 0000 0000 0000 0000 0000 0000 0000 0000 RX9D 0000 000X 0000 000X TRISC0 1111 1111 1111 1111 TX9D 0000 -010 0000 -010 2010 Microchip Technology Inc. ...
Page 151
... CSRC TX9 TXEN Legend unknown unimplemented read as ‘0’. Shaded cells are not used for Synchronous Slave Transmission. 2010 Microchip Technology Inc. PIC16F/LF722A/723A If two words are written to the TXREG and then the SLEEP instruction is executed, the following will occur: 1. The first character will immediately transfer to the TSR register and transmit ...
Page 152
... POR, BOR Resets RBIF 0000 000x 0000 000x TMR1IE 0000 0000 0000 0000 TMR1IF 0000 0000 0000 0000 0000 0000 0000 0000 RX9D 0000 000X 0000 000X TRISC0 1111 1111 1111 1111 TX9D 0000 -010 0000 -010 2010 Microchip Technology Inc. ...
Page 153
... Upon waking from Sleep, the instruction following the SLEEP instruction will be executed. If the Global Interrupt Enable (GIE) bit of the INTCON register is also set, then the Interrupt Service Routine at address 0004h will be called. 2010 Microchip Technology Inc. PIC16F/LF722A/723A 16.4.2 SYNCHRONOUS TRANSMIT DURING SLEEP ...
Page 154
... PIC16F/LF722A/723A NOTES: DS41417A-page 154 2010 Microchip Technology Inc. ...
Page 155
... Shift Register (SSPSR) LSb MSb General I/O Processor 1 2010 Microchip Technology Inc. PIC16F/LF722A/723A A typical SPI connection between microcontroller devices is shown in Figure 17-1. Addressing of more than one slave device is accomplished via multiple hardware slave select lines. External hardware and additional I/O pins must be used to support multiple slave select addressing ...
Page 156
... SSPBUF Reg SSPSR Reg SDI bit 0 bit 7 Shift Clock SDO SS Control RA5/SS Enable RA0/SS SSSEL 2 Clock Select Edge Select 2 Edge Select Prescaler SCK 4 TRISx SSPM<3:0> DS41417A-page 156 Internal Data Bus Write TMR2 Output F OSC 4, 16, 64 2010 Microchip Technology Inc. ...
Page 157
... TRIS register as follows: • SDI configured as input • SDO configured as output • SCK configured as output 2010 Microchip Technology Inc. PIC16F/LF722A/723A 17.1.1.3 Master Mode Setup In Master mode, the data is transmitted/received as soon as the SSPBUF register is loaded with a byte value ...
Page 158
... MOVWF RXDATA ;Save in user RAM, if data is meaningful MOVF TXDATA reg = contents of TXDATA MOVWF SSPBUF ;New data to xmit DS41417A-page 158 bit 5 bit 4 bit 2 bit 1 bit 3 bit 2 bit 5 bit 4 bit 1 bit 3 4 Clock Modes bit 0 bit 0 bit 0 bit 0 2010 Microchip Technology Inc. ...
Page 159
... A SPI module transmits and receives at the same time, occasionally causing dummy data to be transmitted/ received the user to determine which data used and what can be discarded. 2010 Microchip Technology Inc. PIC16F/LF722A/723A 17.1.2.2 Enabling Slave I/O To enable the serial port, the SSPEN bit of the SSPCON register must be set ...
Page 160
... SCK (CKP = 1 CKE = 1) Write to SSPBUF SDO bit 7 SDI (SMP = 0) bit 7 Input Sample (SMP = 0) SSPIF Interrupt Flag SSPSR to SSPBUF DS41417A-page 160 bit 6 bit 5 bit 4 bit 2 bit 3 bit 6 bit 2 bit 5 bit 4 bit 3 bit 1 bit 0 bit 0 bit 1 bit 0 bit 0 2010 Microchip Technology Inc. ...
Page 161
... SSPIF Interrupt Flag SSPSR to SSPBUF 2010 Microchip Technology Inc. PIC16F/LF722A/723A When the SPI module resets, the bit counter is cleared to ‘0’. This can be done by either forcing the SS pin to a high level or clearing the SSPEN bit. Figure 17-6 shows the timing waveform for such a synchronization event ...
Page 162
... When enabled, these pins must be properly configured as input or output. DS41417A-page 162 R/W-0 R/W-0 R/W-0 CKP SSPM3 SSPM2 U = Unimplemented bit, read as ‘0’ ‘0’ = Bit is cleared /4 OSC /16 OSC /64 OSC R/W-0 R/W-0 SSPM1 SSPM0 bit Bit is unknown (1) 2010 Microchip Technology Inc. ...
Page 163
... UA: Update Address bit 2 Used mode only. bit 0 BF: Buffer Full Status bit 1 = Receive complete, SSPBUF is full 0 = Receive not complete, SSPBUF is empty 2010 Microchip Technology Inc. PIC16F/LF722A/723A R-0 R Unimplemented bit, read as ‘0’ ‘0’ = Bit is cleared ...
Page 164
... TMR1IF 1111 1111 1111 1111 xxxx xxxx uuuu uuuu SSPM0 0000 0000 0000 0000 BF 0000 0000 0000 0000 TRISA0 1111 1111 1111 1111 TRISC0 1111 1111 1111 1111 T2CKPS0 -000 0000 -000 0000 2010 Microchip Technology Inc. ...
Page 165
... Clock SSPSR Reg SDA MSb LSb SSPMSK Reg Match Detect SSPADD Reg Start and Stop bit Detect 2010 Microchip Technology Inc. PIC16F/LF722A/723A FIGURE 17-8: Master SDA SCL 2 C The SSP module has six registers for I They are: • SSP Control (SSPCON) register • ...
Page 166
... BF and SSPOV. Flag bit BF is cleared by reading the SSPBUF register, while bit SSPOV is cleared through software. Generate ACK Pulse Yes Yes Stop Condition Set bit SSPIF (SSP Interrupt occurs if enabled) Yes Yes Yes Yes 2010 Microchip Technology Inc. ...
Page 167
... An ACK pulse is generated. • SSP interrupt flag bit, SSPIF of the PIR1 register, is set (interrupt is generated if enabled) on the falling edge of the ninth SCL pulse. 2010 Microchip Technology Inc. PIC16F/LF722A/723A 17.2.4.2 10-bit Addressing In 10-bit Address mode, two address bytes need to be received by the slave (Figure 17-11) ...
Page 168
... Receiving Address SDA SCL S SSPIF BF SSPOV DS41417A-page 168 Receiving Data ACK ACK Cleared in software SSPBUF register is read Bit SSPOV is set because the SSPBUF register is still full. Receiving Data ACK Bus Master sends Stop condition ACK is not sent. 2010 Microchip Technology Inc. ...
Page 169
... FIGURE 17-11: I C™ SLAVE MODE TIMING (RECEPTION, 10-BIT ADDRESS) 2010 Microchip Technology Inc. PIC16F/LF722A/723A DS41417A-page 169 ...
Page 170
... SCL held low while CPU responds to SSPIF Cleared in software SSPBUF is written in software From SSP Interrupt to clear BF flag Set bit after writing to SSPBUF (the SSPBUF must be written to before the CKP bit can be set) Transmitting Data ACK Service Routine 2010 Microchip Technology Inc. ...
Page 171
... FIGURE 17-13 SLAVE MODE TIMING (TRANSMISSION 10-BIT ADDRESS) 2010 Microchip Technology Inc. PIC16F/LF722A/723A DS41417A-page 171 ...
Page 172
... Refer to Application Note AN578, “Use of the SSP Module in the I (DS00578) for more information bus may Note AN554, “Software 2 C™ Bus Master” (DS00554) for more 2 C™ Multi-Master Environment” 2010 Microchip Technology Inc. ...
Page 173
... CLOCK SYNCHRONIZATION TIMING SDA DX SCL CKP WR SSPCON 2010 Microchip Technology Inc. PIC16F/LF722A/723A 17.2.11 SLEEP OPERATION While in Sleep mode, the I addresses of data, and when an address match or C master device complete byte transfer occurs, wake the processor from Sleep (if SSP interrupt is enabled). ...
Page 174
... When enabled, these pins must be properly configured as input or output using the associated TRIS bit. DS41417A-page 174 R/W-0 R/W-0 R/W-0 CKP SSPM3 SSPM2 U = Unimplemented bit, read as ‘0’ ‘0’ = Bit is cleared ( MODE) R/W-0 R/W-0 SSPM1 SSPM0 bit Bit is unknown (2) 2010 Microchip Technology Inc. ...
Page 175
... Address does not need to be updated bit 0 BF: Buffer Full Status bit Receive Receive complete, SSPBUF is full 0 = Receive not complete, SSPBUF is empty Transmit Transmit in progress, SSPBUF is full 0 = Transmit complete, SSPBUF is empty 2010 Microchip Technology Inc. PIC16F/LF722A/723A R-0 R Unimplemented bit, read as ‘0’ ...
Page 176
... TMR1IE 0000 0000 0000 0000 xxxx xxxx uuuu uuuu 0000 0000 0000 0000 SSPM0 0000 0000 0000 0000 1111 1111 1111 1111 BF 0000 0000 0000 0000 TRISC0 1111 1111 1111 1111 2 C 2010 Microchip Technology Inc. ...
Page 177
... LOWPMBYTE; MOVF PMDATH, W Byte of Program Memory Read MOVWF HIGHPMBYTE; 2010 Microchip Technology Inc. PIC16F/LF722A/723A The value written to the PMADRH:PMADRL register pair determines which program memory location is read. The read operation will be initiated by setting the RD bit of the PMCON1 register. The program memory Flash controller takes two instructions to complete the read ...
Page 178
... Bit is cleared R/W-x R/W-x R/W-x PMD4 PMD3 PMD2 U = Unimplemented bit, read as ‘0’ ‘0’ = Bit is cleared U-0 R/S-0 — RD bit Bit is unknown R/W-x R/W-x PMD9 PMD8 bit Bit is unknown R/W-x R/W-x PMD1 PMD0 bit Bit is unknown 2010 Microchip Technology Inc. ...
Page 179
... Program Memory Read Data Register High Byte PMDATL Program Memory Read Data Register Low Byte Legend unknown unchanged, – = unimplemented, read as ‘0’. Shaded cells are not used by the Program Memory Read. 2010 Microchip Technology Inc. PIC16F/LF722A/723A R/W-x R/W-x R/W-x PMA12 ...
Page 180
... PIC16F/LF722A/723A NOTES: DS41417A-page 180 2010 Microchip Technology Inc. ...
Page 181
... The TO and PD bits in the STATUS register can be used to determine the cause of device Reset. The PD bit, which is set on power-up, is cleared when Sleep is invoked. TO bit is cleared if WDT wake-up occurred. 2010 Microchip Technology Inc. PIC16F/LF722A/723A The following peripheral interrupts can wake the device from Sleep: 1. ...
Page 182
... Inst(0005h) Dummy Cycle Inst(0004h) Value on Value on all Bit 0 POR, BOR other Resets IOCB0 0000 0000 0000 0000 RBIF 0000 0000 0000 0000 TMR1IE 0000 0000 0000 0000 CCP2IE ---- ---0 ---- ---0 TMR1IF 0000 0000 0000 0000 CCP2IF ---- ---0 ---- ---0 2010 Microchip Technology Inc. ...
Page 183
... GND Data Clock 2010 Microchip Technology Inc. PIC16F/LF722A/723A The device is placed into Program/Verify mode by holding the ICSPCLK and ICSPDAT pins low then raising the voltage on MCLR/V Program/Verify mode the Program Memory, User IDs and the Configuration Words are programmed through serial communications ...
Page 184
... PIC16F/LF722A/723A NOTES: DS41417A-page 184 2010 Microchip Technology Inc. ...
Page 185
... PORTB instruction will read PORTB, clear all the data bits, then write the result back to PORTB. This example would have the unin- tended consequence of clearing the condition that set the RBIF flag. 2010 Microchip Technology Inc. PIC16F/LF722A/723A TABLE 21-1: OPCODE FIELD DESCRIPTIONS ...
Page 186
... TO, PD 0000 0110 0100 1kkk kkkk kkkk Z 1000 kkkk kkkk 00xx kkkk kkkk 0000 0000 1001 01xx kkkk kkkk 0000 0000 1000 TO, PD 0000 0110 0011 C, DC, Z 110x kkkk kkkk Z 1010 kkkk kkkk 2010 Microchip Technology Inc. ...
Page 187
... Status Affected: Z Description: AND the W register with register ‘f’. If ‘d’ is ‘0’, the result is stored in the W register. If ‘d’ is ‘1’, the result is stored back in register ‘f’. 2010 Microchip Technology Inc. PIC16F/LF722A/723A BCF Syntax: k Operands: Operation: Status Affected: ...
Page 188
... Operands: d [0,1] ( (destination) Operation: Status Affected: Z Description: Decrement register ‘f’. If ‘d’ is ‘0’, the result is stored in the W register. If ‘d’ is ‘1’, the result is stored back in register ‘f’. 2010 Microchip Technology Inc. ...
Page 189
... Description: 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’. 2010 Microchip Technology Inc. PIC16F/LF722A/723A INCFSZ Increment f, Skip if 0 Syntax: [ label ] INCFSZ f,d 0 ...
Page 190
... Move label ] MOVWF f 0 f 127 (W) (f) None Move data from W register to register ‘f’ MOVW OPTION F Before Instruction OPTION = 0xFF W = 0x4F After Instruction OPTION = 0x4F W = 0x4F No Operation [ label ] NOP None No operation None No operation NOP 2010 Microchip Technology Inc. ...
Page 191
... Interrupt Enable bit, GIE (INTCON<7>). This is a two-cycle instruction. Words: 1 Cycles: 2 Example: RETFIE After Interrupt PC = TOS GIE = 1 2010 Microchip Technology Inc. PIC16F/LF722A/723A RETLW Return with literal in W Syntax: [ label ] RETLW k 0 k 255 Operands: k (W); Operation: TOS PC Status Affected: None ...
Page 192
... SUBLW k 0 k 255 k - (W) W) The W register is subtracted (2’s complement method) from the eight-bit literal ‘k’. The result is placed in the W register. W W<3:0> k<3:0> W<3:0> k<3:0> 2010 Microchip Technology Inc. ...
Page 193
... The upper and lower nibbles of register ‘f’ are exchanged. If ‘d’ is ‘0’, the result is placed in the W register. If ‘d’ is ‘1’, the result is placed in register ‘f’. 2010 Microchip Technology Inc. PIC16F/LF722A/723A XORLW Exclusive OR literal with W Syntax: [ label ] XORLW k 0 ...
Page 194
... PIC16F/LF722A/723A NOTES: DS41417A-page 194 2010 Microchip Technology Inc. ...
Page 195
... MPLAB ICD 3 - PICkit™ 3 Debug Express • Device Programmers - PICkit™ 2 Programmer - MPLAB PM3 Device Programmer • Low-Cost Demonstration/Development Boards, Evaluation Kits, and Starter Kits 2010 Microchip Technology Inc. PIC16F/LF722A/723A 22.1 MPLAB Integrated Development Environment Software ® digital signal The MPLAB IDE software brings an ease of software development previously unseen in the 8/16/32-bit microcontroller market ...
Page 196
... Support for the entire device instruction set ® standard HEX • Support for fixed-point and floating-point data • Command line interface • Rich directive set • Flexible macro language • MPLAB IDE compatibility 2010 Microchip Technology Inc. ...
Page 197
... Microchip Technology Inc. PIC16F/LF722A/723A 22.9 MPLAB ICD 3 In-Circuit Debugger System MPLAB ICD 3 In-Circuit Debugger System is Micro- chip's most cost effective high-speed hardware ...
Page 198
... This usually includes a single application and debug capability, all for DDMAX on one board. Check the Microchip web page (www.microchip.com) for the complete list of demonstration, development and evaluation kits. ® L security ICs, CAN ® 2010 Microchip Technology Inc. ...
Page 199
... 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. 2010 Microchip Technology Inc. PIC16F/LF722A/723A , PIC16F722A/723A ............................................................ -0.3V to +4.0V ...
Page 200
... OSC 20 MHz, HS OSC 2.5V = 1.024V, V FVR DD 2.5V = 2.048V, V FVR DD 4.75V; = 4.096V, V FVR DD 85°C A 2.5V = 1.024V, V FVR DD 2.5V = 2.048V, V FVR DD 4.75V; = 4.096V, V FVR DD 125°C A 2010 Microchip Technology Inc. ...