When you program your PIC, you will need to select the “INTIO2” oscillator configuration option to enable the internal oscillator.
The display defaults to scrolling the digits of pi on power-up (Figure 4). If you press and hold the mode/enter button while powering up or resetting the PIC, the display enters National Debt clock mode.
First, you will enter the current value of the debt, starting with the most significant digit and using leading zeros as necessary.
I recommend using sockets for the four ICs to reduce the risk of damaging them during soldering.
However, if you plan to mount the board behind a panel or in an enclosure, note that the height of the chips in their sockets exceeds the height of the displays themselves.
The bypass capacitors can also be mounted horizontally to keep them below the plane of the displays.
I have included extra pads on the unused I/O pins on the PIC so you can “roll your own” ICSP interface if you choose to solder the chips to the board (though you will have to add a diode between the MCLR pin and its pull-up resistor to protect the rest of the circuit from the programming voltage). After scrolling all the digits, the display will pause and then restart from the beginning.The pi data is stored in the PIC’s Flash memory during device programming with the POKECODE instruction (take a look at the source code file at the end of the article in the downloads). The math for the National Debt clock is very straightforward — all we need to do is look up the current amount of debt and the rate of increase, enter them into the PIC, and then keep a running total with time.This information is available at among other places. Selector .selector_input_interaction .selector_input. Selector .selector_input_interaction .selector_spinner. I like the look of seven-segment LED displays and came up with a couple of fun applications for them: a scrolling display of the digits of pi (3.14159…) and my own desktop version of the National Debt clock.I found that my math skills weren’t sufficient to get these algorithms to work (even in a spreadsheet), though, so I never got to try to write the PIC code.