Go Down

Topic: Due USB Host Port Problem (Read 951 times) previous topic - next topic

MichaelDelaney

Dear Gurus,

I'm trying to connect an external USB Device, that internally uses the FTDI USB/Com Port bridge chip, to the Due Usb Host Port using the SerialUSB object.
But the status of SerialUSB remains "0".
Any ideas what I'm doing wrong?


Code: [Select]
char dataout[256];
char datain[256];

void setup()
{
  SerialUSB.begin(38400);
  SerialUSB.setTimeout(500);
  Serial.begin(115200);
  delay(500);
  //while(!SerialUSB); //here it waits forever if uncommented
}
void loop()
{
  Serial.print("SerialUSB: ");
  Serial.println(SerialUSB); // it says "0"
  strcpy(dataout,"ATI");
    Serial.print("Out: ");
    Serial.println(dataout);
    SerialUSB.print(dataout);
    SerialUSB.print("\r ");
    delay(200);
    Serial.print("SerialUSB bytes available: ");
    Serial.println(SerialUSB.available());
    //SerialUSB.readBytesUntil(13,datain,16);
    Serial.print("In:  ");
    Serial.println(datain);
    delay(1000);
}


When I run the the Native USB Port Descriptor code http://forum.arduino.cc/index.php?PHPSESSID=ttpp845u9t0ld93dj9adhgt0n6&topic=199608.0
I get plausible results:
String Descriptors:
Manufacturer: FTDI
Product:   USB <-> Serial Cable
Serial: FTWRT2L8

Device Descriptor:
Descriptor Length: 22
Descriptor type: 1
USB version: 200
...

Go Up