#251

Поділитися
Вставка
  • Опубліковано 4 лип 2024
  • Using a latching 8-bit shift register to control 7-segment LEDs - Easy!
    ► PCBWay $5 for 10 pieces www.pcbway.com
    Submit your entry to PCBWay's 5th Design Competition (by end Dec 2022)
    00:00 Welcome Back
    00:26 PCBWay 5th Design Contest
    02:08 What are Shift Registers?
    09:28 Basic demo using bits “4”
    12:41 Dual Digit demo “42”
    15:57 Code description
    18:06 SMD construction video
    18:41 Conclusion
    See my GitHub for this video for all sketches and more information:
    github.com/RalphBacon/251-8-b...
    ► shiftOut Arduino Command
    www.arduino.cc/reference/en/l...
    ► Useful Shift Register tutorial by Akarsh Agarwal
    create.arduino.cc/projecthub/...
    ► 74HC595 Datasheet
    www.sparkfun.com/datasheets/I...
    www.ti.com/document-viewer/SN...
    ► The Kingbright SC56-11EWA 7-seg LED I used for prototyping
    www.kingbrightusa.com/images/...
    The 5.1mm ~0.21" SMD Kingbright KCSC02-106 I used in the final project £1 each (in a pack of 5):
    uk.rs-online.com/web/p/led-di...
    PDF for above
    docs.rs-online.com/f9af/09007...
    More information (including all links, sketches & PDFs in my GitHub):
    github.com/RalphBacon/251-8-b...
    ► List of all my videos
    (Special thanks to Michael Kurt Vogel for compiling this)
    bit.ly/UA-camVideoList-RalphB...
    NOT THIS ONE bit.ly/VideoList-RalphBacon
    ► If you like this video please give it a thumbs up, share it and if you're not already subscribed please consider doing so and joining me on my Arduinite (and other μControllers) journey
    My channel, GitHub and blog are here:
    ------------------------------------------------------------------
    • / ralphbacon
    • ralphbacon.blog
    • github.com/RalphBacon
    • buymeacoffee.com/ralphbacon
    ------------------------------------------------------------------
    My ABOUT page with email address: / ralphbacon
  • Наука та технологія

