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

Поділитися
Вставка
  • Опубліковано 7 сер 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

КОМЕНТАРІ • 50

  • @etce10avijitdey95
    @etce10avijitdey95 10 місяців тому +3

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

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

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

  • @piratsik7691
    @piratsik7691 3 роки тому +6

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

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

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

  • @jaimecosta2966
    @jaimecosta2966 3 роки тому +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  3 роки тому

      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! :-)

  • @jerril42
    @jerril42 3 роки тому +2

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

    • @FriendlyWire
      @FriendlyWire  3 роки тому +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... :)

  • @jmans4928
    @jmans4928 10 місяців тому +1

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

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

      Thank you, glad you like it!

  • @muhammadhayyan9914
    @muhammadhayyan9914 3 роки тому +2

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

    • @FriendlyWire
      @FriendlyWire  3 роки тому +1

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

  • @lorenzo7046
    @lorenzo7046 3 роки тому +1

    Really nice project!

  • @jonathancrawford7106
    @jonathancrawford7106 3 роки тому +1

    Superb! Liked and subscribed! many thanks

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

      Thanks so much, glad you like it! :)

  • @anokhautomation4453
    @anokhautomation4453 2 роки тому +1

    Very nice project 👍

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

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

  • @amrishhirani6096
    @amrishhirani6096 11 місяців тому +1

    Nice video thanks

    • @FriendlyWire
      @FriendlyWire  11 місяців тому

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

  • @konturgestalter
    @konturgestalter 3 роки тому +1

    excellent channel.....pleaaaase more

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

      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 :)

  • @kanishkawijayananda6957
    @kanishkawijayananda6957 2 роки тому +1

    Great job thanks

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

      Thank you, glad you like the video!

  • @user001sg9
    @user001sg9 2 роки тому +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  2 роки тому

      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!

  • @Alex-rv8gw
    @Alex-rv8gw 3 роки тому +2

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

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

      Of course! I have one of these already: ua-cam.com/video/e4Q2dYVedPY/v-deo.html Is that what you have in mind?

  • @ezequielacevedo770
    @ezequielacevedo770 3 роки тому +1

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

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

      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 3 роки тому +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  3 роки тому +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 3 роки тому +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  3 роки тому +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 :)

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

    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  3 роки тому

      Hi Mayukh, thanks for your question :) To use LED display you could use the TLC5916 driver, it is not so hard: ua-cam.com/video/EsUxWO096L0/v-deo.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?

  • @Alex-rv8gw
    @Alex-rv8gw Рік тому +1

    May I know the DS1302 is using what protocol?

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

      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/ :)

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

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

    • @FriendlyWire
      @FriendlyWire  3 роки тому +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: ua-cam.com/video/H2x3aAJ3jr0/v-deo.html

  • @dtadetayo
    @dtadetayo 3 роки тому +1

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

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

      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 :)

  • @bah4dz
    @bah4dz 3 роки тому +1

    GET MORE VIEWERS !

  • @Sarahbuildsstepsequencers
    @Sarahbuildsstepsequencers 2 роки тому +1

    That’s one expensive clock! Nice, though!

    • @FriendlyWire
      @FriendlyWire  2 роки тому +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!

  • @uss-usaf-atlantis
    @uss-usaf-atlantis Рік тому +1

    The clock is wrong it is earth time