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

tu-uart emulation does not match documentation #62

Open
EtchedPixels opened this issue Dec 9, 2018 · 3 comments
Open

tu-uart emulation does not match documentation #62

EtchedPixels opened this issue Dec 9, 2018 · 3 comments

Comments

@EtchedPixels
Copy link

The manual states of 03 (interrupt register)

'After the register is read the corresponding bit in the interrupt request register is reset'

However the code as implemented only seems to update this on a 1 ms timer.

In addition the uart0_int value when computed considers the int_mask value at the point of computation, but does not appear to recompute the mask when the int mask changes only at the next ms timer.

It looks to me like the register state computation (as opposed to the timer expiries) is happening in entirely the wrong time domain, so that code which polls the register until it hits FF handling events spins for a millisecond incorrectly.

@udo-munk
Copy link
Owner

If I remember right the problem was that I don't know anymore what caused the interrupt, when the register is read. So I din't reset the bit then, but just computer the whole state new on the next run. This is not too bad, because at 9600 baud there are no interesting status changes in < 1ms.
This not not accurate of course and could be improved, need to have a look at it.

@EtchedPixels
Copy link
Author

I hit other problems with the emulation such as repeat reads not allowing you to see each source, and the masking being broken but for now I hacked my code t use IM2 reads the way the Cromemco official code seems to.

@udo-munk
Copy link
Owner

Cromemco used vectored interrupts and the implementation is tested against the Cromemco original code.

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

2 participants