I am trying to receive TTL signals using Digital pins of Arduino Uno. The problem is that TTL can be detected only in Pin 0, but somehow not in other pins. When I measured the voltage of the cable using an oscilloscope, it turned out that the voltage rises to 5V when I connect the cable to Pin 0, but the voltage gets lower and lower, as I connect to a pin that is far from Pin 0. (i.e. if I connect to Pin 3, I get ~1.5V. If I connect to Pin 8, I get less than 1V.) I am wondering if this means that the pins with higher numbers have lower impedance. (I know that does not make sense.) I am running StandardFirmata sketch on the Arduino Uno, if it is relevant.
I would really appreciate it if you could give me suggestions on why this is happening. Right now I can record TTL only in Pin 0, and other pins are not functional.
Pin 0 has the USB to serial wired into it and is the only pin that will accept serial TTL data. This is due to the way the UART is connected inside the chip. If yo want to receive TTL serial data on another pin you have to have code that emulates a UART. One such code is implemented as a library and is called software serial.
Have you initialised those pins to be inputs and indicated you want the internal pull-ups to be activated? Is your TTL signal open collector?
Oh, I didn't know that Pin 0 and 1 are special. Okay, I will avoid them.
What still confuses me is that the voltage measurements of TTL signals do not look right. For example, I connected like the following diagram:
TTL source -----------------> pin 8 of Arduino Uno
|
|
v
Oscilloscope
When I measure the voltage at the Oscilloscope, somehow the TTL reads only less than one volt. If I disconnect pin 8, the oscilloscope reads ~5V, which is the correct TTL voltage. I am wondering if this means that the pins of Arduino have very low impedance that the current is not enough to bring up the voltage.
Those pins are initialized as inputs. I don't know if my TTL is open collector.
Connecting serial pin 0,1 to another pin that is set to INPUT (default mode) should not pull the 5volt on those serial pins down. Input pins are extreme high impedance for voltages between 0 and VCC.
But why do you want to do that anyway. The MCU knows the state of the pin internally.
Use code to "connect" the pins if you have to.
Never used Firmata, and not seen your sketch.
Joining pins, and setting pin8 to output,LOW will drag the TTL pins down (and fry the pins).
Leo..
Not if they are dragging a TTL signal down they are not. Input pins are very high impedance. What you describe makes little sense and can not happen for the reasons you postulate.
If these observations are real then you have something else going on you are not spotting and so not telling us about.