The SD card interface uses a 65C22 chip ("VIA") for the I/O between the computer and the SD card, but that chip is also available to the programmer for other purposes. For example keeping track of passing time, something that's not possible on the naked Apple-1. So I wrote a demo ("VIACLOCK") where a timer is set to generate an interrupt at the rate of one second (corresponding to 15996 CPU clock cycles). The routine that responds to the interrupt keeps account of passing seconds and draws a digital clock in BIG fonts on the screen.
See the video: https://www.youtube.com/watch?v=yWrxlwocEXs
The demo is written in C and its source code is available here: https://github.com/.../blob/main/demos/viatimer/viaclock.c
Curiosity: it can recognize the Replica-1, in which case it takes into account the missing RAM refresh cycles.
Note: if you try it on your SD card interface, don't forget to short the "interrupt" jumper on the interface, that's how the INT signal is delivered to the 6502 CPU.
SD card info: https://p-l4b.github.io/sdcard/
Awesome stuff! Keep it coming ;)
Cheers
Alex
Hi Alex,
you can download the final version of VIACLOCK suitable for your Replica-1 (along with other interesting new programs that will be introduced soon...) from the main site above.
The section is the "SD CARD FILES ARCHIVE"...
If you notice big divergences between VIACLOCK and actual time let us know, some fine-tuning may be needed... ;-)
Thank you,
cheers,
Claudio - P-LAB
I have added the VIACLOCK from the archive to my SD card. This version appears to be running accurately now for a while this afternoon, and of course on start it recognized it was on a Replica 1 ;)
Cheers,
Alex