Introduction
PIC18F4550 is a high performance 8-bit PIC micro-controller produced by Microchip Technology nearly two decades now. It's a USB micro-controller since it has a USB interface that supports up to USB 2.0. It operates up to 48MHz by enable its Phase Lock Loop (PLL) with pre-scaler and post-scaler settings.
![]() |
| A DIY PIC18F4550 Prototype Board |
It has up to 5 I/O ports ranging from PORTA to PORTE. They are digital programmable input output ports. Some ports have an alternative functions such as ADC inputs, PWM output, SPI, I2C, interrupt capture, etc.
![]() |
| PIC18F4550-I/P I stock and its pin diagram |
This 8-bit chip is very easy to program since there are a lot of compilers including Assembly and C. Using Assembly is free since the manufacture offer this feature with it MPLABX IDE compiler.
Today, using a high level programming language is common since modern micro-controllers have a large RAM and Flash memory space. The XC8 C compiler is free of charge with some limited C language features. Some commercial C compiler for this chip are CCS PICC, Mikroelektronika MikroC, IAR Embedded Workbench for PIC18, etc.
However Mikroelektronika offers a free version of its compiler for evaluation without limiting any features. But the compiling code is not larger than 2KB. It's suitable for any small control project, students and hobbyists.
PIC18F4550 LED Blinking using MikroC
I test the oscillator and on-board LED of my DIY PIC18F4550 prototype board by blinking an LED connects to RD0.
The on-board crystal clock frequency is 20MHz. So need to do additional configurations to get a 48MHz clock frequency. It's useful to drive the USB hardware clock of this micro-controller.
After creating a new project, go to Project menu and click on Edit Project as show in the picture below.
![]() |
| Edit Project to set a 48MHz clock frequency. |
Schematic
![]() |
| Schematic |
MikroC Source Code
#define LED LATD0_bit- void main() {
- PORTD = 0;
- LATD = 0;
- TRISD = 0;
- while(1){
- LED = 0;
- Delay_ms(1000);
- LED = 1;
- Delay_ms(1000);
- }
- }
Hardware Test
![]() |
| LED Blinking at RD0 |
We can do the LED blinking using MPLABX XC8 or CCS PICC Compiler with the same chip.







.jpg)