КОМЕНТАРІ • 147

  • @IanSlothieRolfe
    @IanSlothieRolfe Рік тому +5

    Good explanation Ralph. About 15 years ago I built an information display board for a friend, it was for showing stats for Ice Hockey and had 20 7 segment displays, some of them those big 3 inch ones. It was all built through-hole on veroboard (budget and time didn't stretch to a PCB!) and the bigger displays needed driver transistors, but it all worked on the same principles you described here. My friend was amazed we could connect all those displays with just a few wires. He built the controller (it was a PIC if I remember correctly) after I explained how he needed to send out a 160 bits every time he wanted to change a digit, and made it look nice with a display box. We completed it and got it working the night before the first hockey match...... The only real problem was the power supply wasn't really up to the job and got very hot due to all the LEDs but we upgraded that for the next time it was used. It was one of a number of strange projects my friend got me involved in, although usually he was the electronics man and I did the software, so it was a bit of a change for me!

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

      The PSU is often overlooked. My 0.9m LED matrix display uses 1.7A when fully lit. I get a feeling an Arduino would not cope.

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

    The demo with the push buttons was a great idea. That really reinforces how the data shifts one bit at a time.

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

      I'm glad you thought so, Mark, I was worried about switch bounce but all was well!

  • @electronics.unmessed
    @electronics.unmessed Рік тому +2

    Nice demo! And brilliant humor choosing 42 as demo code. 😎👍

    • @RalphBacon
      @RalphBacon  Рік тому

      Glad you liked it! And appreciated the significance of 42.

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

    Hi Ralph, its good to see you putting out SMD videos ! it was a while back now but you weren't very keen on using SMD at first and now you enjoy (or at least tolerate !) it. Great tutorial....cheers.

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

      I'm very happy and comfortable using SMD now. It has a number of advantages, the main one is that components are a lot smaller (sometimes _too_ small for my eyes!) so you can get more on a PCB.
      Next video shows me soldering up that dual digit project, only a few components which is why I thought it could be a persuasive argument for those in denial to "have a go!"

  • @guidovlaere
    @guidovlaere 7 місяців тому +1

    Again a very good tutorial! Nice to understanding shift registers. Thanks Ralph! It's really very helpfull for me. 😊
    Thanks from the Netherlands

    • @RalphBacon
      @RalphBacon  7 місяців тому

      Glad it was helpful!

  • @willofirony
    @willofirony Рік тому +2

    The shift register is a most useful chip. It can also be used as a divider. But its primary serial to parallel job saves so much bit banging. The "decimal point" can also be used to indicate various states. With two digits they can indicate 4 states with optional flashing. Just OR in the h bit (toggling can be done by AND 0xfe).

    • @RalphBacon
      @RalphBacon  Рік тому

      Using the decimal point is always a good way to show things are still running. I do that on almost all my projects (eg the Smart Workshop Heater and its sensors all do it).

  • @NormanNodDunbar
    @NormanNodDunbar Рік тому +2

    Hi Ralf.
    I've been messing with these shift registers just this week for my next book. I've got mine wired up to SPI which makes life a bit easier, just dump the value into SPDR and off it goes. SDA goes to SER, SCK to RCLK, plus a couple of GPIO pins for CS and ~OE and Bob's yer Auntie!
    Hope you are well.
    Cheers,
    Norm.

    • @RalphBacon
      @RalphBacon  Рік тому +2

      Sounds great! Oh, "your next book". Nicely done, Norm, good luck with it.

    • @NormanNodDunbar
      @NormanNodDunbar Рік тому +2

      @@RalphBacon Thanks. It's coming along slowly, like the first one. All about Arduino Interrupts.
      Cheers,
      Norm.

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

    Nice video Ralph. I really enjoyed it and the banners at the bottom were great. Every time I was thinking "But Ralph, what about this?" a banner addressing my exact question would pop up. Well done.

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

      Glad you enjoyed it! Thank goodness I added all those banners!

  • @1_HighDuke
    @1_HighDuke Рік тому +2

    Another great one, Ralph! I honestly wish I had teachers like you in uni. There were a few, but few indeed and far between. I hope people in the microcontroller community realise what a treasure your channel is. A heartfelt "thank you" is in order as I've been watching your videos for years now and have learned so much from you.

    • @RalphBacon
      @RalphBacon  Рік тому

      Wow, thank you! High praise indeed. Glad you liked it.

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

    The 2 digit board you bought feeds bits from left digit to right. Presumably the '595's could have been designed to shift bits from the right hand side of the module. I realise the direction is fixed at design time - so the end user can't choose to force data in from the end they wish. Another excellent video

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

      That's right. The "overflow" from one 595 feeds the other and for some reason this design (and mine too) feeds from left to right. Perhaps it's the tens and units format we adhered to, but there is no reason at all why it cannot feed in the other direction. In fact, with a couple of jumpers (or cut-able tracks) it could be made to work in either direction.

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

    Thank you so much. I’ve been afraid of shift registers for a long time but not anymore.

    • @RalphBacon
      @RalphBacon  Рік тому

      Your fears have been allayed. Good!

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

    A good explanation of shift registers and how to use them

    • @RalphBacon
      @RalphBacon  Рік тому

      Thanks Keith, nice of you to say. 👍

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

    Good work, I expect to see some library next series :) , that will help us understand how people wrote their library

    • @RalphBacon
      @RalphBacon  Рік тому

      The library is simple (more a wrapper, really) but could be a good intro to newcomers.

  • @marsrocket
    @marsrocket Рік тому

    Perfect timing - I just yesterday decided I wanted to learn more about shift registers. Thank you for your content.

    • @RalphBacon
      @RalphBacon  Рік тому

      I knew you were interested in this topic, Daniel, enjoy!

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

    As always, very well explained. Thanks Ralph.

  • @jeffbluejets2626
    @jeffbluejets2626 Рік тому

    Well done.
    Looking forward to the next one on this.

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

      I'm just wondering what the next one is... oh, I'm editing it now! How did you know, Jorgo?

  • @skf957
    @skf957 Рік тому

    Nice tutorial. I've heard the term many times, but now thanks to you I know what it means. More like this if you can please.

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

    Brilliant tutorial, clear as crystal 🎉😊

    • @RalphBacon
      @RalphBacon  Рік тому

      Thank you! 😊 Nice to know it was understandable.

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

    Always interesting... thank you!!! And one funny thing that could be done, is to show how all those bits travel from start to finish on a 4 or 6 digit display. And a clock made that way could be amusing at firt and annoying after a while...

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

      A bit-animated, 4-digit clock, you say? Yes, amusing for a while but quite long-winded if you happen to glance up to see the time just as it's starting it's bit rolling pattern! Perhaps just do it on the hour, or something? Hmm.

  • @gregwmanning
    @gregwmanning Рік тому

    Im enjoying this series. All the best Ralph

  • @hariseldon2577
    @hariseldon2577 Рік тому

    Great stuff. Your approach is very easy to follow and a pleasure to listen to.

    • @RalphBacon
      @RalphBacon  Рік тому

      Nicely said, Hari, I'm glad you liked this video.

  • @tim_bbq1008
    @tim_bbq1008 Рік тому

    I learned a lot. This will let me move forward on a project I have been thinking about. THANKS for sharing!

  • @liveen
    @liveen Рік тому

    for those wondering how the overflow works in circuit, the input of the first register takes high, or low, and I assume it follows a clock signal, which Ralph has set up to step every time he presses a button, but usually you'd use a crystal or similar for that. it could also be just looking for a rising/falling edge (voltage goes up, voltage goes down, on, off)
    The OUTPUT of that register, is of course a bunch of pins, and the way a shift register functions is you press on, pin 1 gets positive voltage, you press off, pin 2 and NOT 1 gets positive voltage etc.
    The last pin in this sequence, however? That one feeds into the second register's input, serving as your virtual button presser, just far behind, and so if you make a four, then press all 0s, the first register will shift all of it's bits over and past that last pin, feeding into the second register, and will end up cleared out.
    Actually, about the clock signal, just noticed the description said latching shift register. Latching means you press ON on a push button, and instead of going OFF as you release it, it STAYS on, and so another ON press will likely either pull the signal LOW and then latched ON, or it will simply do nothing except step a clock signal, meaning your current ON state will be re-read as another bit

    • @RalphBacon
      @RalphBacon  Рік тому

      Yes, nicely summarised. The LATCH just copies the registers to the output (pins) so subsequent LATCHes don't do anything (they just re-copy the same registers to the output) unless the registers have changed, of course.

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

    I really enjoyed this explanation. thanks

    • @RalphBacon
      @RalphBacon  Рік тому

      Nice of you to say so, thank you 💖

  • @VLandrew
    @VLandrew Рік тому

    Great video

  • @guidovlaere
    @guidovlaere Рік тому

    Again a very good video, very helpfull! I'm a big fan of you! Thanks Ralph.... 😊

    • @RalphBacon
      @RalphBacon  Рік тому

      Kind of you to say, Guido 👍

  • @metamud8686
    @metamud8686 Рік тому +2

    16:58 for readability (again) don't use both camelCase (i.c. "charSet.h") and snake_case (i.c."wiring_shift.c") for file names in a single project. Choose one and be consistent.

    • @RalphBacon
      @RalphBacon  Рік тому

      I _always_ use camelCase, standard for C# programming. The "wiring" file is not mine but from Arduino themselves who obviously are animal averse. I guess we are therefore both consistent but not when mixed.

  • @Bianchi77
    @Bianchi77 Рік тому

    Nice info, thanks for sharing it :)

  • @davidwensboposaric5498
    @davidwensboposaric5498 Рік тому

    Thought I was subscribing. Realized I wasn't. Now I've set things as they should be.

    • @RalphBacon
      @RalphBacon  Рік тому

      Excellent! Glad to have you along, David 👍

  • @prestongivens3594
    @prestongivens3594 Рік тому

    Greetings Ralph,\
    i really enjoyed this video. You brought back the memories about when i first figured out the power of using shift registers as I/O expanders, the way you have done. It was such an "Aha!" moment. 😅😅 The real fireworks came when I realized that I could easily achieve a refresh rate of 5-10 times / second, with fairly rudimentary code. It still impresses me how well the chips were designed to work together, to do the low-level work so quickly and easily. Also amazing is how many years ago that was. These designs are not new!
    Cant wait to see your SMD assembly video on this. Trying to get my old eyes and hands geared up and trained up to do it myself!
    Cheers! Keep up the great work!

    • @RalphBacon
      @RalphBacon  Рік тому

      I'll pre-empt the video a bit and suggest you scour Banggood for SMD practice kits. They (usually) don't result in any kind of working board, they are just for SMD soldering practice. Very cheap ($5) and worth their weight in gold.
      SMD video on Friday 14th October, 2022 10am GMT+0100 Video #252! Be there or be square! (Something they said back in the 1960s)

  • @MUHAMMADYAWARIFRAHEEM
    @MUHAMMADYAWARIFRAHEEM Рік тому

    Very informative video Sir

    • @RalphBacon
      @RalphBacon  Рік тому

      Glad you liked it Muhammed. You been away, not seen your comments lately?

  • @stub1116
    @stub1116 Рік тому

    Briliant!

  • @mouseminer2978
    @mouseminer2978 10 місяців тому

    I am waiting for the future video. Thanks from Canada.

    • @RalphBacon
      @RalphBacon  9 місяців тому +1

      Coming soon! Er, hang on, what future video? Remind me!

    • @mouseminer2978
      @mouseminer2978 9 місяців тому

      It is regarding a library which can ease up using 7 segment display. So library takes care of all the shifting process. (You have mentioned around17:25 in this video) Thanks always.@@RalphBacon

    • @RalphBacon
      @RalphBacon  9 місяців тому

      Good news and bad news.
      The good news is that I definitely wrote a tiny library for this (and have used it in my projects).
      The bad news is that I never officially launched it. How about I just add it into this project's repository now? [Done] Any issues or questions let me know.

    • @mouseminer2978
      @mouseminer2978 9 місяців тому +1

      @@RalphBacon You are a Super ⭐. Thanks

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

    Thanks Mr Digit

  • @theonlymudgel
    @theonlymudgel Рік тому

    Slowly but surely sneaking up to that 50k subscriber level. Also a respectable 4.1 million total views. Great work Ralph. Mike V

    • @RalphBacon
      @RalphBacon  Рік тому

      You know more about my stats than I do, Mike! I try to not get too transfixed by numbers except views per video, as that indicates how popular they were with my Arduinites!
      Of course, when I watch other people's videos and see they get 200K+ views _per video_ it does make one feel somewhat deflated. 😟

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

    18:10 Soldering SMD 🥶🥶 thats me LOL

    • @RalphBacon
      @RalphBacon  Рік тому

      Watch next week's video, Pekka. You might just change your mind.

  • @ronvanzijl2629
    @ronvanzijl2629 5 місяців тому

    Hi Ralph, I have watched a couple of your video's/tutorials and it helped me a lot to get a better understanding of how I should structure/improve my Arduino/ESP coding. The downside is that for some completed projects I decided to develop the next version purely for quality improvements which results in improved stability/reliability.
    Maybe its there however it would be nice if you could do a video on char/string passing and returning to/from functions. In my solutions I always avoid the use of strings as they can (when improperly used) ruin your run-time memory.
    Anyway long story short: A big thumbs up from the Netherlands for the way you share your knowledge and experience.

    • @RalphBacon
      @RalphBacon  5 місяців тому

      I'm happy your getting value from my videos 👍
      You are correct that using Arduino Strings can fragment your Heap memory, leading to eventual crashes.
      Using Strings or Chars in parameters is never a great idea; it's better to use an integer that represents a String (eg an error message).
      That said, you can technically pass an std::string as a parameter; ideally you don't want to modify the string, especially not increase its size.
      Re-writing your proof-of-concept code is always a good idea. I'm always refactoring my original code, once it's working!

  • @viswanathanr6851
    @viswanathanr6851 Рік тому

    super bro

    • @RalphBacon
      @RalphBacon  Рік тому

      Glad you found it useful (or entertaining)!

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

    That is a great project
    It'd be nice if you added the dot, letters, and maybe symbols
    It is useful for warngings,
    sometime my bench power supply outputs OtP ( = Over Temp Protection ) on the 7segment display.

    • @RalphBacon
      @RalphBacon  Рік тому

      Yes, you can _easily_ extend the sketch in the GitHub to allow letters or symbols. Just extend the _digits array. Job's done.

  • @fredflintstone1
    @fredflintstone1 Рік тому

    Nice video Ralph I have used the 8x8 led boards in banks of 4 and you can do letters as well as numbers and join the boards together to make longer words and scrolling as well great fun to play with😏

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

      I have a 0.9m (about 3ft) strip of 8x8 LED pixels but they are controlled by a MAX7219 chip (one chip per 8x8 module) and I have a project on the go for it, right now!
      It's been sitting in my workshop for about 2 years waiting for this moment. Stay tuned for a future video on how that went.

    • @fredflintstone1
      @fredflintstone1 Рік тому

      @@RalphBacon with baited breath🙂

    • @andymouse
      @andymouse Рік тому

      @@fredflintstone1 SQUEAK!!

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

      @@andymouse Cheese!!!!!!!!!!!!!!!!!!!!!!!!

  • @ForwardGuidance
    @ForwardGuidance Рік тому +2

    I'm looking forward to the code that just does it.

    • @RalphBacon
      @RalphBacon  Рік тому

      All in the GitHub. Well, not the library I wrote but the basic sketch.

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

    Can you show the schematic where the first shift register passes the bitstream to the second shift register? Thanks.

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

      Indeed, there is a circuit diagram in a previous GitHiub of mine:
      github.com/RalphBacon/247-Error-Reporting-Display
      In summary, the "overflow" of the first 74HC595 chip on pin 9 (QH`) goes to the serial input of the second chip on pin 14 (SI, Serial In).

  • @jonathanr4242
    @jonathanr4242 Рік тому

    As well as SMD soldering, can you please include a short segment on how you did the pcb design?

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

      Hmm, that's certainly an idea, Jonathan and took far longer than soldering the board up! We shall see.

  • @beatadalhagen
    @beatadalhagen Рік тому

    I have a pile of boards that uses four 595s to drive an LED array. Was used for scrolling signage. Talk about bit-banging.

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

      Probably the cheapest way of doing it!

  • @threeMetreJim
    @threeMetreJim Рік тому

    If you chain multiple displays together, you can create a retro (scrolling) text display. It should be pretty easy:
    Convert (single byte ascii) text to led equivalent, optionally add some animation function, then pump the bytes to the leds bit by bit. I had to do that project in 6502 assembly as part of a college course, circa 1995; The programming and platforms may have changed a lot, but the underlying method to achieve the result (what the program has to do) stays the same.

    • @RalphBacon
      @RalphBacon  Рік тому

      Indeed, it's often not the "what" but the "how" that is important. Once you have the sequence of events, it "just" needs translating into the language and methodology that you are using.

  • @stevewilliams1054
    @stevewilliams1054 Рік тому

    Hi Ralph, as you say simple when explained well great job. As a change of topic how about something on using, now getting redundant, hard disk drive motors as stepper motors or rotary encoders, etc.

    • @RalphBacon
      @RalphBacon  Рік тому

      Great suggestion! I might even have a hard disk somewhere. Although I did do a clean out before moving house 18 months ago. I'll check.

  • @Roy_Tellason
    @Roy_Tellason Рік тому

    I've been aware of shift registers since I first got my hands on a TTL databook, some time in the early 1970s, I guess that was. I hadn't considered them terribly useful until considered in the context of using an arduino and wanting to minimize the number of i/o lines in use.
    The one shortcoming of the devices shown, both the commercial unit and the one you came up with, are that they are not stackable, in the sense of being able to build larger arrays, say four or more digits. The spacing on either side doesn't allow this to work, and perhaps it should be a design consideration for future versions.

    • @RalphBacon
      @RalphBacon  Рік тому

      Yes, electrically they stack (cascade) very well, but physically there is a (large) gap. Might be just about OK for a 4-digit clock.
      That said, it would be very straightforward to design a stackable PCB. Or use a 14-segment LED that most certainly do butt up against each other very well and you can then write _anything_ you like!
      Mine are not designed to stack as they have two fixed digits and are oriented vertically (you'll see next video).

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

    The choice of "4" was a bit unfortunate for the demonstration of the significance of bit order, since it reads the same in reverse!

    • @RalphBacon
      @RalphBacon  Рік тому +2

      Yes, I only noticed that whilst I was editing the video and did make a note that it was a palindrome (but I changed it on the fly to include the decimal point so it was, finally, different in one direction to the other!).
      I only stuck with "4" as it was part of the magical "42" combo 😁

    • @jmw5233
      @jmw5233 Рік тому

      @@RalphBacon No worries, you're still the man, Ralph.

  • @metamud8686
    @metamud8686 Рік тому +3

    16:46 for readability: don't write "tens" and "units" in the comment and then use variable names "outer" and "inner'. Instead name the variable for the outer loop "tens" and the lcv for the inner loop "units". That way your code shows what it is doing, rather than you having to explain it in the comments and have the reader confused as to why you subsequently use two different variable names in your loop. Lines 117 and 118 become immediately clear as to which one is sending units and which is sending tens. As you wrote it here, the reader has to mind-map "outer" and "inner" back to the earlier statements.

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

      Separation of concerns. The inner and outer loops are just that. They might be used to send out tens and units _now_ but the two are not really connected. A bit like calling a variable greenLEDPin. That's my thinking, anyway.

  • @joymakerRC
    @joymakerRC Рік тому

    Love your face Mr Bacon

    • @RalphBacon
      @RalphBacon  Рік тому

      I'd probably like yours just as much, I'm sure!

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

    do you have the gerber file available, want to build a countdown timer! great work.

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

      Yes I have. Now uploaded.
      You can find them here (look for the Gerber Files folder):
      github.com/RalphBacon/251-8-bit-Shift-Register-for-7-segment-LEDs
      If you need anything else please ask.
      Note that although I used (initially) 7-segment LEDs (uk.rs-online.com/web/p/led-displays/6165428 ) from UK-based RS Components, I also found some on AliExpress that worked great (but were green, not orange).
      Like this: www.aliexpress.com/item/1005003861707022.html but do ensure you get the correct common cathode LEDs that is required for your project!

    • @TheUnofficialMaker
      @TheUnofficialMaker Рік тому

      @@RalphBacon Thanks! I'm going to get some made!

  • @TheUnofficialMaker
    @TheUnofficialMaker Рік тому

    Will Bacon be using the hotplate method? I like mine crisp but not burnt.

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

      Hmm, crispy Bacon 😋 Although USA bacon is very, very different to UK bacon (and I'm not talking about accent).

  • @kendrickapps674
    @kendrickapps674 Рік тому

    I saw at the bottom of your video a set of 4 14 segment display could you do a video about that.

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

      I was planning on doing _something_ with them, but as the control of 14-segments requires a special chip (on the reverse of the PCB you saw) it might be a very quick video.
      I'll see what I can come up with!

  • @peterf983
    @peterf983 Рік тому

    Next time you could show us how easy is to control shift registers via onboard hardware SPI.

    • @RalphBacon
      @RalphBacon  Рік тому

      Well, yes, I suppose you might be able to do it with SPI but we would be cheating. There is no MISO requirement (the device never sends anything back) and the SS is not required because it is the SCK that tells the chip to read the input (MOSI) line. So not really SPI at all.
      The shiftOut command works well for this and my library wraps it all up to make it even easier (a future video, I think).

    • @peterf983
      @peterf983 Рік тому

      @@RalphBacon
      Why cheating? It's obvious that this is one way communication (only MOSI, CLK), and SS could be used to latch shift register. Another advantage is hardware support - less code - more space for main program.
      You could try SPI on f.osc/2 clock (I'm wondering is it real 8MHz on ATMega 328P@16MHz) and test/show it on oscilloscope.

  • @SkottTomas
    @SkottTomas Рік тому

    Hi Ralph
    Once again a fine video. Especially the first program where you can step through the serial sequence one bit at a time is great for learning.
    Is it possible to get the schematics for the pcb you are using for this demo in the video?
    BR
    Tomas

    • @RalphBacon
      @RalphBacon  Рік тому

      If you mean the larger, dual digit device (not my design) then I haven't one, but should be very similar to my own with one CAVEAT: the larger display I used is a common ANODE display (the Common pin goes to VCC), whereas my design is a common CATHODE display (Common pin goes to GND).
      So my design SOURCES current for the LEDs from the HC595, the larger device SINKS current into the 74HC595.
      See here: github.com/RalphBacon/247-Error-Reporting-Display for the schematic on which I (loosely) based mine.
      I've also uploaded my actual design into the above-mentioned repository.

    • @SkottTomas
      @SkottTomas Рік тому

      @@RalphBacon Hi Ralph
      Exactly. Thanks for the schematics. I prefer CC displays as well. I am planning a similar pcb for educational use, so I find your solution as a lump of gold on my behalf :)
      I really enjoy your videos - they are strait forward, but still at a level where the need for paying attention is neccesary!

  • @bautroiEM
    @bautroiEM 3 місяці тому

    could you design perpetual calendar in STM32 please

    • @RalphBacon
      @RalphBacon  2 місяці тому

      Sorry I don't do custom code, but if you can connect to Wi-Fi you can then get the current date/time from an NTP server.

  • @dnarobo
    @dnarobo Рік тому

    Yes, a shifty video for a doddering old lot like me! But how does one eat an elephant, one byte at a time.

    • @RalphBacon
      @RalphBacon  Рік тому

      Really easy to use, David, you should get one of those modules and have a go. Nothing beats doing it yourself.

  • @mouseminer2978
    @mouseminer2978 8 місяців тому

    Hi, I am just having trouble writing a program to use your library functions. Can you make a video about this topic. Like 7 segment temperature monitor or something else which can utilize full functionality of your library. Thanks

    • @RalphBacon
      @RalphBacon  8 місяців тому +1

      It won't need a video on how to use that tiny library, believe me! Let's see...
      Step 1. Once you have #included the library in your sketch, by including this line at the top of your sketch:
      #include "DualDigit_74HC595.h"
      you next create the object and tell it whether your device is common cathode or common anode. If you get gibberish on the display, chances are that you have specified the wrong type. Don't guess, look it up!
      Example:
      DualDigit_74HC595 dualDigit(DualDigit_74HC595::commonLedType::CATHODE);
      Step 2. Then you need to initialise your 7-seg device by telling it which is your data pin, clock pin and latch pin. You can use pretty much any pins that are OUTPUT pins. On an ESP32 it might look like:
      #define dataPin 25
      #define clkPin 32
      #define latchPin 27
      Example:
      In your setup( ) function then add the line:
      dualDigit.begin(dataPin, clkPin, latchPin);
      Step 3. In your loop( ) or other functions, just display the (integer) value you want to appear.
      Example:
      dualDigit.updateValue(value);
      dualDigit.sendOut();
      Don't forget to include the "sendOut" function call, which does the actual transmitting of the bits, otherwise nothing will appear on the display!
      Is that not super simple? Let me know how you get on!

    • @mouseminer2978
      @mouseminer2978 8 місяців тому +1

      Thank you very much. :)@@RalphBacon

    • @mouseminer2978
      @mouseminer2978 7 місяців тому

      I like to move it, move it
      I like to move it, move it
      I like to move it, move it
      Ya like to (move it!)
      I like to move it, move it
      I like to move it, move it
      I like to move it, move it
      Ya like to (move it!)
      I like to move it, move it
      I like to move it, move it
      I like to move it, move it
      Ya like to (move it!)
      I like to move it, move it
      I like to move it, move it
      I like to move it, move it
      Ya like to (move it!)
      Worked ... God Bless You!

    • @RalphBacon
      @RalphBacon  7 місяців тому

      Excellent! 👍

  • @FloatTheBuizel
    @FloatTheBuizel 6 місяців тому

    I have a 4 digit 7 segment display that i need to wire to the shift register, ive watched multiple videos on top of this one and its just too confusing, i know that i need to get D1-4 to cycle but there aren't enough pins to wire up to. What do i do?

    • @RalphBacon
      @RalphBacon  6 місяців тому +1

      Pretend you have a single digit, 7-segment display. Can you make that work with a Shift Register (spoiler: this video proves it works).
      To have it display values on 4-digits you will have to learn about multiplexing. That is, switching each digit on (and off again) very quickly, during which time you display the required value for _that_ digit. Then the next one and so on. It's how all bedside alarm clocks work.
      So you need 8 GPIO pins for each of the segments in a 7-segment display (plus the decimal point) and 4 more GPIOs for the anode (or cathode) of each of the 7-segment LED devices. I'm pretty sure I showed all this in a previous video #43. It's an older video but should show your what I mean: ua-cam.com/video/6piP5YuK0Lc/v-deo.html

  • @markgreco1962
    @markgreco1962 Рік тому

    I’m going to a wedding, thanks for the chat topic. “Hey Jim I have been messing around with my 74HC595… You?

    • @RalphBacon
      @RalphBacon  Рік тому

      Don't forget to include the words "... yes, that old 8-bit Shift Register!"

  • @jimmybaker7494
    @jimmybaker7494 Рік тому +2

    wonderful video!!
    I really like the way you explain things, would give 2 thumbs up if possible
    keep up the good work

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

      Thank you very much! Two thumbs up you say? Wow!

  • @veedonfleece3694
    @veedonfleece3694 Рік тому

    Well done Ralph, you are so clear on the important "bits" ;-)
    I like to think of the bit movement (order) as water going over a waterfall....
    --->--->
    a
    b
    c
    d
    e
    f
    g
    dp

  • @jstro-hobbytech
    @jstro-hobbytech Рік тому

    Hey RALPHIE!?!?!?!?

    • @RalphBacon
      @RalphBacon  Рік тому

      Hey, Joeyeyeyyeye! (Yeah, I know, doesn't work). But nice to see you here.

    • @jstro-hobbytech
      @jstro-hobbytech Рік тому

      @@RalphBacon haha just wanted to say hi. Lol A hurricane in Nova Scotia took 75 my roof away with it just over a week ago. 8 days without power until yesterday or the day before. Thankfully we evacuated our 5 kitties into a vacant apartment in my basement. Water even got down there in a few rooms that That to be gutted. No water went through our hardwood floor on the main level. A testament to quality of older hardwood from the early 60s. This is probably the only time in my life where I'm happy for extensive insurance. I lost a bunch of gear but that can be replaced. The contractor had a need roof built in 4 days by himself and a very green apprentice. You don't hear of many people getting into that trade anymore. My house was built by a family of carpenters. They say carpenters do the worse work when they're not paid. I watched the previous owner replace the roof a year before we bought the place. I could go on but I'm not looking for pitty. It was good to see your video. Made me smile. Do I have to buy you a coffee every month or is it automatic? I may take you up on that pcb offer as well but I'll pay the shipping. You have tons that would be good material for my local makerspace classes as teaching material. Sorry for rambling

  • @jensschroder8214
    @jensschroder8214 Рік тому

    Is that SPI?

    • @rianderous8761
      @rianderous8761 Рік тому

      you can drive shift registers with the SPI peripheral

    • @igrewold
      @igrewold Рік тому

      Are the arduino regular data pins spi ?

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

      It's not native SPI as such but the data stream can be used as an SPI stream, or the other way around.
      Arduino's regular GPIO pins are not SPI; pins 13,12,11,10 are the "standard" hardware SPI pins although you could "bit-bang" the SPI protocol on any pins (much more slowly though).

  • @hansdegroot652
    @hansdegroot652 Рік тому

    Is that how bitcoins are made?🥳

    • @RalphBacon
      @RalphBacon  Рік тому

      Does anyone know how BitCoins are made?