6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Sat Nov 16, 2024 10:50 am

All times are UTC




Post new topic Reply to topic  [ 17 posts ]  Go to page 1, 2  Next
Author Message
PostPosted: Wed Oct 12, 2005 7:20 am 
Offline

Joined: Mon Sep 29, 2003 6:45 am
Posts: 7
Hi all,

Updating my little 6502 design and wanted to use a '573 and '541 for i/o instead of the typical 6522.

For output, the 573 (aka 373 with a different pinout), would be set up with OC\ (1) tied low and E (11) as:
Ph2 NAND !R/_W AND OSEL
where OSEL is an active high signal for my address, no other qualifications.

For input, the '571, G1\ is directly tied to R/_W and G2\ is connected to !ISEL.
where ISEL is an active high signal for my address, no other qualifications.

Am I missing anything here? Been awhile, thanks for the sanity check.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Wed Oct 12, 2005 7:37 am 
Offline

Joined: Fri Aug 30, 2002 2:05 pm
Posts: 347
Location: UK
Acording to my datasheets the '573 latches the data on the falling edge of LE so the signal would need to be ..

ph2 AND !R/W AND OSEL

.. assuming OSEL is active high. For the '541 output is enabled when /G1 and /G2 both low so /G1 needs to be driven by !R/W.

Lee.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Wed Oct 12, 2005 7:40 am 
Offline

Joined: Mon Sep 29, 2003 6:45 am
Posts: 7
Ph2 AND !R/W

By !R/W you mean R/_W from the 6502 but inverted correct? thnx


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Wed Oct 12, 2005 7:50 am 
Offline

