PIC18F4550 Microcontroller : Pin Configuration & Its Applications

Microchip technology introduced 8-bit, 16-bit and 32-bit portable microcontrollers called PIC18 microcontrollers with nano-watt technology to perform a huge range of tasks. These are used in many electronics applications and industries due to their high performance and low power consumption. The family of PIC microcontrollers includes PIC18FXXXX (F- flash program memory), PIC18CXXXX (C- EEPROM program memory), and PIC18LFXXXX (L- low voltage operation). This article describes one of the PIC microcontrollers called PIC18F4550 microcontroller with a circuit diagram and pin configuration.


What is a PIC18F4550 Microcontroller?

PIC18F4550 is an 8-bit microcontroller manufactured by Microchip with nano-Watt technology with enhanced flash, USB, and high-performance. It is a 40-pin microcontroller that comes with several features such as memory endurance, self-programmability, extended instruction set, enhanced CCP module, and addressable USART and 10-bit ADC (Analog to digital converter).

PIC18F4550 Microcontroller
PIC18F4550 Microcontroller

It consists of 4 timers or an external oscillator is interfaced for clocking purposes, 13 channels for ADC, ADC comparators, and other peripherals. It is an 8-bit popular microcontroller available in various packages like QPF, QPN, and DIP. It is selected based on the type of project and requirement. The PIC18F4550 portable Portable microcontroller chip form is shown below.

It is very simple to program the PIC18F4550 controller and easy to interface with many peripheral devices using 35 programmable I/O pins. With the feature of the USB interface, it provides hassle-free communication between the controller and the PC. The watchdog timer can be reset to use the systems without any human interface.

Pin Configuration/Pin Diagram:

The PIC18F4550 pin configuration/pin diagram is illustrated below.

