-- Jeff
NMOS 6502 Reset bug
NMOS 6502 Reset bug
In one of our other threads we found ourselves discussing a somewhat mysterious reset bug reported to exist in NMOS 6502s. I opened this new thread in order not to interfere with the original discussion, which pertains to a Microbot robot arm. You can read preliminary comments regarding the reset bug beginning with the 2nd-last post on this page.
Later my curiosity was aroused when I learned that Data Sheets make no mention of the bug. (I myself learned about it only informally, thanks to references by Garth Wilson.)
Heating problem??! With luck, in this new thread we'll be able to get to the bottom of the matter. NMOS chips have less relevance nowadays perhaps, but there's an interesting puzzle here and probably a chance to learn.
-- Jeff
I wrote:
The NMOS 6502 (unlike most CPUs, including 65C02) is prohibited from long periods with RST true, and therefore a one-shot timing circuit is usually provided.
Garth Wilson wrote:
The CMOS 6502's reset timing is not critical since it does not have the heating problem that the NMOS 6502 had whereby the uP could be destroyed if you kept the reset line true for too long. IIRC, the maximum recommended reset time on those was 50 or 100 ms.
-- Jeff
Last edited by Dr Jefyll on Sun Sep 11, 2011 6:20 pm, edited 1 time in total.
-
falcon5252
- Posts: 74
- Joined: 16 Aug 2011
- Location: USA Pa
Excerpt from "The rise of Mostek"
Excerpt from "The rise of MOS Technologies" Concerning the cost of modifying a FAB when you own the clean-room..
""Using MOS' Engineers and facilities, Commodore was able to produce prototype chips in days rather than months and at practically no cost. Other companies, like Atari, Apple, and Osborne would have to spend tens of thousands of dollars and wait weeks or months for new chips. MOS was critical to Commodore's fast paced style of business in the 1970's and early 80's. Commodore Engineers could get a chip produced without so much as formal paperwork. When Bill Herd (the Plus/4 and C128 Engineer) quit and went to work for a chip small design shop, he was shocked that he could not simply order up new prototype chips. ""
Also note the pulse width on the commodore C64 pulse reset circuit is 500ms according to the text on the link below,, And being they owned MOS and had the inside info, It kind of verifies that the Bug still existed at least in MOS6502 or actually the MOS6510 when they were designing the C64..
Weather or IF the bug was ever corrected and when in the NMOS 6502's either by MOS or any of the cross licensed manufacturers is what we are trying to determine...
As I stated in the other thread,, The robot Arm I own has been running 29 years in a School or University with a 2mhz Rockwell R6502AP with a simple non pulsed rest circuit without smoking the CPU.. Also let me add here the reset circuit is a 4.7k charging a 47uf Cap,, And its quite hard to calculate the time constant because the supply voltage is rising from 0v on its way to 5v and reset toggles L to H at the gate threshold which varies somewhat from various chip brands and temp of the 74LS14,, On a very rough guess I'll say reset is only being held low for about 100 to a 125 ms... Which is far less time than the actual commodore pulsed reset at 500ms ,, AAAAAA Drain Bramage..
http://www.zimmers.net/anonftp/pub/cbm/ ... c64-05.gif
""Using MOS' Engineers and facilities, Commodore was able to produce prototype chips in days rather than months and at practically no cost. Other companies, like Atari, Apple, and Osborne would have to spend tens of thousands of dollars and wait weeks or months for new chips. MOS was critical to Commodore's fast paced style of business in the 1970's and early 80's. Commodore Engineers could get a chip produced without so much as formal paperwork. When Bill Herd (the Plus/4 and C128 Engineer) quit and went to work for a chip small design shop, he was shocked that he could not simply order up new prototype chips. ""
Also note the pulse width on the commodore C64 pulse reset circuit is 500ms according to the text on the link below,, And being they owned MOS and had the inside info, It kind of verifies that the Bug still existed at least in MOS6502 or actually the MOS6510 when they were designing the C64..
Weather or IF the bug was ever corrected and when in the NMOS 6502's either by MOS or any of the cross licensed manufacturers is what we are trying to determine...
As I stated in the other thread,, The robot Arm I own has been running 29 years in a School or University with a 2mhz Rockwell R6502AP with a simple non pulsed rest circuit without smoking the CPU.. Also let me add here the reset circuit is a 4.7k charging a 47uf Cap,, And its quite hard to calculate the time constant because the supply voltage is rising from 0v on its way to 5v and reset toggles L to H at the gate threshold which varies somewhat from various chip brands and temp of the 74LS14,, On a very rough guess I'll say reset is only being held low for about 100 to a 125 ms... Which is far less time than the actual commodore pulsed reset at 500ms ,, AAAAAA Drain Bramage..
http://www.zimmers.net/anonftp/pub/cbm/ ... c64-05.gif
Last edited by falcon5252 on Mon Sep 12, 2011 3:00 am, edited 1 time in total.
When falling from a high place, You might as well try to fly
Re: Excerpt from "The rise of Mostek"
Thanks for the excerpt, falcon5252. Is "The rise of Mostek" something we can read online?
Regarding the reset bug, the most provoking aspect of the puzzle is the overheating thing -- a hardware fault so different from "soft" errors (such as missing flag updates in Decimal Mode, etc.) Here is one possible explanation.
What would be nice is to run some sort of concrete test. Is anyone willing to try a hardware experiment using an actual 6502? Can the Visual6502 be coaxed to reveal the truth? All comments (and offers of assistance) are appreciated!
-- Jeff
Regarding the reset bug, the most provoking aspect of the puzzle is the overheating thing -- a hardware fault so different from "soft" errors (such as missing flag updates in Decimal Mode, etc.) Here is one possible explanation.
- - at the silicon level, RESET is just an interrupt, much like NMI or IRQ. For the sake of economy, hardware is shared among these 3 functions as much as possible.
- RESET produces the same pattern of bus activity as IRQ and NMI. RESET actually results in stack access cycles as if pushing a return address. Perhaps the very earliest in-house 6502 prototypes actual did push a return address.
- But RST has no need to save a return address. In fact it may be considered undesirable that RST should write to memory.
- MOS opted to eliminate the push of the return address. The easiest way to make the change was to keep the stack access cycles, but simply let those cycles be reads instead of writes.
- Somehow they patched it so the R/W pin remains high during RST's dummy stack pushes. This satisfies the requirement that no write occur. But if the R/W pin is the only change they made then the system would experience bus contention. During the dummy push, does the CPU try to drive the external data bus (despite R/W being high)? Memory will be driving the data bus too, resulting in excess current flow -- and heating -- of CPU and memory ICs. Or, perhaps it's only internal buses within the 6502 that butt heads and draw excess current.
What would be nice is to run some sort of concrete test. Is anyone willing to try a hardware experiment using an actual 6502? Can the Visual6502 be coaxed to reveal the truth? All comments (and offers of assistance) are appreciated!
-- Jeff
Last edited by Dr Jefyll on Sun Sep 11, 2011 8:26 pm, edited 1 time in total.
-
falcon5252
- Posts: 74
- Joined: 16 Aug 2011
- Location: USA Pa
The Rise of MOS Technology,, Some of the links sited in the story are dead but its still a good read..
http://www.commodore.ca/history/company ... nology.htm
External contention is easy to test,, just poke the address and data with a scope or logic probe while the reset is low .. but still as long as the other chips on the board are in reset they are also prohibited from buss access to,, but being address and data on the nmos cannot be tri-stated some signal has to be on the buss probably all Low or all High at-least on the address buss because you really don't want the address decoders responding,, The answer to that should be in at-least one of the many datasheets,, There should be no buss contention except some not so well thought out user designed circuits,,
As for the internal circuitry I don't know enough about it to really comment on it, Other than it makes some sense in that if you keep accessing the same register endlessly the duty cycle on those transistors goes way up an could cause spot heating on the wafer, Maybe enough to damage it...
Maybe a email to Western Design Center,, Might be some of the original chip designers that left MOS still around that could settle this for us.. Bill Mensch the founder of WDC came straight from MOS Technologies with full ownership of all the 6502 hardware ( I stand corrected"MOS Tech not Mostek) Its been a long time sense i saw a chip with either lable on it somehow my brain melded the two )
http://www.commodore.ca/history/company ... nology.htm
External contention is easy to test,, just poke the address and data with a scope or logic probe while the reset is low .. but still as long as the other chips on the board are in reset they are also prohibited from buss access to,, but being address and data on the nmos cannot be tri-stated some signal has to be on the buss probably all Low or all High at-least on the address buss because you really don't want the address decoders responding,, The answer to that should be in at-least one of the many datasheets,, There should be no buss contention except some not so well thought out user designed circuits,,
As for the internal circuitry I don't know enough about it to really comment on it, Other than it makes some sense in that if you keep accessing the same register endlessly the duty cycle on those transistors goes way up an could cause spot heating on the wafer, Maybe enough to damage it...
Maybe a email to Western Design Center,, Might be some of the original chip designers that left MOS still around that could settle this for us.. Bill Mensch the founder of WDC came straight from MOS Technologies with full ownership of all the 6502 hardware ( I stand corrected"MOS Tech not Mostek) Its been a long time sense i saw a chip with either lable on it somehow my brain melded the two )
Last edited by falcon5252 on Mon Sep 12, 2011 3:12 am, edited 3 times in total.
When falling from a high place, You might as well try to fly
- BigDumbDinosaur
- Posts: 9425
- Joined: 28 May 2009
- Location: Midwestern USA (JB Pritzker’s dystopia)
- Contact:
Re: Excerpt from "The rise of Mostek"
falcon5252 wrote:
Excerpt from "The rise of Mostek"
- GARTHWILSON
- Forum Moderator
- Posts: 8773
- Joined: 30 Aug 2002
- Location: Southern California
- Contact:
I have not found any more info on this bug, but ioncannon's comment does support what I've been saying. I'm going on what I read in the 1980's, which I cannot find again. I have used only the CMOS version for the last 25 years, and there has been no reason to go back to the inferior NMOS one unless I had been doing a lot with the C64 which had the 6510 which was not available in a CMOS version. I don't know offhand when they quit making the NMOS 6502. I don't want people to run into the reset hardware problem, but if it is indeed a potential problem, they ought to know about it.
I can't put much credibility into an argument that a company could easily make non-trivial changes to the masks easily though, because to my knowledge, the only bug that ever got fixed in NMOS was ROR bug which performed entirely wrong the first year such that they didn't even list it in the instruction set. It was really messed up—in all address modes—and did not have a workaround. The worst of the other many bugs may have been the JMP(xxFF) where the page did not increment before reading the second operand byte, and in all the years the NMOS 6502 was made by different companies, even that one never got fixed.
I can't put much credibility into an argument that a company could easily make non-trivial changes to the masks easily though, because to my knowledge, the only bug that ever got fixed in NMOS was ROR bug which performed entirely wrong the first year such that they didn't even list it in the instruction set. It was really messed up—in all address modes—and did not have a workaround. The worst of the other many bugs may have been the JMP(xxFF) where the page did not increment before reading the second operand byte, and in all the years the NMOS 6502 was made by different companies, even that one never got fixed.
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?
The "second front page" is http://wilsonminesco.com/links.html .
What's an additional VIA among friends, anyhow?
-
falcon5252
- Posts: 74
- Joined: 16 Aug 2011
- Location: USA Pa
Garth.. It does say in the article "The rise of MOS" That once Commodore purchased MOS all interest turned to production and R&D was discouraged.. That's why most of their R&D department jumped ship... Including Bill Mensch one of the original designers of the 6502 who started WDC after leaving MOS,, So the lack of bug fixes can probably be blamed on Commodore management rather than the inability to do it...WDC went on to fix many bugs but by that time the CMOS version was already in the works.. And with the original design team gone MOS now under Commodore, They just kept pumping out the original 6502 design.. After all they were still selling millions of chips even with the bugs
Last edited by falcon5252 on Mon Sep 12, 2011 3:59 am, edited 1 time in total.
When falling from a high place, You might as well try to fly
Garth Wilson wrote:
I have not found any more info on this bug, but ioncannon's comment does support what I've been saying. I'm going on what I read in the 1980's, which I cannot find again.
falcon5252 wrote:
There should be no buss contention except some not so well thought out user designed circuits
Normally at any given time all the drivers on a bus are tri-stated (disabled) except one. If more than one are enabled simultaneously it represents a collision of sorts; ie, bus contention. A potential short-circuit exists, for example if the pull-up transistor of one driver tries to pull a bus line high while the pull-down transistor of another driver tries to pull the line low. The result is a large drain on the supply, with current flowing from VCC through the pull-up to the bus line then through the pull-down to ground.
Contention on an external bus is probably more serious since the current capability of the external-bus-driving transistors is greater than that for transistors driving internal buses. Also, correct me if I'm wrong, but with NMOS logic, don't they use weak, passive pull-up transistors for the internal logic? That would greatly reduce the current flow -- to safe values, in fact. (Mebbe I was wrong to suggest the bug could be the result of contention on internal buses. Contention on the external bus seems a more likely bet.)
-- Jeff
Re: NMOS 6502 Reset bug
Dr Jefyll wrote:
In one of our other threads we found ourselves discussing a somewhat mysterious reset bug reported to exist in NMOS 6502s.
The idea of the bug is that NMOS parts, or early NMOS parts, suffered a heating problem or even suffered damage if RST was active for too long. The information has not been found in any datasheet. Garth recalls it as being true, and ioncannon believes he saw a heating problem this year (**)
Checking Acorn's BBC micro and Electron schematics, neither make any effort to limit the length of RST. I have a BBC micro here, with a Rockwell NMOS 6502 with datecode 8402. I held RST for well over ten seconds, with no heating problem and no evidence of ill effect. Of course, that's a late datecode.
GARTHWILSON wrote:
I can't put much credibility into an argument that a company could easily make non-trivial changes to the masks easily though
GARTHWILSON wrote:
Making new masks for a design change was very expensive. It would not make sense for them to fix this bug without fixing several others; but those were never fixed on the NMOS 6502.
falcon5252 makes the point that an in-house fab can change the process to improve yield, and indeed the parent company can design according to the process capability. That might well have helped Commodore once they'd acquired MOS, and MOS having design and process very close would have helped them get good yields and performance faster, compared to a hypothetical company where design and process didn't communicate.
Dr Jefyll wrote:
Contention on an external bus is probably more serious since the current capability of the external-bus-driving transistors is greater than that for transistors driving internal buses. Also, correct me if I'm wrong, but with NMOS logic, don't they use weak, passive pull-up transistors for the internal logic?
The suppression of the stack writes during reset is something I still haven't tracked down in visual6502. Bear in mind that visual6502 is a particular NMOS part, in fact it had date code 8316 and is a Revision D. So, not an early part. (Although, it's possible that Rockwell, say, had a second source licence and never updated their mask copies other than to shrink them.)
Now, the references, for reference:
GARTHWILSON wrote:
At viewtopic.php?t=1759&start=4 , or the fifth post of the topic General Discussions-->Beginner in digital circuitry which is at viewtopic.php?t=1759 , after I mentioned the NMOS RST chip-heating bug, ioncannon wrote on Feb 1 of this year, "Ahh so it wasn't just me, whenever RST was grounded, the chip would heat up significantly." So far I have not found anything more on it though. My possibly inadequate search line was "6502 NMOS RST bug".
Making new masks for a design change was very expensive. It would not make sense for them to fix this bug without fixing several others; but those were never fixed on the NMOS 6502.
Making new masks for a design change was very expensive. It would not make sense for them to fix this bug without fixing several others; but those were never fixed on the NMOS 6502.
ioncannon wrote:
...
Ahh so it wasn't just me, whenever RST was grounded, the chip would heat up significantly. Should 500khz clock be ok? I read it's due to DRAM data inside the CPU degrading if the chip is not clocked fast enough.
GARTHWILSON wrote:
All good answers from BDD, but I think he's mostly thinking about the CMOS 6502. I don't think the NMOS one had a Schmitt-trigger input for RST\, so it needed a clean edge with a quick rise time. I can't find anything about it in the Rockwell or Synertek data sheets right now though. I do know that the NMOS ones had a die-heating problem with leaving the RST line down more than a tenth of a second or so. 50ms was what a lot of RST circuits were made to deliver. You will need more than just a switch, since the switch will produce a lot of bouncing instead of a clean RST signal. If the last low time is at least a few clock cycles long, you might be in luck, if the rise time is fast enough. Use a CMOS one and you won't have to worry about it.
...
The NMOS 6502 had several bugs and quirks that got fixed in the CMOS one. ...
...
The NMOS 6502 had several bugs and quirks that got fixed in the CMOS one. ...
Ed
ps. Edit: added footnote:
(*)
falcon5252 wrote:
The Rise of MOS Technology,, Some of the links sited in the story are dead but its still a good read..
http://www.commodore.ca/history/company ... nology.htm
http://www.commodore.ca/history/company ... nology.htm
Quote:
MOS had a secret weapon: the ability to "fix" its masks
(**) would be nice to know the datecode and manufacturer of the CPU - ah, I note it's a Nintendo, which is NMOS and contains a presumed unlicensed mask copy of a 6502 with 5 datapath transistors removed as a single-mask hack. It has some yield fixes which visual6502's revD does not have, but they could be Nintendo's. As it's a Nintendo chip, the reset problem might not even be in the 6502 section.
- BigDumbDinosaur
- Posts: 9425
- Joined: 28 May 2009
- Location: Midwestern USA (JB Pritzker’s dystopia)
- Contact:
GARTHWILSON wrote:
I can't put much credibility into an argument that a company could easily make non-trivial changes to the masks easily though, because to my knowledge, the only bug that ever got fixed in NMOS was ROR bug which performed entirely wrong the first year such that they didn't even list it in the instruction set. It was really messed up--in all address modes--and did not have a workaround. The worst of the other many bugs may have been the JMP(xxFF) where the page did not increment before reading the second operand byte, and in all the years the NMOS 6502 was made by different companies, even that one never got fixed.
My take on this apparent reset errata is like that of considering what happened if you ran a Pontiac straight-eight engine at too high an RPM: academically interesting to historical trivia buffs, but irrelevant in the context of current technology. My not-so-humble opinion is that contemplating what might or might not happen to an NMOS 6502 when reset is held down for a long time is in the same realm as wondering if that Pontiac straight-eight will go or blow at 6000 RPM.
-
falcon5252
- Posts: 74
- Joined: 16 Aug 2011
- Location: USA Pa
Nintendo: The altering the CPU mask was probably done to discourage reverse engineering and cloning their product.. They might have even changed a couple of Op-Codes.. The only other reason I can think for changing it, Was they needed to overclock it and that part of the circuit was preventing it.. It's only speculation on my part but I thought I'd throw it out here.. I really can't Imagine to many other reasons to have a CPU with a custom Mask.. All the Nintendos I had opened up in my life and I never glanced at the crystal to see what clock they were running..
When falling from a high place, You might as well try to fly
Hi falcon,
The supposition is that Nintendo went to the trouble of changing the poly layout (to remove the 5 transistors) so they wouldn't be infringing the patent on BCD correction. They were not seeking to protect their own invention, but re-using someone else's.
If you look at the 2A03 chip photos, you'll see that the rest of the chip has a completely different design style -the 6502 is like a photographic insert.
(Note that the 2A03 did need its own unique custom mask set: there's no question of re-using 6502 masks, only of re-using the mask layout)
Cheers
Ed
The supposition is that Nintendo went to the trouble of changing the poly layout (to remove the 5 transistors) so they wouldn't be infringing the patent on BCD correction. They were not seeking to protect their own invention, but re-using someone else's.
If you look at the 2A03 chip photos, you'll see that the rest of the chip has a completely different design style -the 6502 is like a photographic insert.
(Note that the 2A03 did need its own unique custom mask set: there's no question of re-using 6502 masks, only of re-using the mask layout)
Cheers
Ed
-
falcon5252
- Posts: 74
- Joined: 16 Aug 2011
- Location: USA Pa
- GARTHWILSON
- Forum Moderator
- Posts: 8773
- Joined: 30 Aug 2002
- Location: Southern California
- Contact:
Quote:
I've read(*) that MOS had a competitive advantage in that they could make trivial changes to their masks, where other companies would have to re-do one or more masks. That's more expensive. It's not unusual to seek fixes which affect the smallest number of masks, then as now.
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?
The "second front page" is http://wilsonminesco.com/links.html .
What's an additional VIA among friends, anyhow?
Well, of course, a whole variety of changes would need multi-layer fixes - and that's one reason why bugs remain. But it's also true that one and two layer fixes are possible, surprisingly often - and the economics of the situation are a strong motivator! The ROM/PLA approach can be helpful here (many sites where a transistor can be usefully added or removed as a single rectangle of active), as is the possibility of using the depletion mask to knock out individual pull-downs (as was used to fix bugs in the z80.)
Cheers
Ed
Cheers
Ed