Learn everything about the DS3231-SN Real Time Clock | Use without Arduino Library

preview_player
Показать описание
The DS3231-SN is a very useful and precise Real Time Clock (RTC).
It comes in handy for all your projects in need of accurate timekeeping.

Learn how to use the DS3231 on your Arduino (or any other microcontroller) without the use of extra RTC libraries! This way you can customize as you like and save precious memory on your microcontroller to do other tasks!
A visual representation of the registers with LED's makes it easy to understand how the IC works and how to use it properly.
We look at how to use Bitwise OR operation, Two’s compliment, and much more.
I hope you enjoy the video!

00:00 - Intro DS3231
02:13 - Temperature-controlled RTC (TCXO)
02:56 - General info
03:46 - What to buy?
04:07 - SN vs M version
05:07 - Rechargeable battery on breakout board
06:05 - Pinout on the DS3231SN
09:00 - Connect to Arduino
09:35 - Coding
10:15 - Time/Date registers setup
12:55 - Binary Coded Decimal (BCD)
15:54 - Bitwise OR in Hours register
19:45 - ALARM
23:01 - Extra Settings
25:09 - Two's Compliment
29:05 - Extra info/tips

Рекомендации по теме
Комментарии
Автор

Every now and then while wandering through the wasteland called YouTube you come across a real gem.. This video is Gold!

TheScissorunner
Автор

Excellent. This will help a lot of people out.
Slight correction to your video 25:00 the Aging register is a signed 8 bit number.. you can set from decimal negative 128 [80h] to positive 127 [7Fh] . I have calibrated over 120 of these modules and found adjusting 1 number was much closer to 0.06PPM change (not the 0.1PPM the datasheet mentions.)

ericwright
Автор

You put a lot of work into this video. Thank you!

GregCoonrod
Автор

Wow, your brain is wired as a clock, I was totally mesmerised listening to you describe how it all works 5 star, thank you so much Bob in the UK

MrBobWareham
Автор

I'm truly amazed at how you manage to pack so much information into this video. I spent a long time searching through the datasheet for some of these details before I came across your channel. You're awesome!

ritschratsch
Автор

Incredible video. So information dense yet easy to understand. I’m trying to make an automated door that will open and close at specific times of the day, set by the user. I’m new to arduino, but I’m having a hard time moving from “hello world” and blinking LEDs to using libraries to control external components over I2C. I bought a ds3231 but man the learning curve is steep. Your video is helping me break through the fog of confusion. Thank you for all the effort you put into making this.

calebcourteau
Автор

Super extra video. I would like to ask for a video of the readings

starasowa
Автор

There are also the LIR2032 or (a bit harder to find) the CR2032H (high output), that are rechargeable.

TruthWielders
Автор

Great interesting video, well done, understandable 😊
You write at 11:30 inside the video that you want to give an example of setting DS3231 to: 11:23:47 PM October 2023 as well as alarm-1: 11:50:00 pm 28th each month, but without github the code, can I get it from you, you are really good at packaging the code to a minimum, thanks

prebengranberg
Автор

thx for the hint to desolder the chargeresistor

MrsYT
Автор

Great video, though please check the BCD conversion at 15:14, it looks like the operations were 'mixed up'

pdipatria
Автор

I like those. Have a couple of Pico's running MMBasic with a DS3231 attached. The temperature "quarters" in register 18 worries me. The integer number in register 17 gives the full number in Celsius directly. Typing RTC getreg 17, a and print a will give 19 (or whatever) degrees and RTC getreg 18, a and print a gives 64 which could mean 0.75 and it's weird to test, but I got to see another number. If it's 64, 32, 16 then it's still weird.

Edit: You answered it to be bit 6 and 7 in the end of the video. The code you showed bit moved (>>) down to 0/1/2/3 as a reading and x 0.25, so I figure it out.

elektronkim
Автор

you saved one person from dying due to library fever😁

RiteshKumar-uyfx
Автор

Nice, i didnt think there was this much under those clothes, thanks for exposing.

mikejones-vdfg