I'm starting this topic about the 6522, which as I'm a hardware lamer, always seems complicated for me to understand even with its data sheet.
Ok, so: I'm reading the IFR byte to check if there was a signal transition on CB1.
The question is: does reading it automatically reset the flag, or do I have to do a specific operation to reset it? (seem like LDA#0300 could reset it, but I'm not sure it's mandatory?)
6522 - VIA
Re: 6522 - VIA
The VIA has always been my archenemy on the Oric, most of my VIA related code is either copied from the Atmos rom, or was from Jonathan.
Re: 6522 - VIA
It's mandatory.
http://unusedino.de/ec64/technical/misc ... a6522.html
Code: Select all
REG 13 -- INTERRUPT FLAG REGISTER
+-+-+-+-+-+-+-+-+
|7|6|5|4|3|2|1|0| SET BY CLEARED BY
+++++++++++++++++ +-----------------------+------------------------------+
| | | | | | | +--CA2+ CA2 ACTIVE EDGE | READ OR WRITE REG 1 (ORA)° |
| | | | | | | +-----------------------+------------------------------+
| | | | | | +--CA1--+ CA1 ACTIVE EDGE | READ OR WRITE REG 1 (ORA) |
| | | | | | +-----------------------+------------------------------+
| | | | | +SHIFT REG+ COMPLETE 8 SHIFTS | READ OR WRITE SHIFT REG |
| | | | | +-----------------------+------------------------------+
| | | | +-CB2-------+ CB2 ACTIVE EDGE | READ OR WRITE ORB° |
| | | | +-----------------------+------------------------------+
| | | +-CB1---------+ CB1 ACTIVE EDGE | READ OR WRITE ORB |
| | | +-----------------------+------------------------------+
| | +-TIMER 2-------+ TIME-OUT OF T2 | READ T2 LOW OR WRITE T2 HIGH |
| | +-----------------------+------------------------------+
| +-TIMER 1---------+ TIME-OUT OF T1 | READ T1 LOW OR WRITE T1 HIGH |
| +-----------------------+------------------------------+
+-IRQ---------------+ ANY ENABLED INTERRUPT | CLEAR ALL INTERRUPTS |
+-----------------------+------------------------------+
Re: 6522 - VIA
Thanks a lot! It was written clearly but I never found it in the doc, my bad :-/
Now thanks to tests I found that resetting timer 2 low-byte is achieved by putting FF in the high-byte of the counter.
Oh well, newbie ranting I suppose - that thing seems magical but it probably takes quite a while to master
Now thanks to tests I found that resetting timer 2 low-byte is achieved by putting FF in the high-byte of the counter.
Oh well, newbie ranting I suppose - that thing seems magical but it probably takes quite a while to master
-
- Squad Leader
- Posts: 774
- Joined: Sat May 21, 2011 7:21 pm
- Location: Between UK and France
- Contact:
Re: 6522 - VIA
The 6522 is clearly not a simple beast to handle, don't worry about not understanding all of it's possibilities.Symoon wrote:Thanks a lot! It was written clearly but I never found it in the doc, my bad :-/
Now thanks to tests I found that resetting timer 2 low-byte is achieved by putting FF in the high-byte of the counter.
Oh well, newbie ranting I suppose - that thing seems magical but it probably takes quite a while to master
My Projects: Replic'Oric Project - StratoCumulus Project