6522 - VIA

If you want to ask questions about how the machine works, peculiar details, the differences between models, here it is !
How to program the oric hardware (VIA, FDC, ...) is also welcome.
User avatar
Symoon
Archivist
Posts: 2301
Joined: Sat Jan 14, 2006 12:44 am
Location: Paris, France

6522 - VIA

Post by Symoon »

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?)
User avatar
Dbug
Site Admin
Posts: 4437
Joined: Fri Jan 06, 2006 10:00 pm
Location: Oslo, Norway
Contact:

Re: 6522 - VIA

Post by Dbug »

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.
User avatar
polluks
Pilot Officer
Posts: 76
Joined: Tue Jun 05, 2012 10:09 pm
Location: Germany
Contact:

Re: 6522 - VIA

Post by polluks »

It's mandatory.

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         |
                     +-----------------------+------------------------------+
http://unusedino.de/ec64/technical/misc ... a6522.html
cc65 development
Oric Atmos + Cumulus
Acorn Electron
User avatar
Symoon
Archivist
Posts: 2301
Joined: Sat Jan 14, 2006 12:44 am
Location: Paris, France

Re: 6522 - VIA

Post by Symoon »

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 ;)
Godzil
Squad Leader
Posts: 774
Joined: Sat May 21, 2011 7:21 pm
Location: Between UK and France
Contact:

Re: 6522 - VIA

Post by Godzil »

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 ;)
The 6522 is clearly not a simple beast to handle, don't worry about not understanding all of it's possibilities.
Post Reply