6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Fri Sep 20, 2024 2:44 pm

All times are UTC




Post new topic Reply to topic  [ 12 posts ] 
Author Message
 Post subject: Sync pin behaviour
PostPosted: Fri Mar 08, 2019 2:18 am 
Offline

Joined: Sat Mar 11, 2017 1:56 am
Posts: 276
Location: Lynden, WA
Simple question. Does SYNC go HIGH for only the first byte of an opcode fetch, or does it stay HIGH for as many cycles as there are bytes to fetch? For instance, the LDX #$FF is a two byte opcode, taking to cycles to fetch. Is SYNC high for both cycles?

Second question: Is this specific behavior different on an original NMOS part, as opposed to a modern 65C02?

Here's the context. I'm trying to set up an inverse assembler on my logic analyzer. I show SYNC being HIGH for as many cycles as an opcode has bytes. Meanwhile, the fellow on the EEVBlog forum that is helping me, has the same inverse assembler running on the same logic analyzer, and it seems to me that his SYNC must go low after the first byte of the fetch. He is running an original KIM though, which I presume has an original part. I'm am still mid conversation with the guy, so maybe all will be cleared up after his next post. Just though I'd query more minds while I wait!


Top
 Profile  
Reply with quote  
 Post subject: Re: Sync pin behaviour
PostPosted: Fri Mar 08, 2019 2:28 am 
Offline
User avatar

Joined: Fri Dec 11, 2009 3:50 pm
Posts: 3367
Location: Ontario, Canada
SYNC is high for the opcode byte only -- just one cycle. This is true for 6502 and 65C02. (On 65C815 that same cycle is marked by VPA and VDA both being high -- for '816, *that* is "SYNC.")

J. :)

_________________
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  
 Post subject: Re: Sync pin behaviour
PostPosted: Fri Mar 08, 2019 4:56 am 
Offline

Joined: Sun Oct 14, 2012 7:30 pm
Posts: 107
SYNC does not change during a WRITE operation either.

I just so happen to be knee deep in developing a 65xx emulator/accelerator board. If you use one of Saleae's LOGIC devices I can send you the .logicdata file of a 6502 starting up, coming out of reset, and then executing code (for a Commodore 1541 disk drive).


Attachments:
Clipboard01.jpg
Clipboard01.jpg [ 165.64 KiB | Viewed 1371 times ]
Top
 Profile  
Reply with quote  
 Post subject: Re: Sync pin behaviour
PostPosted: Fri Mar 08, 2019 7:39 am 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10938
Location: England
Interesting projects!

As a reference, or just for fun, I recommend a good look at hoglet's project to decode 6502 behaviour, starting with minimal signals and reducing to surprisingly minimal signals:

The only time SYNC stays high for more than one cycle is if the fetch is extended by bringing RDY low: see this visual6502 simulation.


Top
 Profile  
Reply with quote  
 Post subject: Re: Sync pin behaviour
PostPosted: Fri Mar 08, 2019 12:14 pm 
Offline
User avatar

Joined: Fri Dec 11, 2009 3:50 pm
Posts: 3367
Location: Ontario, Canada
BigEd wrote:
The only time SYNC stays high for more than one cycle is if the fetch is extended by bringing RDY low
For the 65C02 another special case exists. The C02's undefined aka illegal opcodes include 32 which are one-cycle NOP's. Because the time to fetch one of these instructions equals the time to execute one of these instructions, coding a bunch of them in sequence will cause SYNC will go high and stay high for the duration of the sequence.

( Details on the C02's undefined opcodes are here. Although these are described as NOP's, there are various behaviors exhibited -- some of which generate bus activity which is interesting and even potentially useful. )

-- 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 Mar 08, 2019 1:46 pm, edited 2 times in total.

Top
 Profile  
Reply with quote  
 Post subject: Re: Sync pin behaviour
