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

All times are UTC




Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: Sat May 18, 2013 12:34 am 
Offline

Joined: Fri Mar 15, 2013 4:29 pm
Posts: 4
Time for another newbie question.

I just got an Arduino Due with the nice 32 bit MCU and being that I never had a real 6502 circuit running I went and bought a couple G65SC02P-1 chips as well. I wired up all the address bus lines and data bus lines to the Arduino as well as the clock-0 line. I also wired up the interrupts,ready,reset,etc all to high I think. It runs through addresses the current way I have it. Anyway, I've got a LCD display to tell me what the current data bus signal is, address bus signal is and if the CPU is trying to read or write (r/w pin state).

My first test was to just make the data line always output EA (NOP) from the Arduino to the chip, which worked, r/w was always high (read), address would increment every 2 clock cycles (clock from Arduino btw) and the data would always read EA. Very exciting.

My second test however, was to make the data line always output 4C (JMP direct address) to the data line, so the way I saw it it would always be trying to JMP $4C4C .
I've tried this in emulators and its worked, but when I try it on my rig it outputs the following (first is addr, second is data and third is r/w):

Code:
A9E4 4C R
A9E5 4C R
A9E6 4C R
8C8C 32 W
A9E7 4C R
A9E8 4C R
A9E9 4C R
8C8C 32 W


and so on. There are 3 cycles of 3 continuous addresses, then it tries to write $32 to the address 8C8C. It just goes on forever.

Anyone have any Idea of what is wrong? Or have I just made a terrible mistake?

Heres a link to the arduino code, but I'm not sure its the source of the problem (could be wrong though).
http://pastebin.com/MUxQdjfp


Top
 Profile  
Reply with quote  
PostPosted: Sat May 18, 2013 1:00 am 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8541
Location: Southern California
You appear to have the data bus bits 6 & 7 swapped, so you're telling it over and over STY $8C8C, and Y happens to have $32 in it.. 8C is the op code for STY abs.

_________________
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: Sat May 18, 2013 5:16 am 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10980
Location: England
Nice diagnosis! It's so easy to make a wiring error. We've all had our head-scratching moments.
Cheers
Ed


Top
 Profile  
Reply with quote  
PostPosted: Sat May 18, 2013 4:51 pm 
Offline

Joined: Fri Mar 15, 2013 4:29 pm
Posts: 4
It worked! Of course I checked the addr bus wiring like 100 times...

Anyway, that was a suspicious level of deduction...

You guys know your stuff, thanks again.

And now this will forever stand as proof of my dumb mistake.


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

All times are UTC


Who is online

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