Split a large 7-segment clock into two independent problems: keeping accurate time, and driving many segments without overloading anything. The timebase and the display scan have nothing to do with each other, and a design that keeps them separate is far easier to reason about.
Two jobs that only look like one
A clock has to count seconds and it has to light segments. Those sound like the same activity but they are not. The Microchip PIC18F2XK20/4XK20 datasheet describes a family that includes the PIC18F26K20 and notes that it provides timers and a Timer1 secondary oscillator facility. From that hardware, the central architectural decision follows: the oscillator keeps time, the scanning logic lights digits, and neither should be allowed to dictate the other’s timing.
Timebase accuracy is its own problem
Whatever holds the seconds should be evaluated on its own merits, including drift and how the design reacts when the display is busy. If scanning ever blocks or delays the timekeeping path, accuracy suffers for reasons that have nothing to do with the oscillator. Keep the two timing paths independent.
Display architecture is a budgeting problem
Six digits means six times the segment count of a single digit, and current has to go somewhere. The choice of driver class, whether direct pin drive, a dedicated driver, or an array like the ULN2003A, is really about budgeting current, pins and voltage rather than finding a single right answer. The ULN2003A datasheet is a useful documented comparison point: it comprises seven NPN Darlington pairs with common-cathode clamp diodes intended for inductive switching. Its 500 mA collector-current figure is a single-output rating and is not a guarantee of simultaneous full current on every channel, a distinction that matters the moment several digits switch together.
| Approach | Documented role | Strength | What to check |
|---|---|---|---|
| Direct processor-pin drive | pins drive segments directly | fewest parts | per-pin current and the processor’s voltage range |
| Darlington array | seven NPN Darlington pairs with common-cathode clamp diodes | suits inductive switching and saves pins | 500 mA is per output; simultaneous full current is not guaranteed |
| Dedicated constant-current driver | regulates per-segment current | steadier brightness | confirm it against its own datasheet |
Voltage compatibility is not universal
The PIC18F26K20 is specified over an operating voltage range of 1.8 V to 3.6 V. That alone should stop anyone from assuming 5 V logic compatibility with this part. The interface between processor and driver has to be checked against both documents, not assumed.
Evaluating the architecture, in order
- Separate the timebase from the scan, and give them independent timing paths.
- Choose the processor and note its operating voltage range before planning the interface.
- Count total segment current and compare it with the driver’s per-channel and simultaneous limits.
- Decide the multiplexing scheme and how it shares current across digits.
- Select a driver class that fits the current and voltage you actually have.
- Verify the display against its own datasheet, since no segment pinout or current figure here is verified.
Reader questions
Why keep oscillator and scanning apart?
Because they solve unrelated problems. One holds the time reference, the other lights digits, and blending them lets display load corrupt timekeeping.
Can I drive all segments straight from the processor?
Only within its per-pin limits and its voltage range. The PIC18F26K20 is documented at 1.8 V to 3.6 V, so assuming 5 V tolerance would be a mistake.
Is a ULN2003A the right driver?
It is offered here as a documented comparison example, not as the verified circuit of any particular clock. Its seven Darlington pairs and clamp diodes suit inductive switching, but the 500 mA figure is per output only.
Why does brightness change with digit count?
Multiplexing shares current over time, so lighting more digits per frame changes average current. That is a budgeting question you decide deliberately, not a fixed number.
For display-driving basics, the LED and bar-graph display tutorial is a helpful companion reference.
Documentation
- Microchip PIC18F2XK20/4XK20 datasheet, 40001303H
- Texas Instruments ULN200x/ULQ200x Darlington array datasheet, SLRS027T
Documentation note: the DS32kHz oscillator and the display datasheets are outside this reference, and no bench testing was done. Segment voltages, multiplex duty, current figures and clock accuracy for a specific build are not established. Do not wire a display pinout or set currents without its actual datasheet, and do not assume 5 V logic compatibility for the processor’s documented 1.8 V to 3.6 V range.
