6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Sun Oct 06, 2024 5:27 pm

All times are UTC




Post new topic Reply to topic  [ 7 posts ] 
Author Message
PostPosted: Thu Feb 28, 2013 10:46 pm 
Offline

Joined: Thu Feb 28, 2013 10:12 pm
Posts: 2
Hi there. Wondering if anyone can help me solve a mystery. I have a certain 6502 chip (labeled R6502AP/R6502-13/8147) that acts a little funkier than every other 6502 chip that's been tested. It runs certain parts of the game twice as fast as it should, more specifically where delay loops are concerned. Either this particular chip has failed in this very specific way or it is an earlier "buggier" version of the 6502 chip. Any insights? Would a relabeled zip chip produce these results?

Thanks in advance.


Top
 Profile  
Reply with quote  
PostPosted: Thu Feb 28, 2013 11:10 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8521
Location: Southern California
Welcome. A double speed sounds pretty unlikely. Even the 65CE02 which eliminated most of the dead bus cycles still only sped things up about 25% if you didn't re-write the code to take advantage of the new instructions, because most bus cycles are necessary and cannot be eliminated. LDA absolute for example will always be four clocks: one to fetch each byte of the 3-byte instruction and one to fetch the data from the actual target address. The same goes for all the other instructions, other than where there's one additional clock added for certain internal operations like changing the address high byte when branching or indexing across a page boundary.

_________________
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: Thu Feb 28, 2013 11:18 pm 
Offline

Joined: Thu Feb 28, 2013 10:12 pm
Posts: 2
Thanks. The speedup is exactly twice as fast. Is this something an earlier "buggier" NMOS chip might do, since I read that sometimes this chip clears timer flags?


Top
 Profile  
Reply with quote  
PostPosted: Fri Mar 01, 2013 1:27 am 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10949
Location: England
Very odd! If the game is not cpu-limited, but the tempo is based on a timer interrupt, then at least there's a possibility of this kind of misbehaviour - or indeed, if the delays are based on a loop and the zero-detect is broken so that the loop finishes early, I supposed that's possible too. For the timer case, it would only be seeing the right number of interrupts, so the failure would have to be somehow failing to clear them, or otherwise re-entering the interrupt routine. Or, perhaps, the interrupt routine increments a counter and that's what's going on.
If 8147 is a datecode, that's 1981, so it's not an early chip.
Seems more likely to be a one-off failure of this particular chip, not a design difference to be found in all such chips.
Cheers
Ed


Top
 Profile  
Reply with quote  
PostPosted: Sat Mar 16, 2013 12:12 pm 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10949
Location: England
Pasting in posts from a follow-on thread, which can I think usefully be deleted:

futurama65 wrote:
Hey everybody,
I asked a somewhat similar question (and much less specific) on an earlier post, so forgive me if this seems like a re-thread. I have a glitchy 6502 chip (R6502AP-13) from an 80's arcade game that runs its intended program delay loops twice as fast as it should. The delay loops are are software based - not tied to the video refresh. The delay loops are directly influenced by the CPU clock speed. It seems that the 6502 has spontaneously started running double CPU cycles for its clock pulses.

Has anybody every seen this kind of glitch (perhaps caused by some static electricity or voltage spike) in a 6502 chip? All other parts of the program apparently run at normal speed. What exactly could be causing the 6502 to behave in this manner?

I could provide the affected lines of code if that helps.

Thanks in advance for your insight.
tim


GARTHWILSON wrote:
I know some forums don't want you to revive old threads; but here where projects may take years and it's also helpful to be able to review what was discussed before, it might have been better to continue on the same thread. For reference, it was at viewtopic.php?f=3&t=2458.

What does the clock circuit consist of in the computer you're talking about? Since it's not a CMOS processor (65c02), you wouldn't have an RC or crystal connected directly to the processor, but is one of those connected to a separate circuit, or does it have an oscillator can? The oscillator cans seem to be pretty dependable, but especially home-made crystal-oscillator circuits may not remain stable under all conditions (especially across temperature and voltage). When I made crystal oscillators 20 years ago, I remember them taking off on the wrong frequency if I didn't find the sweet spot for feedback. This is a fault of the oscillator and has nothing to do with the processor.


futurama65 wrote:
Yes, I should have posted under previous post. Thanks for showing the link.

Forgive me for not being incredibly knowledgeable in this field. I am documentary filmmaker who has been following the high score on a classic game that happens to use the 6502. Somebody got a world record, but further analysis showed that certain non-critical sub routines (involving a delay loop/timer countdown) were running faster, giving the player an unfair advantage.

So the program is on a big PCB with 11 Eproms, the 6502 and the 11.289 MHZ crystal. Swapping the PCB with another 6502 fully corrects the problem. The programmers of the game say that there is a failure on the 6502, but don't know exactly what is going on.


Top
 Profile  
Reply with quote  
PostPosted: Sat Mar 16, 2013 12:16 pm 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10949
Location: England
Hi futurama65
I believe further ideas and information have come to light in a more private channel. Are you OK for me to paste them here, would you prefer to do it, or would you prefer to keep those ideas and information off the forum at this time?

(If you do paste the info here, please do not paste any email addresses.)

Cheers
Ed


Top
 Profile  
Reply with quote  
PostPosted: Thu Oct 10, 2013 8:12 pm 
Offline

Joined: Sun Sep 15, 2002 10:42 pm
Posts: 214
> I could provide the affected lines of code if that helps.

This would be interesting.

IIRC the old 6502 NMOS bug was in the ROR instruction, and these were only in the very early 6502s.
The only one I've ever seen with the ROR bug was a ceramic 6502 in a KIM-1 with a 1975 datecode owned by Ken Arnold.

Toshi


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

All times are UTC


Who is online

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