Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add clock support to MOS #24

Closed
breakintoprogram opened this issue Mar 8, 2023 · 2 comments
Closed

Add clock support to MOS #24

breakintoprogram opened this issue Mar 8, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@breakintoprogram
Copy link
Owner

breakintoprogram commented Mar 8, 2023

Acceptance criteria:

  • The ability to set the time with a star command (maybe *TIME, or split into *DATE and *TIME)
  • The ability to read the time with a star command (maybe the same command, no parameters)
  • Time can be set and read using MOS api calls
  • Time can be used in FatFS as a timestamp

Nice to have:

  • Check whether the EZ80F92 has a RTC (yes, but not fully plumbed in - see comments below)
  • Check whether the ESP32 has a RTC (yes)
@breakintoprogram breakintoprogram added the enhancement New feature or request label Mar 8, 2023
@breakintoprogram breakintoprogram changed the title Add clock support to MOs Add clock support to MOS Mar 10, 2023
@breakintoprogram
Copy link
Owner Author

Tested with Agon Light Issue 1 and it looks like the RTC requires an external 32768hz crystal connected to its oscillator. Investigating using a timer to provide a software option. Future proof to make it easy to plug in a RTC module and / or use the eZ80 built in one (for future revisions).

@breakintoprogram
Copy link
Owner Author

breakintoprogram commented Mar 16, 2023

Using ESP32 RTC is working out okay:

  • VDU 23, 0, 7. 0 to request the time
  • VDU 23, 0, 7, 1, Y - 1980, M, D, H, M, S to set the time
  • This is sent back as a packet from the ESP32 to the vdp protocol handler

Changes:

  • Added *TIME command
  • Added mos_getrtc
  • Added mos_setrtc

NB:

  • Time does not survive reset
  • Clock doesn't handle dates before 1970

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Released
Development

No branches or pull requests

1 participant