Книга: Advanced PIC Microcontroller Projects in C
Project PDL
Project PDL
At the beginning of the program PORTB and PORTC pins are configured as outputs. The program then enters an endless loop where first of all the Most Significant Digit (MSD) of the number is calculated, function Display is called to find the bit pattern and then sent to the display, and digit 1 is enabled. Then, after a small delay, digit 1 is disabled, the Least Significant Digit (LSD) of the number is calculated, function Display is called to find the bit pattern and then sent to the display, and digit 2 is enabled. Then again after a small delay, digit 2 is disabled, and this process repeats indefinitely. Figure 6.33 shows the PDL of the project.
START
Create SEGMENT table
Configure PORTB as outputs
Configure PORTC as outputs
Initialize CNT to 25
DO FOREVER
Find MSD digit
Get bit pattern from SEGMENT
Enable digit 1
Wait for a while
Disable digit 1
Find LSD digit
Get bit pattern from SEGMENT
Enable digit 2
Wait for a while
Disable digit 2
ENDDO
END
Figure 6.33: PDL of the project