- Discrete LEDs
- Dot/Bar LEDs
- Matrix LEDs
- 7-Seg LEDs
- LCDs
- Switches
- KBDs
- Sensors
- Motors
- Analog
-
Comm
- Serial -- Software
- Serial -- Hardware
- RS-232 via the MAX3232
- I2C -- EEPROM
- I2C -- DS1307 Real Time Clock
- 1-Wire -- DS18B20, Powered, Single-Drop
- 1-Wire -- DS18B20, Powered, Multi-Drop
- 1-Wire -- DS18B20, Parasitic, Multi-Drop
- TI Link Protocol -- Calculator Demo
- Infrared Communication
- MIDI -- Output Demo
- MIDI -- Input Demo
- MIDI to Analog Synth
- Miscellaneous
7-Segment Display -- Two Digits
It's pretty easy to bump things to two digits through the magic of multiplexing. As usual, we'll let Timer0 generate interrupts within the PIC16F88 to determine when each segment within each digit should be lit. The diodes are updated at 122 Hz which is fast enough to avoid flicker.
We'll dispense with the decimal point now. So, seven pins of Port B are needed for the pairwise-ganged anodes, along with two additional ones in Port A for the cathode selection. A pair of 2N2222 NPN transistors takes care of enabling the latter.
As always, take time to study the source code. By this point, you should be quite comfortable with Timer0 interrupts, setting the port data direction, using variables, constants and arrays in memory, and more. See! PIC Micro Pascal really is so easy to use, and elegant as can be.
Click to get the source code.
Click to get the schematic PDF.
Next Project: 7-Segment Display -- Latched
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment