6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Sun Nov 24, 2024 3:18 pm

All times are UTC




Post new topic Reply to topic  [ 15 posts ] 
Author Message
PostPosted: Sun Nov 24, 2019 11:42 pm 
Offline

Joined: Mon Sep 17, 2018 2:39 am
Posts: 138
Hi!

For amusement, I purchased a very cheap 6502 from an aliexpress seller, from the photo I already expected it to be fake: https://www.aliexpress.com/item/33021360734.html

This is what I received:

Attachment:
File comment: IC top view
ic-top.jpg
ic-top.jpg [ 96.19 KiB | Viewed 4240 times ]
Attachment:
File comment: IC bottom view
ic-bottom.jpg
ic-bottom.jpg [ 102.16 KiB | Viewed 4240 times ]


Well, it seem it is a relabeled chip, time to do research!. Tested with a multimeter, pins 5, 35 and 36 are N/C, and pin 8 is VDD, so it seems a real 6502. So, I attached it to a breadboard with 1MHz clock signal, resistors at the inputs and some logic analyzer probes:

Attachment:
File comment: Probing the IC
ic-probe.jpg
ic-probe.jpg [ 154.76 KiB | Viewed 4240 times ]


First, data bus set to $EA (a simple NOP), this is the trace, blue vertical line marks the start of RESET:

Attachment:
File comment: Trace $EA
mos6502-EA.png
mos6502-EA.png [ 45.19 KiB | Viewed 4240 times ]


It behaves like a proper 6502, but at closer examination the RESET sequence actually writes to the stack, this is not supposed to happen in a NMOS 6502.... so I tested the data bus set to $FA (invalid on the NMOS 6502, PLX in the 65C02):

Attachment:
File comment: Trace $FA
mos6502-FA.png
mos6502-FA.png [ 45.5 KiB | Viewed 4240 times ]


It is a PLX, this means this is a 65C02. And setting the data bus to $FF, I got this:

Attachment:
File comment: Trace $FF
mos6502-FF.png
mos6502-FF.png [ 47.32 KiB | Viewed 4240 times ]


A one cycle NOP. So, this is not a newer 65C02, is an original 65C02 without the Rockwell extensions. Searching online, the only 65*02 that is documented to write to the stack on reset is the "G65SC02".

My questions: Do anyone know of other possibilities? Is there any other test I could do to properly identify the chip?

Have Fun!


Top
 Profile  
