How to Interfacing seven segment display with pic microcontroller and Mikro C
In this tutorials I am show how to interface a seven segment display with pic Microcontroller. You can watch the flowing video and read the written tutorial below.
7 segment displays are two type . they are liquid crystal and light emitting diode. In this this tutorials I am used light emitting seven segment display. 7 segment display contain 7 LED of a digit. When LED is active and it emit light. In this tutorial we are used common cathode 7 segment display.
7 segment display are used in digital clocks,electronics meter,measuring tools,calculator and electronics elements. It show decimal value from binary value.
Code Explain:
Here I am use Mikro C compiler for code editing. In define section we define a array for common cathode display. The display show the value in decimal numbers. Then in void main function we define PORTB is output by clearing TRISB register. Than we clear the PORTB by clearing PORTB register. Next we create a while loop for continues program execution. In while loop function we create a for loop. The for loop increase the value of i variable. The value of i is increase 0 to 9 and show the value on 7 segment display.
Mikro C Code:
7 segment displays are two type . they are liquid crystal and light emitting diode. In this this tutorials I am used light emitting seven segment display. 7 segment display contain 7 LED of a digit. When LED is active and it emit light. In this tutorial we are used common cathode 7 segment display.
Internal structure of seven segment display below
7 segment display are used in digital clocks,electronics meter,measuring tools,calculator and electronics elements. It show decimal value from binary value.
CIRCUIT DIAGRAM
Code Explain:
Here I am use Mikro C compiler for code editing. In define section we define a array for common cathode display. The display show the value in decimal numbers. Then in void main function we define PORTB is output by clearing TRISB register. Than we clear the PORTB by clearing PORTB register. Next we create a while loop for continues program execution. In while loop function we create a for loop. The for loop increase the value of i variable. The value of i is increase 0 to 9 and show the value on 7 segment display.
Mikro C Code:
Click the download button for source code:
download |
No comments