mikroc picc proteus |
Hello friends, hope you all are fine and having fun together with your lives. In today’s tutorial, we are going to see however one can compile and simulate PIC18F . Its my first tutorial on that and I am progressing to post quite an heap of tutorials on PIC18F Microcontroller in coming week.
it is my first tutorial on PIC18F Microcontroller
that’s why it's quite an easy one , I will 1st of all have a glance at only 1 single pin(I/O) during this Project, a basic circuit for PIC18F Microcontroller. After that, I will be able to attach a light emitting diode(LED) on any of its I/O pins so will switch to it high
state. I even have additionally given the Proteus Simulation along side Programming code designed in
miKroc and CCS . So, let’s get started with it.
Proteus simulation for First project
- Once the electrical connection is done for simulation, I need the programming code for Microcontroller.
- In order to develop the code, two compilers miKroc and CCS are used .you can use anyone of them.
Circuit diagram to connect Led with PIC |
Reference above image for circuit
Friends for further learning about PIC18 checkout:
- Notice that a 5V is connected with Reset pin of PIC18.
- LED is connected to RA0(PIN designator) of Port A.
- Next, we will take advantage of useful C language by using compliers to develop programming code for Microcontroller that is running on top of image and produce an running LED.
mikroC Programming Code for (PORT A) first Bit.
- Now as I have mentioned earlier, the compilers I have used for designing the programming code for Project are mikroC and CCS.
- So I hope you have installed any one of them on your computer and if not then must install it as otherwise you won't be able to compile this code.
- So now create a new project in your mikroC compiler.
Program to turn on led in mikroc |
CCS Programming Code for (PORT A) first Bit.
Program to turn on led in PICC |
- Inside the while() loop, we have used the first bit of PortA in which it's sate is made high and so led is ON.
- Now after adding the code in your anyone of your choice complier, compile it and get the hex file.
- Proteus allows us to upload hex file into your PIC Microcontroller model ,just double click on controller and browse your hex file, Press run button to start simulation.
- If everything’s goes fine ,code should run as expected.
Comments
Post a Comment