Electronics > Projects, Designs, and Technical Stuff
Problems with two Arduinos back-to-back on the GPIB bus
(1/3) > >>
WaveyDipole:
I am working on an Arduino based GPIB controller and have come across a rather strange issue when two Arduinos are placed back-to-back on the GPIB bus along with another GPIB device. Let me explain.

I have been working on a GPIB controller and have pretty much completed controller mode with using my Solatron 7150 DMM as a test instrument and so far everything seemed to work as expected. I then moved on to implementing a device mode. This required that two Arduinos be connected to the GPIB bus simultaneously – one acting as a controller and the second as the device. Since the controller has a GPIB cable to connect to an instrument, I left this attached to my Solatron, but also I the controller to a prototype board. This allowed me to also connect the second Arduino as well as a logic analyser so that I could develop device mode using the second Arduino and see what was happening with the various GPIB wires. This did not prove to be quite as  straightforward as I had hoped.

Firstly, I quickly discovered that the power draw exceeded USB limits which was resolved by using an externally powered USB hub. I then also found that the breadboard connections can be quite temperamental sometimes. Having noted that and working with it, I then discovered a further problem.

Now, I am aware that the Arduino has only sufficient current handling to drive two devices at most so maybe that is part of the issue. I’m also not sure whether the Logic Analyser adds something to the load but I quickly found some odd reliability issues. Sometimes I could read the meter, sometimes I could not. Sometimes I could send the meter commands, sometimes I could not. Sometimes the readings returned from the meter were corrupted. None of these issue occurred when just one Arduino was connected to the instrument.

Initially some work had to be done to ensure that the Arduino pins were in the correct state. For example that the "device" was not asserting signals when it should be listening. However, having got past these issues, the problems persisted. On the logic analyser I observed that when the second Arduino is turned off, all GPIB signals go high and occasionally the odd signal on a pin fluctuates rapidly. Disconnecting the second Arduino completely from the breadboard even without resetting the controller and instrument, restores normal operation between those two devices. On the other hand, just turning off the instrument allows successful communication between the two Arduinos. It seems like three is a crowd, but I can’t quite figure why that should be, and why when the second Arduino powered off, it still affects signal states between the remaining Arduino and instrument? As mentioned, disconnect that second Arduino from the circuit and everything works normally again.

Any thoughts?
oPossum:

--- Quote from: WaveyDipole on December 12, 2018, 10:47:27 am ---On the logic analyser I observed that when the second Arduino is turned off, all GPIB signals go high and occasionally the odd signal on a pin fluctuates rapidly. Disconnecting the second Arduino completely from the breadboard even without resetting the controller and instrument, restores normal operation between those two devices.
--- End quote ---

This is probably due to parasitic power via the GPIO pins. Ground reset instead of removing power.

Most likely problem is a flawed device implementation.
WaveyDipole:

--- Quote from: oPossum on December 12, 2018, 11:04:27 am ---This is probably due to parasitic power via the GPIO pins. Ground reset instead of removing power.

Most likely problem is a flawed device implementation.

--- End quote ---

Thanks for your comment. Although I'm not entirely familiar with the term "parasitic power", I did observe that even after I disconnect the USB cable, one or two LEDs stay lit - although perhaps not to the same intensity. Since USB is now disconnected, the only way power can be getting to the board is, as you point out, via the GPIO pins. I have just tried disconnecting each wire in turn and found that one of the LEDs can be extinguished by disconnecting a particular wire, however the other LED cannot be extinguished by disconnecting any single wire. Both LEDs do extinguish when I pull all of the wires out, so it seems evident that power is getting there via multiple paths. With only two pins to spare (Rx/Tx excepted) there are plenty of wires with signals in different states connecting the two boards.

Regarding "ground reset", if this refers to the action of momentarily connecting RESET to GND, then I have found that all lines remain high while the reset button is pressed (i.e. RESET grounded) and become active again (as one expects) after the Arduino re-boots when the button is released. I will however try the reset button next time I start having problems reading from and sending to the instrument and see whether that clears it.
Kilrah:
An unpowered device WILL affect signals unless specifically designed not to.
An arduino definitely isn't.

Each microcontroller pin has ESD protection diodes to GND and VCC to divert current from electrostatic discharges into the power supply instead of the chip itself. That means that all pins are clapmed on the high side to 0.7V above the microcontroller's supply voltage.
As your microcontroller is powered down it is now supplied with 0V. That means anything on the data lines above 0.7V is going to start "leaking" into the arduino's power supply, drawing more current on the lines than they're meant to carry which can bring them down, and can cause weird stuff due to the arduino being partially powered and potentially starting to run erratically and affecting the lines itself. Current may also be going wherever else depending on the circuitry you have and cause other weirdnesses.

So an arduino with direct connection of its GPIOs to a bus is not something you can leave connected to a bus when off.

Also you need a scope in addition to the logic analyzer. The LA alone can be very misleading since it either shows high or low but won't let you see that a line is actually in a completely invalid state in the middle.
Kilrah:

--- Quote from: WaveyDipole on December 12, 2018, 12:31:53 pm ---Regarding "ground reset", if this refers to the action of momentarily connecting RESET to GND

--- End quote ---
No, what he says is leave the "unwanted" arduino powered, but tie its RESET line to ground (aka hold its RESET button down permanently) so it's effectively disabled, but since it's powered it's not causing the problems explained above.
Navigation
Message Index
Next page
There was an error while thanking
Thanking...

Go to full version
Powered by SMFPacks Advanced Attachments Uploader Mod