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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>PIC16F84A</strong>APPENDIX C: MIGRATION FROMBASELINE TOMIDRANGE DEVICESThis section discusses how to migrate from a baselinedevice (i.e., PIC16C5X) to a midrange device (i.e.,PIC16CXXX).The following is the list of feature improvements overthe PIC16C5X microcontroller family:1. Instruction word length is increased to 14 bits.This allows larger page sizes both in programmemory (2K now as opposed to 512 before) andthe register file (128 bytes now versus 32 bytesbefore).2. A PC latch register (PCLATH) is added to handleprogram memory paging. PA2, PA1 and PA0 bitsare removed from the status register and placedin the option register.3. <strong>Data</strong> memory paging is redefined slightly. TheSTATUS register is modified.4. Four new instructions have been added:RETURN, RETFIE, ADDLW, and SUBLW. Twoinstructions, TRIS and OPTION, are beingphased out although they are kept forcompatibility with PIC16C5X.5. OPTION and TRIS registers are madeaddressable.6. Interrupt capability is added. Interrupt vector isat 0004h.7. Stack size is increased to 8 deep.8. Reset vector is changed to 0000h.9. Reset of all registers is revisited. Five differentreset (and wake-up) types are recognized.Registers are reset differently.10. Wake up from SLEEP through interrupt isadded.11. Two separate timers, the Oscillator Start-upTimer (OST) and Power-up Timer (PWRT), areincluded for more reliable power-up. Thesetimers are invoked selectively to avoidunnecessary delays on power-up and wake-up.12. PORTB has weak pull-ups and interrupt onchange features.13. T0CKI <strong>pin</strong> is also a port <strong>pin</strong> (RA4/T0CKI).14. FSR is a full 8-bit register.15. "In system programming" is made possible. Theuser can program PIC16CXX devices using onlyfive <strong>pin</strong>s: VDD, VSS, VPP, RB6 (clock) and RB7(data in/out).To convert code written for PIC16C5X to <strong>PIC16F84A</strong>,the user should take the following steps:1. Remove any program memory page selectoperations (PA2, PA1, PA0 bits) for CALL, GOTO.2. Revisit any computed jump operations (write toPC or add to PC, etc.) to make sure page bitsare set properly under the new scheme.3. Eliminate any data memory page switching.Redefine data variables for reallocation.4. Verify all writes to STATUS, OPTION, and FSRregisters since these have changed.5. Change reset vector to 0000h.DS35007A-page 62 Preliminary © 1998 Microchip Technology Inc.

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

Saved successfully!

Ooh no, something went wrong!