Go Down

Topic: Reading data from a USB breakout (Read 997 times) previous topic - next topic

eliganem

Hi,

I've disassembled an old printer I had and I took out this USB part out of it (images attached). How can I figure out which pin is GND, VC and data? Is there a standard that will apply to this board as well?

Thanks!



MAS3

This "board" hardly deserves that name.
It is just a medium to put the one single USB connector on, and to connect it to the flatcable (which would indeed define a board).
There is nothing else on there.

Looking into the USB connector, you'll have pin 1 at the left, and pin 4 at the right.

pin 1 = 5 volts
pin 2 = - data
pin 3 = + data
pin 4 = 0 volts

Let me guess at what you have shown in the picture.
To be sure, you need a multimeter to beep the connections.

The first wire next to the USB connector is pin 1, then 2 and so on.
Have a look at "blink without delay".
Did you connect the grounds ?
Je kunt hier ook in het Nederlands terecht: http://arduino.cc/forum/index.php/board,77.0.html

eliganem

Thanks for the info. Actually it was the other way around - The closest pin was the ground.
Now my problem is I always get 0's out of the (-) pin and 1's out of the (+) pin.
Should I read the data at any specific rate? Here's my code:

int data = 5;

void setup()
{               
  Serial.begin(9600);
  pinMode(data, INPUT);
}

void loop() {
  Serial.print(digitalRead(data));
  delay(1);
}

MAS3

#4
Jan 26, 2013, 03:24 pm Last Edit: Jan 26, 2013, 05:06 pm by MAS3 Reason: 1
USB means Universal Serial Bus.
But it has nothing to do with serial communications like you are attempting by Serial.begin and so on.

D+ and D- are differential datalines.
They will react in opposite directions in case of a 0 or a 1.
This will filter out interference, as there is no known differential interference (at least not by me ;) ).

Sift through the link Riva posted to find out how USB works.
You'll find out you need to do something completely different to get your Arduino to work with USB and this connector.

Ofcourse you can use this connector for your own project in any fashion you like.
Just don't call it USB even if you are unsing that connector.
Have a look at "blink without delay".
Did you connect the grounds ?
Je kunt hier ook in het Nederlands terecht: http://arduino.cc/forum/index.php/board,77.0.html

Riva

Atmel have software USB drivers suitable for the ATmega chips called V-USB and someone has ported them over to work on the Arduino (see http://code.google.com/p/vusb-for-arduino/)

eliganem

Thanks MAS3 and Riva. You sent me in the right direction and hopefully I can take it from here  8)

Go Up