Skip to main content

First Project of PIC 18 using Proteus 7 ,mikroC and CSS.

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

  1.  First ,we need a simple circuit to simulate for I/O Project for PIC18F4580 Microcontroller in Proteus ISIS, as you all understand Proteus is appropriate simulation tool for MC.
  2. Once the electrical connection  is done for simulation, I need  the programming code for Microcontroller.
  3. In order to develop the code, two compilers miKroc and CCS are used  .you can use anyone of them.
So let’s create a simple circuit for the Proteus Simulation and run it.

Circuit diagram to connect Led with PIC

Reference above image for circuit

  • 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.


Friends for further learning about PIC18 checkout:

Comments

Popular posts from this blog

How to use SPI Debugger

  SPI Debugger Hi Friends, in this post, we will discuss how to use SPI Debugger available in proteus for serial peripheral interface (SPI) which is a built-in feature of PIC microcontroller to communicate and data exchange between PIC and other devices. SPI Debugger Introduction to SPI Guys, SPI can be considered as a programmable shift  register, The SPI module is a synchronous serial I/O port that shifts a serial bit stream of variable length and data rate between the PIC and other peripheral devices. Here “synchronous” means that the data transmission is synchronized to a clock signal. To avoid further delay, let's see some important connections and different configurations to effectively use SPI Debugger. How to use SPI Debugger in MASTER & SLAVE configuration Select the virtual instrument and from the instrument, list selects "SPI Debugger". SPI Debugger Insert two SPI Debugger on the working area, select any one of ...

PIC18f4580 Timer0 calculation using miKroC , CSS and proteus

PIC18f4580 TIMER PROGRAMMING The PIC18f4580 has four timers. they're named as Timers zero, one, two, and three. they will be used either as timers to come up with a time delay or as counters to count events happening outside the microcontroller. First, we see however Timers zero is employed to come up with time delays. Every timer wants a clock pulse to tick. The clock supply will be internal or external. If we have a tendency to use the inner clock supply, then 1/ fourth of the frequency of the crystal oscillator on the OSC1 and OSC2 pins (Fosc/4) is fed into the timer. Therefore, it's used for time delay generation and for that reason is termed a timer. By selecting the external clock choice, we have a tendency to feed pulses through one among the PIC18's pins: this is often known as a counter. GIF  taken from  https://exploreembedded.com Basic registers of the timer Majority of t timers in 18F are 16 bits wide. Because the PIC 18 has an 8- bit ...

PIC18F PINOUT

Vdd(Vcc) Two pins are used to provide supply voltage to the chip.The typical voltage source is +5V DC. Vss(GND) Two pins are also used to for ground. OSC1 & OSC2 The PIC18F has many options for the Clock source.Most often a quartz crystal controller is connected to input OSC1 & OSC2.The quartz crystal oscillator connected to the OSC1 & OSC2 pins also needs two capacitors.One side of each capacitor is connected to the the ground as shown in figure below: PIC18F microcontroller can have speeds of up to 40 MHz. Easy Programming  PICKIT3.5 PIC KIT3.5 PICKIT MCLR Pin1 (in the PIC18F4548 40-pin DIP) is the MCLR (master clear reset) pin. It is an input and is active-Low (normally High),When a low pulse is applied to this pin,the microcontroller will reset and terminate all activities.This is often referred to as a power-on reset (POR). Port A, B, C, D & E The Ports PORTA, PORTB, PORTC, PORTD, and PORTE use a total ...