6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Thu May 09, 2024 3:40 am

All times are UTC




Post new topic Reply to topic  [ 7 posts ] 
Author Message
 Post subject: Strange NOP results
PostPosted: Sun Apr 03, 2022 9:53 am 
Offline

Joined: Wed Jul 28, 2021 7:49 am
Posts: 5
Hello!

So I'm just starting out with 6502s after a long while, and I'm getting some strange results.
I'm using a modified version of the arduino code Ben Eater used output. (Just changed the pin numbers)

The address jumps around despite a NOP being shown.

The resets also seem to be working weirdly.

Code:
First reset: address reads 3fff


0011111000010111   11101010   3e17  r ea
0101001001111111   11101010   527f  r ea
0000101000010000   11101010   0a10  r ea
0110011001001000   11101010   6648  r ea
0010111000000100   11101010   2e04  r ea
1000010001001100   11101010   844c  r ea
1101100100000010   11101010   d902  r ea
1011000101010010   11101010   b152  r ea
1111010100011010   11101010   f51a  r ea
0001111101010110   11101010   1f56  r ea

Second reset: address reads 9777

0100000010001111   11101010   408f  r ea
1010100111000000   11101010   a9c0  r ea
1110010110001000   11101010   e588  r ea
1000110111100100   11101010   8de4  r ea
1111011110010100   11101010   f794  r ea
0011001111111100   11101010   33fc  r ea
0101101110010010   11101010   5b92  r ea
0001011101001010   11101010   174a  r ea
0110111100000110   11101010   6f06  r ea
0010000101001110   11101010   214e  r ea

Third reset: address reads d685

1000110111101111   11101010   8def  r ea
1101011110000000   11101010   d780  r ea
1011101111101000   11101010   bbe8  r ea
1111101110111000   11101010   fbb8  r ea
1001011101110100   11101010   9774  r ea
1110111100111100   11101010   ef3c  r ea
0010000101000010   11101010   2142  r ea
0100100000001010   11101010   480a  r ea
0000000001000110   11101010   0046  r ea
0011110000001110   11101010   3c0e  r ea

Results from 3 different resets.

I am using an old Rockwell 6502 instead of the Western CMOS version used in his videos.


Top
 Profile  
Reply with quote  
 Post subject: Re: Strange NOP results
PostPosted: Sun Apr 03, 2022 3:39 pm 
Offline

Joined: Sat Feb 19, 2022 10:14 pm
Posts: 147
What clock speed are you using? It's likely the 6502 you're using isn't stable at that speed.


Top
 Profile  
Reply with quote  
 Post subject: Re: Strange NOP results
PostPosted: Sun Apr 03, 2022 3:49 pm 
Offline

Joined: Fri Apr 15, 2016 1:03 am
Posts: 136
If you're using a Rockwell R6502 CPU (older NMOS part with dynamic memory in its logic), it has a maximum clock period of 10usec. Clocking it much slower will probably make it fail.
The W65C02S CPU that Ben uses has no limit how slow it can be clocked.
Check the spec sheet for your particular CPU model. 6502.org has a wide selection of spec sheets you may find helpful.

The Ben Eater 6502_monitor.ino program will probably be much too slow to keep up with a 100KHz (10usec period) or faster CPU clock. I think it is intended for use with much slower clock rates.


Top
 Profile  
Reply with quote  
 Post subject: Re: Strange NOP results
PostPosted: Sun Apr 03, 2022 4:52 pm 
Offline

Joined: Wed Jul 28, 2021 7:49 am
Posts: 5
tmr4 wrote:
What clock speed are you using? It's likely the 6502 you're using isn't stable at that speed.


Using a 1MHz Crystal oscillator connected to phi in.


Top
 Profile  
Reply with quote  
 Post subject: Re: Strange NOP results
PostPosted: Sun Apr 03, 2022 4:55 pm 
Offline

Joined: Wed Jul 28, 2021 7:49 am
Posts: 5
leepivonka wrote:
The Ben Eater 6502_monitor.ino program will probably be much too slow to keep up with a 100KHz (10usec period) or faster CPU clock. I think it is intended for use with much slower clock rates.


That’s probably the issue. When connecting some LEDs to pins A15 and A14, they flash as expected.


Top
 Profile  
Reply with quote  
 Post subject: Re: Strange NOP results
PostPosted: Mon Apr 04, 2022 12:25 am 
Offline

Joined: Sat Feb 19, 2022 10:14 pm
Posts: 147
Cypress-25 wrote:
leepivonka wrote:
The Ben Eater 6502_monitor.ino program will probably be much too slow to keep up with a 100KHz (10usec period) or faster CPU clock. I think it is intended for use with much slower clock rates.


That’s probably the issue. When connecting some LEDs to pins A15 and A14, they flash as expected.


Yes, I couldn't get even an optimized Ben Eater monitor to work at 1 MHz. I had to buy a logic analyzer to monitor at that speed.


Top
 Profile  
Reply with quote  
 Post subject: Re: Strange NOP results
PostPosted: Sat May 07, 2022 7:28 am 
Offline

Joined: Fri Feb 12, 2021 10:17 pm
Posts: 34
Hi Cypress,

As mentioned at 1MHz you will have zero chance to catch the restart cycle ( .... fffc fffd ) .

Ben is using the "breadboard" clock module at that stage, single stepping with a 65c02. Even with a 65c02, the button to single step has to be debounced well, i.e. even a poorly debounced button will cause several clock cycles to occur rapidly enough that the Arduino monitor will miss many clock cycles, and this button bounce rate is far below the 1mhz speed.

If you didn't build the clock module do not worry, just proceed with the build, soon you will be adding the ram/rom, writing code to send messages to the LCD, finishing the videos and begin taking it further, adding an ACIA (6551 for example) so as to connect via serial to your pc, maybe another 6522, sd card, vga, sound...

Good luck, enjoy the journey and have fun.

_________________
Shaking out the dirty bits!

https://github.com/DonaldMoran


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: Google [Bot] and 4 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: