Octocontrabass wrote:
What are you expecting to see?
I am expecting the update bit to change. Although I am only reading time on PIT interrupts.
Octocontrabass wrote:
When the lowest four bits of register A are set to 0b0000, the RTC periodic IRQ is disabled. You need to write a different value to those bits to enable the IRQ.
I am initialising the RTC in the way the wiki describes:
Code:
port0x70.write(0x8Au8);
port0x71.write(0x20u8);
port0x70.write(0x8Bu8);
let prev = port0x71.read();
port0x70.write(0x8Bu8);
port0x71.write(prev | 0x40);
This seems in fact to clear lower bits of register A. I'm unsure why the wiki claims that this will result in periodic interrupt being enabled?
Octocontrabass wrote:
You need to interpret the values differently according to register B. For example, if register B says BCD 12-hour time, then 0x84 in the hours register means 4 PM.
That could explain what I'm seeing, but I am not reading hours, only minutes and seconds:
Code:
port0x70.write(0x8Au8);
let update: u8 = port0x71.read();
if (update & (1 << 6)) == 0 {
let time = unsafe {
port0x70.write(0x80);
let sec = port0x71.read();
port0x70.write(0x82);
let min = port0x71.read();
format!("{:02}:{:02}", min, sec)
};
}