Re: LCD controlling with comparators

From: Danny T (danny_at_nospam.oops)
Date: 01/16/05


Date: Sun, 16 Jan 2005 15:11:31 +0000

Anthony Fremont wrote:

> It listens to a pendulum clock ticking and measures the time between the
> ticks and tocks. I've got it working pretty well right now. It's got
> two LEDs that ping-pong in sync with the tick-tock for a visual
> reference that it's working. It also prints the time between beats to
> an LCD for balancing the beat. I'm going to have it calculate the
> number of beats per hour to help speed up pendulum length adjustments.
> I have one old clock that keeps time with an accuracy of a few seconds
> per week. Not bad for something on the order of 125 years old, huh?
<snip>

Sounds interesting, though I'm an 80s child, so I'd probably rig the
clock to be controlled by something digital and leave the pendulum for
show ;-)

> Without the pull-up resistor, the pin can't actively drive anything.
> IOW, it can't put out +5V. It can only act as a current sink. It may
> be that the segment you have it connected to doesn't draw any
> significant current (very likely) and that the pin floats high enough to
> make it happy. It would never be able to supply enough +5V juice to
> turn on an LED.

I see - so if I noticed the segments attached to those pins didn't
light, putting a resistor between 5V and the pins would correct it?

What would be the correct (or possible) ways to attach an LED to this
port? Would it just a resistor from +5V to the pin, connected to the
LED, or would it make more sense to attach the LED from +5V to the pin,
and let it sink? Does the chip need to be told if it's sinking or
sourcing, since I imagine they'd need to be hooked up rather differently?

>>Does that make sense?
>
>
> Yes, that's why you need a data hold time. This is the time spent
> continuing to present valid data on the port even after you bring the
> enable pin low. As long as it's a predictable value, the slave PIC can
> safely accept data from the master without worry. You'll see this value
> specified in applicable datasheets where data is being exchanged via
> I2C, SPI, etc...

Excellent, I was worried the electronics world was pumping out dodgey
electronics for a while then! Though I do find it strange this value is
specified, rather than the "reading" component reading data off into a
buffer, then processing from there - this way it's always perfect. We
only update *if* the clock is on, with the data we *know* was present
with the clock :-)

-- 
Danny

Quantcast