Reply with quote  
PostPosted: Mon Nov 25, 2019 2:26 am 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10986
Location: England
Great idea and well executed! (Sorry, can't answer the specific question)


Top
 Profile  
Reply with quote  
PostPosted: Mon Nov 25, 2019 9:09 am 
Offline
User avatar

Joined: Tue Mar 02, 2004 8:55 am
Posts: 996
Location: Berkshire, UK
The 65SC02 does not have the bit operations BBR/BBS/SMB/RMB.

You could try using a SMB/RMB opcode and look for a locked memory access.

_________________
Andrew Jacobs
6502 & PIC Stuff - http://www.obelisk.me.uk/
Cross-Platform 6502/65C02/65816 Macro Assembler - http://www.obelisk.me.uk/dev65/
Open Source Projects - https://github.com/andrew-jacobs


Top
 Profile  
Reply with quote  
PostPosted: Mon Nov 25, 2019 11:59 am 
Offline

Joined: Mon Sep 17, 2018 2:39 am
Posts: 138
Hi!

BitWise wrote:
The 65SC02 does not have the bit operations BBR/BBS/SMB/RMB.

You could try using a SMB/RMB opcode and look for a locked memory access.

I already tried $FF, "BBS7 ZP", look at the third plot above, so I know it does not have the Rockwell extensions.

Looking at old datasheets, the NCR 65C02, Synertec SY65C02 and the CMD G65SC02 are the ones that only support the original opcodes, without Rockwell extensions, but only the CMD G65SC02 documents the write to the stack on reset. Sadly, there I could not found an old WDC datasheet to look at the original.

Have Fun!


Top
 Profile  
Reply with quote  
PostPosted: Mon Nov 25, 2019 1:58 pm 
Offline
User avatar

Joined: Sat Dec 01, 2018 1:53 pm
Posts: 730
Location: Tokyo, Japan
This is really great work. It would be interesting to build an automatic tester into which one could drop parts alleged to be 6502s and see what they really are. (I don't know how useful this would really be, though.)

_________________
Curt J. Sampson - github.com/0cjs


Top
 Profile  
Reply with quote  
PostPosted: Mon Nov 25, 2019 2:07 pm 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10986
Location: England
cjs wrote:
This is really great work. It would be interesting to build an automatic tester into which one could drop parts alleged to be 6502s and see what they really are. (I don't know how useful this would really be, though.)

See this previous thread:


Top
 Profile  
Reply with quote  
PostPosted: Mon Nov 25, 2019 5:24 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8546
Location: Southern California
dmsc wrote:
but only the CMD G65SC02 documents the write to the stack on reset. Sadly, there I could not found an old WDC datasheet to look at the original.

The Aug '92 W65C02 data sheet I have here (which is as far back as I have, and it's on paper) says there are no writes in the reset sequence.

_________________
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 Nov 25, 2019 6:29 pm 
Offline

Joined: Mon Sep 17, 2018 2:39 am
Posts: 138
Hi!

GARTHWILSON wrote:
dmsc wrote:
but only the CMD G65SC02 documents the write to the stack on reset. Sadly, there I could not found an old WDC datasheet to look at the original.

The Aug '92 W65C02 data sheet I have here (which is as far back as I have, and it's on paper) says there are no writes in the reset sequence.


So, the winner is a CMD G65SC02 .... strange that of all possibilities, I thought this would be the least common.

Now, I wonder, where the seller got this chip? It is certainly used, so from a pinball machine or an arcade?

Have Fun!


Top
 Profile  
Reply with quote  
PostPosted: Mon Nov 25, 2019 9:05 pm 
Offline
User avatar

Joined: Thu May 14, 2015 9:20 pm
Posts: 155
Location: UK
See also this eBay listing...

And this thread over on StarDot

Mark


Top
 Profile  
Reply with quote  
PostPosted: Tue Nov 26, 2019 12:28 am 
Offline

Joined: Mon Sep 17, 2018 2:39 am
Posts: 138
Hi!

1024MAK wrote:
See also this eBay listing...

And this thread over on StarDot

Mark


Well, that photo from the ebay listing looks fake to me, but ho knows.... and it is expensive at £5.99 !!!

At least mine was only US$0.75 :P

Looking at my test results, one could do a 6502 tester with an arduino ad only a few pins: to test instructions $EA, $FA and $FF you only need control over 5 pins: Phi0, RESET, D0, D2 and D4, and only need to read 4 pins: SYNC, R/W, A0, A1, and if you also read pin 5 (MLB) you can also detect a newer WDC65C02.

So, with a simple Arduino pro-mini (about US$1.5 on aliexpress) and a few 2k2 resistors you could build a complete 6502 tester.

Have Fun!


Top
 Profile  
Reply with quote  
PostPosted: Tue Nov 26, 2019 10:10 pm 
Offline

Joined: Mon May 21, 2018 8:09 pm
Posts: 1462
I haven't actually got around to building my 6502 Fake Finder yet; I've had day-job type interference which included a week-long visit to Singapore. Interesting place; probably wouldn't want to live there though.

The idea behind it, though, is that it performs both software tests (to identify the core version - this one would be a "65SC02" as it doesn't have the bit ops) and hardware signal examination (to identify the chip built around it). It does assume that it's a genuine 6502 of *some* sort with a compatible pinout (or a 65816, which is sufficiently compatible to test), but that it might be mislabelled as to model, like yours. It wouldn't be able to deal with something like a 6510, which has an incompatible pinout.


Top
 Profile  
Reply with quote  
PostPosted: Wed Nov 27, 2019 1:54 am 
Offline

Joined: Mon Sep 17, 2018 2:39 am
Posts: 138
Hi!

Chromatix wrote:
I haven't actually got around to building my 6502 Fake Finder yet; I've had day-job type interference which included a week-long visit to Singapore. Interesting place; probably wouldn't want to live there though.

The idea behind it, though, is that it performs both software tests (to identify the core version - this one would be a "65SC02" as it doesn't have the bit ops) and hardware signal examination (to identify the chip built around it). It does assume that it's a genuine 6502 of *some* sort with a compatible pinout (or a 65816, which is sufficiently compatible to test), but that it might be mislabelled as to model, like yours. It wouldn't be able to deal with something like a 6510, which has an incompatible pinout.


It would be easy to at least support all the chips in this page: http://www.acornatom.nl/sites/fpga/www. ... 02_cpu.htm , but as you say, identifying a 6510 would need a much more complex circuit. Also, you could add a test for the MC6800, MC6802 and MC6808, the pinout is almost equal to the 6502.

Have Fun!


Top
 Profile  
Reply with quote  
PostPosted: Mon Dec 09, 2019 1:01 pm 
Offline

Joined: Mon May 21, 2018 8:09 pm
Posts: 1462
It would be harder to identify the Motorola chips, because the software runs on the CPU under test - so it'd have to be written for two very different ISAs at once. That's a complication I'd rather not take on. It should be enough to observe that the display doesn't respond when power is applied, so we can infer "this is not a 6502".


Top
 Profile  
Reply with quote  
PostPosted: Mon Dec 09, 2019 1:22 pm 
Offline
User avatar

Joined: Sat Dec 01, 2018 1:53 pm
Posts: 730
Location: Tokyo, Japan
Chromatix wrote:
It would be harder to identify the Motorola chips, because the software runs on the CPU under test - so it'd have to be written for two very different ISAs at once.

Couldn't you do a quick initial guess just by holding pins 21 GND and 40 /RESET low, gently applying power to pin 8 (Vcc), raising /RESET, and noting whether it fetches the reset vector from $FFFC/D (6502) or $FFFE/F (6800)?

_________________
Curt J. Sampson - github.com/0cjs


Top
 Profile  
Reply with quote  
PostPosted: Wed Dec 11, 2019 9:54 am 
Offline

Joined: Mon May 21, 2018 8:09 pm
Posts: 1462
If you're testing manually, you can do whatever you like. When the software doing that test is executing on the CPU under test, it gets somewhat more complicated. I haven't yet heard of a case where a CPU marked as a 6502 turned out to actually be a 6800, though I *have* heard of numerous cases of them turning out to be a different 6502, or occasionally something else entirely (in one case, a 42-pin chip that was probably an EEPROM).


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: No registered users and 48 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: