DS1302 real-time clock tutorial: the clock that doesn't forget the time!

Sdílet
Vložit
  • čas přidán 24. 07. 2024
  • The DS1302 real-time clock keeps the time, even when the main power of the circuit is turned off. And today we will learn how to build a clock with it and the PIC16F1455 microcontroller!
    More details and an up-to-date list of all components: www.friendlywire.com/tutorials...
    Thanks for tuning in, and let me know in the comments if you have any questions!
    Website: www.friendlywire.com
    Twitter: / friendlywire
    Reddit: / friendlywire
    Facebook: / friendlywire
    Instagram: / friendlywire
    Timestamps:
    00:00 Introduction
    00:44 What you need
    01:42 Schematic
    03:28 How does the DS1302 work?
    07:21 Programming the PIC16F1455
    08:24 Flashing the PIC16F1455
    09:42 Preparing the 7-segment LEDs
    10:10 Building the circuit on the breadboard
    14:49 Possible improvements

Komentáře • 50

  • @etce10avijitdey95
    @etce10avijitdey95 Před 9 měsíci +3

    Excellent work
    I really like how clean you make the circuit its really great

    • @FriendlyWire
      @FriendlyWire  Před 9 měsíci

      Thank you for your kind words, and I am glad you liked the video! :)

  • @muhammadhayyan9914
    @muhammadhayyan9914 Před 3 lety +2

    You are a great motivation for me 🙂. Thank you for your work

    • @FriendlyWire
      @FriendlyWire  Před 3 lety +1

      Thank you, Muhammad, that means a lot! :-)

  • @jmans4928
    @jmans4928 Před 10 měsíci +1

    Excellent work, very well documented and a lot of attention to detail. Thanks for the video.

  • @piratsik7691
    @piratsik7691 Před 3 lety +6

    Your channel is great, the content is helpful and enjoyable. I hope you get all the viewers!

    • @FriendlyWire
      @FriendlyWire  Před 3 lety

      Thank you so much, that's very kind of you. Have a great day!

  • @jerril42
    @jerril42 Před 3 lety +2

    Thank you Jens. Very interesting, the access protocol was simpler to understand than I thought it would. Take care.

    • @FriendlyWire
      @FriendlyWire  Před 3 lety +1

      Thanks, I am glad you like it! Yeah, the protocol looks confusing at first but it's actually not that bad. What had me confused was the rising-edge/falling-edge stuff... :)

  • @jaimecosta2966
    @jaimecosta2966 Před 3 lety +2

    Hi when I was young electronics was my hobby.. And since I decided to move to a different country other hobby came along... Now that I am mutch older I will starting electric hobby again.. I find your chanel amazing... Thank you for charing your information and keep up the good work.. Apologies for any spelling mistake it has been a while since I written English.. Wish you well

    • @FriendlyWire
      @FriendlyWire  Před 3 lety

      Hello Jaime, thank you so much for your kind words. I am so happy to hear your story, and even more excited that you find my videos useful. Keep uo the great work, and best wishes from the US! :-)

  • @lorenzo7046
    @lorenzo7046 Před 3 lety +1

    Really nice project!

  • @jonathancrawford7106
    @jonathancrawford7106 Před 3 lety +1

    Superb! Liked and subscribed! many thanks

  • @anokhautomation4453
    @anokhautomation4453 Před 2 lety +1

    Very nice project 👍

    • @FriendlyWire
      @FriendlyWire  Před 2 lety

      Thank you for your kind words, I am glad you like it! :)

  • @amrishhirani6096
    @amrishhirani6096 Před 11 měsíci +1

    Nice video thanks

    • @FriendlyWire
      @FriendlyWire  Před 11 měsíci

      Thank you, Amrish, I am glad you like it! :)

  • @kanishkawijayananda6957
    @kanishkawijayananda6957 Před 2 lety +1

    Great job thanks

  • @konturgestalter
    @konturgestalter Před 3 lety +1

    excellent channel.....pleaaaase more

    • @FriendlyWire
      @FriendlyWire  Před 3 lety

      Thanks! :-) I have no plans of stopping! Do you have anything you want to see when it comes to PIC microcontrollers? Always looking for new inspirations :)

  • @user001sg9
    @user001sg9 Před 2 lety +1

    Very nice video, thanks. One unclear issue for people who are not used to RTCs is - how to set the clock time initially?

    • @FriendlyWire
      @FriendlyWire  Před 2 lety

      Thank you! Yeah, you make a good point! I explain the microcontroller source code in a lot of detail in the companion article: friendlywire.com/tutorials/ds1302/#ch3 There you can find these explanations, but you are right, it should have been mentioned in the video, too. I hope it's not too confusing. Thanks again, and have a great day!

  • @ezequielacevedo770
    @ezequielacevedo770 Před 3 lety +1

    great video you have win a new loyal subscriber my friend! greetings!

    • @FriendlyWire
      @FriendlyWire  Před 3 lety

      Ezequiel, thank you so much for your kind words, I am so happy you liked the video. Do you have any suggestions for future topics? Anything PIC-related you want to see? I am always looking for new ideas :)

    • @ezequielacevedo770
      @ezequielacevedo770 Před 3 lety +1

      @@FriendlyWire you're welcome!! certaintly i am more an analog dude like 'a vacuum-tube-nixie head' so ...uControllers give me some allergies ...i scratch arduino and C but totally noob for PIC based projects (they're expensive in my country). Personally i'd rather enjoy these tipe of videos with explanations close to datasheets than simplist explanations. It will be great if you can make some freq counter or multiplexed 7 segment display. One of mine delayed projects is an 4026 controlled VFD display freq counter. Anyway whatever project with vfo's , LEDs or cd40xx i jump into it!! keep on rocking!!

    • @FriendlyWire
      @FriendlyWire  Před 3 lety +1

      @@ezequielacevedo770 Thank you so much! Can I ask where you are located? I had no idea PIC controllers are expensive, I actually use them because they are so cheap! So this would be very helpful information :)
      I have more videos like this one planned, glad you like the style! Maybe I will do multiplexing in the future, it's a very useful tool to have.
      Thanks again for your kind words, and have a fantastic weekend!

    • @ezequielacevedo770
      @ezequielacevedo770 Před 3 lety +1

      @FriendlyWire I am from Argentine, a small city, very far from the capital. It's the price's chain indeed. On a retailer The pickit + pic16 can cost around the equivalent of +25-35 U$s meanwhile a chinese clone of uno or stm32 cost a quarter or less!! offer & demand rules...it is still affordable but nowadays that 40xx are still available and no longer so popular, you can buy these for fewer money...yes i am a cheap bastard! always looking for bargains ha ha but anyways sooner or later i'll buy PIC, your webpage is really well documented for learning how to code so it worths a lot! really helpfull and quality resources. thumbs up!

    • @FriendlyWire
      @FriendlyWire  Před 3 lety +1

      @@ezequielacevedo770 Thank you for explaining that to me, Ezequiel, this is a new perspective I did not think about before. Hmm... I always used to think that buying the PICkit3 is worth it after flashing a few microcontrollers (total cost per project will be lower the more you flash). Thank you also for your kind words, and best wishes to Argentine from the US :)

  • @Alex-rv8gw
    @Alex-rv8gw Před 3 lety +2

    hi sir can you do a tutorial video about PIC microcontroller with practical and programming for beginner ???

    • @FriendlyWire
      @FriendlyWire  Před 3 lety

      Of course! I have one of these already: czcams.com/video/e4Q2dYVedPY/video.html Is that what you have in mind?

  • @mayukhbanerjee8877
    @mayukhbanerjee8877 Před 3 lety

    Hi Friendly wire. for my upcoming college project I have decided to built a alcohol sensor and display it on 3 seven segment display however the 8051 development board which I have brought already has a lcd.now I feel lazy and don't want to use the seven segment display can y pls tell what changes should I make

    • @FriendlyWire
      @FriendlyWire  Před 3 lety

      Hi Mayukh, thanks for your question :) To use LED display you could use the TLC5916 driver, it is not so hard: czcams.com/video/EsUxWO096L0/video.html Let me know if it helps! :) But other than that I am not so sure. Do you want to learn how to drive an LCD?

  • @eastgoalstv7009
    @eastgoalstv7009 Před 3 lety

    Bro can you help me please, I couldn't get PIC16F1455 and TLC5916 What else should I use instead??

    • @FriendlyWire
      @FriendlyWire  Před 3 lety +1

      You can use basically any PIC microcontroller for this, in this project we don't use anything that is specific to the PIC16F1455. For the drivers you can use the CD4094 shift registers, if you have to, but they are not so ideal. For smaller displays they work OK, see this video here: czcams.com/video/H2x3aAJ3jr0/video.html

  • @dtadetayo
    @dtadetayo Před 3 lety +1

    Will the time be correct if the power is off after powering it On back?

    • @FriendlyWire
      @FriendlyWire  Před 3 lety

      Yeah exactly! The clock keeps ticking as long as the small battery is connected. So even if you disconnect the main power and the LEDs go out, the time will be correct when you turn it back on :)

  • @Alex-rv8gw
    @Alex-rv8gw Před rokem +1

    May I know the DS1302 is using what protocol?

    • @FriendlyWire
      @FriendlyWire  Před rokem

      I don't think it has a name, it is just a serial interface. The details are explained in the video, and there are more details in the companion article at www.friendlywire.com/tutorials/ds1302/ :)

  • @Sarahbuildsstepsequencers

    That’s one expensive clock! Nice, though!

    • @FriendlyWire
      @FriendlyWire  Před 2 lety +1

      Thank you! I guess that's true, it's probably cheaper to buy one from somewhere else :) But I like the idea of constructing it on a breadboard because then you can disassemble it and build something else with the components!

  • @bah4dz
    @bah4dz Před 3 lety +1

    GET MORE VIEWERS !

  • @uss-usaf-atlantis
    @uss-usaf-atlantis Před rokem +1

    The clock is wrong it is earth time