6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Thu Jun 06, 2024 11:28 pm

All times are UTC




Post new topic Reply to topic  [ 17 posts ]  Go to page 1, 2  Next
Author Message
PostPosted: Mon Jul 03, 2017 12:14 am 
Offline

Joined: Mon Jan 09, 2017 3:50 pm
Posts: 39
I spent most of this beautiful Sunday afternoon cloistered indoors and working on bringing up the new 6522 VIA board for the RC2014.

Attachment:
File comment: 6522 board
6522board-small.jpg
6522board-small.jpg [ 220.54 KiB | Viewed 4337 times ]


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/rc2014/tree/master/source/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.

_________________
Blog: http://ancientcomputing.blogspot.com/
GitHub: https://github.com/ancientcomputing


Top
 Profile  
Reply with quote  
PostPosted: Mon Jul 03, 2017 1:05 am 
Offline

Joined: Thu Jan 21, 2016 7:33 pm
Posts: 270
Location: Placerville, CA
Ah, spiffy! Is the interrupt line hooked up?


Top
 Profile  
Reply with quote  
PostPosted: Mon Jul 03, 2017 3:21 am 
Offline

Joined: Mon Jan 09, 2017 3:50 pm
Posts: 39
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/rc2014/tree/master/eagle/6522_board

_________________
Blog: http://ancientcomputing.blogspot.com/
GitHub: https://github.com/ancientcomputing


Top
 Profile  
Reply with quote  
PostPosted: Mon Jul 03, 2017 3:52 am 
Offline

Joined: Thu Jan 21, 2016 7:33 pm
Posts: 270
Location: Placerville, CA
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...


Top
 Profile  
Reply with quote  
PostPosted: Mon Jul 03, 2017 4:49 am 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8199
Location: Midwestern USA
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!


Top
 Profile  
Reply with quote  
PostPosted: Mon Jul 03, 2017 4:53 am 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8455
Location: Southern California
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?


Top
 Profile  
Reply with quote  
PostPosted: Mon Jul 03, 2017 5:18 am 
Offline

Joined: Thu Jan 21, 2016 7:33 pm
Posts: 270
Location: Placerville, CA
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.


Top
 Profile  
Reply with quote  
PostPosted: Mon Jul 03, 2017 1:25 pm 
Offline

Joined: Mon Jan 09, 2017 3:50 pm
Posts: 39
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.

_________________
Blog: http://ancientcomputing.blogspot.com/
GitHub: https://github.com/ancientcomputing


Top
 Profile  
Reply with quote  
PostPosted: Mon Jul 03, 2017 2:25 pm 
Offline

Joined: Thu Jan 21, 2016 7:33 pm
Posts: 270
Location: Placerville, CA
Got it. That's what I figured.


Top
 Profile  
Reply with quote  
PostPosted: Mon Jul 03, 2017 4:36 pm 
Offline

Joined: Mon Jan 09, 2017 3:50 pm
Posts: 39
Tested with a WDC 65C22N this morning.

Attachment:
6522-wdc-small.jpg
6522-wdc-small.jpg [ 218.63 KiB | Viewed 4263 times ]


I've also update GitHub with the latest code with interrupt handling (https://github.com/ancientcomputing/rc2014/tree/master/source/6502/6522).

The code show how you can chain interrupt handlers: 6522 timer 1 interrupt chains to the serial console interrupt.

_________________
Blog: http://ancientcomputing.blogspot.com/
GitHub: https://github.com/ancientcomputing


Top
 Profile  
Reply with quote  
PostPosted: Mon Jul 03, 2017 6:29 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8455
Location: Southern California
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?


Top
 Profile  
Reply with quote  
PostPosted: Mon Jul 03, 2017 10:34 pm 
Offline

Joined: Mon Jan 09, 2017 3:50 pm
Posts: 39
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.

_________________
Blog: http://ancientcomputing.blogspot.com/
GitHub: https://github.com/ancientcomputing


Top
 Profile  
Reply with quote  
PostPosted: Mon Jul 03, 2017 10:40 pm 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8199
Location: Midwestern USA
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!


Top
 Profile  
Reply with quote  
PostPosted: Mon Jul 03, 2017 10:53 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8455
Location: Southern California
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?


Top
 Profile  
Reply with quote  
PostPosted: Mon Jul 03, 2017 11:07 pm 
Offline

Joined: Mon Jan 09, 2017 3:50 pm
Posts: 39
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.

_________________
Blog: http://ancientcomputing.blogspot.com/
GitHub: https://github.com/ancientcomputing


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 17 posts ]  Go to page 1, 2  Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 29 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: