It's a 40 pin DIL with pin layout as shown below. Basically I want to be
able to switch the bus from one device to another using (hopefully) one or
two control lines going to my PIC's PORTA. However there seem to be plenty
of control lines on this device and I'm not sure which ones to try.

Any ideas where I can get more info or has anyone got any experience with
this device?

Long ago 15 years or more
All data books long gone but from memory
Port A TTL logic
Port B Tri state
port C ? >>you got ? I think these were out only?
pins 22 23 24 ChipSelect High
pin 34 Reset
pins 37 38 tie and use as /IRQ

Hi Paul,
I have all the info for these in some old data books at home. If you like,
I can scan it for you and send you a copy. It shouldn't be too hard to
hook it up to a PIC. Some of the pins are:
CS* are the chip select
RS* are the register selects to get to the 4 internal registers
IRQ* are the interrupt requests and are open collector
E is the phase2 clock and IIRC, clocks on the negative edge
CA and CB are either input or output I think.

The device is more than a switch, basically two I/O ports on an 8 bit bus,
complete with data direction 'TRIS' registers.

For full function the pic will need to connect to E,R/W,RS1,RS2,D0-D7.

Reduced read-only function might be achieved with R/W and one of the RS
lines tied up.

Finding the full data would take time. I'll do it if you're serious!

There's a 24 pin device called the 8243 that provides 16 IO pins (4x4bit)
and only needs five pins to attach. I'd recommend it if only I knew of more
than one manufacturer but I don't and it may cost more than a PIC.

I've used it and the 6522. The 6821 is a peripheral interface adaptor
while the 6522 is a "versatile interface adaptor." It's similar to a 6522
but it also has some timers and shift registers, as I recall. Also,
(again, recalling from many years ago), the 6821 uses fewer address lines
and has an "access bit" in one of the registers to reach some of the
other registers. The 6522 just maps everything out with each register
getting its own address.
These devices are designed to be used on the Motorola/Mostek bus, as
opposed to the Intel/Zilog bus. Motorola uses a single enable line (E).
Data is enabled on the leading positive edge and latched on the trailing
negative edge. Intel uses two enable lines (active low) that enable data
on the leading negative edge and latch data on the trailing positive
edge. The two enable lines are -RE (read enable) and -WE (write enable).
Back on the Motorola bus, there is an E clock every processor clock
cycle, even when there is not an access to an outside address (for
example, the BRA instruction is only two bytes long but is three cycles
long, since it needs to calculate the absolute address from the relative
address). 6800 series processors have a VMA (valid memory address) line
that is high when the outside world needs to be accessed. This is often
tied to an active high chip enable on peripheral chips so a false read
does not clear an interrupt flag in the periperal chip (like falsely
indicating a serial port was read, clearing the interrupt bit).
Finally, the RD/-WR line is high for a read (it's also high if VMA is
false) and low for a write. It's timing is synchronized with the address
bus, which becomes valid substantially before E and holds a little after
the trailing edge of E.
Below are some comments on the pin outs...

Thanks to all who responded to my 6821 (6521) question. This device seems
really old and is probably more complicated that needs be for my purposes.
So I think I'll go with Keith's suggestion and use a 74HC241 or 74FST3245
instead. I can control this with one pin from RA on my PIC and there's no
data direction bits to worry about. Of course I could probably elimate the
whole bus switching problem by using a PIC with more i/o pins (!) but I'm
happy starting out with with the F84 for now :)

Thanks again,

Paul

On Wed, 9 Aug 2000, W. K. Brown
wrote:

> Could you settle for two twenty pin parts? Use the 74HC241's.
> The complementary enables let you select a device bus with
> only 1 PIC pin.
> Regards, Keith
> {Original Message removed}

Thanks to all who responded to my 6821 (6521) question. This device seems
really old and is probably more complicated that needs be for my purposes.
So I think I'll go with Keith's suggestion and use a 74HC241 or 74FST3245
instead. I can control this with one pin from RA on my PIC and there's no
data direction bits to worry about. Of course I could probably elimate the
whole bus switching problem by using a PIC with more i/o pins (!) but I'm
happy starting out with with the F84 for now :)

Thanks again,

Paul

On Wed, 9 Aug 2000, W. K. Brown
wrote:

> Could you settle for two twenty pin parts? Use the 74HC241's.
> The complementary enables let you select a device bus with
> only 1 PIC pin.
> Regards, Keith
> {Original Message removed}

If all you are looking for is a way to get a lot of outputs out of very few
pins you should be looking at shift register/latch combinations like the
74HC595. A daisy chain of these chips will allow you to create almost
unlimited outputs from just 3 PIC pins (clock, data and latch control).
Basically these chips contain a shift register and an 8-bit latch in one
chip.

Bob Ammerman
RAm Systems
(contract development of high performance, high function, low-level
software)

> Hi,
>
> Thanks to all who responded to my 6821 (6521) question. This device seems
> really old and is probably more complicated that needs be for my purposes.
> So I think I'll go with Keith's suggestion and use a 74HC241 or 74FST3245
> instead. I can control this with one pin from RA on my PIC and there's no
> data direction bits to worry about. Of course I could probably elimate the
> whole bus switching problem by using a PIC with more i/o pins (!) but I'm
> happy starting out with with the F84 for now :)
>
> Thanks again,
>
> Paul
>
>
> On Wed, 9 Aug 2000, W. K. Brown
> wrote:
>
> > Could you settle for two twenty pin parts? Use the 74HC241's.
> > The complementary enables let you select a device bus with
> > only 1 PIC pin.
> > Regards, Keith

> You would be even happier with a F877. 8x the program space Xx the
> RAM, lots of peripherals, and it still burns quickly.
>
Wow! I just realised the F877 is also EEPROM capable!
This is the main reason I wasn't trying any other PICS - I don't think I'm
ready for OTP yet! But this looks great. I'll get some tomorrow! Even
just the extra program space would be worth it. :)

Now if only the PICLITE compiler supported this instead of the '84, you'd be in
hog heaven. <G>

My purchasing experience of late is that the PLCC version is available, but the
DIP's aren't.

One thing - the power and ground pins near the A/D inputs should be treated as
AVCC and AGND, and all the power and ground leads need to be connected or it
won't work reliably (this goes for other PICs as well).

> You would be even happier with a F877. 8x the program space Xx the
> RAM, lots of peripherals, and it still burns quickly.
>
Wow! I just realised the F877 is also EEPROM capable!
This is the main reason I wasn't trying any other PICS - I don't think I'm
ready for OTP yet! But this looks great. I'll get some tomorrow! Even
just the extra program space would be worth it. :)