Hello World Project With PIC Microcontroller – Part II

Hello Friends, Welcome back. In the last tutorial we started working with MPLab and HI-TECH C Compiler and written our first C program to blink LED. After compiling the program we got the HEX file. Now, in this tutorial we will see how to transfer(burn) the hex file to our Microcontroller chip and then power it up to actually blink the LED.

We will use eXtreme Burner – PIC , which is a easy to use GUI programmer for PIC18 MCUs. The burner supports USB connectivity with PC so it is very easy to install and use.

Launch eXtreme Burner – PIC from Windows Desktop or Start Menu.

 

usb pic programmer software

Fig.: eXtreme Burner – PIC, Main Screen.

 

The software is easy to use. First you need to load the HEX file which was generated by MPLAB+HI-TECH C in previous tutorial. So select Open from File Menu or From the Toolbar. Then select the hex file. Now the HEX file will be loaded and the contents (FLASH,EEPROM,Chip Settings) will be available.

Now connect the programmer with your PC by using standard USB Cable the programmer will be automatically detected by software (provided drivers are installed previously) . Apply power to programmer using a 12v DC adaptor. Place a PIC18F4550 chip in the ZIF socket and lock it.

 

usb pic programmer  hardware

Fig.: eXtreme Burner – PIC, USB Programmer for PIC Micros.

 

After that select PIC18F4550 from Chip Menu and Programming Mode = ZIF Socket from Settings Menu. You are now ready Burn !!!

Select Write All From Toolbar or Write Menu.

The burner will start the Burn Process. It will write each section of memory and verify that they are written correctly.

 

easy pic programmer

Fig.: eXtreme Burner – PIC, Burning in Progress.

 

After few seconds the process ends. The chip is now programmed with the provided HEX file contents. The chips settings have also been modified to suit the hardware environment we will be using. These settings were also embedded in the HEX file (more on this topic in latter tutorial). And it got into the HEX file from the C file. Notice the two lines

__CONFIG(1,0x0F24);
__CONFIG(2,0X0000);

in the C file of previous tutorial.

The chips is now ready for some amazing lighting effects !

Get the following to see that in action

  • A Breadboard.
  • A 20MHz Crystal
  • 1 x 330 Ohms resistor
  • 1 x 4.7k resistor.
  • 2 x 22pF Ceramic Disk Type Capacitor.
  • A LED
  • Some Bread boarding wires (free if you buy Breadboard from above link)

Go ahead and connect them like this.

 

pic micro hello world led project

Fig.: A Simple LED blinker project using PIC18F4550.

 

Fig.: A Simple LED blinker project using PIC18F4550 in a breadboard.

 

Time to power it up to experience a hi tech led blinking demo!

Apply a regulated 5v supply using a 7805 chip. If you have done all wiring correctly then the led will start blinking. Please do not apply more that 5v or supply the power in reverse direction, because it will fry your chip within seconds!

So now you have made your first project with PIC micros and you know all the basic steps and the tools required for them. You are now ready to learn and experiments with these chips

Facing problem with your embedded, electronics or robotics project? We are here to help!
Post a help request.

Avinash

Avinash Gupta is solely focused on free and high quality tutorial to make learning embedded system fun !

More Posts - Website

Follow Me:
FacebookLinkedInGoogle Plus

11 thoughts on “Hello World Project With PIC Microcontroller – Part II

Leave a Reply

Your email address will not be published. Required fields are marked *


− four = 1

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>