Skip to content

What is the PIC18F4550

The PIC18F4550 is the 8-bit microcontroller you will use in this course. If you have not read basic microcontroller concepts (μC vs μP, memory, and peripherals) yet, start there.

It integrates CPU, Flash/RAM/EEPROM memory, I/O ports, and internal peripherals in a single chip. It is popular in courses because it forces you to understand the machine from the inside: registers, bits, ports, interrupts, and timers.

40-pin PDIP pin diagram of the PIC18F4550
40-pin PDIP pinout for the PIC18F4550 (ports RA–RE, oscillator, MCLR, and peripherals). — Microchip PIC18F4550 Datasheet DS39632E

In digital systems, each bit is a position that holds 0 or 1. With n bits, the number of distinct combinations is 2ⁿ (two to the power of n).

n (bits)Combinations 2ⁿNumbers you can represent (unsigned)
120 to 1
240 to 3
380 to 7
82560 to 255

With 3 bits you get the combination table used in digital courses (each row is a distinct state):

bit 2bit 1bit 0Decimal
0000
0011
0102
0113
1004
1015
1106
1117

That is 8 rows = 2³ = 8 states, numbered 0 through 7.

The PIC18F4550 uses 8 bits per register (one byte). Same idea at scale: 2⁸ = 256 combinations, numbered 0 through 255. That is why WREG, PORTB, and most data registers fit in a single byte.

Each bit in the byte has a weight (power of 2). If the bit is 1, you add that weight:

bit 7bit 6bit 5bit 4bit 3bit 2bit 1bit 0
1286432168421

Examples:

DecimalBinary (8 bits)Calculation
5000001014 + 1 = 5
25511111111128 + 64 + 32 + 16 + 8 + 4 + 2 + 1 = 255

In Basic architecture you will see why a sum like 200 + 100 = 300 does not fit in 8 bits and sets carry flag C. In Bits and hexadecimal you go deeper into conversions and masks.

8-bit CPU

Executes instructions from the PIC18 instruction set. It works with one-byte registers (0–255), such as WREG, STATUS, BSR, and the program counter.

Flash memory

Stores the program. When you burn the .hex file, its content is stored here.

RAM

Stores temporary variables, counters, flags, and data while the program runs.

EEPROM

Non-volatile memory for data that must remain saved even when the circuit is powered off.

I/O ports

Pins configurable as digital inputs or outputs through registers like TRISx, PORTx, and LATx.

Peripherals

Timers, ADC, PWM, USART, USB, interrupts, and other internal modules.

Assembly lets you see what a high-level language usually hides. Instead of writing an abstract function, you directly modify registers and bits. This helps answer theory questions such as:

  1. What is the difference between PORTB and LATB?
  2. Why must a pin be configured with TRISB before using it?
  3. How does an interrupt change the normal program flow?
  4. What is the relationship between clock frequency, instruction cycles, and timers?

The PIC18F4550 is a small dedicated computer where your program directly controls the hardware.

Interactive exam

Introduction to PIC18F4550

Based on: Tema 1. Conceptos Básicos (1).pdf

0 of 0 answered

Does the PIC18F4550 run an operating system like a Raspberry Pi?
Where is the program you burn with the .hex file stored?
How many bits is the PIC18F4550 CPU?
With 8 bits, how many distinct combinations are there (2⁸)?
With 3 bits, the combination table has rows from 0 to...