[comp.sys.m68k.pc] LDS/UDS lines on 68k

ignac@electro.UUCP (Ignac Kolenko) (12/16/88)

hello. i have a question regarding the exact function of the upper data/lower
data strobes on the m68k. can the LDS be used in place of the missing A0 line?
in other words, if i do a byte access to an even addressed byte, the LDS signal
will be low, right. and if i do a byte access to an odd byte, the LDS signal
will be high, right?? can someone please verify my theory.

also, if the above is correct, can i do the following:

MOVEA.L $FB0000,A0
TST.B (A0,D0.W)

where D0 contains either an even or an odd integer??
in case anyone is wonderin' why i'm asking, i want to try to build an interface
to my atari 1040st cartridge port, which doesn't have write access capability.
i therefore have to use the bottom 8 lines of the address bus as a "data bus"
when i want to write to the cartridge port address space, and using one of the
higher address lines a pseudo read/write line. thus i need to somehow pass the
least significant bit on the address bus, which led me to believe the LDS would
do the trick.

thanx ahead of time for any info.

-- 
Ignac A. Kolenko                   "Squeeze my lemon, let the juice run
watmath!watcgl!electro!ignac        down my leg!" - Led Zep (Lemon Song)
"Ask me no further questions, I WILL NOT answer!!" - Spock (ST:TOS Amok Time)

jkg@GATECH.EDU (Jim Greenlee) (12/17/88)

In article <227@electro.UUCP> Ignac Kolenko <electro!ignac> writes:
>hello. i have a question regarding the exact function of the upper data/lower
>data strobes on the m68k. can the LDS be used in place of the missing A0 line?

Actually, I think you want UDS* here. One of the things that is confusing 
about interfacing to the 68000 (at first, anyway) is that "upper" data
actually corresponds to "even" (or lower numbered) addresses (let's see -
is that Little-Endian or Big-Endian? :-). 

You can synthesize A0 by combining UDS* and LDS* - neither strobe by itself 
is sufficient to reproduce A0. Here are the possible combinations (I will 
used "A" to indicate the asserted state and "N" to indicate the negated 
state of the strobes - hope this is not confusing).

	UDS*	LDS*	A0	Description
	 N	 N	Z	No bus operation being performed (3-state)
	 N	 A	1	BYTE operation on odd address
	 A	 N	0	BYTE operation on even address
	 A	 A	0	WORD or 1/2 LONG operation on even address

If you aren't concerned about what A0 does when there is no bus activity, 
then you can wire UDS* straight through. However, it is probably safer to 
buffer it through a 74LS125 or some such.

For your application, though, it may be simpler to just connect the address
lines "off-by-one" (A1 to A0, A2 to A1, etc.) and just do byte operations
consistently to odd (or even) addresses. That way the appropriate strobe 
can be used as an enable (which is really what it is anyway). This is how 
the 68000 is ordinarily interfaced to 8 bit peripherals.

Disclaimer: I'm not familiar with the 1040ST, so this may not be practical.

>also, if the above is correct, can i do the following:
>
>MOVEA.L $FB0000,A0
>TST.B (A0,D0.W)
>
>where D0 contains either an even or an odd integer??

Well, since the above was *not* correct, the answer to this question is
irrelevant :-). But since you asked, a BYTE operation can be done on any 
effective address (odd or even). WORD or LONG operations on odd addresses 
will result in an Address Exception.

						Jim Greenlee
-- 
Jim Greenlee - Instructor, School of ICS, Georgia Tech     jkg@gatech.edu

Cato said, "I had rather men should ask why my statue is not set up, than 
why it is." - Plutarch