PIC18F4550 Microcontroller Pin Diagram
PIC18F4550 Microcontroller Pin Diagram
  • Pin 1: (MCLR; VPP; RE3): This pin refers to Master Clear Input (RESET), Programming Voltage Input, and I/O Pin 3 of PORTE.
  • Pin 2: (RA0; AN0): This pin refers to time PORTA I/O Pin 0 of PORTA and Analog Input 0
  • Pin 3: (RA1; AN1): This pin refers to I/O Pin 1 of PORTA and Analog Input 1.
  • Pin 4: (RA2; VREF; CVREF; AN2): This pin refers to I/O Pin 2 of PORTA, A/D reference Voltage Input (low), Analog Comparator Reference Output, and Analog Input 2.
  • Pin 5: (RA3; AN3; VREF): This pin refers to I/O Pin 3 of PORTA, Analog Input 3, and A/D reference Voltage Input (High).
  • Pin 6: (RA4; T0CK1; C1OUT; RCV): This pin refers to I/O pin 4 of PORTA, Timer 0 external clock input, Comparator 1 output, and External USB Transceiver RCV input.
  • Pin 7: (RA5; AN4; SS; HLVDIN; C2OUT): This pin refers to I/O pin 5 of PORTA, Analog Input 4, SPI Slave Select input, High/Low-level Voltage Detect Input, Comparator 2 output.
  • Pin 8: (RE0; AN5; CK1SPP): This pin refers to I/O PIN 0 of PORTE, Analog Input 5, and SPP clock 1 output.
  • Pin 9: (RE1; AN6; CK2SPP): This pin refers to PORTE I/O PIN 1, Analog Input, and SPP clock 2 output.
  • Pin 10: (RE2; AN7; OESPP): This pin refers to I/O PIN 2 of PORTE, Analog Input 7, and SPP Enable output.
  • Pin 11: (VDD): This pin refers to 5 Volts positive power supply.
  • Pin 12: (VSS): This pin refers to Ground (0V).
  • Pin 13: (OSC1; CLKI): This pin refers to Oscillator pin 1 and External clock source input.
  • Pin 14: (OSC2; CLKO; RA6): This pin refers to Oscillator pin 2, a clock source output.
    and PORTA I/O PIN 6.
  • Pin 15: (RC0; T1OSO; T13CKL): This pin refers to PORT C I/O pin 0, Timer 0 oscillator output, and Timer 1/ Timer 3 external clock input.
  • Pin 16: (RC1; T1OSL; CCP2; UOE): This pin refers to PORTC I/O PIN 1, Timer 1 Oscillator input, Capture 2 input or compares 2 output/PWM2 output and External USB transceiver OE output.
  • Pin 17: (RC2; CCP1; P1A): This pin refers to PORTC I/O PIN 2, capture 1 input/ compare 1output/ PWM1 output and Enhanced CCP1 PWM output, channel A.
  • Pin 18: (VUSB): This pin refers to Internal USB 3.3V regulator voltage output.
  • Pin 19: (RD0; SPP0): This pin refers to PORT D I/O pin 0 and Streaming parallel port data.
  • Pin 20: (RD1; SPP1): This pin refers to PORT D I/O PIN 1 and Streaming parallel port data.
  • Pin 21:(RD2; SPP2): This pin refers to PORT D I/O PIN 2 and Streaming parallel port data.
  • Pin 22:(RD3; SPP3): This pin refers to PORT D I/O PIN 3 and Streaming parallel port data.
  • Pin 23: (RC4;D-; VM): This pin refers to PORT C I/O PIN 4, USB differential minus line (input/output), and External USB transceiver VM input.
  • Pin 24:(RC5; D+; VP): This pin refers to I/O PIN 5 of PORT C, USB different (input/output) plus line, and External USB transceiver VP output.
  • Pin 25:(RC6; TX, CK): This pin refers to I/O PIN 6 of PORT C, EUSART asynchronous transmit, and EUSART synchronous clock (RX/DT).
  • Pin 26:(RC7; RX; DT; SDO): This pin refers to I/O PIN 7 of PORT C, EUSART asynchronous receive, EUSART synchronous data (TX/CK), and SDO: SPI data output.
  • Pin 27:(RD4; SPP4): This pin refers to I/O PIN 4 of PORT D and Streaming parallel port data.
  • Pin 28: (RD5; SPP5; P1B): This pin refers to I/O PIN 5 of PORT D, Streaming parallel port data and Enhanced CCP1 PWM output, channel B.
  • Pin 29: (RD6; SPP6; P1C): This pin refers to I/O PIN 6 of PORT D, streaming parallel port data and Enhanced CCP1 PWM output, channel C.
  • Pin 30: (RD7; SPP7; P1D): This pin refers to I/O PIN 7 of PORT D, streaming parallel port data and Enhanced CCP1 PWM output, channel D.
  • Pin 31:(VSS): This pin refers to a 5V Positive power supply.
  • Pin 32:(VDD): This pin refers is for the Ground connection.
  • Pin 33: (RB0; AN12; INT0; FLT0; SDI; SDA): This pin refers to I/O pin 0 of PORT B, Analog input 12, External interrupt 0, Enhanced PWM fault input ( module ECCP1), SPI data in and I2C data I/O.
  • Pin 34: (RB1; AN10; INT1; SCK; SCL): This pin refers to I/O pin 1 of PORT B, Analog input 10, External interrupt 1, Synchronous serial clock input/output for SPi module, and synchronous serial clock input/output for the I2C module.
  • Pin 35: (RB2; AN8; INT2; VMO): This pin refers to I/O pin 2 of PORT B, Analog input 8, External interrupt 2, and External USB transceiver VMO output.
  • Pin 36: (RB3; AN9; CCP2; PWM; VPO): This pin refers to I/O pin 3 of PORT B, Analog input 9, capture 2 input / Compare 2 output / PWM output, and External USB transceiver VPO Output.
  • Pin 37: (RB4; AN11; KBI0; CSSPP): I/O Pin 4 of PORT B, Analog Input 11, Interrupt-on-change pin, and SPP chip select control output.
  • Pin 38: (RB5; KBI1; PGM): This pin refers to I/O Pin 5 of PORT B, Interrupt-on-change pin and Low-voltage ICSP programming enable pin.
  • Pin 39:(RB6; KBI2; PGC): This pin refers to I/O pin 6 of port B, Interrupt-on-change pin and In-circuit debugger, and ICSP programming clock pin.
  • Pin 40: (RB7; KBI3; PGD): This pin refers to I/O pin 7 of PORT B, Interrupt-on-change pin and In-circuit debugger, and ICSP Programming data pin.

Features & Specifications:

The PIC18F4550 microcontroller technical Specifications or technical features are given below.

