6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Sat Sep 21, 2024 7:52 pm

All times are UTC




Post new topic Reply to topic  [ 35 posts ]  Go to page Previous  1, 2, 3  Next
Author Message
PostPosted: Thu Dec 19, 2019 10:51 pm 
Offline

Joined: Wed Oct 16, 2019 11:17 pm
Posts: 34
I'd like to thank everyone for all your help. I took a lot of different advice from this thread today:

  • I changed all my 74LS04 chips out for 74HC04
  • I moved the capacitor on the crystal to pin 6, and replaced it with a 30nf one
  • I added a 1meg resistor in parallel with the crystal
  • I added a 10k pull up resistor to IRQB and NIMB
  • I looked in the datasheet for the 65C02 and found out that I should be adding a pull up on RDY as well, so there's another 10K
  • I added a 47nf bypass capacitor to the ACIA. I placed it as close to the chip as I possibly could

And in the end, now it works.

Again, thank you all for your help!

Happy Holidays, Merry Christmas, Happy Hanukkah and Happy New Year!


Top
 Profile  
Reply with quote  
PostPosted: Thu Dec 19, 2019 10:59 pm 
Offline

Joined: Wed Oct 16, 2019 11:17 pm
Posts: 34
GARTHWILSON wrote:
Be sure to go through the 6502 primer at http://wilsonminesco.com/6502primer/ . I can think of quite a few possible causes of your problems, but I wouldn't give any individual one a very high chance of being the key until I know more about your system. The 6502 primer should address all of them though.


I actually have read quite a few sections of your website in the past. My first addressing model was basically stolen from your guide. I haven't read it cover to cover, but I have referred to it on a number of occasions. Thank you!


Top
 Profile  
Reply with quote  
PostPosted: Thu Dec 19, 2019 11:06 pm 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8390
Location: Midwestern USA
rickseiden wrote:
The ACIA is addressed at $5000-$5FFF. I have two VIAs addressed at $6000-$6FFF and $7000-$7FFF. My ROM is $8000-$FFFF. My RAM is $0000-$3FFF.

Just an opinion, but that is a lot of wasted address space that could be used for more RAM. Have you considered using a 74*138 decoder to reduce the footprint of your I/O space? There is no reason for each I/O device to occupy 4KB of address space like that. You could arrange for the '138 to appear at $7000 and by connecting the A0-A2 inputs of the '138 to A8-A10, respectively, each piece of I/O hardware will occupy one page of address space. That allows you to reclaim space in which to address RAM.

Here's how I would do it if I were using your basic architecture:

Attachment:
File comment: Basic Computer Glue Logic
simple_computer.gif
simple_computer.gif [ 15.28 KiB | Viewed 557 times ]

The above could be reduced to two chips by using the unused sections of the 74HC10 as substitutes for the 74HC00 NANDs. However, I drew it that way so you could better visualize the logic.

The selection logic for the UART and VIAs uses only their low-true select inputs, that is, CS2B on the VIAs and CS1B on the UART. The other select pins must be connected to Vcc. Almost all RAM and ROM has a /CE or similar for selecting the device. That is how I wired the RAM and ROM decoding.

_________________
x86?  We ain't got no x86.  We don't NEED no stinking x86!


Top
 Profile  
Reply with quote  
PostPosted: Thu Dec 19, 2019 11:11 pm 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8390
Location: Midwestern USA
rickseiden wrote:
[*]I added a 10k pull up resistor to IRQB and NIMB
[*]I looked in the datasheet for the 65C02 and found out that I should be adding a pull up on RDY as well, so there's another 10K

Next time you dig into your circuit you should replace those 10K resistors with a lower value. I use 3.3K. The lower resistance value improves noise immunity and in the case of IRQ, which is a wired-OR arrangement, an interrupt will clear more quickly. Garth discusses the effect of spurious interrupts in his interrupt primer. Excessive pull-up resistance tends to increase the likelihood of a spurious IRQ, which if it occurs, will drive you to drink.

_________________
x86?  We ain't got no x86.  We don't NEED no stinking x86!


Top
 Profile  
Reply with quote  
PostPosted: Thu Dec 19, 2019 11:41 pm 
Offline

Joined: Wed Oct 16, 2019 11:17 pm
Posts: 34
BigDumbDinosaur wrote:
rickseiden wrote:
The ACIA is addressed at $5000-$5FFF. I have two VIAs addressed at $6000-$6FFF and $7000-$7FFF. My ROM is $8000-$FFFF. My RAM is $0000-$3FFF.

Just an opinion, but that is a lot of wasted address space that could be used for more RAM. Have you considered using a 74*138 decoder to reduce the footprint of your I/O space? There is no reason for each I/O device to occupy 4KB of address space like that. You could arrange for the '138 to appear at $7000 and by connecting the A0-A2 inputs of the '138 to A8-A10, respectively, each piece of I/O hardware will occupy one page of address space. That allows you to reclaim space in which to address RAM.

