6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Sat Nov 23, 2024 10:09 pm

All times are UTC




Post new topic Reply to topic  [ 15 posts ] 
Author Message
PostPosted: Thu Feb 23, 2006 2:12 am 
Offline

Joined: Wed Oct 08, 2003 1:15 am
Posts: 25
Location: Florida
I have used all kinds of varieties of 6502 and 6522, from MOS, Synertek, Rockwell, GTE, CMD, and on. Never had any problems with any of those.
Until I've run out of CMD's 65C22 and had nothing left other than go to Western Design's current 6522 (whatever they mark it).

I can't make it work. They have eliminated the pullup resistors on Inputs and substituted some "buss control". Even when I install pull-up resistors, the 6522 still will not work and behaves in random, peculiar manner. Who knows what else has been changed and who knows if they are even aware of it.

Being in a deep do-do now, I am using old Rockwell 6522, these work like a charm. Except they use too much of power. I am however using Western Design's current 6502 and that one doesn't give me trouble.

Do you know any source of old 65C22 of any variety, except for Western Design?


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Thu Feb 23, 2006 4:51 am 
Offline

Joined: Sat Jan 04, 2003 10:03 pm
Posts: 1706
I don't know what the problem is, but the WDC W65C22 part works perfect and as-advertised for me. There are some things which have changed from the earlier parts: IRQB is no longer open-drain. To facilitate the higher CPU speeds, it is now direct-driven. To turn it into an open-drain signal, stick a diode in its path:

Code:
    |
IRQB|o----|<|----> IRQB "open-drain"
    |


This way, when IRQB is high, it'll reverse-bias the diode, and thus, will appear to be high-impedance from the point of view of the remainder of the circuit.

Other than that, literally everything else remains the same as I remember it being described by Commodore's documents way back in the early 80s.

What I want to know is, seeing as how the serial-port bug still exists in 65C22, do the timer race-conditions also still exist? This was apparently a problem for the Commodore PET series of machines, though I don't recall hearing any issues for the VIC-20. The VIC-20 was the last CBM 8-bit product to use 6522s; everything from then on has either been 6526 CIAs or 8520 CIAs.

One very important thing to remember: make sure your clock slew rates are within spec!!! I cannot over-emphasize this. The 65816 I was using in the Kestrel 1 was flaking out big-time because my clock wasn't within specification. When the data sheet says 5ns max slew rate for the clock, they mean it! If your clock is not within spec, I recommend using a 74F-series logic gate or two to clean it up.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Thu Feb 23, 2006 11:53 am 
Offline
User avatar

Joined: Fri Dec 12, 2003 7:22 am
Posts: 259
Location: Heerlen, NL
kc5tja wrote:
The VIC-20 was the last CBM 8-bit product to use 6522s;


Not quite true, the 1571 drive is. But this drive had to be hardware compatible withe the 1541, which on its turn is the decendant of the 1540 which was the drive meant for the VIC-20.

Then another thought, the VIC-20 is made in 1981 I think? What about the successors of the 8000 series like the CBM 6x0 and 7x0?

But this has nothing to do with the original subject, so don't pay to much attention to it :)

_________________
Code:
    ___
   / __|__
  / /  |_/     Groetjes, Ruud
  \ \__|_\
   \___|       URL: www.baltissen.org



Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Thu Feb 23, 2006 1:48 pm 
Offline

Joined: Sun Feb 05, 2006 1:20 am
Posts: 21
Location: The Netherlands
Unlike many CMOS 6522 devices, WDC's 65C22 bus interface is not NMOS (or TTL) compatible. It requires a VIH of 0.7*VDD.

_________________
I trust my somewhat flawed English is comprehensible to all.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Thu Feb 23, 2006 9:16 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8546
Location: Southern California
Related past discussions here on the forum:
http://www.6502.org/forum/viewtopic.php?p=895#895
http://www.6502.org/forum/viewtopic.php?t=195

WDC has changed the datasheet since we had those discussions, mostly providing more information and fixing some errors.  I had not seen the .7VDD V(IH) requirement before in my older data sheets, but I just now looked at the one at http://www.westerndesigncenter.com/wdc/ ... 65c22s.pdf and see it.

_________________
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  
 Post subject: Thanks for suggestions.
