Go Down

Topic: Logic 1 reads 4V ? (Read 1 time) previous topic - next topic

MarkT

And I'd recommend using 74HC14's because schmitt-triggers are so useful to have in stock, why get inverters
that aren't schmitt-triggers?  (Well perhaps because they might be a little faster I suppose).
What is the purpose of the 74HC04  inverter ?

Typically your indicator leds would be on the ULN2803As outputs...


The PCF8574 cannot source anything like enough current to drive the 2803, the inverter can.
[ I will NOT respond to personal messages, I WILL delete them, use the forum please ]

Watcher

#16
Dec 18, 2016, 08:37 pm Last Edit: Dec 18, 2016, 08:39 pm by Watcher
Quote
What is the purpose of the 74HC04  inverter ?
This is necessary in order to make sure all relays are de-energised (off) at power on in addition to current source capability.


Watcher

Quote
Starting to think that this push-pull I/O expander would have been a better fit, possibly no need for 74HC04.
Interesting.. I am not familiar with this one. What is the advantage in this case?

Watcher

Quote
And I'd recommend using 74HC14's because schmitt-triggers are so useful to have in stock, why get inverters
that aren't schmitt-triggers?  (Well perhaps because they might be a little faster I suppose).
I agree Mark. Speed is not an issue here but there should be a need for a schmit trigger since the output should have been within the  logic specs.


Watcher

Quote
Hmm ... I was thinking the inverter was there to prevent all relays being energized during startup since by default the expander will initialize all I/Os to inputs with a weak pullup current to Vcc.
That as well... See my my other post

dlloyd

Quote
Interesting.. I am not familiar with this one. What is the advantage in this case?
Pin compatible package, push-pull logic level outputs (source 10mA, sink 25mA), polarity inversion register,  shouldn't need inverter, may only need external pulldown resistor on each output to prevent all relays energizing on powerup.

ricky101

This seems like a more suitable device ... even the C++ code as well ?

https://www.adafruit.com/product/593


Wawa

Isn't it easier to dump the whole circuit, and use one TPIC6B595 (or another member of that family).
I used the TPIC6C596 (smd) for eight 12volt relays. No other parts than one 100n decoupling cap.
Leo..

Watcher

dlloyd: will sure consider the option next time i revise the pcb design. For now i am stuck with this pcb layout!

dlloyd

It has the exact same pin configuration, so I think its compatible with your existing PCB.

sterretje

#25
Dec 19, 2016, 04:19 am Last Edit: Dec 19, 2016, 04:20 am by sterretje
Just thinking here about that 10k pull-up. It does not hurt but does one really need it with the given circuit?

The PCF8574 can drive 30 uA (IOH) minimal, the input current of the HC04 is 1 uA maximum; (II) you can drive 30 HC04 inputs from one PCF8574 output. And it gets even better if you base the calculation on IOH = 100 uA ;)

What am I missing? Looking at the wrong parameter?
If you understand an example, use it.
If you don't understand an example, don't use it.

Electronics engineer by trade, software engineer by profession. Trying to get back into electronics after 15 years absence.

dlloyd

#26
Dec 19, 2016, 05:14 am Last Edit: Dec 19, 2016, 05:21 am by dlloyd
Quote
What am I missing?
Nothing (maybe). Perhaps it would work without the pullups as the internal 30-100µA could be enough. I'm a bit concerned that VIH for the 74HC04 would work out to be about 3.5V (with Vcc = 5V) and the OP was getting only 4V on the output of the expander when weakly pulled high. Only a 0.5V margin with the outputs being somewhat susceptible to noise.

I'm guessing that during design of the circuit, the relays were all getting energized during power up and adding the 10K external pullup resistors resolved the problem.

There might be a small interval of time during power up where the inputs would be high impedance (I think) until VCC reaches VPOR which is 2.5V max. However, probably not enough time to cause the relays to pulse on/off.

Watcher

#27
Dec 19, 2016, 06:35 am Last Edit: Dec 19, 2016, 08:27 am by Watcher
Quote
The PCF8574 can drive 30 uA (IOH) minimal, the input current of the HC04 is 1 uA maximum; (II) you can drive 30 HC04 inputs from one PCF8574 output. And it gets even better if you base the calculation on IOH = 100 uA ;)   
So in other words lowering the pullups to say 4k7 wont solve the problem?

EDIT: Measuring the output voltage on P6,P7 with nothing connected and while outputting 0s, gives 0.0009V (VHI=4.8044, Vcc=4.9954)  I am inclined to conclude that the 10k pull-ups are not strong enough to adequately drive high the input for the HC04 eventhough, as dlloyd pointed out, this doesn't seem to be supported by the specs.

Watcher

Update: I decided to put a scope on the outputs instead of just relying on the DMM voltage readings.

Turns out that what I was seeing as a dim lit led, is in fact a perfectly square pulse of about 2kHz and Vpp =2.8V. The DMM was just measuring the RMS value of that. And the source of this pulse is..software!

The sketch is routinely updating the status of the outputs of the PCF8574 just to flash the LED that is supposed to be connected on P7. Every time the PCF8574 is written to, all outputs pulse even if the actual data written is the same as the last state.

So the root of the problem is not electrical, just software.

I now have to figure out how to only change the particular bit that needs to change state without re-sending the complete word to avoid these pulses.



Thank you all for all the positive input!


Go Up