Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Digital Clock With PIC16F84A [Timming Problem].

Status
Not open for further replies.

mosh

Junior Member level 2
Joined
Aug 30, 2004
Messages
23
Helped
1
Reputation
2
Reaction score
0
Trophy points
1,281
Location
where I don't want to be!
Activity points
339
clock generator 4060

I want to made a digital clock with PICs,
So I Wrote "counting" & "Multiplexing" Functions, for my clock
But I found a BIG problem: finding A REAL 1S for timming! :?

How can I find or made an exact "1second" for timming?
I should use an external Clock generator or PIC can do this job?

Delay functions aren't good because, Time of delay functions will add to
time of other process [like "counting" & "Multiplexing" Functions ],

Also, I can use a simulator for finding the process time but ,
the process time is not a stable value[changed values, temprutuer,etc...].

Don't forget about Multiplexing technic, 25 frame or more per second,so
main loop is refreshing the display.


any idea for a real 1s can be helpful.
regards
Mosh
 

software compensation for digital clock

Choose a Microcontroller with internal timer and with it you can avoid using delays.

Keep in mind that the crrystal has to be very accurate for this application.
In the software include a compensation routine.

Regards
Nox
 

c2c c compiler for pic16f84

If you want precisión, use a 3.2768Mhz crystal, and timer!!!
 

k73sch

This could help
 

pic 3.2768mhz

Hi,

- Use the internal timer (tmr0) as internal counter

- setup prescalar as 1:32

- Setup the tmr0 overflow interrupt

- Use crystal 32768HZ (suitable too for low power operation)

32768\4\32=256HZ

So when the counter counts 256 cycles, tmr0 will overflow (256\256 = 1Sec)
and generate interrupt.

- Write what you want to execute every 1 sec in in the ISR.

Bye
 

pic16f84a up down timer

Why not use external clock with Cmos 4521/4541 ?
Cristal's tolerances allow good precision --> 50ppm --> 0.005% so you obtain a maximum time lag of 4.32sec per day ;)
You can check your crystal ( + capacitors ) with a precision frequency meter too.
regards,
 

pic16f84+external real time clock

Hi all,

Dear Nox, surely your text is good, but I'm not familiar with assembly,
It seems I should learn it as fast as I can, so any suggestion about E-Books
for learning ?

Dear SphinX,
can you explane abit more about how I can adjust tmr0 ,I use PICBasic,
can I adjust tmr0 on PICBasic or I should insert some assembly codes on it

also It seems I can't use 32768HZ Xtals. rightnow I have an 8 digit up/down counter on my board, with 32.768KHz I can see each digit Separatly,
with 1MHz it have some flikers ,with 4MHz it's good.

mybe I want to use this as main clock for timming some other stuffs with wireless.
for true timming with 16F84A/4 I should use 4MHz Xtal also about sending data:
SEROUT PORTA.2,N2400,[#DG1,#DG2,#DG3,#DG4,#DG5,#DG6,#DG7,#DG8]
it makes fliker even in 4MHz , i should brake it to some seprated parts isn't it.
SEROUT2 have 19200 Baud Rate, it can solve this problem or no?

I prefered to don't use an external clock, but if if the code going to be too complicated I will use something like 4060 with 32.768KHs Xtal [out 1/2 S].

what is your idea, witch one is beter ???
sorry about my long texts, it's the only way to get much more helpful & ralated answers.

Thanks in advance
Mosh
 

4060 digital clock

hi friend

here is ready code in pic assembly file for pic based clock just click the link given below i have made this clock working fine some very fine feature such as in the night light of led display automaticaly adjusted also software based clock calibration

**broken link removed**

and the schematic for above code

https://kitsrus.com/pdf/k73sch.pdf


and fully annotated software code

https://kitsrus.com/zip/clocksrus.zip
 

pic16f84a interrupt test

Why dont you use some RTC chip and easily solve problem.


I suggest PCF8583.

Regards,


Mr.Cube
 

clock 4mhz com 4060

Hi,
it seems I should ask something Different.... WHERE IS THE FUN HERE ?!
It's quite easy for me to made a simple clock, actualy I have one alredy
with standard cmos chips ,with less than 1sec time lag.
I'm just new in MCU's not in Electronic. anyway.... .

thanks Fragrance , your clock is realy fine, But I just want to know timming technics on PICs & specialy how can I use them in PICBasic. [something like the file "Nox" uploaded].

forgot about this topic it seems I should continue it by myself.
thank you all,
Mosh
 

cr2032

The best thing would be to use Real Time Clock (RTC) ICs like DS1307. It is the best RTC I've used. Consumes only 300nA current. That means CR2032 coin battery will last for years. The clock accuracy is also excellent.
 

pic16f84 clock 32768

hi,

look at
hxxp://users.skynet.be/bk317494/
you will find DS1307 real time clock project...

if you want to use single pic like pic16f84 and interrupts, most probably you want 1 interrupt per second. if then, look at
hxxp://www.picant.com/c2c/c.html
you find SourceBoost IDE and BoostC C-compiler, which has a wizard that helps you to set timers and interrupts interval. it generates code for you. i test it several months ago. You can it with it.

with picbasic it seems more difficult because of picbasic's interrupt handling mechanism.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top