Atmega328 on PC 8-bit ISA BUS - I/O Pin question

Hello Everyone!

This is my first post out here, and I apologize if this question has been asked before but I have not been able to locate an answer after searching off and on for the last month or so.

I have been trying to use the Atmega328 on a card I'm designing for a relatively simple goal. I am using a sound chip that needs its registers zeroed out on start-up / reset to silence it. The code works, and I can even use the Arduino for address decoding just using the pins for input. (This is nice & almost as cheap if you need to address multiple devices on the same board.) However, I have an issue when sharing the data lines on the PC. I know the intent of the Arduino is to set the pins to input or output, and from what I've read, you can change them "on the fly". I have a 74HCT245 connected to the data pins to isolate the initial zeroing off of the PC BUS. The Arduino then does its thing on the sound chip, and then enables the 245 to allow the data to be written to the sound chip. The sound chip is input only, so there is never a need to swap directions on the 245.

At this point, the Ardino pins are set to output, after the sound chip resets, the idea is really just to make the Arduino go away. However, no matter what I've tried, I still seem to keep having issues. I initially thought that just setting the pinmode to input with no pullup would make them invisible. It seems they may be drawing just enough current to make the sound chip not get a strong enough signal to read from the bus, and somethings I have tried make the PC hang, like the arduino is syphoning power off the data pins. That's my guess anyway. Even putting the chip to sleep doesn't seem to help

I'm trying to prevent adding too much hardware. I already thought I could put another 245 between the arduino and the sound chip, and just shut it off too. I suspect this would work, but I already tried this with no 245 and the bus went nuts when the arduino started writing to the chip, so this isolation was needed.

Anyway, I'm happy to provide any more detail which would be pertinent, want to keep this as short as possible. :slight_smile:

Thanks so much!

Are you really sure that you mean an PC ISA bus?

For troubleshooting you should have a scope at hand and know how to use it.

The '245 for the bus interface looks okay to me, but the control signals must be used as well, for proper operation and timing. See IOCHK, IOCHRDY, IOR/IOW and possibly more related pins. The IOW signal must be multiplexed as well, so that both the Arduino and PC can write to the sound chip. Also the address bits have to be decoded and eventually multiplexed.

I've built hardware for several old 8 bit ┬ÁC bus systems, but never for the ISA bus.

Yes, I do mean the PC ISA bus. Specifically, this is an 8-bit card and not a 16-bit card. I'm aware of the other lines as well. AEN is handled by a 74hct688 as well as the address lines. I also only need /IOW and IOChRdy for the sound chip. I do not need IOChRdy to talk to the Arduino, but the /IOW line connects to the /WE line on the sound chip, and I do need it from the Arduino to push the appropriate bits to reset. I just put a diode on this line so the Arduino does not send a signal down the /IOW line of the bus. I also use the /CE line on the sound chip which has a similar diode coming from the 688 to prevent interfering with it, although this diode is probably not necessary as it never hits the bus, just the output of the 688.

I just left all of this out of the original post to keep it simple. Long story short, lines on the bus that are true I/O, like the datapins are an issue. Inputs or outputs only like AEN, /IOR, /IOW, or the address lines are not an issue. I've actually been able to use an Arduino as an address decoder before, and it works like a champ when the pins are set to input here.

I guess I haven't probed it out because I kinda know what the problem is, but can it be fixed without adding a ton more parts in essence? I suspect heavily that the Arduino is pulling current from the datapins when it is set to input. If I set them to output, I'm guessing they don't really ever "float". They seem to pull the lines high or low, which is bad. That's what I want to know. Can I just make the Arduino not do this? Sleep() doesn't help. I only want it to wake up when reset is pushed on the bus, and at power on. It's acting like a big old resistor pack I think. :slight_smile:

I know it's this chip because if I just pull it out, the sound chip works fine. It just makes a ton of random noise since the registers come up in a random state.

Thanks for your help!

The Arduino pins are really high-Z in input mode, this cannot be a problem.

Diodes are not enough for wired-AND, a pullup resistor is also required.

I'd simply route all signals to the sound chip through tristate drivers, and disable everything while the Arduino is initializing the chip. Afterwards the Arduino pins are made inputs, the drivers are enabled and the Arduino goes sleeping. Then you can test everything with and without the Arduino without changing the hardware.