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 ability to synchronizing MCHPRS simulation with a real-time clock #98

Open
benburk opened this issue Dec 22, 2022 · 0 comments
Open

Comments

@benburk
Copy link

benburk commented Dec 22, 2022

Currently, it's difficult to synchronize a program running on a CPU with real-time. For example, running a game at 30fps or applying physics forces at certain intervals. Current solutions involve counting CPU cycles and setting the TPS accordingly, but different code paths or cache misses can make this difficult if not impossible.

As the interest in running more sophisticated programs on MCHPRS grows, I think it would be worthwhile to brainstorm potential solutions.

I propose introducing a clock generator block that pulses at 60hz. This signal could be divided into 30hz and 15hz with clock dividers (i.e. T-flip-flops). This circuit could be connected to a rising-edge monostable. When a CPU wants to synchronize itself, it could stall until it receives a pulse from this circuit.

I'm curious to hear people's thoughts and attempting an implementation if the community is interested.

- Embi

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant