DS3231(4)
π DS3231(4) π
ok so this is a page from the Kernel Interfaces Manual, and it's all about ds3231 β the Extremely Accurate i2c-integrated RTC/TCXO/Crystal. yes bestie, that's the full government name. πβ¨
πΈ NAME πΈ
ds3231 β Extremely Accurate i2c-integrated RTC/TCXO/Crystal
β¨ SYNOPSIS β¨
device iic
device iicbus
device ds3231
π DESCRIPTION π
ok so the ds3231 is a low-cost, extremely accurate I2C realtime clock (RTC) with an integrated temperature-compensated crystal oscillator (TCXO) and crystal. it's giving "tiny chip, huge responsibility." π
the device has a battery input and it keeps accurate timekeeping even when main power to the device is interrupted. it literally does not care about your power outage. main character energy fr. π
you get at the ds3231 data through the sysctl(8) interface, and it looks like this:
dev.ds3231.0.%desc: Maxim DS3231 RTC
dev.ds3231.0.%driver: ds3231
dev.ds3231.0.%location: addr=0xd0
dev.ds3231.0.%pnpinfo: name=rtc compat=maxim,ds3231
dev.ds3231.0.%parent: iicbus1
dev.ds3231.0.temperature: 23.2C
dev.ds3231.0.temp_conv: 0
dev.ds3231.0.bbsqw: 0
dev.ds3231.0.sqw_freq: 8192
dev.ds3231.0.sqw_mode: interrupt
dev.ds3231.0.32khz_enable: 1
dev.ds3231.%d.temperatureβ the read-only value of the current temperature read by the RTC. you can look, you cannot touch. πdev.ds3231.%d.temp_convβ start a new temperature conversion. when you read it as1, a temperature conversion is in progress. when you read it as0and then set it to1, a temperature conversion is started. the temperature conversion runs automatically on power up and once every 64 seconds afterward. it's on its own lil schedule, no notes. β±οΈdev.ds3231.%d.bbsqwβ if you set it to1anddev.ds3231.%d.sqw_modeis set to square-wave, battery-backed square-wave output is enabled. if you set it to0, the SQW pin will be set to high impendance when the RTC is being powered by battery.dev.ds3231.%d.sqw_freqβ select the frequency of the SQW pin when the square-wave output is enabled ondev.ds3231.%d.sqw_mode. it can be set to1,1024,4096, and8192.dev.ds3231.%d.sqw_modeβ set the operation mode for the SQW pin. it can be set to'interrupt'(default) or'square-wave'. in interrupt mode, the SQW pin is used to generate interrupts for the RTC alarms. in square-wave mode, the SQW pin drives a square-wave ofdev.ds3231.%d.sqw_freqfrequency.dev.ds3231.%d.32khz_enableβ enable the 32kHz output. π΅
please check the ds3231 datasheet for more details. (yes bestie, the datasheet. it's the lore. π)
π¦ device.hints(5) systems π¦
on a device.hints(5) based system, such as MIPS, these values are configurable for ds3231:
hint.ds3231.%d.atβ theiicbus(4)that theds3231is connected to.hint.ds3231.%d.addrβ the 8-bit i2c address ofds3231. the default 8-bit address fords3231is0xd0.
π FDT(4) systems π
on a FDT(4) based system the following properties must be set:
compatibleβ must always be set to"maxim,ds3231". no negotiating. π«regβ the 7-bit i2c address ofds3231. the default 7-bit address fords3231is0x68.
β οΈ heads up bestie:device.hints(5)systems want the 8-bit address (0xd0default), FDT systems want the 7-bit address (0x68default). two different numbers, same chip. don't mix them up, it's not the vibe. π
β SEE ALSO β
fdt(4), iic(4), iicbus(4), sysctl(8)
π HISTORY π
the ds3231 driver first appeared in FreeBSD 11.0. a legend from day one, honestly. π₯
π AUTHORS π
the ds3231 driver and this manual page were written by Luiz Otavio O Souza <loos@FreeBSD.org>. we stan. π«Ά
ok that's the whole page bestie, you're officially a ds3231 girlie now π β¨
this was DS3231(4) from the Debian build, dated February 12, 2016 β yeah it's an old baddie but she still slays. bye ily, go read your datasheet ππ¦π
π¦ where this page comes from
- debian bookworm: freebsd-manpages 12.2-1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- debian trixie: freebsd-manpages 12.2-2 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu jammy: freebsd-manpages 12.2-1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu noble: freebsd-manpages 12.2-1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu questing: freebsd-manpages 12.2-2
- ubuntu resolute: freebsd-manpages 12.2-2build1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu stonking: freebsd-manpages 12.2-2build1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- Copyright (c) 2014 Luiz Otavio O Souza <loos@freebsd.org>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms