Книга: Advanced PIC Microcontroller Projects in C

Project PDL

Project PDL

The operation of the project is shown in Figure 6.26 with a PDL. At the beginning of the program an array called SEGMENT is declared and filled with the relationships between the numbers 0 and 9 and the data to be sent to PORTC. The PORTC pins are then configured as outputs, and a variable is initialized to 0. The program then enters an endless loop where the variable is incremented between 0 and 9 and the corresponding bit pattern to turn ON the appropriate segments is sent to PORTC continuously with a one-second delay between outputs.

START
 Create SEGMENT table
 Configure PORTC as outputs
 Initialize CNT to 0
 DO FOREVER
  Get bit pattern from SEGMENT corresponding to CNT
  Send this bit pattern to PORTC
  Increment CNT between 0 and 9
  Wait 1 second
 ENDDO
END


Figure 6.26: PDL of the project

Оглавление книги


Генерация: 0.033. Запросов К БД/Cache: 0 / 0
поделиться
Вверх Вниз