Joined: Fri Aug 30, 2002 2:05 pm
Posts: 347
Location: UK
Yes, inverted R/W (Read not Write, it doesn't need an underscore after the / as that would be a double inversion).

I wouldn't bother gating it with ph2 but if I did I'd use

ph2 NAND R/W

Lee.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Wed Oct 12, 2005 9:33 pm 
Offline

Joined: Mon Sep 29, 2003 6:45 am
Posts: 7
Thanks for your help last night, Lee. Looking back, I guess I was up too late! Thank you!

-Ryan


Top
 Profile  
Reply with quote  
PostPosted: Fri Oct 14, 2005 10:11 am 
Offline
User avatar

Joined: Fri Dec 12, 2003 7:22 am
Posts: 259
Location: Heerlen, NL
s800 wrote:
Updating my little 6502 design and wanted to use a '573 and '541 for i/o instead of the typical 6522.


Why not using a 6522? Soldering a 573 and a 541 means soldering 40 pins, the same amount when soldering a 6522. And then you need an extra decoder for seperating these two.
The disadvantage is you have to program the Data Direction register first before being able to use it.
The advantage is that you get a lot of extra goodies for free. Another important thing: in case of the 6522 you knoe that all "outputs" are High after a reset. But you cannot be sure of the state of the 573.
Last thing: if you only need the I/O, just disregard the the upper two address lines and connect them to Ground.

_________________
Code:
    ___
   / __|__
  / /  |_/     Groetjes, Ruud
  \ \__|_\
   \___|       URL: www.baltissen.org



Top
 Profile  
Reply with quote  
PostPosted: Fri Oct 14, 2005 2:21 pm 
Offline

Joined: Sat Jan 04, 2003 10:03 pm
Posts: 1706
Ruud wrote:
Why not using a 6522?


Probably due to cost. If you need a lot of output ports, wiring up a 74138 and 8 74373s is cheaper (chipwise, at least) than a single 6522.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sat Oct 15, 2005 1:35 am 
Offline

Joined: Fri Aug 30, 2002 2:05 pm
Posts: 347
Location: UK
There are lots of reasons to use discrete ports rather than a 6522.

Type, you can chose the family and type of both input and output chip to suit your needs. If you need defined states on reset there are latches with (p)reset available.

Size, a surface mount latch/buffer pair take up little room, even DIL parts can be squeezed into a smaller space than a 0.6" 40 pin chip.

Speed, even standard LS parts are faster than the fastest 6522s.

Addresses, you can have separate in and out on the same address.

Overhead, you can make the port require no setup and much faster in use, especially with bidirectional ports.

What's in the junkbox. I have many 8 bit latch and buffer chips but few spare 6522s.

Lee.


Top
 Profile  
Reply with quote  
 Post subject: Other I/O devices
PostPosted: Sat Oct 15, 2005 8:49 pm 
Offline

Joined: Sun Aug 28, 2005 9:01 pm
Posts: 17
Location: Pennsylvania
How about the 8255/82C55/D71055C(fast) parts,
which are dirt cheap?
One write configures all ports, and inputs may be
later coded as outputs etc. as needed (not so using
latches).
The 82C55 is available in surface-mount; don't
know about 8255 nor 71055.

Just some thoughts...

Brian


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sat Oct 15, 2005 10:55 pm 
Offline

Joined: Fri Aug 30, 2002 2:05 pm
Posts: 347
Location: UK
Quote:
and inputs may be later coded as outputs etc. as needed (not so using latches).

When using discrete buffers and latches you can do both input and output without needing to reconfigure pins, this can more than double performance when talking to other intelligent, bi-directional devices such as mass storage or other processors.

I've nothing against VIA or CIA type devices but, unless they either cost nothing, i.e. are integrated with the CPU as in the M380xx or CCU300x, or you need or a majority of the features they offer[1], I can usually do I/O faster, smaller and cheaper with discretes.

Lee.

[1] I have a logic analyser that uses both timers, the serial I/O port and all the I/O pins of a 6522, the design actually needed eight other outputs and four other inputs and these are provided by a 74LS373 and 74LS126.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sun Oct 16, 2005 8:08 am 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8541
Location: Southern California
Lee has some good points but I feel compelled respond to some things.


> When using discrete buffers and latches you can do both input and
> output without needing to reconfigure pins. This can more than double
> performance when talking to

If you have lines tied both to latch outputs and buffer inputs, you'll still need to disable the latch's outputs in order to input data, meaning you still have another step. Unfortunately, you cannot change individual pin direction with the 8-bit wide discrete-logic latches and buffers. Did you have something else in mind?

In the case of something like I²C where you need an open-drain bidirectional data line, a 6522 allows you to just leave the output at 0 for that bit, full time, and then just change the corresponding bit in the data direction register to either A., make it an output and pull it down to output a 0, or B., make it an input to "output" a 1 (using the pull-up resistor) or read the level the selected peripheral is sending you. IOW, you keep writing to the data direction register, but you don't keep writing to the port itself. There's not as much overhead as one might think.


> unless they either cost nothing

If you're wire-wrapping, don't forget to include the price of the socket, which is usually a lot more than the discrete logic IC. (WW sockets are a lot more expensive than soldertail sockets.) The original poster sounds like he's headed for a lot of glue logic, as is common for first-timers. They wind up with a ton of ICs (which also makes it more work to assemble), long propagation delays, and then they don't get much functionality. I started there too.


> Speed, even standard LS parts are faster than the fastest 6522s

The fastest 6522's can still keep up with the fastest 6502's. Were you talking perhaps about propagation delays through the port itself? (I can't imagine that would matter since a single read or write of a port will always take the processor at least three clocks anyway, and usually four.)


> Overhead

Remember you don't have to write to all the 6522 registers to set it up. If you initially only need the functions you'd get with the mentioned latches and buffers, a reset leaves a port as all inputs so there's no overhead at all for all inputs. Granted that there's no preset for outputs, and making the port all outputs requires storing FF to its data direction register in addition to storing the initial output value in the corresponding output register. If you only want an 8-bit parallel input or output port, there's no need to write to even the ACR or PCR, let alone the timers, SR, or interrupt registers.


Last edited by GARTHWILSON on Sat Apr 07, 2012 4:16 am, edited 1 time in total.

Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sun Oct 16, 2005 5:27 pm 
Offline

Joined: Fri Aug 30, 2002 2:05 pm
Posts: 347
Location: UK
Quote:
Did you have something else in mind?

Yes, byte wide devices usually either provide their own data enable, which is tied to the latch output enable, or have a strobe input which would be driven by the latch clock and the latch replaced by a buffer.

Quote:
In the case of something like I²C where you need an open-drain bidirectional data line, a 6522 allows ... There's not as much overhead as one might think.

But for just an I²C port a 6522 is overkill, a 74LS74 and 74LS125 does just as well.

Quote:
The fastest 6522's can still keep up with the fastest 6502's. Were you talking perhaps about propagation delays through the port itself?

I was thinking about events outside the port, when talking to fast buffered devices, like ethernet interface chips, the time between a flagged event being cleared and the next one being generated can be as little as 10s or 100s of nanoseconds, this can be too fast to be detected reliably by synchronous inputs but is easily handled by discrete asynchronous latches. This sort of failure can be frustrating as it may only manifest infrequently if the conditions nearly meet timing requirements.

Quote:
Remember you don't have to write to all the 6522 registers to set it up.

I was thinking more of the requirements of something like an IDE port, it can be done with a 6522 but it's much easier in both hardware and software to make it from discrete logic (and I do include PAL/GAL devices as discrete logic).

It's much like socket sets and adjustable spanners, I know which I'd rather use and which I'd rather carry around.

Lee.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Mon Oct 17, 2005 11:29 am 
Offline
User avatar

Joined: Fri Dec 12, 2003 7:22 am
Posts: 259
Location: Heerlen, NL
leeeeee wrote:
Quote:
I was thinking more of the requirements of something like an IDE port, it can be done with a 6522 but it's much easier in both hardware and software to make it from discrete logic (and I do include PAL/GAL devices as discrete logic).


Hallo Lee,


I would say its easier to use 6522's. I am still working on the idea of putting an IDE harddisk inside a 1541 (= floppydrive for the Commodre 64). One design uses addressdecoders and some 573 to cover the 16 bits data bus, the other design _only_ needs two 6522's. And all I have to do is to piggyback them on the already present 6522's, solder lines between an already decoder and these 6522's and solder lines between these 6522's and the harddisk. OK, this design means bit-banging but much easier to realise for somebody with hardly any solder skills.

Your remark triggered an idea were a 6522 is involved in handling the 8 extra bits and still enable us to use the IDE-HD as a normal CPU driven device. If it works out, you get the credits :)

_________________
Code:
    ___
   / __|__
  / /  |_/     Groetjes, Ruud
  \ \__|_\
   \___|       URL: www.baltissen.org



Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Tue Oct 18, 2005 4:18 am 
Offline

Joined: Fri Aug 30, 2002 2:05 pm
Posts: 347
Location: UK
Quote:
I would say its easier to use 6522's.

.. and of course I would disagree.

http://www.themotionstore.com/leeedavison/6502/ide/index.html

Quote:
OK, this design means bit-banging but much easier to realise for somebody with hardly any solder skills.

Which for you is what matters, and you obviously have more spare 6522s than I do. 8^)=

Quote:
If it works out, you get the credits :)

I could live with that. 8^)=

Lee.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Thu Oct 20, 2005 5:47 am 
Offline
User avatar

Joined: Thu Mar 11, 2004 7:42 am
Posts: 362
Another reason to use discrete logic rather than a 6522 is that some logic families can source and sink significantly more current than a 6522. Of course you could always add a transistor (or transistors) to a 6522 output (or outputs) for more current drive, but discrete logic might help reduce the part count.

However, I agree that using a 6522 is a reasonable general purpose solution.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 17 posts ]  Go to page 1, 2  Next

All times are UTC


Who is online

Users browsing this forum: Google [Bot] and 7 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: