Reference time/clock help

I'm trying to mesh two microcontrollers that need to sample separate data at a relatively fast rate (one at 50 samples/sec, the other at

150 samples/sec). In order to determine what events logged by one microcontroller corrospond to events logged by the second microcontroller, I'm hoping to insert some sort of reference time (not nessesarily in seconds, possibly in "counts") that they can both access in order to timestamp the data before putting it on an eeprom. I imagine this would require a parallel interface, but am not familiar with alot of options out there.

What "viable" (aka relatively cheap and easy) options are there for a fast reference clock for both chips? Can I just get a 555 hitting up a counter? (Ideally, I'd like the "unit" of the timer to in the range of 1/100th of a second or less, but 1/10th is doable).

Thanks in advance! Dave

Reply to
David Harper
Loading thread data ...

?

?

Serial EEPROM might be what you want if you need external storage.

The uC should have timers/counters to use on-board. You can use an external timer input. Drive it with anything, really. Two spare inverters as an oscillator. CMOS 555. Full-wave rectified AC squared up. Some PICs have an Fosc/4 output.

--
Best Regards,
Mike
Reply to
Active8

Many micros contain counters. If you arrange it so that one micro can turn on the reference clock, at power up, both can clear the counters and then after a short delay, one of the micros can start the reference clock.

--
--
kensmith@rahul.net   forging knowledge
Reply to
Ken Smith

Eh, ok, I didn't want to say it, but they're basic stamps, which do not have timers/counters for accurate timekeeping (especially since they can't multitask). Therefore I'm hoping to set up a peripheral circuit that can be polled by both to get a timestamp (again, it doesn't have to be in seconds, but can be in counts). Ideally, each count would be down around the 1/100th second range, and it could record atleast 10 seconds before reseting/rolling back to 0.

Thanks for the suggestions, and for any additional advice! Dave

Reply to
David Harper

Argh!

Do they have I2C interface? You can get RT clocks with I2C..

Best regards, Spehro Pefhany

--
"it's the network..."                          "The Journey is the reward"
speff@interlog.com             Info for manufacturers: http://www.trexon.com
Embedded software/hardware/analog  Info for designers:  http://www.speff.com
Reply to
Spehro Pefhany

Yeah, I'd seen some of those with 3-wire/SPI interfaces (I guess that's I2C?), but they apparently only keep track down to the second or quarter second. The more accurate ones are $$$. I may just use a counter with a 555 hitting it every few seconds.

Thanks! Dave

Reply to
David Harper

Ok, how about these ideas about the same one bit signal:

(a) One micro outputs a signal that the other can listen to.

(b) An external circuit makes the sync signal.

This line changes at a rate a fair bit slower than the micro(s) samples it.

I'll discribe one version of this signal not the only one that you can use:

The signal goes from low to high on the seconds boundary. The micros count off their own sub-cycles with in the seconds to get the bits below the second time.

Sometimes the line goes high and remains so for 0.25 seconds and then goes low again. Sometimes the line goes high for 0.50 seconds before going low and sometimes its 0.75 seconds This will be used to shift in one bit of information every second as follows:

Time Meaning

0.5 We are in the gap between data 0.25 Shift in a zero 0.75 Shift in a one

The master clock always starts its data pattern on a 32 second boundary.

Every 32 seconds, we can shift in a 30 bit value for the time in 10 second increments

2^30 * 10 = 10.7 Billion seconds.
--
--
kensmith@rahul.net   forging knowledge
Reply to
Ken Smith

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.