6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Sat Nov 23, 2024 3:39 am

All times are UTC




Post new topic Reply to topic  [ 125 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6, 7 ... 9  Next
Author Message
PostPosted: Fri Dec 07, 2012 4:21 pm 
Offline

Joined: Wed May 20, 2009 1:06 pm
Posts: 491
Commie wrote:
Thanks for all the fpga tutorial's responses from various members, thank you I will look them up.

Cheers
Commie


You may be able to do video with a Parallax Propeller or one of these boards:

http://www.4dsystems.com.au/prod.php?id=149


Top
 Profile  
Reply with quote  
PostPosted: Fri Dec 07, 2012 4:53 pm 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8507
Location: Midwestern USA
Commie wrote:
I purchased 4x W65C02 and 4xW65C22 from Mouser, the first one I tried would not run KB9, then I accidently pulled it out of my prototype whilst power was still applied, it never worked again,i.e., wouldnt even communicate with my console, so fair enough I blew the chip, so get another brand new one out of the tube, and try it, same result again, runs kim monitor rom but not KB9.
For what it's worth,I the made the same mistake with an NMOS R6502P and there after it carried on working no problem.

Are you sure that other devices on the board weren't damaged when you mistakenly unplugged the MPU with power applied?

Quote:
I more than anyone want the W65C02 to work, I have checked the data sheet and have applied the correct pullups on various pins, but alas nogo. It simply does not want to run KB9 which can only mean there is a question mark on WDC.

It's HIGHLY UNLIKELY that chip errata is to blame for this predicament. Hundreds of millions of WDC 65C02s have been sold and used, many for critical applications such as implantable defibrillators. If there was a fundamental defect in the device's operation it would have been encountered long ago. Invariably, when I've diagnosed problems of this nature, the cause is either something in the circuitry (a logic defect being a likely scenario in a new or one-off device) or code. Take your pick.

For what it's worth, my POC unit, which is powered by a W65C816S, a WDC part, worked flawlessly once I eliminated a hardware bug. Every instruction in the MPU does exactly what the data sheet says it's supposed to do. Although it has been quite a long time since I worked on anything with a W65C02S in it, I don't recall ever having any problem with that MPU's operation as well.

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


Top
 Profile  
Reply with quote  
PostPosted: Fri Dec 07, 2012 5:03 pm 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8507
Location: Midwestern USA
GARTHWILSON wrote:
clockpulse wrote:
I think that the problem may be that the Rockwell part has some branch on bit set/reset instructions and the WDC doesn't have those opcodes.

The WDC part has all of them and even a little more (STP & WAI) than the Rockwell 65c02 did; but he's talking about the non-CMOS Rockwell one. It sounds like the BASIC used some undefined op codes of the NMOS processor which the later CMOS ones replaced with well-behaved & more-useful ones. The CMOS op code table is still not full like the 65816's is, but the unused spots of the W65C02S effectively become NOPs.

Some of those undefined opcodes that map to NOPs are multibyte instructions. If KB-9 used any of them there's no telling what might happen.

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


Top
 Profile  
Reply with quote  
PostPosted: Fri Dec 07, 2012 5:44 pm 
Offline
User avatar

Joined: Fri Dec 11, 2009 3:50 pm
Posts: 3367
Location: Ontario, Canada
BigDumbDinosaur wrote:
Some of those undefined opcodes that map to NOPs are multibyte instructions. If KB-9 used any of them there's no telling what might happen.
BDD's right. And we have three processors at issue here: the NMOS, the Rockwell cmos and the WDC cmos. If there's an undefined opcode encountered I think it must have been put there intentionally -- it had a function (intended to execute on the NMOS part). Both of the cmos versions will fail to perform that function. And it's plausible that the failures would differ from one another -- one conspicuous, the other subtle. Perhaps we need to question more closely the observation that the Rockwell cmos runs KB9 properly.

Commie wrote:
my tests are conclusive
Not yet. IMO it won't be conclusive until you find out what happened, down to the exact instruction.

It's apparent that the WDC chip is somehow different, but not all differences are defects. I think we'll find that the WDC parts live up to their published specifications, if we get to the bottom of the matter. The question is how to do that :?

-- Jeff

_________________
In 1988 my 65C02 got six new registers and 44 new full-speed instructions!
https://laughtonelectronics.com/Arcana/ ... mmary.html


Last edited by Dr Jefyll on Fri Dec 07, 2012 6:06 pm, edited 1 time in total.

Top
 Profile  
Reply with quote  
PostPosted: Fri Dec 07, 2012 6:06 pm 
Offline

Joined: Mon Nov 19, 2012 11:08 pm
Posts: 29
BigDumbDinosaur wrote:
GARTHWILSON wrote:
clockpulse wrote:
I think that the problem may be that the Rockwell part has some branch on bit set/reset instructions and the WDC doesn't have those opcodes.

The WDC part has all of them and even a little more (STP & WAI) than the Rockwell 65c02 did; but he's talking about the non-CMOS Rockwell one. It sounds like the BASIC used some undefined op codes of the NMOS processor which the later CMOS ones replaced with well-behaved & more-useful ones. The CMOS op code table is still not full like the 65816's is, but the unused spots of the W65C02S effectively become NOPs.

Some of those undefined opcodes that map to NOPs are multibyte instructions. If KB-9 used any of them there's no telling what might happen.


Hi Guys,

I specifically ordered the Rockwell 65C02P4 micro, it's the closest I could(can) get to the CMOS W65C02S. My Rockwell CMOS parts arrived yesterday and 'in a way' I was hoping the CMOS Rockwell parts were going fail then I could at least draw a line and tell the world that the NMOS 6502 is 99% compatible with the CMOS 65C02 but thats not what happened as I've said elsewhere the CMOS Rockwell parts rock perfectly.

I know I've said this before but I will say it again, the W65C02S work in my system, it runs the 2kbyte KIM 1 monitor rom no problem, so it does work there, if there were other chips damaged in my system due to my incompetence then the other micro's wouldn't work either and yet they do.

Exactly how close the W65C02S is to the R65C02, is uncertain but I can remember reading the Rockwell data sheet and I destintly remember it having an enhanced instruction set similar to the W65C02S.

Cheers for now
Commie


Top
 Profile  
Reply with quote  
PostPosted: Fri Dec 07, 2012 6:22 pm 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10986
Location: England
Hi commie
Note that we do have equivalent sources for the ROM. Have you checked that your ROM is byte-exact with the image you downloaded? Can you check that it matches the ROM sources I posted a link to?

Could you stick BRK at various points in the ROM to see if they are hit? I'm presuming you can arrange BRK to drop into your monitor.

Cheers
Ed


Top
 Profile  
Reply with quote  
PostPosted: Fri Dec 07, 2012 7:58 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8544
Location: Southern California
Quote:
but not all differences are defects.
+1. There's nothing wrong with the W65C0S. Bill Mensch, president of WDC, is the designer of the CMOS 6502, and hundreds of millions of units of this processor are going into products even today, including life-support products. Several of us on the forum have been using WDC processors, with no problem.

I'm not familiar with KB-9. Do you have the source code, and if not, does it even still exist? It would be much easier to figure out which way the bear went into the woods if you can troubleshoot with actual source code that you can modify and re-assemble and try again and repeat the cycle over and over as you home in on the problem area. My debugging tips at http://wilsonminesco.com/6502primer/debug.html are what I've used to develop many products that I did in assembly. I would be interested to know which instruction is messing it up.

_________________
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 Dec 07, 2012 8:04 pm 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10986
Location: England
I'm pretty sure I already posted the source code - why does it seem that no-one saw it?


Top
 Profile  
Reply with quote  
PostPosted: Fri Dec 07, 2012 8:22 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8544
Location: Southern California
Ah yes, you did. I wasn't paying attention. My apologies.

_________________
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 Dec 07, 2012 9:08 pm 
Offline
User avatar

Joined: Fri Dec 11, 2009 3:50 pm
Posts: 3367
Location: Ontario, Canada
Sorry Ed. Thanks for posting that; I failed to mention I had a look -- just scanned the README files and glanced at the file sizes. Unfortunately that left me none the wiser.

_________________
In 1988 my 65C02 got six new registers and 44 new full-speed instructions!
https://laughtonelectronics.com/Arcana/ ... mmary.html


Top
 Profile  
Reply with quote  
PostPosted: Fri Dec 07, 2012 9:18 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8544
Location: Southern California
The links in his post at the top of page 2 of this topic have a lot more than the first one did.

_________________
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 Dec 07, 2012 9:22 pm 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10986
Location: England
This is where I determined that we do have the source: viewtopic.php?p=22785#p22785
And I posted the assembly listing file at https://gist.github.com/4127984
(The gist contains two files: the symbol table and the listing)

Note: we only have the source if the ROM has been downloaded and programmed with the same bytes that I compared against.

Cheers
Ed


Top
 Profile  
Reply with quote  
PostPosted: Sat Dec 08, 2012 5:34 am 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8507
Location: Midwestern USA
I took a quick peek at the ROM listing and am seeing things like:
Code:
001C2Cr 2  20 rr rr             jsr     POLYNOMIAL
and
Code:
001C4Br 2  4C rr rr             jmp     FMULT

:?: :?: :?: :?: :?:

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


Top
 Profile  
Reply with quote  
PostPosted: Sat Dec 08, 2012 7:12 am 
Offline
User avatar

Joined: Fri Dec 11, 2009 3:50 pm
Posts: 3367
Location: Ontario, Canada
Quote:
Kim runs and communicates with my tty emulator no problem
Commie, are you still eager to see that WDC chip working per expectations (or at least seeing the puzzle solved)? Let me know what you think of this for a troubleshooting idea:

  • set up one of the timers in the KIM-1's RIOT chips to generate a periodic interrupt
  • let the interrupt handler dump trace info to the TTY -- some combination of reg's and/or the return address off the stack
  • run KB9 and take a picture of the TTY emulator screen or else save it to disk. Swap processors and repeat.

I've skipped over some important details but no show-stoppers AFAIK. You see where I'm going with this. You'll be able to easily collect a lot of data points, and by comparing them you'll eventually find where the execution divergence starts. Then we'll have an answer -- or at least a much-improved set of questions! :wink:

BDD wrote:
:?: :?: :?: :?: :?:
Strange stuff there, BDD. Could that rr rr business indicate an address that would need changing if the program is to be relocated? (I'm guessing.)

cheers
Jeff

_________________
In 1988 my 65C02 got six new registers and 44 new full-speed instructions!
https://laughtonelectronics.com/Arcana/ ... mmary.html


Top
 Profile  
Reply with quote  
PostPosted: Sat Dec 08, 2012 7:49 am 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10986
Location: England
I think the listing must be produced before the assembler has entirely resolved all addresses. As promised on Michael's blog, assembling his code does produce exactly the same ROM.
Cheers
Ed


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 125 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6, 7 ... 9  Next

All times are UTC


Who is online

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