PIC16F84A Simulation Lab

PIC16F84A Simulation Lab — interactive hardware simulator for the 18-pin PIC16F84A · all special function registers live · type instructions or run full programs

The PIC16F84A is an 18-pin part with only two I/O ports: PORTA (RA0–RA4, 5 bits) and PORTB (RB0–RB7, 8 bits) — there is no PORTC/PORTD/PORTE on this chip. Both ports are wired to breadboard hardware here (switches and LEDs/7-seg). Any pin currently configured as an input (dashed ring, once you flip its TRIS bit) can also be clicked directly on the chip body itself.

Logic Analyzer — 4 Channels

Time/div

Name each channel and pick any pin (any port, wired to the breadboard or not) to trace it live — captured instruction-by-instruction while running, so fast toggles aren't missed. Time/div runs from 1 ms down to 1 ns; the drawing is laid out on that real time axis (cycles × Tcy), so zooming in past one instruction's Tcy just shows a held value, same as a real instrument outrunning its sample rate. This panel is global — it keeps running under the Interrupt (RB0/INT) and SFRs & Memory tabs too, not just Breadboard — and Run/Stop here are the same Assemble & Run / Stop controls as the ones next to the code editor, so you never have to leave this view to control the simulation.

How this demo works

• The PIC drives PORTB (RB0–RB7). Each RB pin wires straight into the jumper matrix — click its L dot to route that pin to an LED, or its S dot to route it onto the 7-segment bus (bit0..7 → a,b,c,d,e,f,g,dp).
• Switches are wired to PORTA (RA0–RA4, only 5 lines on this chip) whenever a pin is configured as an input (TRISA bit = 1) — click to toggle, read with MOVF PORTA,W / BTFSC PORTA,0. Configure an RA pin as an output instead and its switch knob turns yellow, showing the value the CPU is driving, and stops responding to clicks.
• Set TRISB = 0 before writing PORTB, otherwise the pins stay inputs and nothing lights up.
• Bank switching is real, across both banks. Instructions only carry a 7-bit register offset — PORTA/PORTB (bank 0) and TRISA/TRISB (bank 1) share the same offset, so which one you actually hit depends on the live STATUS<RP0> bit at that moment, exactly like real hardware (RP1/IRP are unimplemented on the 84A). Writing MOVWF TRISB while RP0=0 silently writes PORTB instead — BSF STATUS,RP0 before touching TRISx, then BCF STATUS,RP0 before touching PORTx, exactly as the default program does.
• The currently-executing instruction is highlighted directly in the Program Editor as the program runs.

CPU State

PCWBankZCDC
00x000 000
PORTATRISAPORTBTRISB
0x000x1F 0x000xFF
EEDATAEEADRStack
0x000x000/8

      
Clock (Fosc): Tcy = 0.500 µs/instr · up to 2.00 MIPS
Run speed: 1/4 Full Full speed (1×) — real-time-accurate at the selected clock
Instructions: 0  ·  Simulated time: 0.000 ms  ·  Real time: 0.000 ms  ·  Achieved: —