Skip to content

Using GPIO ports

Practical guide unit

Using GPIO ports

Beginner

Step-by-step tutorial: from creating the MPLAB project to simulating an LED controlled by a button — one verifiable action per step.

You will build

A `.ASM` that builds, loads in Proteus, and makes an **LED on RB0** follow a **button on RB1** using TRIS → LAT → PORT.

  1. 1 Welcome: what you will achieve
  2. 2 Create project and .ASM file
  3. 3 LIST and #include
  4. 4 Course config bits
  5. 5 Reset vector and sandwich layout
  6. 6 TRIS: RB0 output, RB1 input
  7. 7 Wire LED and button in Proteus
  8. 8 LAT: turn on the LED (first test)
  9. 9 PORT: button controls the LED
  10. 10 Review final program and save
  11. 11 Check what you learned

Start step 1 →