Category Archives: PIC Tutorials


ADC channels in PIC16F688

The PIC16F688 microcontroller has a built-in 10-bit ADC with eight input channels. The eight channels are available at RA0, RA1, RA2, RA4, RC0, RC1, RC2, and RC3. They have alternate labels, AN0-AN7, for this function, and are multiplexed into a single sample and Hold circuit. The output of the sample and hold is connected to the input of the A/D converter. The A/D conversion is successive approximation based and the 10-bit result is stored  into the ADC result registers ADRESH (A/D Result Higher byte) and ADRESL (A/D Result Lower byte). Each of these registers is 8-bit. Pin diagram of the PIC16F688 microcontroller

Read more

Lab 1: Flashing an LED

Description Today is our first session in PIC microcontroller lab, and we will begin with an experiment that flashes an LED on and off. While this looks very simple it is the best project to start because this makes sure that we successfully wrote the program, compiled it, loaded inside the PIC, and the circuit is correctly built on the breadboard. In this lab session we will connect an LED to one of the port pin of PIC16F688 and flash it continuously with 1 sec duration. Required Theory You must be  familiarized with, digital I/O ports (PORTA and PORTC) of PIC16F688

Read more

Digital I/O Ports in PIC16F688

PIC16F688 is a 14-pin flash-based, 8-bit microcontroller. It can be obtained in different packages, but the DIP (Dual In-line Package) version is recommended for prototyping. The figure below shows a PIC16F688 microcontroller in DIP chip, and its pin outs. Most of the pins are for input and output, and are arranged as PORTA (6) and PORTC (6), giving a total of 12 I/O pins.  All of these can operate as simple digital I/O pins but they do have more than one function. For example, eight of total 12 I/O pins also serve as analogue inputs for the internal analog-to-digital converter

Read more

Hardware and Software requirements

The development of an embedded system requires some hardware and software products. Although the hardware requirements depend on the type and complexity of the project, the following hardware tools are required in all of the experiments we are going to discuss here. A solderless breadboard for constructing and testing the experimental circuits. The breadboard is chosen because it is reusable. You can change, modify or remove the components on it at any time. While an embedded system is in development phase, you never know in advance whether or not your circuit will function correctly when assembled. So it is always good to

Read more

Lab 2: Basic digital input and output

Description Today we will learn how to read digital inputs from a push button switch. A digital input has only two values: 1 and 0. The configuration of the push button switch is same as that of the reset switch except it goes to a different port pin. The status of the switch will be read through RC1 and every time when it is pressed, an LED connected to RC0 will be toggled ON and OFF. Required Theory You must be familiar with the digital I/O ports of PIC16F688 and their direction settings. If you are not, read Digital I/O

Read more
« Older Entries Recent Entries »