Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Interfacing real time clock

Status
Not open for further replies.

goodpickles

New Member
hello!
I have a PCF8583 Real time clock connected to a pic 16f877, I want to do 2 things with it.

1. display hours, minutes, seconds
2. use it as a counter to count time between pulses (for a speedometer)

From reading the datasheet I could not determine if it can do both of this at once, or not.

Also does anybody have code examples in JAL I searched google but found none.
 
goodpickles said:
hello!
I have a PCF8583 Real time clock connected to a pic 16f877, I want to do 2 things with it.

1. display hours, minutes, seconds
2. use it as a counter to count time between pulses (for a speedometer)

I see no problem doing that, you could either do them both by polling, both by interrupts, or one of each.

As I recall you can set the PCF8583 to output a pulse every second on one of the pins, you could use that to signal when the next update is needed.

Or you could simply read the clock during the half of the pulse you're not reading - if you're measuring the LOW part of the pulse, use the HIGH part to read the clock.

You might like to consult the (very old) MicroChip datasheet for a frequency counter, it does much of what you want - while multiplexing LED displays at the same time. There's a later modified version (not from MicroChip) which uses an LCD display instead.
 
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top