PostPosted: Fri Feb 24, 2006 2:43 am 
Offline

Joined: Wed Oct 08, 2003 1:15 am
Posts: 25
Location: Florida
Thanks to all for your invaluable comments and suggestions.
I have been using WDC 65x02 for two years now, without any problem so far and without modifying the circuits.
My problem is their 65x22. I don't have time to mess with WDC spec sheets to find how they differ from CMD, etc. I have to produce, deliver products.
Foolishly, I have allowed my 65c22 to deplete to only a few pieces left, assuming that the WDC's 65x22 will be a direct replacement, as their spec sheet implies. It is not, unfortunately.
For example, I drive with one 65x22 a 4*4 matrix keypad. You use four pins inputs, four pins output to decode it. The WDC does not have pull-up resistors for the input pins, so I soldered 10K resistor network to those pins (I only have 10k network on hand). It still doesn't work, the WDC part goes beserk, out of control. So, there must be more to it than installing pull-up resistors.
I am aware of the other known issues, like IRQ, but don't have time for that so far. Time is too valuable to waste.
So, I did ask WDC for help and they are looking into it.
That probably may not solve my problem immediately, however. For now, I will have to use my Rockwell 6522 that I have on hand and try to buy some R65C22 or similar from wherever. Speed is not the issue in my applications.
Anyhow, aren't the new things supposed to be better than the old workhorses? :wink:


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Fri Feb 24, 2006 3:53 am 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8546
Location: Southern California
Quote:
Anyhow, aren't the new things supposed to be better than the old workhorses?

They are better, but there seems to be some compatibility issue, which I have not run into (although I have not worked with NMOS in 20 years either).  Do you have a schematic we can look at to find the trouble spot?

_________________
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: Fri Feb 24, 2006 5:43 am 
Offline

Joined: Sat Jan 04, 2003 10:03 pm
Posts: 1706
Icy wrote:
Anyhow, aren't the new things supposed to be better than the old workhorses? :wink:


They're WAY better than they used to be. But that being the case, I think the compatibility issues go relatively unnoticed because the new parts end up in newer designs.

I know you're on a tight schedule, but perhaps now might be a good time to consider EOLing the current hardware design on the basis of parts availability, and allocate some resources to renovating the circuit to handle the new parts. I suspect it won't take much in the way of circuit modifications. It's probably just a matter of cleaning up the CPU-side of the interface. I don't see the peripheral side being much different, personally. Maybe I'm wrong.

:|


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Fri Feb 24, 2006 9:30 pm 
Offline

Joined: Wed Oct 08, 2003 1:15 am
Posts: 25
Location: Florida
O.K., got it fixed. As several of you have suggested, adding DIODE to IRQ output of W65C22S, pin 21, solved the problem. What puzzles me, since I have two W65C22S on the board and only one has the diode, how come it works? When IRQ of the one W65C22S with the DIODE goes low, it also pulls down IRQ of the other W65C22S. I do realize that this IRQ is output, but why it doesn’t work without DIODE?

The change to W65C22S requires adding a lot of discrete components (pull-up resistors and preferably two diodes). This is opposite what I am trying to do; I want to minimize the components. So, I will use non-WDC 65C22, if I can get them. After that, I’ll switch to W65C22S. I am, however, using W65C02, with no modifications and no problem.
Again, thank you for your suggestions.
Icy


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Fri Feb 24, 2006 10:04 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8546
Location: Southern California
Quote:
When IRQ of the one W65C22S with the DIODE goes low, it also pulls down IRQ of the other W65C22S. I do realize that this IRQ is output, but why it doesn’t work without DIODE?

They're totem-pole outputs.  If one is essentially shorting the output to Vcc in an effort to pull it up, while the other one is essentially shorting its output to ground in an effort to pull it down, and those two outputs are connected together, there will be an awful lot of current flowing.  Even if you don't damage the parts from excessive heat, the power supply will be pulled well out of spec, internally if not externally too.

WDC's went to the totem-pole output because they didn't want to live with the speed limitation imposed by the slow rising edge of the passive pull-up used before.  This is shown in the 6502 interrupts primer.


Quote:
The change to W65C22S requires adding a lot of discrete components (pull-up resistors and preferably two diodes).

