VIA CA2 interrupt
Posted: Wed Jun 28, 2017 9:36 am
I am hoping someone can clarify the state of the CA2 on VIA#1 ($9110) on a real VIC.
I'm working on validating the operation of the VIA's in my own FPGA based VIC20 and for this I am using the tests from VICE, however some of the tests for the shift registers give a state of the VIA Interrupt Flag Register that I don't understand.
For the VICE Shift Register tests via_sr - viasrXXifr.prg, all of these have test results that indicate bit 0 of the IFR is set in the 8th cycle of the test, bit 0 being CA2 active edge and I can't see what would cause an active edge to be generated on CA2 !! CA2 for VIA#1 is the cassette motor output.
The VICE SR tests configure all VIA registers to zero, then set the shift register to a specific mode and monitor either the shift register register OR the IFR. I get good results with my VHDL when monitoring the shift register, but I don't ever get bit 0 set when monitoring IFR and I can't see why it should be set either.
Setting all VIA registers to zero will actually configure CA2 as "input negative edge" and I'm wondering if the results given in the VICE tests are due to some interaction with the analog cassette motor drive circuit when CA2 is configured as an input (normally it would be an output).
I have tried running the tests on my VIC20, but I get different results to those expected and different to my VHDL. On my VIC it seems bit 0 of the IFR is generally (always?) stuck ON and I'm beginning to think I may have a partially faulty VIA, but without another VIC on which to test I can't confirm that.
If anyone is able to explain the behaviour and / or run the VICE shift register tests on another VIC to confirm the expected results that would be most appreciated.
Kevin
I'm working on validating the operation of the VIA's in my own FPGA based VIC20 and for this I am using the tests from VICE, however some of the tests for the shift registers give a state of the VIA Interrupt Flag Register that I don't understand.
For the VICE Shift Register tests via_sr - viasrXXifr.prg, all of these have test results that indicate bit 0 of the IFR is set in the 8th cycle of the test, bit 0 being CA2 active edge and I can't see what would cause an active edge to be generated on CA2 !! CA2 for VIA#1 is the cassette motor output.
The VICE SR tests configure all VIA registers to zero, then set the shift register to a specific mode and monitor either the shift register register OR the IFR. I get good results with my VHDL when monitoring the shift register, but I don't ever get bit 0 set when monitoring IFR and I can't see why it should be set either.
Setting all VIA registers to zero will actually configure CA2 as "input negative edge" and I'm wondering if the results given in the VICE tests are due to some interaction with the analog cassette motor drive circuit when CA2 is configured as an input (normally it would be an output).
I have tried running the tests on my VIC20, but I get different results to those expected and different to my VHDL. On my VIC it seems bit 0 of the IFR is generally (always?) stuck ON and I'm beginning to think I may have a partially faulty VIA, but without another VIC on which to test I can't confirm that.
If anyone is able to explain the behaviour and / or run the VICE shift register tests on another VIC to confirm the expected results that would be most appreciated.
Kevin