Navigation

Showing posts with label MPLAB. Show all posts
Showing posts with label MPLAB. Show all posts

Saturday, 3 September 2016

Using MPLAB software for programming a PIC microcontroller – Part 2

In this tutorial, procedures on how to simulate a PIC18F1320 microcontroller using the HEX code generated by the MPLAB software will be explained. Also, programming the physical chip using PICKit3 will be shown.

Below is a circuit in Proteus ISIS that blinks an LED every 500ms explained in the previous post. The LED is connected as a pull up resistor to pin RB2 of the PIC. Not that in the software, it is also pin RB2 that is being turned ON and OFF. The circuit also shows connection of the PIC to the PICKit programmer.


After drawing the circuit, Right click on the PIC18F1320, Choose Edit Properties. The following screen will appear.

Using MPLAB software for programming a PIC microcontroller – Part 1

I would be using the MPLAB 8.89 and CCS C Compiler
Step 1: Go to Project -> Project Wizard
Step 2: Choose the PIC18F1320 microcontroller

Wednesday, 28 August 2013

Home-made Thermometer Project built on a Veroboard

Components Required

  • ·         LM35 Temperature sensor
  • ·         4MHz Resonator
  • ·         PIC16F876A microcontroller
  • ·         28-pin DIL socket, for the PIC microcontroller
  • ·         LCD
  • ·         1KΩ Resistor
  • ·         4.7KΩ Resistor
  • ·         220Ω Resistor
  • ·         1N4148 diode
  • ·         100nF capacitor
  • ·         Green LED, a power ON LED
  • ·         6-way male header row, a connector for programming the PIC.
  • ·         3AA Batteries
  • ·         Battery Holder
  • ·         Veroboard
  • ·         Jumper wires
Tools Required
  • ·         Soldering iron
  • ·         Solder
  • ·         Crimping tools
  • ·         Wire cutter
  • ·         Solder sucker
  • ·         Voltmeter
Connect the circuit as shown in the figure below in Proteus ISIS or any other suitable simulation software. The code should be tested first in simulation before it is built physically on a veroboard. 




The code written was in C and was compiled using CCS compilier on the MPLAB platform. The screen below shows an excerpt of the code.


When the compiled HEX file was loaded into the PIC, and the circuit simulated, the result is as shown below.


The circuit was built on a veroboard as shown below



When the PIC was programmed and power applied, the output is as shown below




The cost of this project is not more than £20! Why not try it today.