All other 65c22's, including the NMOS ones, have always needed the pull-up resistor.  If you've gotten away without it before, you probably had the IRQ line going to an LSTTL input which is basically in its high state if something is not pulling it down externally.

The idea now is not to add more parts, but to run the individual IRQ outputs to an AND gate (possibly a spare one that's already on the board), so that if any of them goes low, the AND gate's output goes low.  (Of course there are a lot of other possibilities for the hardware design if you want things like hardware interrupt prioritizing or making the interrupt vector directly give the right address for the particular IC that produced the interrupt.)

_________________
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  
 Post subject:
PostPosted: Mon Feb 27, 2006 2:41 am 
Offline

Joined: Wed Oct 08, 2003 1:15 am
Posts: 25
Location: Florida
Quote:
All other 65c22's, including the NMOS ones, have always needed the pull-up resistor. If you've gotten away without it before, you probably had the IRQ line going to an LSTTL input which is basically in its high state if something is not pulling it down externally.


I am not really and expert in this field, but know another company that was run by a PhD in Comp. Science. We have got away without using any pull-up resistors, not even on IRQs. Both IRQs are wired directly to IRQ of 65C02. But, there could be some cases where pull-up resistors might have been a good idea.

The AND gate suggestion is a neat idea, unfortunately, I don't have any AND gates on the board. I do have one NOR and three Inverters available, so I'll try to cook-up something. Unfortunately, they are not placed near.
Thanks for the suggestion.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Mon Feb 27, 2006 7:27 pm 
Offline

Joined: Tue Nov 18, 2003 8:41 pm
Posts: 250
GARTHWILSON wrote:
> When IRQ of the one W65C22S with the DIODE goes low, it also
All other 65c22's, including the NMOS ones, have always needed the pull-up resistor. If you've gotten away without it before, you probably had the IRQ line going to an LSTTL input which is basically in its high state if something is not pulling it down externally.


From the Rockwell 65c00 datasheet

Quote:
On the NMOS device, unused input-only pins (/IRQ, /NMI, /RDY,
/RES, and /SO) must be connected to a low impedance signal
to avoid noise problems. These unused pins on the CMOS
devices are internally connected by a high impedance to
Vcc (approximately 250k ohms).


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Mon Feb 27, 2006 8:05 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8546
Location: Southern California
Quote:
These unused pins on the CMOS devices are internally connected by a high impedance to Vcc (approximately 250k ohms).

You can usually get away with the internal pull-up if you're not using the pin, but that internal pull-up is so weak that the IRQ line can take as much as 100 clock cycles to float up after the interrupt condition has been cleared, which can be disastrous depending on the length of the ISR, or in the case of NMI, the noise on the line if the processor's NMI input is not Schmitt trigger.  (I don't know which brands may have had a non-Schmitt-trigger input here.)  100 clocks is kind of an extreme case, but I have been bit by this before.  It is addressed in the interrupts primer mentioned above.  The data sheets for the NMOS and older CMOS 6522's recommended a 3K pull-up resistor on the line.  3.3K is more common and will work fine.

_________________
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  
 Post subject:
PostPosted: Tue Feb 28, 2006 1:11 am 
Offline
User avatar

Joined: Thu Mar 11, 2004 7:42 am
Posts: 362
One thing that often goes unstated about internal pull-ups is that their tolerance can be extremely wide. A product I worked on a few years back had a custom ASIC with internal pull-ups whose nominal value was something like 150k or 250k. I asked the IC designer how much that value could vary from IC to IC and he said 50 percent! Needless to say, they weren't used for anything but pull-ups.


Top
 Profile  
Reply with quote  
 Post subject: CORRECTION !!!!!!!!!!!!!
PostPosted: Thu Mar 02, 2006 2:29 am 
Offline

Joined: Wed Oct 08, 2003 1:15 am
Posts: 25
Location: Florida
I want to correct what I have posted above, namely that we were never using pull-up resistors on IRQ. Wrong!
I just looked at the schematics, and all IRQ, NMI, RDY and SO have a pull up resistor!
This was designed in about 20 years ago. By the guy who is writing this.
I must be getting old!
:roll:


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 15 posts ] 

All times are UTC


Who is online

Users browsing this forum: Google [Bot] and 9 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: