Home/Teaching/Course
Recently taught

Embedded Systems Design

Architecture, programming and interfacing of PIC microcontroller-based systems, taught through hands-on, project-based design.

Course Description

This course introduces students to the fundamental concepts of embedded systems, focusing on the architecture, programming, and interfacing of microcontroller-based systems. Using PIC microcontrollers, students explore embedded hardware and software design, digital input/output, timers, interrupts, analog-to-digital conversion (ADC), pulse-width modulation (PWM), and serial communication. The course emphasizes practical applications through programming, simulation, and interfacing with sensors, actuators, and motors.

  • LevelUndergraduate
  • PlatformPIC 16F84A / 16F877A
  • ToolsMPLAB, mikroC PRO
  • DeliveryProject-based

Key Topics

  1. Microcontroller vs. microprocessor architecture and the PIC 8-bit family.
  2. Digital I/O, parallel ports, clocking, and switch/LED interfacing.
  3. Assembly and C (mikroC PRO) programming with MPLAB.
  4. Interrupts, timers, counters, and Capture/Compare/PWM modules.
  5. Analog-to-digital conversion and signal conditioning.
  6. Sensors, displays, keypads, and DC/stepper/servo motor drivers.

Topics Covered

Ch.TopicContent
1Introduction to Embedded SystemsMicrocontroller vs. microprocessor architecture, semiconductor memory technologies (SRAM, ROM, Flash), computer organization, and 8-bit PIC microcontroller family overview.
2PIC Mid-Range Family & 16F84A ArchitectureProgram and data memory structure, status registers, Special Function Registers (SFRs), banked RAM addressing, and configuration word settings.
3Parallel Ports, Power Supply, & Clock OscillatorsPort A/B electrical characteristics, push-pull vs. open-drain outputs, switch/LED interfacing, pull-up resistors, and RC/crystal clock oscillators.
4Starting to Program – Introduction to AssemblerSoftware development cycle, PIC 16 instruction set, MPLAB IDE, MPASM assembler, software simulation with MPSIM, and downloading code to hardware.
5Building Assembler ProgramsFlowcharts/state diagrams, conditional branching, subroutines, software delay generation, bitwise logical instructions, look-up tables (retlw/addwf PCL), macros, and mikroC PRO.
6Interrupts, Counters, & TimersHardware interrupt processing (INTCON, ISR, context saving, critical regions), Timer 0 (TMR0) module, prescalers, hardware delay loops, and Sleep mode.
7Larger Systems & PIC 16F873A/16F874A/16F877AProgram memory paging (PCLATH), expanded I/O ports (Ports A–E), peripheral allocation, and system testing/diagnostic tools (emulators, debuggers).
8Human & Physical InterfacesMatrix keypads, 7-segment display multiplexing, switch debouncing, sensors (optical, ultrasonic, Hall effect, temperature), and motor drivers (DC, H-bridge, stepper, servo).
9Taking Timing FurtherAdvanced timing features including 16-bit Timer 1, 8-bit Timer 2 (with PR2 period register and postscalers), and Capture/Compare/PWM (CCP) hardware modules.
11Data Acquisition & ManipulationAnalog-to-Digital Converters (ADC characteristics, step size, resolution), signal conditioning, voltage scaling/translation circuits, analog multiplexing, and comparators.

Textbook

  • Tim Wilmshurst, Designing Embedded Systems with PIC Microcontrollers: Principles and Applications, Newnes.

Video Lectures

Recorded lecture demonstrations, practical laboratory tutorials, and student videos showcasing their hardware–software embedded prototypes.

Open the playlist on YouTube Start with the first video

Interactive Simulation Labs

Browser-based PIC simulators: write assembly, run or single-step it, and watch the registers, breadboard LEDs, 7-segment display, timer and interrupts update live. The I/O Pin Lab zooms in on the hardware behind one port pin, the Power-Up Reset Lab shows why the PIC must be held in reset at switch-on, the Oscillator Lab shows the LP/XT/HS/RC clock signals, the Motor Drive Lab shows how the PIC switches a DC motor through a BJT, a MOSFET or an H-bridge, and the IDE Simulator recreates an MPLAB-style debugging session with machine code, registers, RAM and the stack. Click a lab to open it in a new tab.

Screenshot of the PIC16F84A Simulation Lab 18-pin · 2 banks · 1K×14 Flash

PIC16F84A Simulation Lab

The classic 18-pin PIC used throughout the course: PORTA/PORTB, TMR0, the RB0/INT interrupt and bank switching.

Open in a new tab ↗
Screenshot of the PIC16F877 Simulation Lab 40-pin · 4 banks · 8K×14 Flash

PIC16F877 Simulation Lab

The larger 40-pin device with PORTA–PORTE, four register banks and a logic analyzer for tracing any pin.

Open in a new tab ↗
Screenshot of the PIC16F84A I/O Pin Lab showing the port-pin circuit with an LED lit One port pin · Q1–Q4 · switch & LED

PIC16F84A I/O Pin Lab

Look inside a single port pin. Type an instruction and watch the data latch and TRIS latch get clocked, the tri-state buffers switch on and off, and the result reach a switch or an LED. Includes the bank-select, read-modify-write and open-drain RA4 traps.

Open in a new tab ↗
Screenshot of the Power-Up Reset Lab showing VDD, MCLR and oscillator traces after switch-on POR · PWRTE · OST · MCLR RC

PIC16F84A Power-Up Reset Lab

Watch the first milliseconds after switch-on: VDD ramping up and the crystal starting. See how the internal POR, the 72 ms power-up timer, the oscillator start-up timer and the external R-C (with diode and Rs) on MCLR keep the PIC in reset until conditions are healthy.

Open in a new tab ↗
Screenshot of the PIC Oscillator Lab showing the oscillator circuit and OSC1, OSC2, Q1 to Q4 and CLKOUT waveforms LP · XT · HS · RC · Q1–Q4

PIC16F84A Oscillator Lab

Fit a crystal, ceramic resonator, R–C network or external clock and choose the FOSC mode. See whether the oscillator matches, is overdriven or fails to start, and watch the OSC1/OSC2 signals, the Q1–Q4 clock phases, CLKOUT and the two-stage instruction pipeline (Tcy = 4·Tosc).

Open in a new tab ↗
Screenshot of the PIC Motor Drive Lab showing an H-bridge with current flow, node voltages and oscilloscope traces BJT · MOSFET · H-bridge · L293D stepper

PIC16F84A Motor Drive Lab

Drive a DC motor from a PIC pin through a BJT, a logic-level MOSFET or an H-bridge, and step a two-phase stepper through an L293D. Watch the current flow and the voltages at every important node, compare flyback clamps and PWM decay modes, follow the operating point on the torque–speed plane with an energy and heat budget, and work through self-checking challenges with H-bridge code for forward, reverse, coast and brake.

Open in a new tab ↗
Screenshot of the PIC IDE Simulator showing the editor, disassembly listing, special function registers, file registers and hardware stack MPLAB-style debugger · machine code · stack

PIC16F84A IDE Simulator

An MPLAB-style debugger in the browser. Write assembly in the editor, build it, and step through the program while the disassembly listing shows each instruction's 14-bit machine code. Watch the Special Function Registers, File Registers (RAM) and the 8-level hardware stack update, with breakpoints, Step Over/Out and a cycle stopwatch.

Open in a new tab ↗

Source code: Qaralleh-Esam/Embedded-Systems- on GitHub.

Course Materials

Slides are hosted on Google Drive and open in a new tab. Browse the whole folder, or pick a file below. Student project repositories are on GitHub.

Student Projects