Here's how I would do it if I were using your basic architecture:

Attachment:
simple_computer.gif

The above could be reduced to two chips by using the unused sections of the 74HC10 as substitutes for the 74HC00 NANDs. However, I drew it that way so you could better visualize the logic.

The selection logic for the UART and VIAs uses only their low-true select inputs, that is, CS2B on the VIAs and CS1B on the UART. The other select pins must be connected to Vcc. Almost all RAM and ROM has a /CE or similar for selecting the device. That is how I wired the RAM and ROM decoding.


At first I was really worried about all the empty space in my addressing scheme. Then I sat down and tried to write software for what I had built. IT WAS VERY DIFFICULT. Still is. So I'm not close to using what memory I have, meaning that it doesn't matter that I'm wasting it.

I did do some work on a closer addressing of devices. Like having one VIA be $6000-$600F and the next to $6010-$601F. It just took too many logic chips to do.

My board is modular, though. I have a main board with the CPU, ROM, RAM and the first VIA on it. Then I have the address lines fed out to a header on the left, and I've attached a small board with addressing logic on there, which in turn feeds back into the main board's chip select lines for the various chips. If I want to change my addressing scheme in the future, I just change that little side board. The second VIA and the ACIA are both on daughter boards that link in to headers on the side of the main board, and their addressing logic is on their boards. It does mean some redundancy in the chips, but it also means flexibility. Like I have one board that has just a VIA on it, and another board (that I probably need to redesign after today) that has a VIA and an ACIA on it, along with a CH340G chip and some USB headers so the USB to Serial is right on the board.

If I ever do anything more with this than just putz around--like as in design an actual computer or something--I'll clean it all up and put it all on one board. But for now, it's working out pretty well the way it is.


Top
 Profile  
Reply with quote  
PostPosted: Thu Dec 19, 2019 11:42 pm 
Offline

Joined: Wed Oct 16, 2019 11:17 pm
Posts: 34
BigDumbDinosaur wrote:
rickseiden wrote:
[*]I added a 10k pull up resistor to IRQB and NIMB
[*]I looked in the datasheet for the 65C02 and found out that I should be adding a pull up on RDY as well, so there's another 10K

Next time you dig into your circuit you should replace those 10K resistors with a lower value. I use 3.3K. The lower resistance value improves noise immunity and in the case of IRQ, which is a wired-OR arrangement, an interrupt will clear more quickly. Garth discusses the effect of spurious interrupts in his interrupt primer. Excessive pull-up resistance tends to increase the likelihood of a spurious IRQ, which if it occurs, will drive you to drink.



Luckily, my pull ups are installed in a header, and not soldered to the board. So it will be really easy to replace them. Thanks for the advice.


Top
 Profile  
Reply with quote  
PostPosted: Fri Dec 20, 2019 12:07 am 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8390
Location: Midwestern USA
rickseiden wrote:
BigDumbDinosaur wrote:
rickseiden wrote:
[*]I added a 10k pull up resistor to IRQB and NIMB
[*]I looked in the datasheet for the 65C02 and found out that I should be adding a pull up on RDY as well, so there's another 10K

Next time you dig into your circuit you should replace those 10K resistors with a lower value. I use 3.3K. The lower resistance value improves noise immunity and in the case of IRQ, which is a wired-OR arrangement, an interrupt will clear more quickly. Garth discusses the effect of spurious interrupts in his interrupt primer. Excessive pull-up resistance tends to increase the likelihood of a spurious IRQ, which if it occurs, will drive you to drink.

Luckily, my pull ups are installed in a header, and not soldered to the board. So it will be really easy to replace them. Thanks for the advice.

I assume you know the W65C22S has a totem-pole IRQ output, not open collector. You can't wire-OR the W65C22S' IRQ output with other open collector devices. Either a Schottky diode is needed for each 'C22S or an AND gate is needed to aggregate IRQ lines. Garth shows the latter arrangement on his website. I use a version of it in my POC V1.2 design, mostly to avoid the problems associated with an IRQ line meandering all over the PCB.

_________________
x86?  We ain't got no x86.  We don't NEED no stinking x86!


Top
 Profile  
Reply with quote  
PostPosted: Fri Dec 20, 2019 12:30 am 
Offline

Joined: Wed Oct 16, 2019 11:17 pm
Posts: 34
BigDumbDinosaur wrote:
I assume you know the W65C22S has a totem-pole IRQ output, not open collector. You can't wire-OR the W65C22S' IRQ output with other open collector devices. Either a Schottky diode is needed for each 'C22S or an AND gate is needed to aggregate IRQ lines. Garth shows the latter arrangement on his website. I use a version of it in my POC V1.2 design, mostly to avoid the problems associated with an IRQ line meandering all over the PCB.


