Using the PICSimLab Oscilloscope: Two-Channel Basics
PICSimLab includes a built-in oscilloscope, and learning it early makes every other tutorial easier: instead of guessing whether a pin toggles at the right speed, you measure it. Be clear about what it is, though — per the official documentation it is a basic two-channel oscilloscope for viewing the signal on any microcontroller pin, not a professional bench instrument. Within that scope, it is genuinely useful.
What you need
- PICSimLab 0.9.3 — see the download page.
- Any running simulation with a changing pin. The LED blink project (RB0 toggling every 500 ms) is the ideal first signal; the timer interrupt project works too.
- No spare parts are required — the oscilloscope is its own module, not a spare part.
Steps
1. Start a simulation with a known signal
Load the blink hex file, start the simulation and confirm the LED toggles. A measurement is only meaningful against a signal you can predict: RB0 should be a square wave with a period of about one second (500 ms high, 500 ms low).
2. Open the oscilloscope
Open Modules → Oscilloscope. The oscilloscope window shows two channels; assign the first channel to pin RB0 of the microcontroller. Adjust the time base until one or two full cycles fit on screen — for a 1 Hz signal you need a much slower sweep than the defaults used for kilohertz signals.
3. Add measurements
The oscilloscope supports up to 4 simultaneous measurements, chosen from: Vmax, Vmin, Vavg, Vrms, Frequency, Duty cycle, Pos. cycle, Neg. cycle and Full cycle. For the blink signal, add Frequency and Duty cycle: expect about 1 Hz and about 50%. Add Full cycle as a third measurement to see the period in time units.
4. Compare two pins on two channels
Assign the second channel to another live pin — for example the Timer0 interrupt LED project running alongside a delay-based blink on a second pin, or the TX pin from the UART tutorial while it sends a character. Two channels are enough to check which signal changes first and whether two outputs stay in step.
5. Measure a PWM-style signal
Generate a faster toggling signal (shorten the blink delays, or use a CCP PWM exercise) and re-measure: Frequency and Duty cycle now change with your code, which is exactly the feedback loop you want when tuning timers. Remember the simulation speed caveat from the documentation: signals are only as accurate as the simulated clock, so verify your _XTAL_FREQ assumption matches the board configuration.
What the oscilloscope is not
It does not turn PICSimLab into a logic analyser suite or a calibrated measurement instrument, and it shows simulated pin levels — idealised logic signals from the simulator core, not the analogue behaviour (ringing, rise times, loading) of a real circuit. Use it to verify timing, frequency, duty cycle and sequencing in your firmware; use real instruments on real hardware for signal integrity.
Try next
- Timers and interrupts — produce precise signals worth measuring.
- ADC potentiometer — probe the analog input pin while you turn the knob.
- Step Motor spare part — check the four step pulses stay evenly spaced.
Troubleshooting
The trace is a flat line. The simulation is stopped, the channel is assigned to the wrong pin, or the time base is so fast that a 1 Hz signal looks frozen. Confirm the LED itself toggles, then slow the sweep down.
Frequency reads about double or half the expected value. Your code’s timing assumption is off — most often _XTAL_FREQ not matching the board clock configured in PICSimLab. Fix the define, rebuild, reload and measure again.
