Author Topic: PISO Shift Register (74HC165) output question  (Read 646 times)

0 Members and 1 Guest are viewing this topic.

Offline NiisseTopic starter

  • Newbie
  • Posts: 8
  • Country: nl
PISO Shift Register (74HC165) output question
« on: August 02, 2021, 11:31:03 am »
Hi all,

I'm attempting to hook up a 74HC165(n) to my Raspberry Pi 4. I believe I understand the operating principles; I've looked at the datasheet and at some (Arduino) tutorials.

Whenever I attempt to get data out of the shift register, the first 4 data lines return data as expected (0000 0001, 0000 0010, 0000 0100 and 0000 1000 respectively), but data lines 4-8 return the data as 1111 1111, 1010 1010, 0100 1001 and 0010 0010. I don't understand why this happens. I would expect 1000 0000, 0100 0000, 0010 0000 and 0001 0000. Looking at tutorials on YouTube, this is the output other people get.

I'm at a loss. Anyone have a clue? The reason I can't use these outputs is that I eventually intend to multiplex the buttons. I need all outputs + combinations to be unique.

Thanks in advance!
 

Online Ian.M

  • Super Contributor
  • ***
  • Posts: 12855
Re: PISO Shift Register (74HC165) output question
« Reply #1 on: August 02, 2021, 12:26:17 pm »
There are many many things that could be wrong with your circuit, and unfortunately my crystal ball is down for maintenance!

We need to know the *EXACT* connections between your 74HC165 and the Pi GPIO header, and around the 74HC165.  What circuit are you using to drive its inputs?  What decoupling have you provided?

Draw a schematic and also take a good sharp well-lit photo of it and its connections to the Pi, then attach them here.
 

Offline NiisseTopic starter

  • Newbie
  • Posts: 8
  • Country: nl
Re: PISO Shift Register (74HC165) output question
« Reply #2 on: August 02, 2021, 12:41:06 pm »
I've followed 74HC165 part - around the 24:00 mark. My wiring is identical to the schematic he's provided, and I've adapted the code to Python. I will post a picture when I get home.
 

Online Ian.M

  • Super Contributor
  • ***
  • Posts: 12855
Re: PISO Shift Register (74HC165) output question
« Reply #3 on: August 02, 2021, 02:46:25 pm »
So you are working roughly from this  'fritzing' style diagram from the above video:


Well its got a few problems if you use it for a Pi.
  • The Pi GPIO pins are all 3.3V logic so you must run it from the Pi's 3.3V pin not the 5V pin.  Getting this wrong can destroy your Pi!
  • The decoupling should be 0.1uF disc ceramic directly across the top of the chip from pins 16 to 8.  100uF electrolytic connected near the Pi wont be very effective and may cause instability problems with the Pi's 3.3V regulator

Also, the devil is in the details, which is why I asked for a photo of your setup.  I have my suspicions about the type of breadboard you are using and its rails . . .

Please delete the Arduino from the left of the diagram and annotate the connections that went to it with the Pi GPIO header physical pin numbers (see https://pinout.xyz/ ) so we can check them!

Take a look at https://www.woolseyworkshop.com/2021/07/02/adding-digital-io-to-your-circuitpython-compatible-board-part-2-the-74hc165/
He's got a far easier to read schematic, knows how to properly decouple CMOS logic,  is already using Python, and has a Pi compatible Python library for the 74HC165 . . .
« Last Edit: August 02, 2021, 02:50:50 pm by Ian.M »
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf