6522 VIA Board for the RC2014

For discussing the 65xx hardware itself or electronics projects.
bluesky6
Posts: 39
Joined: 09 Jan 2017
Contact:

6522 VIA Board for the RC2014

Post by bluesky6 »

I spent most of this beautiful Sunday afternoon cloistered indoors and working on bringing up the new 6522 VIA board for the RC2014.
6522 board
6522 board
It is set up as a typical RC2014 board except for the use of the R/W signal on pin 39 of the RC2014 bus. I decided not to use the /WR signal since that is gated on Phi2 and there's usually a pre-Phi2 rising edge setup time for 6800/6500 style peripherals. The 2 connectors for the ports are per Daryl's specs.

In any case, I was looking at the sample code on this site http://6502.org/source/io/6522timr.htm and found at least a couple of errors in the use of Timer 1:
1. For Timer 1, the value that you compare IFR against is not $20 but $40.
2. Clearing the interrupt flag requires a read from T1CL (per Rockwell specs and my own testing).

Check out my modified test code on GitHub: https://github.com/ancientcomputing/rc2 ... /6502/6522.

The code's probably a little cryptic but I was running 10ms timeouts on the 6522 timer to drive a software counter. This gave me a 1 second tick (+/- 10ms :? )

My next step is to put together an audio output with the same free-running counter.
User avatar
commodorejohn
Posts: 299
Joined: 21 Jan 2016
Location: Placerville, CA
Contact:

Re: 6522 VIA Board for the RC2014

Post by commodorejohn »

Ah, spiffy! Is the interrupt line hooked up?
bluesky6
Posts: 39
Joined: 09 Jan 2017
Contact:

Re: 6522 VIA Board for the RC2014

Post by bluesky6 »

commodorejohn wrote:
Ah, spiffy! Is the interrupt line hooked up?
Yes it is. That's the next level of testing. I'll need to chain interrupts with the serial console. Fun stuff!! :)

The board files have been checked into GitHub: https://github.com/ancientcomputing/rc2 ... 6522_board
User avatar
commodorejohn
Posts: 299
Joined: 21 Jan 2016
Location: Placerville, CA
Contact:

Re: 6522 VIA Board for the RC2014

Post by commodorejohn »

Sweet. Will it work with the 65C22, or just the original? I know there's some difference in the interrupt line on the 65C22, but I'm not an expert on this stuff...
User avatar
BigDumbDinosaur
Posts: 9428
Joined: 28 May 2009
Location: Midwestern USA (JB Pritzker’s dystopia)
Contact:

Re: 6522 VIA Board for the RC2014

Post by BigDumbDinosaur »

commodorejohn wrote:
Sweet. Will it work with the 65C22, or just the original? I know there's some difference in the interrupt line on the 65C22, but I'm not an expert on this stuff...
I think you meant to ask if it would work with the W65C22S, which has a totem-pole IRQ output. The W65C22N, as well as older versions, such as Rockwell parts, have an open-drain IRQ output.
x86?  We ain't got no x86.  We don't NEED no stinking x86!
User avatar
GARTHWILSON
Forum Moderator
Posts: 8775
Joined: 30 Aug 2002
Location: Southern California
Contact:

Re: 6522 VIA Board for the RC2014

Post by GARTHWILSON »

commodorejohn wrote:
Sweet. Will it work with the 65C22, or just the original? I know there's some difference in the interrupt line on the 65C22, but I'm not an expert on this stuff...
I see BDD answered while I was writing and getting interrupted, but I'll post anyway, with a couple of additional details.

The difference with the IRQ\ output is not in CMOS versus NMOS, but specifically in the W65C22S (with the S on the end). The S version has the totem-pole IRQ\ output. This change was made to improve the low-power, high-speed characteristics of the part. The other 65c22 VIAs have the open-drain IRQ\ output. The W65C22S has other improvements also that generally make it a better choice: stronger output pin drivers (much stronger than the data sheet lets on), bus-hold devices, and the inputs are truly high-impedance, unlike other brands of 65(c)22.
http://WilsonMinesCo.com/ lots of 6502 resources
The "second front page" is http://wilsonminesco.com/links.html .
What's an additional VIA among friends, anyhow?
User avatar
commodorejohn
Posts: 299
Joined: 21 Jan 2016
Location: Placerville, CA
Contact:

Re: 6522 VIA Board for the RC2014

Post by commodorejohn »

