9.2 PROJECT 9.2 – Binary Counting Up LEDs

9.2.1 Project Description

This is a simple project where 8 LEDs are connected to PORT C of a PIC microcontroller. The LEDs count up in binary with a 1 second interval between each count. The pattern displayed by the LEDs will be as shown in Figure 9.11.

Figure 9.11 Binary counting up LEDs


9.2.2 Block Diagram

The block diagram of the project is shown in Figure 9.12.

Figure 9.12 Block diagram of the project


9.2.3 Circuit Diagram

The circuit diagram of the project is shown in Figure 9.13. If using the EasyPIC 7 development board, there is no need to change any jumper settings. An 8 MHz crystal is used to provide the clock signal. The microcontroller is Reset, using an external push-button switch.

Figure 9.13 Circuit diagram of the project


9.2.4 Project PDL

The PDL of this project is very simple and is given in Figure 9.14.

Figure 9.14 PDL of the project


9.2.5 Project Program

The program is named LED4.C and the program listing of the project is given in Figure 9.15. At the beginning of the project, variable Cnt is declared and initialised to ...

Get Using LEDs, LCDs and GLCDs in Microcontroller Projects now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.