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

  Рет қаралды 19,781

FriendlyWire

4 жыл бұрын

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/ds1302
Thanks for tuning in, and let me know in the comments if you have any questions!
Website: www.friendlywire.com
Twitter: FriendlyWire
Reddit: www.reddit.com/r/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 Жыл бұрын
Excellent work I really like how clean you make the circuit its really great
@FriendlyWire
@FriendlyWire Жыл бұрын
Thank you for your kind words, and I am glad you liked the video! :)
@piratsik7691
@piratsik7691 4 жыл бұрын
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 жыл бұрын
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! :-)
@jmans4928
@jmans4928 Жыл бұрын
Excellent work, very well documented and a lot of attention to detail. Thanks for the video.
@FriendlyWire
@FriendlyWire Жыл бұрын
Thank you, glad you like it!
@jerril42
@jerril42 4 жыл бұрын
Thank you Jens. Very interesting, the access protocol was simpler to understand than I thought it would. Take care.
@FriendlyWire
@FriendlyWire 4 жыл бұрын
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... :)
@muhammadhayyan9914
@muhammadhayyan9914 4 жыл бұрын
You are a great motivation for me 🙂. Thank you for your work
@FriendlyWire
@FriendlyWire 4 жыл бұрын
Thank you, Muhammad, that means a lot! :-)
@user001sg9
@user001sg9 2 жыл бұрын
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!
@lorenzo7046
@lorenzo7046 4 жыл бұрын
Really nice project!
@FriendlyWire
@FriendlyWire 4 жыл бұрын
Thanks so much, Lorenzo :)
@jonathancrawford7106
@jonathancrawford7106 3 жыл бұрын
Superb! Liked and subscribed! many thanks
@FriendlyWire
@FriendlyWire 3 жыл бұрын
Thanks so much, glad you like it! :)
@anokhautomation4453
@anokhautomation4453 2 жыл бұрын
Very nice project 👍
@FriendlyWire
@FriendlyWire 2 жыл бұрын
Thank you for your kind words, I am glad you like it! :)
@konturgestalter
@konturgestalter 4 жыл бұрын
excellent channel.....pleaaaase more
@FriendlyWire
@FriendlyWire 4 жыл бұрын
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 :)
@amrishhirani6096
@amrishhirani6096 Жыл бұрын
Nice video thanks
@FriendlyWire
@FriendlyWire Жыл бұрын
Thank you, Amrish, I am glad you like it! :)
@kanishkawijayananda6957
@kanishkawijayananda6957 2 жыл бұрын
Great job thanks
@FriendlyWire
@FriendlyWire 2 жыл бұрын
Thank you, glad you like the video!
@ezequielacevedo770
@ezequielacevedo770 3 жыл бұрын
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 жыл бұрын
@@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 жыл бұрын
@@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 жыл бұрын
@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 жыл бұрын
@@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 4 жыл бұрын
hi sir can you do a tutorial video about PIC microcontroller with practical and programming for beginner ???
@FriendlyWire
@FriendlyWire 4 жыл бұрын
Of course! I have one of these already: kzbin.info/www/bejne/m2W0Y5ePi8qXhrs Is that what you have in mind?
@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 жыл бұрын
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: kzbin.info/www/bejne/fmPbZJR3f5idqJI
@Alex-rv8gw
@Alex-rv8gw Жыл бұрын
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/ :)
@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: kzbin.info/www/bejne/e6S4qYqFZZ5pgpI 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?
@dtadetayo
@dtadetayo 3 жыл бұрын
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 :)
@Sarahbuildsstepsequencers
@Sarahbuildsstepsequencers 3 жыл бұрын
That’s one expensive clock! Nice, though!
@FriendlyWire
@FriendlyWire 3 жыл бұрын
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 4 жыл бұрын
GET MORE VIEWERS !
@FriendlyWire
@FriendlyWire 4 жыл бұрын
Ha, thanks I guess? :-)
@uss-usaf-atlantis
@uss-usaf-atlantis Жыл бұрын
The clock is wrong it is earth time
@FriendlyWire
@FriendlyWire Жыл бұрын
Ha, what do you mean? :)
РОДИТЕЛИ НА ШКОЛЬНОМ ПРАЗДНИКЕ
01:00
SIDELNIKOVVV
Рет қаралды 3,8 МЛН
Smart Sigma Kid #funny #sigma
00:14
CRAZY GREAPA
Рет қаралды 4,6 МЛН
РОДИТЕЛИ НА ШКОЛЬНОМ ПРАЗДНИКЕ
01:00
SIDELNIKOVVV
Рет қаралды 3,8 МЛН