I'm must be missing something simple, but connecting Mega 2560 digital outputs to 74HC (245 for example) doesn't work. Switched signals (digitalWrite(pin, HIGH) then LOW) are not seen on the output of the 245. But, if I connect a 100k resistor from the Mega output pin to GND, the 245 sees the signal. What am I doing wrong ? I have a scope and the signals without the 100k seem to switch from 4.5 to around 0v - though the waveform isn't very square.
(deleted)
The code is "digitalWrite(pin, HIGH)" and "digitalWrite(pin, LOW)". I explained the wiring - do you really need a digram to show an output pin from the Mega going to a 74HC245?
PS. I am powering my 245 from the Mega (so common ground).
Sensible answers welcome.
Is the Arduino pin set to pinMode OUTPUT?
If you build your circuit on a breadboard this is the most probable problem. Followed by a logic chip destroyed by static discharge - swap chips.
A 100k resistor cannot change anything when connected to an output pin. On an input pin it can considerably change things, or if the controller can not pull the output pin low due to controller damage. What's the signal swing without the resistor, or with the resistor to 5V instead of GND?
andycapp:
The code is "digitalWrite(pin, HIGH)" and "digitalWrite(pin, LOW)". I explained the wiring - do you really need a digram to show an output pin from the Mega going to a 74HC245?
Yes, yes we do. Because if you are not seeing the mistake you're making, you will probably also not put it in your explanation.
Such sass
groundFungus:
Is the Arduino pin set to pinMode OUTPUT?
+1
Will explain the need for 100k pull-down.
Thank you for all the helpful responses. My ground cable had an internal break. All working as expected now - thanks again.