Closed Candid-Moe closed 3 weeks ago
Hello @Candid-Moe !
What you did is correct, I suspect the RTC is stopped in your case. When you put in a CR battery, the RTC won't start automatically, it needs to be setup.
The bit 7
of its register 00
needs to be cleared. This needs to be done every time the RTC battery runs out. The getdate
syscall doesn't show this register 0's bit 7.
You have two solutions here, from easiest to hardest:
Test hardware
option in the bootloader, which will clear this bit in the RTC automatically. (It will show Disabled (no battery?)
but will enable it right after)date
command on Zeal 8-bit OS command prompt. The "Test Hardware" fixed the problem. Now the clock is ticking but I can't change the date&time. Working on it.
I wrote this little Forth word that execute a SYSCALL 22 to get current time and date.
The word works fine in emulation:
But in the real Zeal 8-bit board, it doesn't work:
The board has a CR2032 battery installed for the RTC (is that necessary) . The voltage is 2.97 v
The boot screen doesn't show an active timer:
How to test
You can test in emulation using https://github.com/Candid-Moe/Zorth/blob/main/prod/zorth.bin
For test in real hardware, use https://github.com/Candid-Moe/Zorth/blob/main/prod/os_with_romdisk.img