How To - Expand Digital Inputs with the 74HC165 + Test Code

Поділитися
Вставка
  • Опубліковано 29 лип 2024
  • The Sample Code:
    www.kevindarrah.com/wp-content...
    Datasheet for the 74HC165:
    www.nxp.com/documents/data_she...
    My tutorial on the 74HC595 to control a ton of outputs:
    • How Shift Registers Work!
    Check out my Tindie store (trigBoard is available) www.tindie.com/stores/kdcircu...
    Thanks to all the Patrons for dropping a few bucks in the tip jar to help make these videos happen!
    / kdarrah
    Twitter: / kdcircuits
    For inquiries or design services:
    www.kdcircuits.com
  • Наука та технологія

КОМЕНТАРІ • 58

  • @Mohrenberg
    @Mohrenberg Рік тому +1

    Dude, are you serious? Why couldn't I have found your 9 minute video in the first place! SUBSCRIBED. You're amazing. I now understand how these things work.

  • @slap_my_hand
    @slap_my_hand 8 років тому +10

    Shift registers are AWESOME!!! I just got started with my arduno and i instantly fell in love with them!

  • @SamnissArandeen
    @SamnissArandeen 6 років тому +2

    Interesting factoid: One 8-bit Parallel In Serial Out register is the only silicon inside an NES controller. Each button on the controller pulls an input low, and when the NES wants controller data (usually once per frame), it latches the register and then reads the data off it serially. You can literally emulate an NES gamepad on a breadboard.
    The Super Nintendo, which has four more buttons on its gamepad, simply used two registers daisy-chained together. In fact, plug aside, SNES pads are back compatible for that reason (if you don't mind B and Y being A and B)

  • @RobertBontrager
    @RobertBontrager 9 років тому +5

    Thank you! Looking forward to your next video on LATCHES.

  • @dougp6664
    @dougp6664 6 років тому +1

    Thanks! Exactly what I was looking for. Focused and understandable. Most everything else about SPI deals with outputs.

  • @zaqwsx28
    @zaqwsx28 9 років тому

    Good to know this is possible. I will check this later if I need more inputs.

  • @discjockykid
    @discjockykid 8 років тому +5

    You mention a future video with latches. Have you made it yet? I'm working on a project with these shift registers and I need to make sure they never miss the trigger. Your videos have been incredibly useful so far.

  • @missdash5992
    @missdash5992 4 роки тому +1

    I grow up in 1980 and apprciate the use of this old IC. I tried the same with the register when running out of I/O, but figured out the power consumption is much to high compared to a simple I2C I/O expander from the 21st century, like the PCF8575.

  • @PococraftOrg
    @PococraftOrg 8 років тому

    I'm looking forward to your follow up video!

  • @nealn11
    @nealn11 9 років тому +1

    Great video Kevin. It seems to me that there could be a sync issue right with this chip. What I mean is of there are any transients on start up or while in run the shift register could "shift a bit" (noise on pl) and the user circuit could lose knowledge of what the shift register is outputting right? Or is it that a clock tick is required before the next bit is "staged?" I guess if I was implementing this I would hold the chip in reset until the pins were all configured by the microcontroller or whatever else is driving this. So I know that everything is in sync.

  • @MegaJefflin
    @MegaJefflin 7 років тому

    THANKS A LOT FOR SOLVING I HAD BEEN CONFUSED AT THIS CHIP FOR SEVERAL MONTHS BEFORE U TEACH ME!!!!!!!!

  • @quaternion-pi
    @quaternion-pi 9 років тому

    Very helpful. Thanks for sharing your knowledge. Please keep the videos coming.

  • @zelra891
    @zelra891 9 років тому

    Thanks Kevin. Excellent tutorial as usual. So is it possible to build a 104 key keyboard with a tons of 74HC165 as input? and yes, I know multiplexing, but it seems much easier to write a code in this way.

  • @starcitizenmodding4436
    @starcitizenmodding4436 5 років тому +1

    Thanks for the videos. ive learned alot. I have a question. i want to build a custom joystick,, is this a good ic to use for 30 ish button inputs or should i be thinking about a multiplexing ic?

  • @brantwinter
    @brantwinter 6 років тому +1

    Was there ever a follow up video with the latching info ? I went searching but couldn't find it.

  • @claudedada6504
    @claudedada6504 4 роки тому

    Hi Kevin! Thanks a lot for your amazing explanations. One thing i would like to ask here is question: is it possible to use the 74HC165 with an interrupt pin on arduino nano?

  • @Rockdagger
    @Rockdagger 7 років тому

    how about doing this with a HV 57708 reading only a digital 1 or 0, if the digital signal is being delivered by a know circut that only sends by via a single wire to this chip

  • @TheRecocebo
    @TheRecocebo 6 років тому +1

    how are you able to make pure pulse with a button

  • @Blacklab412294
    @Blacklab412294 5 років тому

    RE: 5:39, You could always debounce with a Monostable 555 timer ?

  • @albertgeorgy2315
    @albertgeorgy2315 6 років тому

    I'm looking for a sample code for raspberry pi to show how i can collect inputs from more than one shift register

  • @TimeWasted8675309
    @TimeWasted8675309 9 років тому +3

    Thanks very much for this Kevin. Very weird, I had this exact problem (not enough inputs) for a project and I just received the 74HC165's a couple days ago and saw your video today. Your clock edges must be very sharp because you have AWESOME TIMING :) !!! (ha ha). Thank you again I have learned so much from your videos.

  • @courtneyjones8037
    @courtneyjones8037 9 років тому

    hi Kevin another great video i always follow you on youtube ,sorry for bothering you but i'm new to pic & i know your videos are based on arduino, but i need some help in understanding the timing diagram ,interrupt & clock of the pic,i can blink a led & i understand you explanation on shift registers & a bit about the RGB led cube,what i dont understand is all the technical calculations & configuration to do BAM on 8 leds as a start .Thank you again for all that you have done for this very slow learner .

  • @bochraakrout7840
    @bochraakrout7840 4 роки тому

    how can i interfac 8 74HC165 together ??

  • @SouthShoreSonics
    @SouthShoreSonics 3 роки тому

    How close in the functionality of the CD4014/21 compared to the 74HC165?

  • @courtneyjones8037
    @courtneyjones8037 9 років тому

    Hi Kevin ,i already have a couple pics & a pickit 2 ,i know there are forums on pics but you make it so easy to learn ,i'm from Trinidad & i have a friend who orders my parts for me online . i have 2-16f84a, 2 - 18f2550 & 1 - 16f887 ,i've been reading a lot on writing codes & on the pic itself but i think i'm not learning the stuff i need to learn in the correct order ,i love LEDS .I've built a 3x3x3 led cube but nothing as fancy as those cubes that use BAM . i'm hoping to learn all that i can & move on to SPI & LCD , Thank you so much ,always watching your videos even though i'm lost most of the times .

  • @dtesta
    @dtesta 5 років тому

    I see that you have all your input pins connected directly at VCC or GND without resistors. Is this safe for every day use or you just did it here for simplicity? Also, if you DO have to use a resistor, would I need to have one for every single input, even unused ones that I don't care about? Thanks!

  • @emus2707
    @emus2707 4 роки тому +1

    any one have the circuit diagram of the above mentioned circuit

  • @stefa168
    @stefa168 9 років тому +1

    Thank you for the video! Just today I went to my electronics shop and I bought 2 HC165 but I didn't know well how to use them..

  • @rezaeslami1798
    @rezaeslami1798 2 роки тому

    Excuse me.
    Mc 14014b .
    Does this IC do the same thing?
    Or not
    Please explain about that

  • @yashindane2844
    @yashindane2844 Місяць тому

    very great

  • @yoshidis4
    @yoshidis4 9 років тому

    Hi Kevin, i like your videos a lot
    i recently had a dht22 to my arduino, and i noticed that the humidity is off compared to an analog humid meter
    so i am searching for a new one. i found the HIH6131 from sparkfun, but i hesitate to get it because it seems so hard to connect and make it work :/
    can u make a video if you have the time? thanks a lot!

    • @Kevindarrah
      @Kevindarrah  9 років тому

      I would - but don't have that sensor on hand. If I ever pick one up, I'll make a video

    • @starwriter34
      @starwriter34 9 років тому

      It is rather simple to hook up, 5V. GND. SCL - in A5, and SDA - A4. You can read the data easily through I2C.

  • @ProXicT
    @ProXicT 9 років тому +1

    Could you make a video on 4×4 keypad with 74HC165? It would be great!

  • @GectorWhitlox
    @GectorWhitlox 8 років тому +1

    Kinda new to electronics... I want to run this without my arduino to prototype my circuit, using normal momentary switches. I've heard of something called switch bounce or something like that which you mentioned in your video, how do I fix it? If you just put a capacitor after the switch, what size capacitor?

    • @GectorWhitlox
      @GectorWhitlox 8 років тому

      It's actually working a little with out any sort of switch protection. Still, the clock switch is randomly moving the output to the LED.

    • @Loundre3
      @Loundre3 8 років тому

      Try using an monostable multivibrator for the timing, since it can produce an very clean, manual controllable clock pulse.

  • @ProXicT
    @ProXicT 9 років тому

    I have no idea what is going on, but I've got the same connections as you do and it does not work for me at all. When I pull the PL low, it loads the first (actually last [7]) register and the other ones are totally inconsistent when I try to poll the data by pulling CP high. And I am using 7805 to stabilize the voltage at nice 5V.

    • @ProXicT
      @ProXicT 9 років тому

      ***** Well, I found out, the shift register was dead. Pretty embarrassing.

    • @startobytes
      @startobytes 3 роки тому

      @@ProXicT This happens to everyone at least once

  • @rainy724
    @rainy724 9 років тому

    At 1:29 there is an annotation stating "[it's] a good idea to throw in a 0.1uF capacitor across VCC and ground to *close the VCC pin*"; What does this mean?

    • @Kevindarrah
      @Kevindarrah  9 років тому +2

      That gives the part a nice clean voltage to work with

    • @rainy724
      @rainy724 9 років тому

      Thanks!

  • @geertvancompernolle2586
    @geertvancompernolle2586 4 роки тому

    What's the advantage of the 165 over using a 595 for this purpose? 595 was also to read a ton of inputs, wasn't it?

    • @yamitokyoo
      @yamitokyoo 4 місяці тому

      74HC595 is for outputs. 74HC165 is for inputs.

  • @sanatanpaul2895
    @sanatanpaul2895 5 років тому +3

    Life will give u exactly what you need, not what you want.....🤓🤓🤓

  • @everettcook9969
    @everettcook9969 3 роки тому

    wtf. cool video. i learned some stuff... but... I really don't get how you wired these. i don't even see how you have it powered n grounded. it doesn't look like your white-board diagram at all.

  • @ThuanDuong-pv3xu
    @ThuanDuong-pv3xu 8 років тому

    Why serial ouput first by H bit (1) ?

    • @hetijegy
      @hetijegy 7 років тому

      It actually does make sense to start your binary code with the most significant bit. In case of concatenation of values the order of values will be just right.
      In case it is more comfortable to start with bit 0, you can just swap Q7-0 to Q0-7.

    • @ThuanDuong-pv3xu
      @ThuanDuong-pv3xu 7 років тому

      Thank for your explanation! I understand that your mean is the MSB=1(first bit=H) to make sense catching ID code because when serial shift from q0 to q7 , paralell shift from q7-q0. Am i true, or not?

    • @hetijegy
      @hetijegy 7 років тому +1

      I do not think you got the point what I meant to tell.
      Imagine that you have a binary number: 00001111 and you want to send it to your Arduino via 74HC165. In order to transmit the number properly to start with the 0s and end with the 1s it supposes that you set the lower (A-D) 4 bits to high and the upper 4 bits (E-H) to low. Then you will have the desired result.
      In practice, you will have the following values:
      0-0-0-0-1-1-1-1
      H-G-F-E-D-C-B-A
      The program will get value H first, then (depending on your code) it gets G, F, ... then A.
      But if you want you can reverse the values and put 1s to H-E and 0s to D-A. But then the number received will be 11110000 and you will have to reverse it back in your code.
      Hope it helped.

    • @ThuanDuong-pv3xu
      @ThuanDuong-pv3xu 7 років тому

      I used transfer 1of 8 bit from 74HC164 to 74HC165 or 74HC595, so I understand your mean . If we have 1 byte 00001111(H-G-F-E-C-D-B-A) to transfer to a terminal device and if bit A is not 1 the terminal device will understand that the first bit is bit B and the byte will being: 0-0-0-0-0-1-1-1. It is true, isn't it? finally i want to say 'thank you so much!

    • @hetijegy
      @hetijegy 7 років тому

      I think it will be
      H-G-F-E-C-D-B-A
      0-0-0-0-0-1-1-1-x
      I honestly haven't tried this IC before, so I don't know how an empty pin would react. Maybe it is set to zero, but I think it just won't be transmitted at all.
      You're welcome.

  • @andrey7530
    @andrey7530 4 роки тому

    ths from russia