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

All times are UTC




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: VIA shift register
PostPosted: Fri Nov 29, 2013 8:56 pm 
Offline
User avatar

Joined: Sun Nov 28, 2004 3:07 pm
Posts: 28
Location: Budapest, Hungary
Hi,

I'm writing a software based emulator of a 65C22 VIA, also because to get it to know better. Shift register (SR) is especially confusing for me, since I've never needed it. I try to follow WDC's documentation, however there is something I can't understand. The documentation states that reading/writing the shift register starts the shifting (now let's talk about the internal clock mode for example the one based on PHI2). But then, what happens if want to shift-in a byte? By reading the result (shift is ready by checking IFR), it means to access the SR register which starts another shift round, I don't want! It's can be with the actual hardware too, as you may skip a byte my mistake because reading the result itself shifts-in another byte you don't want then, for example. The next "real" shift-in starts after a while forgetting about the previous. Am I really right that it works this way? Then you should disable shifting (eg reset bits 4 - 2 in ACR) before reading the result from SR, and it eliminates the problem of unwanted shift. Or is there any other solution? Thanks!


Top
 Profile  
Reply with quote  
 Post subject: Re: VIA shift register
PostPosted: Fri Nov 29, 2013 10:41 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8541
Location: Southern California
That sounds like more or less it. Also, the very first read will be discarded, because you're reading to start the first shift in that case. So changing the mode should work. There is the bug about shifting in under control of an external shift clock, but if you're not going to shift in anyway, I guess it won't matter. Just put a passive pull-up on CB1 to hold it high while neither end is driving it. I can't take the time to try it right now, but I've used the SR a lot so I hope this little bit saves you some time.

_________________
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  
 Post subject: Re: VIA shift register
PostPosted: Sun Dec 01, 2013 4:30 pm 
Offline

Joined: Tue Jul 05, 2005 7:08 pm
Posts: 1043
Location: near Heidelberg, Germany
I normally use the Rockwell data sheet I have, it has a number of timing diagrams for the shift register as well.
May be also found here: http://www.6502.org/documents/datasheets/rockwell/

André

_________________
Author of the GeckOS multitasking operating system, the usb65 stack, designer of the Micro-PET and many more 6502 content: http://6502.org/users/andre/


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

All times are UTC


Who is online

Users browsing this forum: No registered users and 6 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: