Quantcast
Channel: stardot.org.uk
Viewing all articles
Browse latest Browse all 2345

32-bit acorn hardware • Puzzling over RTC year logic with PCF8583? RISC OS behavior?

$
0
0
TLDR, is there any known issues with RISC OS machines and the year maintained by the clock (assuming good battery) if the machine has been off for more than 5 years? :shock:

Reason for the ask is as follows. I understand that the PCF8583 chip is used in the 32-bit hardware acorn computers for RTC, and as it happens in Dave Hitchens AP6 expansion for the Electron Plus 1. :D

I am finishing up some 6502 code to support reading/writing date/time to enable this for AP6 users. The chip is great in that it has some free storage for settings. But frustrating that it only has 4 year clock :roll: After researching this I found this logic, https://github.com/xoseperez/pcf8583/bl ... 3.cpp#L125, specifically the getYear routine using some of the additional storage and logic to compensate for this situation. #-o

From what I can understand from the getYear code there appears to be a passage of time limitation with the approach (assuming I am understanding the code correctly that is). So.... I wanted to check with folks here to see if they have seen or know of odd effects regarding the year with RISC OS computers using this chip. Because if not, I am wondering what RISC OS code does in this regard? [-o<

So here is what (i think) is going on...
  • When the year is set an offset is calculated and stored in the user storage, later used to calculate full year
  • The last year set value is also stored in the user storage, this is used to check if offset needs to be updated
  • The checking is only done on read for the RTC, aka execution of this logic
  • From what I can see this depends on the computer being switch on at least before 5 years have passed
  • If the computer is switched on within 5 years the code compares current year with last stored
  • If the last stored year is greater than the current device year (4 year one) the offset gets 4 years added to it
  • If the computer is not switched on within 5 years, the offset will still get updated but will fall short
Am I missing something?

Statistics: Posted by !FOZ! — Mon Jul 01, 2024 4:55 am



Viewing all articles
Browse latest Browse all 2345

Trending Articles