You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The KERNAL call clock_set_date_time (Which in is the file rtc.s and called rtc_set_date_time) has a bug in the section that sets the day of week. After it sets the battery enable bit with ora $08, it calls i2c_write_byte_as_bcd. In doing so, depending on which day of week you were trying to set, it can set the wrong day of week, and if the bin_to_bcd conversion (In the same file.) resets the battery enable bit in the BCD conversion, it will disable the battery.
Changing the i2c_write_byte_as_bcd call to i2c_write_byte fixes it. It was never needed to do the BCD conversion as the legal data is never over 7, attempting to do the bcd conversion IF the battery enable bit PLUS the day of week results in a BCD value over 9 it will create 2 BCD digits, with the low order one wrong and the battery enable bit not set.
The text was updated successfully, but these errors were encountered:
https://cx16forum.com/forum/viewtopic.php?p=30971
The KERNAL call clock_set_date_time (Which in is the file rtc.s and called rtc_set_date_time) has a bug in the section that sets the day of week. After it sets the battery enable bit with ora $08, it calls i2c_write_byte_as_bcd. In doing so, depending on which day of week you were trying to set, it can set the wrong day of week, and if the bin_to_bcd conversion (In the same file.) resets the battery enable bit in the BCD conversion, it will disable the battery.
Changing the i2c_write_byte_as_bcd call to i2c_write_byte fixes it. It was never needed to do the BCD conversion as the legal data is never over 7, attempting to do the bcd conversion IF the battery enable bit PLUS the day of week results in a BCD value over 9 it will create 2 BCD digits, with the low order one wrong and the battery enable bit not set.
The text was updated successfully, but these errors were encountered: