I just want to say that I began my electrical career as a electrical technician by starting out with tinkering with microcontrollers, namely Arduinos. I learned the basics from Drone Bot Workshop and carried the knowledge I learned from it to other fields and through these events impressed my current employer to land a job straight out of community college. Thank you so much for all you do. I will be donating to show my gratitude and appreciation :) I encourage anyone else who understands how valuable and rare it is to find material like the one DBW provides.
this gentleman is so generous in giving knowledge, I wish him the best in all (health, long life, fortune, good wife, and more important to stay progressed) >>>> big hug to you from Iraq 🌹
@@muesli4597 I was expressing best wishes for him basing on my country best wishes to good people. In Iraq, one of good wishes to a friend is to wish him have a good wife to support and live with her happily 😉
You, Sir, have opened the doors to my better understanding of Arduino and bitwise logic, and I thank you sincerely. I'm 62-years-old and discovered the Arduino playground in early January of 2020, and I'm hooked (it's my new hobby). After using the 74HC595 in an early LED display project, I began to study the nuts-and-bolts of the unit, and I find this all fascinating. For those interested in the logic-level workings of the 74HC595 (or any other chips, for that matter), here are a few references that I've discovered along the way that can be used by both beginners and advanced coders alike. For those who aren't familiar with bitwise operations and boolean algebra, don't let the big words fool you; it's as simple as yes or no, on or off, zero or one...just forget about the world of 0s and 9s, and shift into the world of 0x0 through 0xf (hex numbers), and 0b0 through 0b1 (binary numbers (all two of them)). Once I started coding with hex and binary numbers back in 1990, I never looked back. Mentally converting hex numbers into binary numbers and vice versa is simple, once you learn the trick. I've C & Ped a copy of comments I wrote for a 74HC595 bit-shifting LED project I wrote. I'll share the code on the DroneBot Workshop as soon as I can. When I code, I comment a lot; I comment on the comments if need be. // Forward: The 74HC595 is a SIPO (Serial In, Parallel Out) shift register used to store eight bits of serial data, // and to produce eight bits of parallel outputs. There are two data registers inside the 74HC595: // // 1) the SHIFT register, used to store the serial data inputs ([shift: 1] shifted-in by the shift clock, via the data pin) // 2) the STORAGE register, which stores the parallel output data shifted-in from the SHIFT register ([shift: 2] by the latch clock, internal). // // In review: the "shift clock" shifts data into the SHIFT register, and after eight bits are shifted into the // SHIFT register, the "latch clock" shifts the data stored FROM the SHIFT register INTO the STORAGE register, // which produces the eight bits of outputs. (lol I'm not screaming; just making a point.) // // The 74HC595 is mainly utilized to reduce the amount of output pins needed to use from the microcontroller board // (the Arduino UNO board, in this case). Using three pins from the microcontroller board, the 74HC595 provides // eight output pins in a state of either on or off at 5vDC or 0vDC (and no, you can't PWM through the 74HC595). // // The 74HC595 contains 8-sets of master/slave flip-flop logic circuits running on an operating voltage range of 2vDC // to 6vDC (the logic runs at the data-input voltage level), 80μA (maximum draw), and is the coolest little gadget to // entertain one's self with. The more I learn, the more I realize how simple this device really is. When I begin // programming FPGAs (soon), one of my first goals is to create an operational bit shifter. I'm lovin' it! // // There are three states that the parallel output can be set to: ON, OFF, and high impedance. High impedance // blocks any data shifts (and is toggled by the OE (with a bar above the OE) pin). If you want inputs/outputs // turned off? Simply set the OE pin HIGH, otherwise, it defaults to LOW. The shift register can also be directly // overridden and cleared by setting the SRCLR (with a bar above the SRCLR) pin LOW, otherwise, it defaults to HIGH. // // The best reference I've found for the 74HC595 is: lastminuteengineers.com/74hc595-shift-register-arduino-tutorial/ // They do a great job of explaining the internal operations of the 74HC595 shift register in simple terms.
And yes, the previous post was premature. I meant to say more with additional links, but the main jist of the idea came through. It's probably not appropriate, but here's the entire .ino file. It doesn't read as well here, but C & P it into the Arduino IDE; play around, have some fun. //øøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøø// //øøøøø[ Begin: Global variables ]]øøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøø// #include // a library of functions for using flash memory and stuff. #define OP_SPEED 0x64 // used to set the speed at which the 74HC595 is updated #define ARRAYSIZE 0xf0 // used to define the size of the dataArray[] and to end loop iterations const int dataPin = SDA; // Arduino UNO digital SDA pin connected to the DS pin of the 74HC595 shift register (Serial data input) const int clockPin = SCL; // Arduino UNO digital SCL pin connected to the SH_CP of the 74HC595 shift register (SHIFT clock pin) const int latchPin = SCK; // Arduino UNO digital SCK pin (a.k.a. pin 13) connected to the ST_CP of the 74HC595 shift register (STORAGE register clock pin (latch pin)) const byte dataArray[ ARRAYSIZE ] PROGMEM = { // the data array: binary data stored in flash memory used as switches to turn LEDs on and off. B10000000, B01000000, B00100000, B00010000, B00001000, B00000100, B00000010, B00000001, B00000001, B00000010, B00000100, B00001000, B00010000, B00100000, B01000000, B10000000, B10000000, B01000000, B00100000, B00010000, B00001000, B00000100, B00000010, B00000001, B00000001, B00000010, B00000100, B00001000, B00010000, B00100000, B01000000, B10000000, B10000000, B11000000, B11100000, B11110000, B11111000, B11111100, B11111110, B11111111, B11111111, B11111110, B11111100, B11111000, B11110000, B11100000, B11000000, B10000000, B10000000, B11000000, B11100000, B11110000, B11111000, B11111100, B11111110, B11111111, B11111111, B11111110, B11111100, B11111000, B11110000, B11100000, B11000000, B10000000, B00000001, B00000011, B00000111, B00001111, B00011111, B00111111, B01111111, B11111111, B11111111, B01111111, B00111111, B00011111, B00001111, B00000111, B00000011, B00000001, B00000001, B00000011, B00000111, B00001111, B00011111, B00111111, B01111111, B11111111, B11111111, B01111111, B00111111, B00011111, B00001111, B00000111, B00000011, B00000001, B00000001, B00000011, B00000111, B00001111, B00011111, B00111111, B01111111, B11111111, B11111111, B01111111, B00111111, B00011111, B00001111, B00000111, B00000011, B00000001, B11111111, B11111111, B11111111, B11111111, B00000000, B00000000, B00000000, B00000000, B11111111, B11111111, B11111111, B11111111, B00000000, B00000000, B00000000, B00000000, B11111111, B11111111, B11111111, B11111111, B00000000, B00000000, B00000000, B00000000, B11111111, B11111111, B11111111, B11111111, B00000000, B00000000, B00000000, B00000000, B11000011, B11000011, B11000011, B11000011, B00111100, B00111100, B00111100, B00111100, B11000011, B11000011, B11000011, B11000011, B00111100, B00111100, B00111100, B00111100, B11000011, B11000011, B11000011, B11000011, B00111100, B00111100, B00111100, B00111100, B11000011, B11000011, B11000011, B11000011, B00111100, B00111100, B00111100, B00111100, B11001100, B11001100, B00110011, B00110011, B11001100, B11001100, B00110011, B00110011, B11001100, B11001100, B00110011, B00110011, B11001100, B11001100, B00110011, B00110011, B11001100, B11001100, B00110011, B00110011, B11001100, B11001100, B00110011, B00110011, B11001100, B11001100, B00110011, B00110011, B11001100, B11001100, B00110011, B00110011, B01010101, B10101010, B01010101, B10101010, B01010101, B10101010, B01010101, B10101010, B01010101, B10101010, B01010101, B10101010, B01010101, B10101010, B01010101, B10101010, B01010101, B10101010, B01010101, B10101010, B01010101, B10101010, B01010101, B10101010, B01010101, B10101010, B01010101, B10101010, B01010101, B10101010, B01010101, B10101010, }; //øøøøø[ End: Global variables ]øøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøø// //øøøøø[ Begin: setup() function ]øøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøø// void setup() { pinMode( clockPin, OUTPUT ); // init the clockPin to output pinMode( latchPin, OUTPUT ); // init the latchPin to output pinMode( dataPin, OUTPUT ); // init the dataPin to output } //øøøøø[ End: setup() function ]øøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøø// //øøøøø[ Begin: loop() function ]øøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøø// void loop() { byte *buf_p; // a pointer to the dataArray[] memory address at the time we're reading the data // begin outer for() loop - this loop pushes the data from the 74HC595's SHIFT register into its STORAGE register for ( int thisByte = 0x00; // declare an index for the data array starting at zero thisByte
Hey Bill! I needed a good tutorial for my daughter (she's learning digital electronics) and this was my go-to for shift registers. Great video and thank you for presenting this subject in such a way that it is easy to understand for complete beginners!
Thank you for the time you give people like myself who are looking to improve their skills with Arduino projects. Your an amazing teacher and I wish you the best in all aspects of life. I love how you explain everything in a normal calm voice unlike others who speak so fast or don't explain in the detail you do. Thanks again
You are amazing! For me, you are the Andrew Huberman of electronics. There is nobody out there that conveys the information needed to create your own schematics more concisely than you.
Probably because he's too specific and slow in his way of explaining his projects, this requires a mind-set that accept this type of videos. People these days are stressed and can't put themselves to listen to him for 30-40min about how you get some LED to blink, they just want the fancy product, not the "boring" side of it. I get calm when listen too teachers and or people like this man or Ben Eater (probably butchered him surname...)
A video that illustrates in a great way some articles on the Net I had to read when I had to deal with shift registers for my project. I wish you had published this before : clear, informative and now, 74H* are not magic to me anymore! Great examples too!!
Synchronicity: A day before this video came out, I was trying to figure out how I could use, say, n outputs from an Arduino to drive, say, 2^n LEDs. I'm very new to electronics and microcontrollers, but I've been doing software development professionally for several years. I love this circuit because it does exactly what I was trying to solve, the circuits in the IC aren't hard to understand, and it's great I can just buy an IC instead of wiring all that stuff together. In software development we have libraries of pre-defined stuff, just as ICs are packages of functionality. So ICs follow the same principle we do: package and make freely available bunches of commonly used functionality.
Shift registers are often unknown by hobbyists and forgotten by others. I have seen them in a lot of designs since the 70's. Computers, wending machines and as receiver/decoders in military radar equipment. You find them very cheap on Ebay. Try to get hold of the good old Texas TTL Handbook.There are many fun and interesting chips in the 74 series.Even an ALU.
Fabulous video and detailed explanation. Not only explaining what shift registers are and their benefits, but also a practical example of how they can be used in the real world (or workshop). Thank you very much.
Thank you Bill! Just what I was looking for. I was lurking around on your forum site and found this in a topic discussion. Your forum website is great! Keep up with the good work.
16:57, I think it's important to keep total current in mind since if you were to wire up two 7 segment displays using 150ohm resistors (mentioned as a possible value earlier), then you would exceed the 200ma limit of the arduino (e.g. 20ma/LED x 16 segments is 320ma).
@@333cgs333 Connect them in parallel, each with their own current limiting resistor. Calculate the current through each LED and total it for all LEDs. Use an external power supply which can provide the correct amound of current (always best to provide more current than required so you won't damage/overheat the supply). Be sure to have a common ground between the arduino and you external supply. You can also search youtube for videos on powering LEDs.
Excellent! I needed to read the states of several pir and magnetic switch sensors while also controlling lights. Shift registers fit this problem like a glove.
This is one of the best explanation and tutorials on logic gates I have come across. The examples you’ve created showcase their use very well. Great work and worth the wait! Thank-you! Now I’m off to order some logic chips to play with.
Hi, I watched this video and said to myself, that's a cool sketch, so I set up the hardware same as yours for the shift register. Then I modified it so that the LEDs would shift from outside to inside and back then repeat. Now, as I was moving the breadboard around while the LEDs were flashing back and forth, the positive 5Vdc from the Arduino connection came out of its pin on the Arduino Uno; and the LEDs still flash as if power is applied to the chip. I have a 150ms delay between LED shifts as follows in the below code segment (this repeats for different binary numbers for the flashing effect): int latchPin=11; int clockPin=9; int dataPin=12; int dt=150;
byte LED1s=0b10000001; byte LED2s=0b01000010; byte LED3s=0b00100100; byte LED4s=0b00011000; byte LED5s=0b00100100; byte LED6s=0b01000010; byte LED7s=0b10000001; byte LED8s=0b00000000; . . . void loop() { // put your main code here, to run repeatedly: digitalWrite(latchPin,LOW); shiftOut(dataPin,clockPin,LSBFIRST,LED1s); digitalWrite(latchPin,HIGH);
delay(dt); digitalWrite(latchPin,LOW); shiftOut(dataPin,clockPin,LSBFIRST,LED2s); digitalWrite(latchPin,HIGH); . . . From my multimeter, pin 11, the latch pin, varies a bit but averages to about 4.93Vdc and seems to be supplying all the power the chip and LEDs require to keep running. I would love to send you a picture or short video so you could see this and maybe repeat it. Scott in Harwood, MD
Hi everybody, Some people ( Joseph Chamness in particular) asked for an '595' that is able to handle higher voltage/current. It exists: Texas Instruments 'TPIC6595' Same pinout as regular LS or HC 595, but open drain output with: - RDS(on) 7 Ohms - Imax 100 mA continuous / 250 mA max - VClamp 33V I have used it widely for anything such as relays (normal or solid-state with HV control) and it works like a charm... Enjoy !
i think it's more situable and common to use a darlington array (such as the uln2003) which are simply a cascade of a low input transistors and more powerful transistors controled by the first one. Those are 7 darlington transistors for each Ic and are pretty cheap i think, hope someone find this useful
Really good video, you take the time to explain, and you speak at just the right pace for me to process what is going on. Great to see practical use rather than all just flop flop theory!
Great videos. Very well structured. Also, being genuine here, serious respect to a guy whose slight speech impediment means he pronounces 'sh' as a kind of 'slzch' having the word workSHop in his title and doing a video on SHift registers. :)
Where do the values of the drop in resistor and filter capacitor come from at 9:49? I assume that Ohm’s Law has something to do with it but what would that math look like?
Very useful tutorial, thank you for the work you put in on this. I did get confused when the clock enable pin was used as the clock and the clock pin was used as the enable. I got the data sheet and sure enough it said those pins are interchangeable. I like the way you taught how the byte was complemented to get it back to what it really represented.
Another great video as usual. I haven't seen or heard anything about DB1 in a very long time. I never expected you to do one a week plus one a week of the component level videos as you had once proposed. That's just to much work! I was however hoping you were going to do a DB1 video every other time. I was not planning on building one right now, but was so intrigued by your concept I needed more. I take it that you were not getting enough interest from other viewers to keep it going? That's really ashame. That looked like it was going to be something really special. I would love to see you bring it back to life.
Another amazing video. Thank you kindly for putting this together, it will simplify a very important and useful process in digital electronics for the amateur/enthusiast.
I'm a complete novice when it comes to basic electronics. I was searching for PISO without knowing it. Thinking it must be named differently because I associated shift registers solely with SIPO functionality. Thanks so much for enlightening me!
Love all your videos and really appreciate your detailed explanations. Just one thing, I would like to request is that you should zoom in the Arduino Code screen so that the words are readable even on smaller devices.
Great tutorial. I used these for controlling a board of 8 active low opto-isolated relays, in conjunction with a library I made specifically for this setup. Basically, shift registers act like gateways.
Your videos are really very informative. It would be interesting in adding a part "B" to this video and connect all 8 data pins to the 1602 LCD. This way a hardware contrast can be made from from a software perspective and a hardware perspective between 4 bit mode and 8 bit mode on the LCD?
Great video! After some initial problems due to my own stupidity (forgot that the same rows on the breadboard are connected ^^..) I got my example to work. Finally I understood how to work with SIPO shift registers and I can't wait to use multiple ones in order to drive more LEDs.
Geee... a great coffee shop video... Aaah, with some Irish-coffee i can watch most anything...:] and this shift is register wonderful stuff... makes me think of the heath-kit days. thaanks a lot...:)
Just ran into an unusual issue with a batch of Nexperia 74HC595 units which the Fairchild version does not exhibit. Turns out that pin 11 (shift reg. clk)suffers 'ringing' that's tough to quantify as any Oscope probe capacitance is enough to stop it. A wet finger capacitance on the pin makes it work fine. My solution ended up being a 470Ω inline with pin 11 to defeat the ringing resonance. I was running it with a 5V PIC 16F886 MCU. Threw away a few 'bad' Nexperia chips b4 I figured out the issue so I could use them.
А можно ли как-то обойтись без delayMicroseconds? В серьезных проектах это парализует многозадачность, от него просто необходимо избавляться, какой бы он длительностью не был этот delay...
Great walkthru, I was wondering how many volts should the 100mf electronic capacitor be, and how necessary is it to have? also running into an issue where 'all' the leds are blinking at once.. not sure what I may have done wrong.
The 75HC165 is what I was looking for in another program to build Ben Eater 8 bit or 16 bit Computer. This would make it easy to make a serial input to program or use of a 3.5 inch floppy drive. COOL thanks.. Also it solves the problem of programing EEPROMS... by using both of these chips and not run out of pins.
Interestingly these DIL-16 types of resistor arrays are relatively expensive and hard to find on cheap sites like aliexpress that prefer the DIP packages. When I say expensive, 2 will cost the same as 50 logic chips.
THANKS!! Very well presented, nice Christmas Lights display; Now how can I customize this to program a set output pattern for a given input Byte? I am trying to get air pistons to "fire" in set order given the desired pattern of piston position sensors (reed switches). So the random pattern of the output with no RESET of INTERRUPT capability is not particularly useful for practical applications: Could you make a Tutorial that caters to programing several air/hydraulic pistons to perform active tasks in a customizable sequence, please? THERE ARE NO USABLE TUTORIALS OUT THERE FOR THAT!!! A lot of the existing tutorials are just about controlling one piston - I cannot find any that would fit my needs... Thanks again for the clear, detailed Tutorials you have already out there - I will definitely incorporate a few of these in my final project. :-) Great stuff!!!
Thank you for sharing your knowledge. This is very helpful to me. I'm making a 28 standard LED police light bar for my RC using a Teensy. It seems using SIPO shift register is the way to go.
Very good presentation. Simple, but not oversimplified. The only thing is, 74HC is NOT TTL. The voltages are different, and the technology is CMOS, not Bipolar transistors like in TTL. Strictly 74HC is not even compatible with TTL when operated at 5V. 74HCT is the same technology, same speed and same low power consumption but intended for co-existence with real TTL. Actually HCMOS is more similar to the CMOS 4000 series. But 74HC was designed so the type numbering is compatible with the antique 7400 series.
I'm an amateur learning electronics, and when seeing schematics like 16:51 this one I always wonder : is not more simply put only one or two resistors at the pin 10 and 16 ? Why the reason to put a single resistor on each output? Is it because of the voltage of the chip? good practice? Or have a good reason I'm missing? Thanks in advance :D
If you don't limit the outputs on a chip, although they have limited current output, if you don't use any dropping resistors, you won't limit the current of the chip, and it will burn or even worse, damage your ic because of forcing it to provide more current than what is capable of You don't put resistors at the the vcc or gnd pins because that will limit the maxium corrent that will enter on the circuit For example, you put a resistor and now your circuit has a maxium of 200mA, if you have more than 4 outputs that provide 50mA each, as the voltaje won't go up, the current will drop to compensate. At least that's what i understand, i may be wrong, if i am please correct me
master task.. correct sleep to the ms which would really add up to 1000ms ;) I guess there would be a couple of cycles iterate through-out the loop which naturally already adds up
I think the reason you are having to use the compliment serial out is because you are not setting clock back to low after you set clock enable low. You are missing shiftIn's first low to high clock transition.
A good intro for the noobs, but I was slightly disappointed you didn't show how you can combine the shift in and the shift out onto the same clock and data pins: just put a resistor from the serial out of the74HC165 to the serial data pin so that when the pin is in input mode it sees the input data but takes control when it is in output mode. ... also, you can dispense with all the extra parallel latch wires too, by using capacitor-resistor-diode from the clock wire. The R-C on the 165 pulls the PL pin low, but a diode to clock holds it high while the clock is pulsing. The R-C on the 595 holds the RCLK high, but a diode to clock pulls it low while the clock is pulsing. The shift in-out process then looks like this: a long enough low on clock latches the parallel input data; shift in the serial to data; switch the data pinmode immediately (waiting too long with clock in low or high will send unwanted signals to PL or RCLK, though staying low at this point would probably be fine) to output and shift out the wanted serial data (it will have shifted in the data from the 165 during previous step); leave the clock high at the end and after a few microseconds RCLK will get high enough for the data to appear on the outputs. Appropriate values for R and C would give an RC time constant of about 5 of your serial clock pulses.
I've been playing with this the last week, and have realised that, for output only, only one controller pin is required if a little delay (50ns or so) is put between the clock signal and the serial input of the 595, with an RC of 1k2Ω/47pF or so. Putting schmidt-trigger buffers or inverters on the input to the board with the shift registers also helps, since with many capacitive things (like CMOS inputs and delay capacitors) running of the clock line it can get a bit messy if all that current has to come down a wire. Then the input side can have a dedicated line, so both lines are now one-way (meaning that optocouplers or current signalling can be used between the boards) and driven from a low impedance source (using a resistor to send data back down the same line when the controller switches the pin to input mode works with 1k5Ω but the signal is messy and takes long time to rise and fall). The One-Wire signal can't be run from a hardware SPI, but can be run from a PWM on chips with DMA like STM32, or with a bit of assembler bitbashing the complete 16bit send & simultaneous receive in 5µs is quite possible - possibly less time than it takes to set up the hardware and definitely smaller code and greater flexibility. Basically, hold the clock low for 100ns to get the data line low as well, and then the rising edge will clock in a 0 to the shift register. hold the clock line high for 100ns till the data line is high too and then blip the clock low for just long enough that the 595 chip registers it (25ns) and then back high before the data line has fallen too far, to clock a 1 into the shift register. Repeat for all bits, leave the clock high at the end and a couple of microseconds later the RCLK will get high too and the new data appears on the outputs. Again, schmidt-trigger buffers help, also after the delay capacitor to the data line, making the ratio between the long high data part of the signal and the short low required before the clocks rising edge less critical, and enabling transmission speed as fast as the processor can handle (72Mhz ARM). With an AVR processor it wouldn't be needed since all timings would be longer, just needing longer RC delays.
Hard to understand when you describe as connect pin 2 to pin 11. Why? What does it mean? If you don't tell why just it would be easy to add some text close to register for understanding connection.
I am curious about the 8 resistor DIP items as well? ... Great Video!! Learned a lot and ordered some 74HC165 and 74HC595 and would also like to order some of the 8 resistor DIP.
Thank you for your video, very educational. How do you put debounce on the switches? I tried to use this but my 7-segment display output is showing random numbers or display. I guess it's the debounce on the switches that cause this problem. Thank you.
Could you please make a workshop about arduino microphones and voice recognition with an arduino. I think that would be a very interesting topic. Thank you for all the interesting workshops, i'm lovin your videos
Excellent class! Any link to this Resistor Array (global)? I just didn't understand the order of the pins from the 7th segment display to the shift register, 74HC595, for example, because it seems that there is a 7th segment display that doesn't follow an order. Thanks for the video.
Do you have a longer intro video with a longer song? I tend to spontaneously bust out into a robotic dance every time your videos start due to the catchy retro 8-bit style tune and it is contagious.
How fast will the 74hc165 read inputs? I was looking to maybe try to use multiple hc sr04's to read the echo's on interrupt pins, but looking at your led's in the video looked a bit slow probably due to the delay at the end
Don't know whether you check comments from this long ago but - why did you use an Arduino output for the '165 clock enable? It's just ORed internally with the clock pin, so in this case could just be connected to GND (as per the datasheet examples). TIA, John.
I just want to say that I began my electrical career as a electrical technician by starting out with tinkering with microcontrollers, namely Arduinos. I learned the basics from Drone Bot Workshop and carried the knowledge I learned from it to other fields and through these events impressed my current employer to land a job straight out of community college. Thank you so much for all you do. I will be donating to show my gratitude and appreciation :) I encourage anyone else who understands how valuable and rare it is to find material like the one DBW provides.
this gentleman is so generous in giving knowledge, I wish him the best in all (health, long life, fortune, good wife, and more important to stay progressed) >>>> big hug to you from Iraq 🌹
yup, agree with you :D
Can you be more specific regarding the "good" wife please?
@@muesli4597
I was expressing best wishes for him basing on my country best wishes to good people.
In Iraq, one of good wishes to a friend is to wish him have a good wife to support and live with her happily 😉
Did you consider peoples sexual preferences before jumping to a conclusion?
@@muesli4597 Dude can you stop talking please
Bill *ALWAYS* has a way of presenting video's in a very logical way. And he presents a wide range of projects!
I have found the Bob Ross of Electronics. Subscribed.
Thank you! I've seen multiple videos saying "this is what a shift register does" but never showed how to actually use it
You, Sir, have opened the doors to my better understanding of Arduino and bitwise logic, and I thank you sincerely. I'm 62-years-old and discovered the Arduino playground in early January of 2020, and I'm hooked (it's my new hobby). After using the 74HC595 in an early LED display project, I began to study the nuts-and-bolts of the unit, and I find this all fascinating. For those interested in the logic-level workings of the 74HC595 (or any other chips, for that matter), here are a few references that I've discovered along the way that can be used by both beginners and advanced coders alike.
For those who aren't familiar with bitwise operations and boolean algebra, don't let the big words fool you; it's as simple as yes or no, on or off, zero or one...just forget about the world of 0s and 9s, and shift into the world of 0x0 through 0xf (hex numbers), and 0b0 through 0b1 (binary numbers (all two of them)). Once I started coding with hex and binary numbers back in 1990, I never looked back. Mentally converting hex numbers into binary numbers and vice versa is simple, once you learn the trick.
I've C & Ped a copy of comments I wrote for a 74HC595 bit-shifting LED project I wrote. I'll share the code on the DroneBot Workshop as soon as I can. When I code, I comment a lot; I comment on the comments if need be.
// Forward: The 74HC595 is a SIPO (Serial In, Parallel Out) shift register used to store eight bits of serial data,
// and to produce eight bits of parallel outputs. There are two data registers inside the 74HC595:
//
// 1) the SHIFT register, used to store the serial data inputs ([shift: 1] shifted-in by the shift clock, via the data pin)
// 2) the STORAGE register, which stores the parallel output data shifted-in from the SHIFT register ([shift: 2] by the latch clock, internal).
//
// In review: the "shift clock" shifts data into the SHIFT register, and after eight bits are shifted into the
// SHIFT register, the "latch clock" shifts the data stored FROM the SHIFT register INTO the STORAGE register,
// which produces the eight bits of outputs. (lol I'm not screaming; just making a point.)
//
// The 74HC595 is mainly utilized to reduce the amount of output pins needed to use from the microcontroller board
// (the Arduino UNO board, in this case). Using three pins from the microcontroller board, the 74HC595 provides
// eight output pins in a state of either on or off at 5vDC or 0vDC (and no, you can't PWM through the 74HC595).
//
// The 74HC595 contains 8-sets of master/slave flip-flop logic circuits running on an operating voltage range of 2vDC
// to 6vDC (the logic runs at the data-input voltage level), 80μA (maximum draw), and is the coolest little gadget to
// entertain one's self with. The more I learn, the more I realize how simple this device really is. When I begin
// programming FPGAs (soon), one of my first goals is to create an operational bit shifter. I'm lovin' it!
//
// There are three states that the parallel output can be set to: ON, OFF, and high impedance. High impedance
// blocks any data shifts (and is toggled by the OE (with a bar above the OE) pin). If you want inputs/outputs
// turned off? Simply set the OE pin HIGH, otherwise, it defaults to LOW. The shift register can also be directly
// overridden and cleared by setting the SRCLR (with a bar above the SRCLR) pin LOW, otherwise, it defaults to HIGH.
//
// The best reference I've found for the 74HC595 is: lastminuteengineers.com/74hc595-shift-register-arduino-tutorial/
// They do a great job of explaining the internal operations of the 74HC595 shift register in simple terms.
And yes, the previous post was premature. I meant to say more with additional links, but the main jist of the idea came through.
It's probably not appropriate, but here's the entire .ino file. It doesn't read as well here, but C & P it into the Arduino IDE; play around, have some fun.
//øøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøø//
//øøøøø[ Begin: Global variables ]]øøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøø//
#include // a library of functions for using flash memory and stuff.
#define OP_SPEED 0x64 // used to set the speed at which the 74HC595 is updated
#define ARRAYSIZE 0xf0 // used to define the size of the dataArray[] and to end loop iterations
const int dataPin = SDA; // Arduino UNO digital SDA pin connected to the DS pin of the 74HC595 shift register (Serial data input)
const int clockPin = SCL; // Arduino UNO digital SCL pin connected to the SH_CP of the 74HC595 shift register (SHIFT clock pin)
const int latchPin = SCK; // Arduino UNO digital SCK pin (a.k.a. pin 13) connected to the ST_CP of the 74HC595 shift register (STORAGE register clock pin (latch pin))
const byte dataArray[ ARRAYSIZE ] PROGMEM = { // the data array: binary data stored in flash memory used as switches to turn LEDs on and off.
B10000000, B01000000, B00100000, B00010000, B00001000, B00000100, B00000010, B00000001, B00000001, B00000010, B00000100, B00001000, B00010000, B00100000, B01000000, B10000000,
B10000000, B01000000, B00100000, B00010000, B00001000, B00000100, B00000010, B00000001, B00000001, B00000010, B00000100, B00001000, B00010000, B00100000, B01000000, B10000000,
B10000000, B11000000, B11100000, B11110000, B11111000, B11111100, B11111110, B11111111, B11111111, B11111110, B11111100, B11111000, B11110000, B11100000, B11000000, B10000000,
B10000000, B11000000, B11100000, B11110000, B11111000, B11111100, B11111110, B11111111, B11111111, B11111110, B11111100, B11111000, B11110000, B11100000, B11000000, B10000000,
B00000001, B00000011, B00000111, B00001111, B00011111, B00111111, B01111111, B11111111, B11111111, B01111111, B00111111, B00011111, B00001111, B00000111, B00000011, B00000001,
B00000001, B00000011, B00000111, B00001111, B00011111, B00111111, B01111111, B11111111, B11111111, B01111111, B00111111, B00011111, B00001111, B00000111, B00000011, B00000001,
B00000001, B00000011, B00000111, B00001111, B00011111, B00111111, B01111111, B11111111, B11111111, B01111111, B00111111, B00011111, B00001111, B00000111, B00000011, B00000001,
B11111111, B11111111, B11111111, B11111111, B00000000, B00000000, B00000000, B00000000, B11111111, B11111111, B11111111, B11111111, B00000000, B00000000, B00000000, B00000000,
B11111111, B11111111, B11111111, B11111111, B00000000, B00000000, B00000000, B00000000, B11111111, B11111111, B11111111, B11111111, B00000000, B00000000, B00000000, B00000000,
B11000011, B11000011, B11000011, B11000011, B00111100, B00111100, B00111100, B00111100, B11000011, B11000011, B11000011, B11000011, B00111100, B00111100, B00111100, B00111100,
B11000011, B11000011, B11000011, B11000011, B00111100, B00111100, B00111100, B00111100, B11000011, B11000011, B11000011, B11000011, B00111100, B00111100, B00111100, B00111100,
B11001100, B11001100, B00110011, B00110011, B11001100, B11001100, B00110011, B00110011, B11001100, B11001100, B00110011, B00110011, B11001100, B11001100, B00110011, B00110011,
B11001100, B11001100, B00110011, B00110011, B11001100, B11001100, B00110011, B00110011, B11001100, B11001100, B00110011, B00110011, B11001100, B11001100, B00110011, B00110011,
B01010101, B10101010, B01010101, B10101010, B01010101, B10101010, B01010101, B10101010, B01010101, B10101010, B01010101, B10101010, B01010101, B10101010, B01010101, B10101010,
B01010101, B10101010, B01010101, B10101010, B01010101, B10101010, B01010101, B10101010, B01010101, B10101010, B01010101, B10101010, B01010101, B10101010, B01010101, B10101010,
};
//øøøøø[ End: Global variables ]øøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøø//
//øøøøø[ Begin: setup() function ]øøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøø//
void setup() {
pinMode( clockPin, OUTPUT ); // init the clockPin to output
pinMode( latchPin, OUTPUT ); // init the latchPin to output
pinMode( dataPin, OUTPUT ); // init the dataPin to output
}
//øøøøø[ End: setup() function ]øøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøø//
//øøøøø[ Begin: loop() function ]øøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøø//
void loop() {
byte *buf_p; // a pointer to the dataArray[] memory address at the time we're reading the data
// begin outer for() loop - this loop pushes the data from the 74HC595's SHIFT register into its STORAGE register
for ( int
thisByte = 0x00; // declare an index for the data array starting at zero
thisByte
CORRECTION: you actually can PWM through the 74HC595 using the OE pin with analogWrite() commands. I got in front of myself on that one; my bad.
Hey Bill! I needed a good tutorial for my daughter (she's learning digital electronics) and this was my go-to for shift registers. Great video and thank you for presenting this subject in such a way that it is easy to understand for complete beginners!
Another incredible tutorial video. The level of detail and explanation you provide in these tutorials is amazing. Thanks so much
Thank you for the time you give people like myself who are looking to improve their skills with Arduino projects. Your an amazing teacher and I wish you the best in all aspects of life. I love how you explain everything in a normal calm voice unlike others who speak so fast or don't explain in the detail you do. Thanks again
Hi, I have used this Sketch to make my own 8 by 8 LED Matrix with 1 74hc595 and I am also just 14 years old, thank you a Lot!
You are amazing!
For me, you are the Andrew Huberman of electronics.
There is nobody out there that conveys the information needed to create your own schematics more concisely than you.
I am an amateur electronics enthusiast, i'm a Noob, i will have to re-watch this a few times, great video by the way.
Great video! Simple and straight forward. I feel I have a better grasp on these than I have ever had.
I really don't get why this guy hasn't more subs. Your one of the best content creators on TH-cam!
Probably because he's too specific and slow in his way of explaining his projects, this requires a mind-set that accept this type of videos. People these days are stressed and can't put themselves to listen to him for 30-40min about how you get some LED to blink, they just want the fancy product, not the "boring" side of it.
I get calm when listen too teachers and or people like this man or Ben Eater (probably butchered him surname...)
A video that illustrates in a great way some articles on the Net I had to read when I had to deal with shift registers for my project. I wish you had published this before : clear, informative and now, 74H* are not magic to me anymore! Great examples too!!
Thanks so much for another excellent video. I'm one of the people who asked for this subject and thrilled to see you listen to us - thanks!
Synchronicity: A day before this video came out, I was trying to figure out how I could use, say, n outputs from an Arduino to drive, say, 2^n LEDs. I'm very new to electronics and microcontrollers, but I've been doing software development professionally for several years. I love this circuit because it does exactly what I was trying to solve, the circuits in the IC aren't hard to understand, and it's great I can just buy an IC instead of wiring all that stuff together. In software development we have libraries of pre-defined stuff, just as ICs are packages of functionality. So ICs follow the same principle we do: package and make freely available bunches of commonly used functionality.
Hope systemd or other models of development don't reach this area...
Shift registers are often unknown by hobbyists and forgotten by others. I have seen them in a lot of designs since the 70's. Computers, wending machines and as receiver/decoders in military radar equipment. You find them very cheap on Ebay. Try to get hold of the good old Texas TTL Handbook.There are many fun and interesting chips in the 74 series.Even an ALU.
Getting a few resistor array dips. Fiddling with individual resistors is for the birds.
Fabulous video and detailed explanation. Not only explaining what shift registers are and their benefits, but also a practical example of how they can be used in the real world (or workshop). Thank you very much.
Thank you Bill!
Just what I was looking for. I was lurking around on your forum site and found this in a topic discussion.
Your forum website is great!
Keep up with the good work.
When you talk about SIPO and PISO, you may use branched and directional arrows to illstrate their jobs in a visual manner.
16:57, I think it's important to keep total current in mind since if you were to wire up two 7 segment displays using 150ohm resistors (mentioned as a possible value earlier), then you would exceed the 200ma limit of the arduino (e.g. 20ma/LED x 16 segments is 320ma).
Hi Enigma, so I have to connect 20-40 leds. Is there a better choice?
@@333cgs333 Connect them in parallel, each with their own current limiting resistor. Calculate the current through each LED and total it for all LEDs. Use an external power supply which can provide the correct amound of current (always best to provide more current than required so you won't damage/overheat the supply). Be sure to have a common ground between the arduino and you external supply. You can also search youtube for videos on powering LEDs.
Excellent! I needed to read the states of several pir and magnetic switch sensors while also controlling lights. Shift registers fit this problem like a glove.
I'm from Iraq .. your videos are very excellent. And very useful. Thank you very very much.. I wish for you the best 🌹❤
This is one of the best explanation and tutorials on logic gates I have come across. The examples you’ve created showcase their use very well. Great work and worth the wait! Thank-you! Now I’m off to order some logic chips to play with.
Hi, I watched this video and said to myself, that's a cool sketch, so I set up the hardware same as yours for the shift register. Then I modified it so that the LEDs would shift from outside to inside and back then repeat. Now, as I was moving the breadboard around while the LEDs were flashing back and forth, the positive 5Vdc from the Arduino connection came out of its pin on the Arduino Uno; and the LEDs still flash as if power is applied to the chip. I have a 150ms delay between LED shifts as follows in the below code segment (this repeats for different binary numbers for the flashing effect):
int latchPin=11;
int clockPin=9;
int dataPin=12;
int dt=150;
byte LED1s=0b10000001;
byte LED2s=0b01000010;
byte LED3s=0b00100100;
byte LED4s=0b00011000;
byte LED5s=0b00100100;
byte LED6s=0b01000010;
byte LED7s=0b10000001;
byte LED8s=0b00000000;
.
.
.
void loop() {
// put your main code here, to run repeatedly:
digitalWrite(latchPin,LOW);
shiftOut(dataPin,clockPin,LSBFIRST,LED1s);
digitalWrite(latchPin,HIGH);
delay(dt);
digitalWrite(latchPin,LOW);
shiftOut(dataPin,clockPin,LSBFIRST,LED2s);
digitalWrite(latchPin,HIGH);
.
.
.
From my multimeter, pin 11, the latch pin, varies a bit but averages to about 4.93Vdc and seems to be supplying all the power the chip and LEDs require to keep running. I would love to send you a picture or short video so you could see this and maybe repeat it.
Scott in Harwood, MD
I kept using eight resistors for these shift register projects, so I cheaped out and stuck them in a DIP socket. Works okay.
i just cant get enough of watching your videos , you among a few who i take as my reference to learn a new skill , so thank you very much
Hi, I have used this Sketch to make my own 8 by 8 LED Matrix with 1 74hc595 and I am also just 14 years old, thank you a Lot!
Excuse me, but how did you manage to drive 64 Leds with just the eight outputs of one 74hc595?
Hi everybody,
Some people ( Joseph Chamness in particular) asked for an '595' that is able to handle higher voltage/current.
It exists: Texas Instruments 'TPIC6595'
Same pinout as regular LS or HC 595, but open drain output with:
- RDS(on) 7 Ohms
- Imax 100 mA continuous / 250 mA max
- VClamp 33V
I have used it widely for anything such as relays (normal or solid-state with HV control) and it works like a charm...
Enjoy !
Typo: TPIC6C595
i think it's more situable and common to use a darlington array (such as the uln2003) which are simply a cascade of a low input transistors and more powerful transistors controled by the first one.
Those are 7 darlington transistors for each Ic and are pretty cheap i think, hope someone find this useful
Thanks for all the great support for my hobby! Very good tutorials! Thanks very much for all your work!
Really good video, you take the time to explain, and you speak at just the right pace for me to process what is going on. Great to see practical use rather than all just flop flop theory!
Great videos. Very well structured.
Also, being genuine here, serious respect to a guy whose slight speech impediment means he pronounces 'sh' as a kind of 'slzch' having the word workSHop in his title and doing a video on SHift registers. :)
Thank you so much for taking the time to do these videos!
This video really helped me. Now my 5x5 led display project can be upgraded to have everything on one board. Thank you!
Where do the values of the drop in resistor and filter capacitor come from at 9:49? I assume that Ohm’s Law has something to do with it but what would that math look like?
Very useful tutorial, thank you for the work you put in on this. I did get confused when the clock enable pin was used as the clock and the clock pin was used as the enable. I got the data sheet and sure enough it said those pins are interchangeable. I like the way you taught how the byte was complemented to get it back to what it really represented.
your videos are becoming top notch and quickly my favorite on youtube, keep it coming!
heck ya, anytime im lookin for a refresher on something i find your videos.
Another great video as usual. I haven't seen or heard anything about DB1 in a very long time. I never expected you to do one a week plus one a week of the component level videos as you had once proposed. That's just to much work! I was however hoping you were going to do a DB1 video every other time.
I was not planning on building one right now, but was so intrigued by your concept I needed more. I take it that you were not getting enough interest from other viewers to keep it going? That's really ashame. That looked like it was going to be something really special. I would love to see you bring it back to life.
Don't forget to tie pin 9 from the HC165 to ground! This was missing in the video.
Purchased on Amazon and tested (Worked Great) these Jameco Valuepro 4116R-1-331LF. Bussed Resistor Network, 16 Pin, 125 mWatt, 330 Ohm, 2% Tolerance ... Great Video!!
Another amazing video. Thank you kindly for putting this together, it will simplify a very important and useful process in digital electronics for the amateur/enthusiast.
Excellent tutorial! Good job man!
Hi, have used this Sketch to make my own 8 by 8 LED Matrix with 1 74hc595 and I am also just 14 years old!
Superb!! Your image / write up on your website was even better. Very grateful to you :)
I'm a complete novice when it comes to basic electronics. I was searching for PISO without knowing it. Thinking it must be named differently because I associated shift registers solely with SIPO functionality. Thanks so much for enlightening me!
Very much appreciated! You are making a difference in this world!
Love all your videos and really appreciate your detailed explanations. Just one thing, I would like to request is that you should zoom in the Arduino Code screen so that the words are readable even on smaller devices.
Great tutorial. I used these for controlling a board of 8 active low opto-isolated relays, in conjunction with a library I made specifically for this setup.
Basically, shift registers act like gateways.
GOD explanation. trashes those of difficult web explanations by words.
Very good explanation.Soothing voice,nice to listen,.Very calm.You got an arduino-fan subscribed!!
Such detailed and easy content is rare
Parabéns por falar um Inglês pausado e fácil de entender. Isso facilita muito para quem não tem o inglês como língua nativa.
Your videos are really very informative. It would be interesting in adding a part "B" to this video and connect all 8 data pins to the 1602 LCD. This way a hardware contrast can be made from from a software perspective and a hardware perspective between 4 bit mode and 8 bit mode on the LCD?
Best ever explanation ... Love from INDIA
Dear Sir, would you explain more about how to wire two 74hc165 together? and are there any changes in code? thz in advance!
Great video! After some initial problems due to my own stupidity (forgot that the same rows on the breadboard are connected ^^..) I got my example to work. Finally I understood how to work with SIPO shift registers and I can't wait to use multiple ones in order to drive more LEDs.
Very interresting video
I didn't think shift register are so useful
Nice! You can also use 7 segment display to demonstrate the operation of this IC.
Thank you very much. I plan to use this for my ESP32 C Lang development
You really are a wealth of knowledge.
Hi good subject, shift registers op can be operated in the alu of the cpu of arduino ! And to expand io
You can use 4x16 decoders.
This was great education and demonstration. Thank you!!!!
Can you explain the complimentary output but again? Why would you not get all 8 bits if you used the non-inverting output?
Thanks for your in-depth explanation.
I've got a Kingbright 7-segment display (SC56-11SRWA) and had to switch the outputs 1 and 2 of my 74HC595 to make your code work properly.
Geee... a great coffee shop video... Aaah, with some Irish-coffee i can watch most anything...:] and this shift is register wonderful stuff... makes me think of the heath-kit days. thaanks a lot...:)
perfect explanation ... Thanks from Vienna/Austria
Very good presentàtion of shift register sipo/piso and Arduino programming . If you can use Ar/Vr/Mr for demo ,it will be excellent .Good job done !!
Bill, Thank you for your always marvelous videos!
Just ran into an unusual issue with a batch of Nexperia 74HC595 units which the Fairchild version does not exhibit. Turns out that pin 11 (shift reg. clk)suffers 'ringing' that's tough to quantify as any Oscope probe capacitance is enough to stop it. A wet finger capacitance on the pin makes it work fine. My solution ended up being a 470Ω inline with pin 11 to defeat the ringing resonance. I was running it with a 5V PIC 16F886 MCU. Threw away a few 'bad' Nexperia chips b4 I figured out the issue so I could use them.
As soon as I saw 'shift registers', my eyes glazed over...
I studied a lot.
Thank you for teaching me properly.^^
It was very helpful and useful.
А можно ли как-то обойтись без delayMicroseconds? В серьезных проектах это парализует многозадачность, от него просто необходимо избавляться, какой бы он длительностью не был этот delay...
Great walkthru, I was wondering how many volts should the 100mf electronic capacitor be, and how necessary is it to have?
also running into an issue where 'all' the leds are blinking at once.. not sure what I may have done wrong.
The 75HC165 is what I was looking for in another program to build Ben Eater 8 bit or 16 bit Computer.
This would make it easy to make a serial input to program or use of a 3.5 inch floppy drive.
COOL thanks.. Also it solves the problem of programing EEPROMS... by using both of these chips and not run out of pins.
Interestingly these DIL-16 types of resistor arrays are relatively expensive and hard to find on cheap sites like aliexpress that prefer the DIP packages. When I say expensive, 2 will cost the same as 50 logic chips.
Bedankt
Thank you Guido!
THANKS!! Very well presented, nice Christmas Lights display; Now how can I customize this to program a set output pattern for a given input Byte? I am trying to get air pistons to "fire" in set order given the desired pattern of piston position sensors (reed switches).
So the random pattern of the output with no RESET of INTERRUPT capability is not particularly useful for practical applications: Could you make a Tutorial that caters to programing several air/hydraulic pistons to perform active tasks in a customizable sequence, please?
THERE ARE NO USABLE TUTORIALS OUT THERE FOR THAT!!! A lot of the existing tutorials are just about controlling one piston - I cannot find any that would fit my needs...
Thanks again for the clear, detailed Tutorials you have already out there - I will definitely incorporate a few of these in my final project. :-) Great stuff!!!
Thank you for sharing your knowledge. This is very helpful to me. I'm making a 28 standard LED police light bar for my RC using a Teensy. It seems using SIPO shift register is the way to go.
Very good presentation. Simple, but not oversimplified. The only thing is, 74HC is NOT TTL. The voltages are different, and the technology is CMOS, not Bipolar transistors like in TTL. Strictly 74HC is not even compatible with TTL when operated at 5V. 74HCT is the same technology, same speed and same low power consumption but intended for co-existence with real TTL. Actually HCMOS is more similar to the CMOS 4000 series. But 74HC was designed so the type numbering is compatible with the antique 7400 series.
i have a doubt , do we need exactly 8 buttons or leds for this projects
I'm an amateur learning electronics, and when seeing schematics like 16:51 this one I always wonder :
is not more simply put only one or two resistors at the pin 10 and 16 ? Why the reason to put a single resistor on each output?
Is it because of the voltage of the chip? good practice? Or have a good reason I'm missing?
Thanks in advance :D
If you don't limit the outputs on a chip, although they have limited current output, if you don't use any dropping resistors, you won't limit the current of the chip, and it will burn or even worse, damage your ic because of forcing it to provide more current than what is capable of
You don't put resistors at the the vcc or gnd pins because that will limit the maxium corrent that will enter on the circuit
For example, you put a resistor and now your circuit has a maxium of 200mA, if you have more than 4 outputs that provide 50mA each, as the voltaje won't go up, the current will drop to compensate. At least that's what i understand, i may be wrong, if i am please correct me
master task.. correct sleep to the ms which would really add up to 1000ms ;) I guess there would be a couple of cycles iterate through-out the loop which naturally already adds up
I think the reason you are having to use the compliment serial out is because you are not setting clock back to low after you set clock enable low. You are missing shiftIn's first low to high clock transition.
A good intro for the noobs, but I was slightly disappointed you didn't show how you can combine the shift in and the shift out onto the same clock and data pins: just put a resistor from the serial out of the74HC165 to the serial data pin so that when the pin is in input mode it sees the input data but takes control when it is in output mode. ... also, you can dispense with all the extra parallel latch wires too, by using capacitor-resistor-diode from the clock wire. The R-C on the 165 pulls the PL pin low, but a diode to clock holds it high while the clock is pulsing. The R-C on the 595 holds the RCLK high, but a diode to clock pulls it low while the clock is pulsing. The shift in-out process then looks like this: a long enough low on clock latches the parallel input data; shift in the serial to data; switch the data pinmode immediately (waiting too long with clock in low or high will send unwanted signals to PL or RCLK, though staying low at this point would probably be fine) to output and shift out the wanted serial data (it will have shifted in the data from the 165 during previous step); leave the clock high at the end and after a few microseconds RCLK will get high enough for the data to appear on the outputs. Appropriate values for R and C would give an RC time constant of about 5 of your serial clock pulses.
I've been playing with this the last week, and have realised that, for output only, only one controller pin is required if a little delay (50ns or so) is put between the clock signal and the serial input of the 595, with an RC of 1k2Ω/47pF or so. Putting schmidt-trigger buffers or inverters on the input to the board with the shift registers also helps, since with many capacitive things (like CMOS inputs and delay capacitors) running of the clock line it can get a bit messy if all that current has to come down a wire. Then the input side can have a dedicated line, so both lines are now one-way (meaning that optocouplers or current signalling can be used between the boards) and driven from a low impedance source (using a resistor to send data back down the same line when the controller switches the pin to input mode works with 1k5Ω but the signal is messy and takes long time to rise and fall). The One-Wire signal can't be run from a hardware SPI, but can be run from a PWM on chips with DMA like STM32, or with a bit of assembler bitbashing the complete 16bit send & simultaneous receive in 5µs is quite possible - possibly less time than it takes to set up the hardware and definitely smaller code and greater flexibility. Basically, hold the clock low for 100ns to get the data line low as well, and then the rising edge will clock in a 0 to the shift register. hold the clock line high for 100ns till the data line is high too and then blip the clock low for just long enough that the 595 chip registers it (25ns) and then back high before the data line has fallen too far, to clock a 1 into the shift register. Repeat for all bits, leave the clock high at the end and a couple of microseconds later the RCLK will get high too and the new data appears on the outputs. Again, schmidt-trigger buffers help, also after the delay capacitor to the data line, making the ratio between the long high data part of the signal and the short low required before the clocks rising edge less critical, and enabling transmission speed as fast as the processor can handle (72Mhz ARM). With an AVR processor it wouldn't be needed since all timings would be longer, just needing longer RC delays.
You deserve more than you get!
Thank you for your excellent presentation. Well done keep it up.
Cheers, makes sense finally!
Hi Bill,
It's great as all of your videos.
Hard to understand when you describe as connect pin 2 to pin 11. Why? What does it mean? If you don't tell why just it would be easy to add some text close to register for understanding connection.
Nice example of Shift Registers, but what is component serial# of the 8 resistors in DIP package ?
I am curious about the 8 resistor DIP items as well? ... Great Video!! Learned a lot and ordered some 74HC165 and 74HC595 and would also like to order some of the 8 resistor DIP.
Purchased on Amazon and tested (Worked Great) these Jameco Valuepro 4116R-1-331LF. Bussed Resistor Network, 16 Pin, 125 mWatt, 330 Ohm, 2% Tolerance ... Great Video!!
Thank you for your video, very educational. How do you put debounce on the switches? I tried to use this but my 7-segment display output is showing random numbers or display. I guess it's the debounce on the switches that cause this problem. Thank you.
coolest thing ever. great explanation.
I actually use it for for driving 16x2 LCDs.
Could you please make a workshop about arduino microphones and voice recognition with an arduino. I think that would be a very interesting topic. Thank you for all the interesting workshops, i'm lovin your videos
Excellent class! Any link to this Resistor Array (global)?
I just didn't understand the order of the pins from the 7th segment display to the shift register, 74HC595, for example, because it seems that there is a 7th segment display that doesn't follow an order. Thanks for the video.
Ultra helpful. Thanks for the vid!!
Do you have a longer intro video with a longer song? I tend to spontaneously bust out into a robotic dance every time your videos start due to the catchy retro 8-bit style tune and it is contagious.
How fast will the 74hc165 read inputs? I was looking to maybe try to use multiple hc sr04's to read the echo's on interrupt pins, but looking at your led's in the video looked a bit slow probably due to the delay at the end
Don't know whether you check comments from this long ago but - why did you use an Arduino output for the '165 clock enable? It's just ORed internally with the clock pin, so in this case could just be connected to GND (as per the datasheet examples). TIA, John.