5 ms·
Maybe I missing the point, but why would a chip/driver need its own calendar?
by mrweasel 5y ago
Maybe I missing the point, but why would a chip/driver need its own calendar?
- flafla2 5y agoit was a bug.
- dmitrygr 5y agoSadly some do! The best kind of RTC in hardware is a second counter that the OS can program as it pleases. This design choice offers the least chance to mess it up. Yet, for some reason so many companies invent over-complicated RTC hardware blocks that count days, weeks, time zones, moon phases, and who the hell knows what else. Most of them suffer from myopic design (I've seen chips with y2k issues in hardware) or outright bugs (as seen in TFA). You know what most drivers do to those? They use them as second counters in the simplest way the driver writer could imagine. And yet, more and more chips keep being made with over-complex RTCs
- exikyut 5y agoWhat's a good knee-jerk "use this" recommendation that's inexpensive and likely to exist for a long time? Popularity and/or intuitivity would be nice bonuses, but I'd value functionally correct/sane behavior more highly. (I'm guessing this question belies my extreme ignorance of the field :), and that the RTCs in even eg basic Arduino etc designs are probably already reasonably decent.) Edit: Just noticed the parent sibling comment about RTCs obviating divide/multiply logic. Much clicks into place now.
- marcan_42 5y agoYou don't buy RTCs. You buy a big SoC with a 5000 page datasheet, of which 3-10 pages are the RTC, and you take what they give you. There is no room for the RTC type/design to be part of the part selection process for a SoC, which is why they can be vaguely crappy and nobody cares or can do anything about it. Edit: it's a power management IC for a SoC, not the SoC itself, but you often don't get much choice of those either since SoCs tend to be designed to pair with a specific PMIC. Whether the RTC is in the SoC or PMIC (or both) depends on the design.
- IshKebab 5y agoIt's a common feature of RTCs, just for convenience really.
- londons_explore 5y agoIn super low power hardware, it is easier/cheaper/smaller/more energy efficient to count days/weeks/months in hardware. That way no multiplication or division is necessary. For any hardware with more than a few hundred bytes of RAM there is no need for it.
- Gibbon1 5y agoI'll just chime and and say it'd be a lot feaking easier if hardware engineers provided a register that counts ticks of the 32.768khz clock. The MM:DD:YY HH:MM:SS 1/256 ticks format is unhelpful and annoying 99.9999% of the time. And is a source of bugs.
- marcan_42 5y agoSome RTCs do work with a simple counter like that. This calendar nonsense is basically cargo cult from the early IBM PC days. But hardware engineers rarely talk to software engineers, and these IP blocks were designed decades ago and people don't want to touch them...
- nousermane 5y ago...and IBM PC RTC chip (Motorola MC146818) cargo-culted that format from HP98035 clock module. That latter was literally a wrist-watch chip (TI AC5954N), surrounded by logic/microcontroller that programmatically "pressed" buttons and "read back" display digits. CuriousMark did a video about it: https://www.youtube.com/watch?v=pr6HTiWrMmk https://www.youtube.com/watch?v=pr6HTiWrMmk
- pantalaimon 5y agoSometimes you can get both. The full RTC is useful if want to do alarms at the first day of a month or so, but yea - those are niece cases.
- deleted 5y ago[deleted]
- yjftsjthsd-h 5y ago