

If you are new to TIMERs and PIC Interrupt handling please see the following tutorials. To make the refreshing of display automatic we will use TIMER0 module. We will use PIC18 series MCU to implement the above technique. And we do so fast enough that human eye cannot catch the trick and see all four digits lit at the same time. ‘2’ is shown on DIGIT3Īfter some time we select digit 4 by setting SEL4 line high (keeping all other SELx line low) and sending segment data that shows ‘1’ on display. We can see all four digit lit at the same time as shown in the figure above.Īfter some time we select digit 3 by setting SE元 line high (keeping all other SELx line low) and sending segment data that shows ‘2’ on display. This is done fast enough that the human I cannot see the movement. Similarly each digit is selected and shown. Then next digit is selected and segment data is changed according to the digit that must be shown in that place. That means MCU can select any digit and put the segment data which drives the segments. All the segments of each four digit are connected in parallel and common of each four digit is tried to MCUs i/o port via transistors. The trick is to activate only one digit at a time. But in reality a small trick can greatly reduce the number of i/o pins required. As you can see in a four digit displays there are a total of 4 x 7 = 28 segments (made of leds) so you may think that they will require lots of i/o pins of MCU. Example includes clocks, panel meters, microwave ovens, refrigerators etc. These type of displays are widely used to present numerical data to users. This will count from 000 to 999.The image above shows a four digit seven segment display.

Pins RB0 – RB6 are connected to the A – G of the display.

We have used Common Cathode Seven Segment Display in this example. Each display is turned on above this rate and our eyes will think that the display is turned on for whole the time. If the frames change at a rate of 25 ( or more) frames per second, human eye can’t detect that visual change.

This technique is based on the principle of Persistence of Vision of our eyes. The simplest way to drive Seven Segment Display is by using a driver or decoder and are available for up to 4 displays. Alternatively we can drive more than one Seven Segment Display by using a technique called ‘Multiplexing’. This is waste and not economical to use lot of pins of a Microcontroller just for display. Thus we actually need Microcontroller with 42 output pins. Lets assume that we need 6 digit display, ie we need 7 segment * 6 Display = 42 pins. But real time applications like Digital Clock, Calculator, Digital Watch requires 3-6 seven segment displays. When a Seven Segment Display is interface with PIC Microcontroller it needs minimum 7 pins to display a value.
