Category Archives: PIC Tutorials


Expanding the number of I/O lines using Microchip MCP23008

A microcontroller comes with a limited number of general purpose input and output (GPIO) ports. However, some applications may require more ports than are available on the microcontroller. In such a case, GPIO expanders can be used to increase the I/O capability of the microcontroller. MCP23008 is one such device (manufactured by Microchip Technology) which provides an easy I/O expansion using 2-wire serial interface. This tutorial illustrates how to add an extra 8-bit I/O port to PIC12683 microcontroller (which has only 6 I/O pins) using MCP23008. A seven segment LED display and a tact switch will be connected to the

Read more

Lab 15: Scrolling text message on an LED dot-matrix display

In Lab 12, we learned about the basic structure of a monochrome (single color) LED dot matrix and its interface with a microcontroller to display static characters and symbols. Today’s lab is its continuation, and we will be discussing on displaying a scrolling text message on a 16×8 LED dot matrix. The microcontroller used is again the same PIC18F2550 from StartUSB for PIC board. The 16 columns of the LED matrix are driven individually by two shift registers (74HC595), whereas the eight combined rows are driven by the decoded outputs from a decade counter (CD4017). In Lab 12, columns were

Read more

Lab 14: Inter-Integrated Circuit (I2C) communication

I2C (Inter-Integrated Circuit) is a short distance serial interface that requires only 2 bus lines for data transfer. It was invented by Philips in 1980’s, originally to provide easy on-board communications between a CPU and various peripheral chips in a TV set. Today, it is widely used in varieties of embedded systems to connect low speed peripherals (external EEPROMs, digital sensors, LCD drivers, etc) to the main controller. In this experiment, we will cover an overview of I2C protocol, its implementation in PIC microcontrollers, and the method of connecting single and multiple devices on a common I2C bus. We will

Read more

Lab 13: Read and Write to internal EEPROM

EEPROM (Electrically Erasable Programmable Read-Only Memory) is a type of non-volatile memory which can be programmed, erased, and re-programmed electrically while it is on the circuit board. A majority of PIC microcontrollers come with some built-inĀ EEPROM which is a great place to store data that should not be lost when the system is powered down. A good example is a digital lock system where the access code can be stored in the EEPROM of microcontroller so that the contents remain intact even after the power supply has been removed. In my ‘Beginner’s data logger‘ project, I used the internal EEPROM

Read more

Lab 12: Basics of LED dot matrix display

We covered how to interface seven segment LED displays to a PIC microcontroller in two sections: Lab 6 and Lab 11. Today, we will move on to interfacing an LED dot matrix display. LED dot matrices are very popular means of displaying information as it allows both static and animated text and images. Perhaps, you have encountered them at gas stations displaying the gas prices, or in the public places and alongside highways, displaying advertisements on large dot matrix panels. In this experiment, we will discuss about the basic structure of a monochrome (single color) LED dot matrix and its

Read more
« Older Entries Recent Entries »