Okay, thanks for the clarification. I don't think I have either on hand at the moment, so I was just curious what I should look for once bluesky6 has this board ready to go.
bluesky6
Posts: 39
Joined: 09 Jan 2017
Contact:

Re: 6522 VIA Board for the RC2014

Post by bluesky6 »

The RC2014 design only has one interrupt line (other than NMI if you have the Pro motherboard with Enhanced bus).

So the assumption is the use of open collector/drain devices to share and drive that interrupt line. My Rev B & C 16550 board designs use a 74HCT03 open collector gate to convert the 16550 interrupt line to open collector. The original 16550 board didn't and interrupts don't/can't work if another I/O board (6850 or Dr Baker's SIO) is plugged in.

In short, yes: you need the open drain version of the WDC 6522.
User avatar
commodorejohn
Posts: 299
Joined: 21 Jan 2016
Location: Placerville, CA
Contact:

Re: 6522 VIA Board for the RC2014

Post by commodorejohn »

Got it. That's what I figured.
bluesky6
Posts: 39
Joined: 09 Jan 2017
Contact:

Re: 6522 VIA Board for the RC2014

Post by bluesky6 »

Tested with a WDC 65C22N this morning.
6522-wdc-small.jpg
I've also update GitHub with the latest code with interrupt handling (https://github.com/ancientcomputing/rc2 ... /6502/6522).

The code show how you can chain interrupt handlers: 6522 timer 1 interrupt chains to the serial console interrupt.
User avatar
GARTHWILSON
Forum Moderator
Posts: 8775
Joined: 30 Aug 2002
Location: Southern California
Contact:

Re: 6522 VIA Board for the RC2014

Post by GARTHWILSON »

You could probably put a Schottky diode in series with the W65C22S's IRQ\ output (with the cathode toward the W65C22S) and meet the requirement. For the other benefits, I would still recommend the S version.
http://WilsonMinesCo.com/ lots of 6502 resources
The "second front page" is http://wilsonminesco.com/links.html .
What's an additional VIA among friends, anyhow?
bluesky6
Posts: 39
Joined: 09 Jan 2017
Contact:

Re: 6522 VIA Board for the RC2014

Post by bluesky6 »

GARTHWILSON wrote:
For the other benefits, I would still recommend the S version.
That's funny. It sounds like there's some history/politics behind this endorsement :?

Since the RC2014 is a hobbyist system, I'd recommend that folks use what they have at hand, especially if they want to recreate the retro vibe of the late 70s/early 80s.
User avatar
BigDumbDinosaur
Posts: 9428
Joined: 28 May 2009
Location: Midwestern USA (JB Pritzker’s dystopia)
Contact:

Re: 6522 VIA Board for the RC2014

Post by BigDumbDinosaur »

bluesky6 wrote:
GARTHWILSON wrote:
For the other benefits, I would still recommend the S version.
That's funny. It sounds like there's some history/politics behind this endorsement :?

Since the RC2014 is a hobbyist system, I'd recommend that folks use what they have at hand, especially if they want to recreate the retro vibe of the late 70s/early 80s.
I think Garth is referring to the lack of current limiting resistors on the W65C22S outputs, which gives the device much stronger drive.
x86?  We ain't got no x86.  We don't NEED no stinking x86!
User avatar
GARTHWILSON
Forum Moderator
Posts: 8775
Joined: 30 Aug 2002
Location: Southern California
Contact:

Re: 6522 VIA Board for the RC2014

Post by GARTHWILSON »

Yes, there's the drive, and the fact that I got bit once with other CMOS VIAs because I thought the port inputs were high-impedance but they weren't. I needed to be able to pull them down with a high-resistance pull-down resistor so they'd be low unless actively pulled up; but that doesn't work with TTL- or LSTTL-type inputs. This was on Rockwell 65c22 VIAs. Similarly, the W65C22N data sheet says the port pins may take as much as 1.6mA in input mode to pull them down to .4V. That rules out a few things you can do with the W65C22S.
http://WilsonMinesCo.com/ lots of 6502 resources
The "second front page" is http://wilsonminesco.com/links.html .
What's an additional VIA among friends, anyhow?
bluesky6
Posts: 39
Joined: 09 Jan 2017
Contact:

Re: 6522 VIA Board for the RC2014

Post by bluesky6 »

The discussion is probably moot at this point because the W65C22N6TPG–14 is no longer available at Mouser. Or at least, it's backordered. On the other hand, there's plenty of the 's' version...

I was in the process of putting up my spare boards on Tindie and writing up a recommendation for 6522 sources when I discovered this.
Post Reply