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?
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 Getting Arduino Due's Native USB Port Descriptors - Arduino Due - Arduino Forum
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
...