Skip to the content
PCBKitNew board
2 layers110.5 × 80 mmDigital clock, the printed circuit board in 3D

Bare-metal digital clock firmware for PIC18F4550 with multiplexed 7-segment display, EEPROM time storage, and cooperative scheduler.

Size
110.5 × 80 mm
Copper layers
2
Thickness
1.6 mm
Parts
40
Nets
63
Pads
166
Tracks, vias
416, 0
Pours
1
Routed
Yes
KiCad
KiCad 7 (file 20221018)
Created
29 Jan 2026
Updated
27 Apr 2026

Overview

Digital clock is an open-source printed circuit board by creyes2001, from the creyes2001/digital-clock repository on GitHub. It is a 2-layer board of 110.5 × 80 mm with 40 parts on 63 nets, routed with 416 tracks and 0 vias.

It is built around the PIC18F4550-I/PT and PN2222A. Its parts include 22 resistors, 5 ICs, 4 transistors, 4 switches and 2 connectors. It belongs with the lEDs and displays boards and the PIC boards of this library.

Main components

2

README

README.md

DIGITAL CLOCK

Overview

This is a bare-metal C project based on the Microchip PIC18F4550 microcontroller that implements a digital clock. The system uses multiplexed seven-segment displays to show the current time and provides a push-button interface for user configuration. The configured time is stored in the internal EEPROM memory.

Features

  • Modular driver-based firmware architecture
  • Timer2-driven system tick for timekeeping and scheduling
  • Multiplexed seven-segment display control
  • Push-button interface for user configuration
  • EEPROM-based non-volatile time storage

Hardware

  • Microchip PIC18F4550 microcontroller with a 16 MHz external crystal oscillator
  • Multiplexed common-cathode seven-segment display
  • NPN transistors for digit control
  • Push-button interface with pull-up resistors

Software architecture

The firmware is organized using a modular architecture that separates hardware drivers from application logic.

The modules include:

  • GPIO HAL for low-level pin control
  • Display driver for multiplexed seven-segment control
  • Button driver for user input handling
  • System tick dirver providing a 1 ms time base
  • EEPROM driver for non-volatile data storage
  • Clock driver for real-time management
  • UART driver for testing and debugging

How It Works?

The system operates on a 1 ms system tick generated by the Timer2 peripherial. The tick drives a cooperative scheduler responsible for executing periodic tasks and maintaining the system time. The scheduler manages key tasks such as button input processing, display multiplexing, and timekeeping. This approach ensures accurate timing efficient CPU utilization.

Challenges & Design Decisions

Display ghosting

My initial design used common-anode displays driven by PNP transistors through a Darlington array, chosen to limit the current going through the PIC's GPIO pins. This setup caused visible ghosting: the Darlington array's slow switching times and high saturation voltage drop meant that the previous digit didn't fully turn off before the next one turned on during multiplexing.

I redesigned the digit-drive stage with common-cathode displays driven directly by NPN transistors. The faster switching produced cleaner digit transitions and eliminated the ghosting entirely. This taught me that in embedded development, firmware correctness alone isn't enough — the underlying circuit topology can make or break a working system.

Build Instruction

bash
make all
make flash
make clean

Schematic

schematic

Parts

