74hc165 weak output? < solved >

Go To Last Post
6 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi,

I am breadboarding the controller part of a project for which I need to read 8 switches. They are pulled-up to Vcc through a resistor network, sent to the parallel inputs of a 74hc165, the 74hc165 is connected to an ATMega644p (clock and load configured as outputs, serial data configured as input without pull-up). I'm not using SPI, just bit-banging load and clock.

All my readouts were 0s so I started looking at the voltage at the pin receiving shifted data. I don't have a scope but by slowing down the code that clocks the 74hc165 I could look at the transitions on a multimeter. Here's my weird findings:
- When the 74hc165 is not connected to the mcu, the voltage is, as expected 0 or 4.96V in a sequence that reflects the pressed switches.
- When the 74hc165 is connected to the mcu, the voltage is a sequence of 0 or 0.95V in the same sequence - so the mcu sees only 0s.

I expected the inputs of the mcu to be high impedance, but there seems to be a heavy "load" at the input pin - that or the 74hc165 output is weak. I tried adding an op-amp buffer and it worked. I also tried a simple transistor pulling the output to 5V, and it worked. But it makes little sense to me to have to use a buffer/transistor for such a common task as reading a 74xxx gate.

I swapped-in another 74xxx ; and another 644p, so I have excluded the "damaged chip" theory. I have also tried using other combinations of input/output pins to no avail. Note also that I have a bunch of rotary encoders connected to digital inputs and they work fine, even when connected on the pins on which I tried to read the 74hc165 output.

Any idea what could be wrong ?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

What does the datasheet for the 'HC165 say? I think you'll find the output for the 'hc165 adequate, but how is it all connected? How fast are you clocking it? Something seems to be fundamentally wrong if it is not working.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You don't have the pins somehow misconfigured (set as outputs)? Maybe a avr intergrated peripheral running? You could add a resistor in series just to check that it is the AVR that is causing the low levels.

oddbudman

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Another finding: when I measure the resistance between GND and the a pin configured as an input, I find a value around 25 ohm. It doesn't look normal...

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

So.. the pin isn't configured as an input correctly. check datasheet. What other internal peripherals can connect to that pin? are they disabled?

Or the pin is broken by now, though they are quite sturdy. Use a 1K series resistor between the output of the 74xx and the input pin, so two fighting devices won't destroy chips.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Fixed. I had another bit of code that overwrote the direction register.