PCBWay
  • It uses an 8-bit CPU with 12 MIPS speed
  • It consists of 28 pins
  • The operating voltage is between +4.0 Volts to +5.5 Volts (where +5.5 Volts is the absolute maximum voltage)
  • It has 24 programmable I/O pins
  • Type of communication interface: USB serial interface for programming the controller (pins 15 and 16); Master/Slave SPI Serial Interface is also for programming the controller (pins 7,18,21,22); Serial programmable UART for programmable (pins 17,18) and 2-wire serial interface used to connect peripheral devices like LCDs and sensors ( pins 21,22).
  • It has an ADC module with 10 channels and 10-bit ADC resolution
  • The timer modules contain one 8-bit and three 16-bit counters
  • It has 2 analog comparators
  • It has 2 PWM channels
  • The frequency of an external oscillator is up to 48 MHZ
  • The frequency of the internal oscillator is 32 kHz to 8 MHz (calibrated)
  • The size of program memory or flash memory is 32 Kbytes (10K cycles for write/erase)
  • The size of RAM is 2 Kbytes
  • The size of EEPROM memory is 256 Bytes
  • The watchdog timer is the programmable type with a separate on-chip oscillator
  • The power-saving modes are available
  • Its operating temperature is between -40°C to +85°C (+85°C absolute maximum temperature and -40°C is absolute minimum temperature).

The alternative PIC18F4550 microcontroller is PIC18F2455 whereas the PIC18F4455 microcontroller is the replacement microcontroller.

How to use PIC18F4550 Microcontroller/Circuit Diagram:

The PIC18F4550 microcontrollers are used as simple microcontrollers but not like digital ICs. So, to start working with this microcontroller, we have to save the desired program file in the FLASH memory controller. Power up the controller to execute the code stored in the Flash memory. Hence, the response will be generated. Follow the steps to know how to use the PIC18F4550 microcontroller for processing and programming.

PIC18F4550 Interfacing with LED
PIC18F4550 Interfacing with LED

The functions which are to be executed by the PIC18F4550 Microcontroller are listed.

  • Use the relative programming language to write the functions in the IDE application (for example for windows OS MPLAB IDE).
  • Write the functions in ‘C’ language for these IDE.
  • Compile the written appropriate program using IDE to eliminate errors.
  • After compiling the written program, the HEX file is generated by the IDE application.
  • Then select the programming device (i.e, PIC kit 3) to provide communication between the PIC18F4550 microcontroller and PC.
  • Select the related programming device to run the dumping software HEX file.
  • Select the desired program HEX file.
  • Burn the program of HEX file stored in the flash memory of PIC18F4550 microcontroller using this program.
  • The required peripherals are connected to the microcontroller and power on the systems by disconnecting the program.
  • When the power is On, the HEX code stored in the flash memory is executed by the controller and the given task is performed.

The basic circuit diagram of interfacing LEDs with the PIC18F4550 microcontroller is shown in the figure below.

The components required for blinking the LEDs using the PIC18F4550 microcontroller or interfacing LEDs with the PIC18F4550 microcontroller are,

Connect the circuit as shown in the figure above and run the code required to interface the LEDs with the PIC18F4550 microcontroller is given below.

// Bits configuration

/* _CPUDIV_OSC1_PLL2_1L, // Divide clock by 2
_FOSC_HS_1H, // High Speed (HS) oscillator is selected
_WDT_OFF_2H, // Turns Off the watchdog timer
MCLRE_ON_3H // Turn ON the Master Clear

*/

void main()
{
TRISB=0x00; // PORTB is set to output PORT
LATB=0xFF; // Initially PORTB is set to high (All LEDs on)

while(1)
{
LATB = ~LATB; // Toggle the value of PORTB
Delay_ms(1000); //1-second delay
}
}

Where to use PIC18F4550 Microcontroller:

The applications of the PIC18F4550 microcontroller are listed below,

  • Engineer and hobbyist general projects
  • Motor Controlling systems
  • Peripheral interfacing systems
  • Embedded systems like vending machines, coffee makers, etc
  • Analog signal manipulations and measuring systems
  • Temperature controlling systems
  • Developmental boards for learning

Please refer to this link to know more about PIC18F4550 Microcontroller Datasheet

Thus, this article discusses PIC18F4550 microcontroller- definition, pin configuration/pin diagram, technical specifications, circuit diagram/how to use, and applications of PIC18F4550 Microcontroller. Here is a question for you, “What are the advantages of the PIC18F4550 Microcontroller? “