Design
a circuit connecting a binary coded decimal seven segment display to PIC
16F877A Microcontroller.
Today we are
going to write a c program to display numbers from 0 to 9 automatically in the
ascending and descending order on a circuit connecting a binary coded decimal
seven segment display to PIC 16F877A Microcontroller.
I would like to
explain it in two different ways. First let’s discuss the hardest way of doing it.
:D Let’s think unfortunately you have created your circuit as below.
figure - 01 |
figure - 02 |
figure - 03 |
You can use an array
and for loop to reduce the amount of codes. So shall we learn the easiest
way of doing that? To do that you should create your circuit as below.
As it’s very easy
I will only demonstrate display numbers from 0 to 9 automatically in the
ascending order.
Below image
will briefly explain what is meant by above code segment.
figure - 06 |
Now you need to use binary to hexadecimal converter
(http://www.binaryhexconverter.com/binary-to-hex-converter
) just convert the number you need to display into binary and then convert that
binary number into hexadecimal.
Here I convert the number into binary to
show the current flow of ports. Otherwise the number can be directly converted
into a hexadecimal number.
No comments:
Post a Comment