PostPosted: Fri Mar 08, 2019 1:21 pm 
Offline
User avatar

Joined: Wed Mar 01, 2017 8:54 pm
Posts: 660
Location: North-Germany
Dr Jefyll wrote:
For the 65C02 another special case exists. The C02's undefined aka illegal opcodes include 32 which are one-cycle NOP's. Because the time to fetch one of these instructions equals the time to execute one of these instructions, coding a bunch of them in sequence will cause SYNC will go high and stay high for the duration of the sequence.
Ha! So the 65C02 got an extra output pin! Probably useful for serial I/O. Together with /IRQ as input (used in the 6502-Badge) this could be a limited UART replacement. 8)
Most likely the code to achieve this will be pretty weird :mrgreen: .


Top
 Profile  
Reply with quote  
 Post subject: Re: Sync pin behaviour
PostPosted: Fri Mar 08, 2019 1:39 pm 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10938
Location: England
Hee hee. Good point about the 'C02. We don't have a transistor-level model of that.

(Just had a thought: someone could hook up a 'C02 to a logic analyser and some signal generator, connect the GPIB control bus to the internet, and anyone could perform some cycle-by-cycle experiments remotely...)


Top
 Profile  
Reply with quote  
 Post subject: Re: Sync pin behaviour
PostPosted: Fri Mar 08, 2019 1:53 pm 
Offline
User avatar

Joined: Fri Dec 11, 2009 3:50 pm
Posts: 3367
Location: Ontario, Canada
GaBuZoMeu wrote:
Ha! So the 65C02 got an extra output pin! Probably useful for serial I/O. Together with /IRQ as input (used in the 6502-Badge) this could be a limited UART replacement. 8)
An extra output pin -- I love it! :lol: But don't you think it should be teamed up with the "extra input pin" -- /SO ? :P

BigEd wrote:
(Just had a thought: someone could hook up a 'C02 to a logic analyser and some signal generator, connect the GPIB control bus to the internet, and anyone could perform some cycle-by-cycle experiments remotely...)
This would be a terrific resource, if anyone cares to rise to the challenge. :!: And even better yet if we could also have an '816 available for cycle-by-cycle testing.

_________________
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  
 Post subject: Re: Sync pin behaviour
PostPosted: Sat Mar 09, 2019 8:01 am 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8389
Location: Midwestern USA
Dr Jefyll wrote:
But don't you think it should be teamed up with the "extra input pin" -- /SO ? :P

You mean SOB (that's what it's called in the data sheet)? :D :shock: :wink:

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


Top
 Profile  
Reply with quote  
 Post subject: Re: Sync pin behaviour
PostPosted: Sat Mar 09, 2019 1:51 pm 
Offline
User avatar

Joined: Fri Dec 11, 2009 3:50 pm
Posts: 3367
Location: Ontario, Canada
The datasheets for Rockwell, CMD and NCR call it /SO. :wink:

GaBuZoMeu wrote:
Ha! So the 65C02 got an extra output pin! Probably useful for serial I/O.
Also the CPU's address lines are entirely eligible for a job like that.

_________________
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  
 Post subject: Re: Sync pin behaviour
PostPosted: Sat Mar 09, 2019 3:08 pm 
Offline

Joined: Mon May 21, 2018 8:09 pm
Posts: 1462
Some datasheets use a B suffix to indicate an active-low signal. Most sane ones use an overline or a stroke prefix.


Top
 Profile  
Reply with quote  
 Post subject: Re: Sync pin behaviour
PostPosted: Sat Mar 09, 2019 7:15 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8510
Location: Southern California
Chromatix wrote:
Some datasheets use a B suffix to indicate an active-low signal. Most sane ones use an overline or a stroke prefix.

Bill Mensch told me the "B" came from the fact that the equipment they used to write the first data sheets decades ago did not provide for the overbar possibility, so the "B" was used to stand for "bar."

_________________
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  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 12 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: