Microchip PIC16F84A-20/P 8-Bit Microcontroller Architecture and Application Design
The Microchip PIC16F84A-20/P stands as a seminal component in the history of 8-bit microcontrollers, renowned for its robust Harvard architecture and remarkable ease of use. This device, operating at a maximum clock speed of 20 MHz, became a cornerstone for embedded systems education and countless commercial applications, from automotive modules to industrial control systems.
Architectural Overview
The core strength of the PIC16F84A lies in its streamlined design. Unlike von Neumann architecture, it employs a Harvard architecture that features separate buses for program and data memory. This separation allows for concurrent instruction fetch and data access, significantly enhancing throughput and performance.
Its RISC (Reduced Instruction Set Computing) core is another critical feature. With a concise set of just 35 single-word instructions, the microcontroller executes operations with high efficiency. Most instructions complete in a single clock cycle, except for program branches which take two, enabling deterministic timing critical for real-time control applications.
The memory organization is logically partitioned:
Program Memory (Flash): 1K x 14 bits of electrically erasable and programmable read-only memory (EEPROM). This non-volatile memory stores the firmware and can be reprogrammed up to 10,000 times, facilitating rapid prototyping and code revisions.
Data Memory (RAM): 68 bytes of general-purpose SRAM for temporary data storage during program execution.
Data EEPROM: 64 bytes of independent electrically erasable memory. This section is used for storing long-term data—such as calibration constants, device parameters, or user settings—that must be retained even when power is removed, supporting up to 10,000,000 write/erase cycles.
A central element of its I/O capability is the bi-directional I/O port. The device features 13 pins dedicated to input/output operations, organized as Port A (5 bits) and Port B (8 bits). Each pin can be individually configured as an input (high-impedance state) or an output (driving high or low) through the TRISA and TRISB registers, providing immense flexibility in interfacing with sensors, actuators, and other peripherals.
Key Peripherals and Interrupts
The PIC16F84A is equipped with a versatile real-time clock counter (RTCC) also known as the Timer0 module. It can operate as an 8-bit timer or counter with an optional prescaler, generating precise time delays or counting external events.
For handling external and internal asynchronous events, it features a powerful interrupt structure. The microcontroller supports four interrupt sources:
External interrupt on RB0/INT pin.

Timer0 overflow interrupt.
Port B change interrupt (on pins RB4-RB7).
Data EEPROM write complete interrupt.
This allows the processor to respond promptly to critical events without constant polling, improving program efficiency.
Application Design Considerations
Designing with the PIC16F84A involves a clear workflow. Code is typically written in C or Assembly, compiled using tools like MPLAB X IDE, and programmed into the device via a dedicated hardware programmer.
A fundamental design practice is effective port manipulation. Engineers must carefully manage the TRIS and PORT registers to avoid conflicts, such as short circuits when a pin configured as an output is driven high while externally pulled low. For example, to blink an LED on RB0:
1. Clear the TRISB0 bit to set RB0 as an output.
2. Set the RB0 bit to drive the pin high (LED on).
3. Use a timer-driven delay routine.
4. Clear the RB0 bit to drive the pin low (LED off).
For applications requiring data persistence, such as a event counter, the on-board data EEPROM is invaluable. Data can be written to and read from this memory space during operation, ensuring critical information is not lost during a power cycle.
Legacy and Modern Context
While modern microcontrollers offer more memory, higher performance, and advanced peripherals (ADCs, PWM, communication interfaces like I²C and SPI), the PIC16F84A remains an excellent tool for learning fundamental embedded concepts. Its simplicity provides a transparent platform for understanding how to directly manipulate hardware registers, manage interrupts, and architect bare-metal firmware without the abstraction layers of more complex systems.
ICGOODFIND: The Microchip PIC16F84A-20/P is a classic, highly reliable 8-bit microcontroller that exemplifies efficiency through its Harvard architecture and RISC core. Its reprogrammable Flash and EEPROM memory, combined with straightforward I/O control, made it an icon for a generation of engineers and continues to serve as a perfect vehicle for educational purposes in embedded system design.
Keywords: Harvard Architecture, RISC Core, Data EEPROM, Bi-directional I/O, Interrupt Structure.
