Blinking LED pattern using microcontroller
Proteus Schematic Diagram:
Software Required:
1- MikroC PRO for PIC (Download latest version or version 6.6.2 is good enough for this tutorial, NOTE: latest version will give errors )
2- Proteus (v7.7 or 8)
2- Proteus (v7.7 or 8)
Hardware Required:
1- PIC16f877a
2- Different Colour eight LEDs
3- 20MHz oscillator
4- 22pf capacitors (2)
5- 10K variable resistor
6- 9 volts battery
7- 7805 voltage regulator
2- Different Colour eight LEDs
3- 20MHz oscillator
4- 22pf capacitors (2)
5- 10K variable resistor
6- 9 volts battery
7- 7805 voltage regulator
Working and Procedure:
Now make sure you have all this stuff, first of all create new project in MikroC, choose your Microcontroller i.e PIC16f877a and set frequency 20MHz (this is basically the frequency of oscillator, in our case we have used 20MHz). If MikroC asks to import libraries then click OK to import all libraries. Create a new C file for you project and add the C code (comment your email address for source code) and save your project. Now it’s time to build .HEX file (we need this file for Simulation and Hardware) you can find BUILD on the top layer of MikroC simply click on it or just press Ctrl+F9. .HEX file is now saved in your project folder.
For Proteus Simulink open the .DSN simulation file (comment your email address for simulation file). You will see PIC16f877a in simulation double click on it and add the .HEX file you generated in MikroC. Now run the Simulation and wow LED are blinking with pattern you may call it Disco LEDs. If you have any question leave a comment.
For Proteus Simulink open the .DSN simulation file (comment your email address for simulation file). You will see PIC16f877a in simulation double click on it and add the .HEX file you generated in MikroC. Now run the Simulation and wow LED are blinking with pattern you may call it Disco LEDs. If you have any question leave a comment.
Author: Engr. Hassam Bin Hassan