12.07.2015 Views

PIC16F84A 18-pin Enhanced Flash/EEPROM 8-Bit MCU Data Sheet

PIC16F84A 18-pin Enhanced Flash/EEPROM 8-Bit MCU Data Sheet

PIC16F84A 18-pin Enhanced Flash/EEPROM 8-Bit MCU Data Sheet

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>PIC16F84A</strong>6.11.3 WAKE-UP USING INTERRUPTSWhen global interrupts are disabled (GIE cleared) andany interrupt source has both its interrupt enable bitand interrupt flag bit set, one of the following will occur:• If the interrupt occurs before the execution of aSLEEP instruction, the SLEEP instruction will completeas a NOP. Therefore, the WDT and WDTpostscaler will not be cleared, the TO bit will notbe set and PD bits will not be cleared.• If the interrupt occurs during or after the executionof a SLEEP instruction, the device will immediatelywake up from sleep. The SLEEP instructionwill be completely executed before the wake-up.Therefore, the WDT and WDT postscaler will becleared, the TO bit will be set and the PD bit willbe cleared.Even if the flag bits were checked before executing aSLEEP instruction, it may be possible for flag bits tobecome set before the SLEEP instruction completes. Todetermine whether a SLEEP instruction executed, testthe PD bit. If the PD bit is set, the SLEEP instructionwas executed as a NOP.To ensure that the WDT is cleared, a CLRWDT instructionshould be executed before a SLEEP instruction.6.14 In-Circuit Serial Programming<strong>PIC16F84A</strong> microcontrollers can be seriallyprogrammed while in the end application circuit. This issimply done with two lines for clock and data, and threeother lines for power, ground, and the programmingvoltage. Customers can manufacture boards withunprogrammed devices, and then program themicrocontroller just before ship<strong>pin</strong>g the product,allowing the most recent firmware or custom firmwareto be programmed.For complete details of serial programming, pleaserefer to the In-Circuit Serial Programming (ICSP)Guide, (DS30277).6.12 Program Verification/Code ProtectionIf the code protection bit(s) have not beenprogrammed, the on-chip program memory can beread out for verification purposes.Note:Microchip does not recommend code protectingwindowed devices.6.13 ID LocationsFour memory locations (2000h - 2004h) are designatedas ID locations to store checksum or other codeidentification numbers. These locations are notaccessible during normal execution but are readableand writable only during program/verify. Only thefour least significant bits of ID location are usable.DS35007A-page 32 Preliminary © 1998 Microchip Technology Inc.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!