I was just reading that. It's something I'm going to have to address at some point.


Top
 Profile  
Reply with quote  
PostPosted: Fri Dec 20, 2019 6:07 am 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10938
Location: England
rickseiden wrote:
If I ever do anything more with this than just putz around--like as in design an actual computer or something--I'll clean it all up and put it all on one board. But for now, it's working out pretty well the way it is.


Well done! You built it yourself, you made your own tradeoffs, and it works! That's about as good as it gets.


Top
 Profile  
Reply with quote  
PostPosted: Sat Dec 21, 2019 3:45 am 
Offline

Joined: Wed Oct 16, 2019 11:17 pm
Posts: 34
BigDumbDinosaur wrote:
You can't wire-OR the W65C22S' IRQ output with other open collector devices. Either a Schottky diode is needed for each 'C22S or an AND gate is needed to aggregate IRQ lines.


I've added a Schottky diode to my schematic, but I'm not sure what I'm looking at when I'm ordering them. I see things like 40V 3A, and 20V 1A and so on. This is a 5V application with just a few milliamps of current. I assume that I can go with anything over 5V and 1A or up. But I'm not a pro at this, so I'm not 100% sure. Can I order Schottky diodes with these kinds of ratings, or do I need something else?

Thanks


Top
 Profile  
Reply with quote  
PostPosted: Sat Dec 21, 2019 4:11 am 
Offline
User avatar

Joined: Tue Mar 05, 2013 4:31 am
Posts: 1382
rickseiden wrote:
BigDumbDinosaur wrote:
You can't wire-OR the W65C22S' IRQ output with other open collector devices. Either a Schottky diode is needed for each 'C22S or an AND gate is needed to aggregate IRQ lines.


I've added a Schottky diode to my schematic, but I'm not sure what I'm looking at when I'm ordering them. I see things like 40V 3A, and 20V 1A and so on. This is a 5V application with just a few milliamps of current. I assume that I can go with anything over 5V and 1A or up. But I'm not a pro at this, so I'm not 100% sure. Can I order Schottky diodes with these kinds of ratings, or do I need something else?

Thanks


In short, the reason for using a Schottky diode is for it's low junction voltage, to ensure the IRQ line gets pulled low enough to ensure a reliable trigger. As there's very little current involved and only 5 volts running about, a small one will work fine. You might want to consider one of these:

https://www.mouser.com/ProductDetail/Ne ... UjQiECs%3D

_________________
Regards, KM
https://github.com/floobydust


Top
 Profile  
Reply with quote  
PostPosted: Sat Dec 21, 2019 5:01 am 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8390
Location: Midwestern USA
floobydust wrote:
You might want to consider one of these:

https://www.mouser.com/ProductDetail/Ne ... UjQiECs%3D

Yep! That one is a good choice.

_________________
x86?  We ain't got no x86.  We don't NEED no stinking x86!


Top
 Profile  
Reply with quote  
PostPosted: Sat Dec 21, 2019 6:58 am 
Offline
User avatar

Joined: Thu May 14, 2015 9:20 pm
Posts: 155
Location: UK
For signal applications (for through hole), I normally use (recommend) diodes: BAT42, BAT43 or BAT46.

Mark


Top
 Profile  
Reply with quote  
PostPosted: Sat Dec 21, 2019 8:20 pm 
Offline

Joined: Wed Oct 16, 2019 11:17 pm
Posts: 34
Mouser's shipping on small items is cost prohibitive. I search eBay for a BAT86, and found one listing in North America

https://www.ebay.com/itm/X5-BAT86-50V-2 ... SwgmJX1uSS

About $8 for 5 with shipping. Not too bad.

I searched eBay for the BAT42, BAT43 and BAT46 Matt mentioned. I found this for BAT43

https://www.ebay.com/itm/50-Pcs-BAT43-S ... Sw1B5dxym3

50 Pieces for $5.20 with shipping. Much better price.

So, going by cost alone, I'm going to get the BAT43s. But if they don't work, I'll try the BAT86s.

One really important thing that I'm taking away from this thread is how great this community is. You've been really great in helping out and explaining things to this n00b, and I appreciate it.


Top
 Profile  
Reply with quote  
PostPosted: Sun Dec 22, 2019 2:32 am 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8390
Location: Midwestern USA
rickseiden wrote:
Mouser's shipping on small items is cost prohibitive. I search eBay for a BAT86, and found one listing in North America...

In suggesting where to find parts, it would be helpful for the rest of us to have some idea of your location. :)

_________________
x86?  We ain't got no x86.  We don't NEED no stinking x86!


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

All times are UTC


Who is online

Users browsing this forum: No registered users and 2 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: