Login
Back to forumSee the full topicGo to last reply

Posted By

GeorgeHug
on 2021-11-30
17:20:52
 Re: Could someone run test software for me?

Thanks very much. 512 is what I was expecting from program 1, but I was hoping program 2 would be 256. The problem is that when the IRQ service routine writes a byte to the ACIA to transmit, the ACIA immediately triggers another interrupt. That's because the byte is immediately transferred to the shift register, which frees up the transmit data register again - so it interrupts again in case there's more to transmit.

So when the current routine is finished, the IRQ line has gone back low again, so the processor immediately goes back into another interation of the IRQ servicing routine. That second one acccomplishes nothing except to release the IRQ line because the processor has no opportunity to queue up another byte. (This is why in the real world coders use multi-byte transmit buffers.)

Program 2 turns off transmit interrupts before sending out the byte to the ACIA, and enables them again afterwards. I was hoping that if the interrupt was disabled at the time it should have been triggered, it would not be triggered at all. But apparently that's not how it works. I wonder though why it seems to work even occasionally as it appears to do.

Anyway, thanks very much for running the programs.



Back to top


Copyright © Plus/4 World Team, 2001-2024. Support Plus/4 World on Patreon