PIC12F675 based digital clock using LCD display (Code + Proteus simulation)




This post provides a simple digital clock implementation using PIC12F675 microcontroller and an LCD display. This code is written in C language using MPLAB with HI-TECH C compiler. You can download this code from the ‘Downloads‘ section at the bottom of this page.

PIC12F675 based digital clock

In this article, it is assumed that you know,

  • How to interface LCD with PIC12F675 microcontroller. If you don’t then please read this page.
  • How to configure timer0 of PIC12F675 microcontroller.  If you don’t then please read this page.

The result of simulating the code in Proteus is shown below.

The above figure was taken after 1 minute and 13 seconds of code simulation in Proteus. In the code, timer0 is used as the base for digital clock generation. Timer0 is used here to generate 1msec interrupts. After every 1msec a global variable named msCounter increments. When msCounter reaches a value of 1000 then another global variable named secCounter increments and this process repeats itself. Similarly, when secCounter reaches 60, then  minCounter increments. And when minCounter reaches 60 then hrCounter increments. This process continues until hrCounter reaches 24 then all of these variables reset their values. LCD is updated with the new values of hrCounter, minCounter and secCounter after every second.

PIC12F675 based digital clock schematic

Code

The main function code is shown below.

Downloads

Digital clock display code using PIC12F675 was compiled in MPLAB v8.85 with HI-TECH C v9.83 compiler and simulation was made in Proteus v7.10. To download code and Proteus simulation click here.

 

For more detail: PIC12F675 based digital clock using LCD display (Code + Proteus simulation)




Current Project / Post can also be found using:

  • code about digital clock using lcd in 30f%0 
  • pic12f675 clock

Leave a Comment

*
= 5 + 3

Read previous post:
PIC12F675 based simple calculator
PIC12F675 based simple calculator ( Code + Proteus simulation )

This post provides a simple calculator project implementation for PIC12F675 microcontroller. This is a simple one digit[1] calculator which implements only...

Close
Scroll to top