6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Thu Nov 14, 2024 5:54 pm

All times are UTC




Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: Fri Jan 10, 2014 5:50 pm 
Offline
User avatar

Joined: Wed Feb 13, 2013 1:38 pm
Posts: 589
Location: Michigan, USA
Greetings guys:

The R65C02 Datasheet I have says that it takes seven cycles after detecting the rising edge on the /RES pin before the CPU fetches the reset vector but I'm only counting five cycles. May I ask if anyone has tried this, please?

Thanks in advance. Cheerful regards, Mike


Attachments:
6502 reset.png
6502 reset.png [ 8.08 KiB | Viewed 1512 times ]


Last edited by Michael on Fri Jan 10, 2014 6:33 pm, edited 1 time in total.
Top
 Profile  
Reply with quote  
PostPosted: Fri Jan 10, 2014 6:13 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8540
Location: Southern California
Fetching the vector is part of the 7-cycle reset sequence.  After that, it's off and running in your reset routine.

BTW, if you were to want a single cycle per byte fetched, you could use something like A9 (LDA#) instead of EA (NOP).  You'll get LDA #$A9 over and over which takes two cycles for a two-byte instruction.

_________________
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 Jan 10, 2014 9:18 pm 
Offline
User avatar

Joined: Wed Feb 13, 2013 1:38 pm
Posts: 589
Location: Michigan, USA
Thanks for the info'/confirmation, Garth. My interpretation of the Datasheet was way off.

I've never had a way to see those extra clock cycles before. Single cycle stepping, as well as having the ability to feed the R65C02 with data (after disabling the address decoder circuitry), is pretty cool...

Cheerful regards, Mike


Top
 Profile  
Reply with quote  
PostPosted: Tue Oct 15, 2024 5:21 pm 
Offline

Joined: Tue Oct 15, 2024 5:13 pm
Posts: 1
It takes 7 cycles because a RESET is just a BRK command ordered via hardware.
T0 fetch brk opcode
T1 discarded data read cycle
T2 Push High byte stack pointer to Stack
T3 Push Low byte stack pointer to Stack
T4 Push Status register to Stack
T5 Fetch low order byte for RESET VECTOR FFFC
T6 Fetch High order byte for RESET VECTOR FFFD

you can see it in the 6502 schematic https://blog.espaciotec.com.ar/wp-conte ... /06/18.png

The Predecode logic inserts an OPCODE of 00 or BREAK when a reset is pushed.

Regards

Carlinho


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 2 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: