Bluefruit EZ LInk Connected to USB Hub Connected to Raspberr

For other supported Arduino products from Adafruit: Shields, accessories, etc.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
onebeartoe
 
Posts: 83
Joined: Wed Mar 20, 2013 2:58 pm

Bluefruit EZ LInk Connected to USB Hub Connected to Raspberr

Post by onebeartoe »

I want to use an EZ Link (https://www.adafruit.com/products/1588 or https://www.adafruit.com/products/1628) with an Arduino that is connected to USB hub. The hub is then connected to Raspberry Pi.

There is software on the Raspberry Pi that reads the strings from Serial.println() on the Arduino.

The write up for the shield version mentions,
You can use the shield in either Direct mode (the Bluetooth module replaces the USB/Serial chip) or in Soft Serial mode (you still want to program over USB but will use SoftwareSerial to communicate with a computer or other device).
If I attach the shield version (or non-shield), then does that change/redirect the normal output of Serial.println() on the Arduino? Will the Raspberry Pi see different data while the Arduino is being reprogrammed?

User avatar
adafruit_support_mike
 
Posts: 67485
Joined: Thu Feb 11, 2010 2:51 pm

Re: Bluefruit EZ LInk Connected to USB Hub Connected to Rasp

Post by adafruit_support_mike »

If you want to use the EZ-Link as a programming interface for the Arduino, yes it will take over the standard Serial port (pins 0 and 1).

User avatar
onebeartoe
 
Posts: 83
Joined: Wed Mar 20, 2013 2:58 pm

Re: Bluefruit EZ LInk Connected to USB Hub Connected to Rasp

Post by onebeartoe »

Thanks Mike!

I am still a newb. Is the standard Serial port taken over the whole time the shield is attached or just while the Arduino is being programmed?

User avatar
adafruit_support_mike
 
Posts: 67485
Joined: Thu Feb 11, 2010 2:51 pm

Re: Bluefruit EZ LInk Connected to USB Hub Connected to Rasp

Post by adafruit_support_mike »

Good question. The answer is, "the whole time," but the reasons for it aren't obvious.

Every logic circuit has two parts at its output end: a "pull-up network" that can (on demand) provide a relatively low-resistance connection to VCC, and a "pull-down network" that can (on demand) provide a relatively low-resistance connection to GND. A basic rule of digital circuit design is that only one of the two will be in the "low resistance" state at any time. Having them both open tends to let the smoke out of a chip.

If you connect two logic-circuit outputs to each other, you no longer have easy control over the "there can be only one" rule for the pull-up and pull-down networks. If circuit A wants to go HIGH while circuit B wants to go LOW, you have an open pull-up network on one side and an open pull-down network on the other. Again.. Bad.

There is a way around that kind of problem, at least in general terms: there's no rule saying either the pull-up or pull-down network *must* be open at any given time. If you shut them both off at the same time, you have high-impedance connections to both VCC and GND. With today's transistors, the impedance both directions is high enough that the logic circuit is basically disconnected from anything else tied to that pin. That doesn't cause any damage at all, and can be quite useful in cases where you need one circuit to shut up so another can talk. That's called 'tristating' the output, 'disabling' it, 'putting it in a high-Z state', etc.

If it was possible to tristate the TX pins of the EZ-Link and the RasPi, it would (in theory) be possible to make them share a single Serial RX pin. The EZ-Link doesn't have a way to tristate its TX pin though, so it would end up fighting with the RasPi's TX pin.

And to quote Sancho Panza, "whether you throw the rock at the pitcher, or the pitcher at the rock, things are going to be bad for the pitcher." A RasPi's GPIO pins can't handle much current.. by default, they're limited to 8mA. Trying to pull more than that from a pin, or send more than that into a pin will probably kill the pin, and might kill the whole microprocessor.

User avatar
onebeartoe
 
Posts: 83
Joined: Wed Mar 20, 2013 2:58 pm

Re: Bluefruit EZ LInk Connected to USB Hub Connected to Rasp

Post by onebeartoe »

Thanks again, Mike. That was a nice explanation.

I hoped the serial take over was only during programming. There are still a couple of sensors that I haven't learned how to hookup the Raspberry Pi. So that is why I need still need an Arduino in the mix.

This is for our lizard enclosure by the way. It is using a Java EE app to monitor the sensor readings from the Arduino via Serial.println()

I'll have to live with hooking up cable to program the Arduino for now.

User avatar
adafruit_support_mike
 
Posts: 67485
Joined: Thu Feb 11, 2010 2:51 pm

Re: Bluefruit EZ LInk Connected to USB Hub Connected to Rasp

Post by adafruit_support_mike »

You could use a software serial connection to move the "communicate with the RasPi" part away from pins 0 and 1: http://arduino.cc/en/Reference/SoftwareSerial

That would make your Arduino code a bit bigger (you'd have code doing things that are handled in hardware by pins 0,1), but it would eliminate the pin-contention issues between the RasPi and the EZ-Link.

(BTW - post photos when you're done.. we like lizards!)

Locked
Please be positive and constructive with your questions and comments.

Return to “Other Arduino products from Adafruit”