This is a simple program on interfacing 7 segment LED display with 8051 AT89S52. In this program we will just move 0x07 to P1 port in AT89S52. Which means 7 segment LED will display Number 7.
P1_0 to A
P1_1 to B
P1_2 to C
P1_3 to E
P1_4 to F
P1_5 to G
P1_6 to DEC
0 to +5v
void main() {
P1 = 0x07;
}
Hardware Connection:
P1_0 to A
P1_1 to B
P1_2 to C
P1_3 to E
P1_4 to F
P1_5 to G
P1_6 to DEC
0 to +5v
Program:
#include<at89x52.h>void main() {
P1 = 0x07;
}
Explanation:
In the main function we are just assigning 0x07 to Pos=rt 1.Hex value for 0 - 9 digits
Output:
Cheers!!!!
-> Let Us Embed <-