40
QtyValueFootprintReferences
4PN2222APackage_TO_SOT_THT:TO-92_InlineQ1, Q2, Q3, Q4
4PULL-UPResistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P7.62mm_HorizontalR3, R4, R5, R6
4PULL_DOWNResistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P7.62mm_HorizontalR16, R18, R20, R22
2CCapacitor_THT:C_Disc_D3.0mm_W1.6mm_P2.50mm22uF1, 22uF2
2DEC_RESResistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P7.62mm_HorizontalR1, R2
116 MHz CrystalCrystal:Crystal_HC49-4H_VerticalY1
1BTN_DECButton_Switch_THT:SW_PUSH_6mmSW4
1BTN_INCButton_Switch_THT:SW_PUSH_6mmSW3
1BTN_MODE Button_Switch_THT:SW_PUSH_6mmSW2
1Conn_01x02Connector_Phoenix_MC_HighVoltage:PhoenixContact_MCV_1,5_2-G-5.08_1x02_P5.08mm_VerticalJ2
1Conn_01x06Connector_PinHeader_2.54mm:PinHeader_1x06_P2.54mm_HorizontalJ1
1Digit 1Display_7Segment:D1X8KU2
1Digit 2Display_7Segment:D1X8KU3
1Digit 3Display_7Segment:D1X8KU4
1Digit 4Display_7Segment:D1X8KU5
1PIC18F4550-IPPackage_DIP:DIP-40_W15.24mmU1
1RB_D1Resistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P7.62mm_HorizontalR15
1RB_D2Resistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P7.62mm_HorizontalR17
1RB_D3Resistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P7.62mm_HorizontalR19
1RB_D4Resistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P7.62mm_HorizontalR21
1R_AResistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P7.62mm_HorizontalR7
1R_BResistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P7.62mm_HorizontalR8
1R_CResistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P7.62mm_HorizontalR9
1R_DResistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P7.62mm_HorizontalR10
1R_DPResistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P7.62mm_HorizontalR14
1R_EResistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P7.62mm_HorizontalR11
1R_FResistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P7.62mm_HorizontalR12
1R_GResistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P7.62mm_HorizontalR13
1SW_PushButton_Switch_THT:SW_PUSH_6mmSW1

Questions

How big is the Digital clock PCB?

It measures 110.5 × 80 mm and has 2 copper layers, 1.6 mm thick.

What parts does the Digital clock use?

40 parts, built around the PIC18F4550-I/PT and PN2222A. The full list of its parts is on this page, with links to each part's symbol and footprint where PCBKit's library has them.

Where can I download the Digital clock KiCad files?

From the creyes2001/digital-clock repository on GitHub, at the commit this page was made from: the board is pcb/digital_clock/digital_clock.kicad_pcb and its schematic pcb/digital_clock/digital_clock.kicad_sch. PCBKit opens the board in the browser, with nothing to install.

Can I use the Digital clock design in my own project?

Its repository states no licence, so its author keeps all rights: ask creyes2001 before reusing the design.

Similar boards

  • 2 layers71.1 × 95.3 mmPlaca PIC18F4550, the printed circuit board in 3D

    Placa PIC18F4550

    WelsTheory/PIC18F4550-TUTORIAL

    PIC18F4550 - TUTORIAL

    36 parts55
  • 2 layers161 × 177 mmPLC Pic18f4550, the printed circuit board in 3D

    PLC Pic18f4550

    Agustin586/Kicad-Projects

    Aca se encuentran los diseños de pcb de kicad

    178 parts
  • 2 layers126 × 72.5 mmProjeto I, the printed circuit board in 3D

    Projeto I

    Carlos9852/Sistemas_Embarcados

    Projeto I da disciplina de Sistema Embarcados e Microcontroladores

    44 parts
  • 2 layersPICDUINO, the printed circuit board in 3D

    PICDUINO

    DouglasFelipe97/Picduino-v2.0

    42 parts
  • 2 layers95.5 × 57 mmDspic30 simple, the printed circuit board in 3D

    Dspic30 simple

    Esdras2/dspic30f-devboard-kit

    Breadboard-friendly dsPIC30F4011 (DIP-40, all-THT) dev board—KiCad 8 hardware (Rev D) plus XC16 demo firmware, 12 V→5 V regulation, crystal clock & ICSP.

    23 partsMIT
  • 2 layers100.3 × 100.2 mmProyecto, the printed circuit board in 3D

    Proyecto

    javimenba/PCB-Alarma-

    Proyecto de investigación

    46 partsGPL-3.0
  • 2 layers39 × 28 mmLcsys, the printed circuit board in 3D

    Lcsys

    mora200217/lcsys

    Sensor de nivel capacitivo. Practica 2 Sensores y actuadores

    5 partsMIT
  • 2 layers99.1 × 63.5 mmPCB PAI, the printed circuit board in 3D

    PCB PAI

    nacaceresp/PetMachine

    23 parts