Wednesday, February 17, 2021

Start To Blink PIC18F4550 Using CCS PICC

Overview Of PIC18F4550

PIC18F4550 is an 8-bit PICMicro built with a USB peripheral inside.  It could clock up to 48 MHz to full fill its USB hardware requirements. The program memory size is 16384 words. It temporary memory SRAM is 2048 KB with an auxiliary non-volatile memory of 256 Bytes.

By selecting its 40-pin DIP package, the digital I/O ports available up to five ports with 35 usable inputs outputs. 

A stable direct current voltage source powers this device between 2 V and 5.5 V, depends on the operating frequency. The higher clock frequency requires a higher supply voltage. Typically, a hobbyist prototyping require a 5 V supply voltage.

PIC18F4550-I/P I stock and its pin diagram

There are five 8-bit ports list from PORTA to PORTD. They are,
  1. PORTA
  2. PORTB
  3. PORTC
  4. PORTD
  5. and PORTE.
All ports are programmable bi-directional I/O. Any ports has other special functions other than the digital I/O.

Interfacing And Programming

I select my DIY PIC18F4550 board I made to work with this example. On this board PORTD connects to an 8-bit LED output.
CCS PICC compiler has a lot of library functions. For digital input output, we need to use a few functions.
  1. output_x(value) - Writes an 8-bit data to any port x ( eg, A, B, C, etc).
  2. set_tris_x(value) - Set the data direction of x port. The value of 0 means output direction, otherwise an input direction.
  3. delay_ms(time) - Creates a timing delay in milli seconds. Time is an unsigned 16-bit integer ( 0 to 65535) milli seconds.
To program in CCS PICC:
  • include the device header file
  • use 'fuses' directive to set the configuration bits
  • use 'delay' directive to set the clock of the CPU
  • write the main function and others.

CCS PICC Source Code From GitHub


Schematic Diagram


Start To Blink PIC18F4550 Using CCS PICC
Schematic Diagram

Click here to download this example in zip file.


No comments:

Post a Comment

Search This Blog

Labels

25AA010A (1) 8051 (7) 93AA46B (1) ADC (30) Analog Comparator (1) Arduino (15) ARM (6) AT89C52 (7) ATMega32 (56) AVR (57) CCS PICC (28) DAC (1) DHT11 (2) Display (105) Distance Sensor (3) DS18B20 (3) dsPIC (2) dsPIC30F1010 (2) EEPROM (5) Environment Sensor (4) esp8266 (1) I2C (29) Input/Output (67) Interrupt (19) Keil (5) Keypad (10) LCD (47) Master/Slave (1) MAX7221 (1) MCP23017 (5) MCP23S17 (4) Meter (3) MikroC (2) Motor (15) MPLABX (71) Nokia 5110 LCD (3) OLED (2) One-Wire (6) Oscillator (8) PCB (6) PCD8544 (3) PCF8574 (5) PIC (107) PIC12F (2) PIC16F628A (2) PIC16F630 (1) PIC16F716 (3) PIC16F818 (10) PIC16F818/819 (2) PIC16F84A (15) PIC16F876A (1) PIC16F877A (9) PIC16F88 (1) PIC16F887 (60) PIC18 (19) PIC18F1220 (4) PIC18F2550 (3) PIC18F4550 (12) PWM (11) RTC (8) Sensor (10) SH1106 (1) Shift Register (11) Shift Registers (3) SPI (24) STM32 (6) STM32 Blue Pill (6) STM32CubeIDE (6) STM32F103C8T6 (6) SysTick (3) temperature sensor (11) Thermometer (21) Timer/Counter (31) TM1637 (2) UART (7) Ultrasonic (4) Voltmeter (7) WDT (1) XC16 (2) XC8 (94)