Using Flowcode 8 software:
Exercise 3: In this exercise, you will make a design using all 4 of the 7-segment displays. Because they share the same segment lines from PORTB, you must display the digits one at a time and continually scan the display.
Each digit is enabled by the first 4 bits of PORTA (PA3, PA2, PA1, PA0), where PA3 enables the left-hand digit and PA0 enables the right-hand digit.
The scanning will put each digit up and then give a short delay so that the digit is visible. Then the next digit is displayed and so on until all 4 digits are displayed. Assuming that you have an integer value count and the 4 digits to display are held in the variables dig3, dig2, dig1, dig0 as shown below:
dig3 = count / 1000; dig2 = (count % 1000) / 100; dig1 = (count % 100) / 10; dig0 = count % 10;
Make the value of count increase from 0 to 9999 and show its values on the 4 7-segment displays as shown in Figure 4. Simulate your design and see whether the design fully functions as you expected.
Figure 4: 7-Segment display