Electronics tutorials including microcontroller, microprocessor, programing and circuits. Intended for beginners, electronics hobbyists, college students, professionals and educational purposes.

Expanding Output Pins of a PIC Microcontroller through Multiplexing

Imagine that you want to control 100 LED's with a PIC Microcontroller. No PIC Microcontroller with a DIP package having that many IO lines. This article explains two ways to expand output pins of a Microcontroller through multiplexing. Here we are using Time Division Multiplexing to expand output pins. The first method is by using D-Latch and second method is by using Serial in Parallel Out Shift register. In this tutorial we demonstrate the working by using 64 LEDs. Using D Flip-Flop and Decoder 74574 Octal...

PIC to PIC Communication using UART

Introduction PIC to PIC communication will be needed in some embedded applications. We have two options to transmit data through transmission lines. Parallel Transmission Serial Transmission Parallel Transmission Parallel Data Transmission In parallel communication an entire byte of data is transmitted at a time. That is each bit has dedicated line. Thus for 8-bit data transfer we need 8 dedicated lines as shown above. Serial Transmission Serial Data Transmission In Serial Transmission only one bit of a byte is transmitted at a time. There is only one communication line, thorough which...

Using Interrupt with PIC Microcontroller

Introduction Interrupt is the one of the most powerful feature in embedded applications. Almost all the real time applications are implemented using Interrupts. So what is an Interrupt...?? As the name suggests Interrupts are special events that requires immediate attention, it stops a microcontroller/microprocessor from the running task and to serve a special task known as Interrupt Service Routine (ISR) or Interrupt Handler. Suppose you are at home, taking coffee. Suddenly your mobile phone rings. You stop taking coffee and answer the call. When you have...

Using Analog Comparator in PIC Microcontroller

Comparator Module in PIC Analog Comparator is a device which compares two voltage signals and switches its output to indicate which one is larger. The analog comparator is used in many applications such as battery charger, analog to digital converters, IR sensors where we need to compare two signals. Most of the PIC Microcontrollers have built in Comparator Module which makes ease of design and saves cost. For demonstration, we use PIC16F877A. PIC16F877A consists of two analog comparators which can be used in eight different...

Interfacing EEPROM with PIC Microcontroller

What is an EEPROM ? EEPROM is an abbreviation for Electrically Erasable  Programmable Read Only Memory and it is a Non-Volatile memory. It is used in computers and other electronic devices to store data that must me saved during no power supply. EEPROM is a class of ROM (Read Only Memory) which can be electrically erased in bit by bit and able to store new data. A small amount of EEPROM (usually 128/256 bytes) is available internally with PIC Microcontrollers. I have already posted about Using...

Interfacing Matrix Keypad with PIC Microcontroller using MikroC Library

I already posted about Interfacing Matrix Keypad with PIC Microcontroller with some user-defined functions. Advantages in using user-defined functions are we can extend it up to any number of keys and able to customise according to our application. The MikroC Pro for PIC Microcontrollers provides a library for working with 4*4 keypad. It can also be used to interface 4*3, 4*2 and 4*1 keypads. MikroC provides the following three functions to interface Matrix Keypad. Keypad_Init Keypad_Key_Press Keypad_Key_Click Keypad_Init Prototype: void Keypad_Init(void); It initializes a particular port for working with keypad. A global...

Using Internal EEPROM of PIC Microcontroller

There are commonly three types of memories in a PIC Microcontroller, Flash Program Memory, Data Memory (RAM) and EEPROM Data Memory. We write Programs in the Flash Program Memory of a microcontroller. Flash memory makes it possible to program a microcontroller many times before installing to device and even after the installation we can change the program. RAM Data Memory is used for storing data temporarily during program execution and it is volatile. That is, this memory is cleared when the power...

Interfacing Servo Motor with PIC Microcontroller

Servo Motor uses error sensing negative feedback to control the precise angular position. Servos are used for precise positioning in robotic arms, legs, RC Aeroplanes, Helicopters etc. Please read the article Servo Motor for more information about its working and construction. Hobby Servo Motors have three wires, two of them (RED and BLACK) are used to given power and the third one is used to give control signals. Servo can be easily be controlled using microcontrollers using Pulse Width Modulated (PWM) signals on  the...

>