# PIC uC digital clock.

Status
Not open for further replies.

#### imranahmed

Please let me know that Im going to build digital clock by using 7-segment display.
Please can anyone refer me any link or C-code tricks by using PIC uC.

#### tpetar

Please let me know that Im going to build digital clock by using 7-segment display.
Please can anyone refer me any link or C-code tricks by using PIC uC.

You can see this project link :

A Real Time Clock IC (DS1307) project using the PIC micro
https://www.best-microcontroller-projects.com/real-time-clock-ic.html

Source is written in MikroC.

imranahmed

### imranahmed

Points: 2

#### imranahmed

Your given circuit is great but I want to make digital clock by only using uC (PIC or AT89C52).

#### Tahmid

A complete project has been discussed here: https://www.edaboard.com/threads/272381/

- - - Updated - - -

Your given circuit is great but I want to make digital clock by only using uC (PIC or AT89C52).

Using DS1307 has its advantages and it's not very expensive.

imranahmed

### imranahmed

Points: 2

#### tpetar

Your given circuit is great but I want to make digital clock by only using uC (PIC or AT89C52).

This change thing, you say in post #3 - 89C52.

Go to this link (registration is free), MikroC source code, Tutorial:

Simple Digital clock using 8051 microcontroller (AT89C51)

imranahmed

### imranahmed

Points: 2

#### imranahmed

Please check my code and circuit.
Question is that I want to make digital clock 4-digits for Hours and Minutes.The minutes digit increase after every 60 secs and hour digits increase after every 60 mins but problem is that if i add delay() function for 1 sec the display off and on and cannot display without flickering how to avoid this problem.

- - - Updated - - -

#### Attachments

• DClock.txt
943 bytes · Views: 18
• Dclk.bmp
2.3 MB · Views: 17

#### iukhan

...... but problem is that if i add delay() function for 1 sec the display off and on and cannot display without flickering how to avoid this problem.

- - - Updated - - -
Adding delay of 1 sec will definatly flicker your display. Dont add delay() function, instead use timer interrupt function for updation of sec. OR you can add 1 ms delay () function and update a variable of millisecond variable, and when millisecond is equal to 1000 increase the sec variable and so on.

imranahmed

### imranahmed

Points: 2

#### imranahmed

In uC 89c52 there are 2 timer interrupt 1)interrpt 0 and interrupt 3.
My question is that can we use interrupt 1 or 3 two,three,four times and so on OR use interrupt only for one task.?

- - - Updated - - -

In uC 89c52 there are 2 timer interrupt 1)interrpt 0 and interrupt 3.
My question is that can we use interrupt 1 or 3 two,three,four times and so on OR use interrupt only for one task.?

#### iukhan

In uC 89c52 there are 2 timer interrupt 1)interrpt 0 and interrupt 3.
My question is that can we use interrupt 1 or 3 two,three,four times and so on OR use interrupt only for one task.?

You can use interrupt for more task, its all depends on programing style and requirment.