6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Sat Nov 23, 2024 2:05 pm

All times are UTC




Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: Sat Mar 18, 2017 4:33 am 
Offline

Joined: Sat Mar 11, 2017 1:56 am
Posts: 276
Location: Lynden, WA
I think I understand this, but want to be sure I know exactly what's happening with a hardwired NOP test.

Tell me if this is right:

CPU comes on. I presume the first thing it does is look in a specific address for directions to first instruction. Since $EA is what it finds at this "address", it puts the instruction pointer at address location $EAEA. Thinking it's at this address, it executes the data it finds (NOP). It then advances the program counter, always finding a NOP instruction. It did this until it reaches the last address, after which I presume it starts over, this time at $0000.

Do I have that sequence correct?

Next, if I want to observe the addresses incrementing, can I hook the address bus directly to the GPIO pins of a microcontroller without some sort of buffer? I can't see why not. I'd like to use an Arduino to read the bus, and display the results in a serial terminal.

Can I hook the bus directly to the Arduinos GPIO pins? I figure since everything is CMOS, no real current gets sourced by the CPU, and all is safe. It's this correct?


Top
 Profile  
Reply with quote  
PostPosted: Sat Mar 18, 2017 4:56 am 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8545
Location: Southern California
Dan Moos wrote:
I think I understand this, but want to be sure I know exactly what's happening with a hardwired NOP test.

Tell me if this is right:

CPU comes on. I presume the first thing it does is look in a specific address for directions to first instruction. Since $EA is what it finds at this "address", it puts the instruction pointer at address location $EAEA. Thinking it's at this address, it executes the data it finds (NOP). It then advances the program counter, always finding a NOP instruction. It did this until it reaches the last address, after which I presume it starts over, this time at $0000.

Do I have that sequence correct?

Yes.

Quote:
Next, if I want to observe the addresses incrementing, can I hook the address bus directly to the GPIO pins of a microcontroller without some sort of buffer? I can't see why not. I'd like to use an Arduino to read the bus, and display the results in a serial terminal.

Can I hook the bus directly to the Arduinos GPIO pins? I figure since everything is CMOS, no real current gets sourced by the CPU, and all is safe. It's this correct?

You can do it that way, but you will probably have to slow the 6502's clock down to really see anything. Otherwise the high digit of a hexadecimal address display will change 122 times per second using $EA. If the 6502 is running at 1MHz, it will be at each address for 2µs if you use $EA, or 1µs for something like A9 (LDA #$A9). The Arduino will read invalid inputs at those time that the address happens to be changing between the Arduino port's set-up time and the hold time. If you can sync them, that won't be a problem; but maybe it's not anyway because the display will be changing too fast to see anything anyway.

_________________
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 Mar 18, 2017 5:10 am 
Offline

Joined: Sat Mar 11, 2017 1:56 am
Posts: 276
Location: Lynden, WA
I would have the Arduino do a new line every advance. That way I'd get a list I could read by stopping the computer. I'd probably use a signal generator as my clock in this test, so I could arbitrarily select a slow speed.


Top
 Profile  
Reply with quote  
PostPosted: Sat Mar 18, 2017 4:26 pm 
Offline
User avatar

Joined: Wed Feb 13, 2013 1:38 pm
Posts: 589
Location: Michigan, USA
Dan Moos wrote:
I would have the Arduino do a new line every advance. That way I'd get a list I could read by stopping the computer. I'd probably use a signal generator as my clock in this test, so I could arbitrarily select a slow speed.

When I did this several years ago using a 40-pin PIC & serial terminal, each press of the space bar would generate a single clock cycle (starting and ending with clock = high). I would display the contents of the address & data bus as well as the state of the R/W line. Instead of hard-wiring the data bus to 'EA', however, the PIC drove the data bus.

Good luck with your project.

Cheerful regards, Mike


Attachments:
6502 reset.png
6502 reset.png [ 8.08 KiB | Viewed 3032 times ]
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: No registered users and 21 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: