Go Down

Topic: VDIP1 USB Host Controller (Read 1 time) previous topic - next topic

bruffner

Mar 29, 2010, 07:12 am Last Edit: Mar 30, 2010, 05:05 am by bruffner Reason: 1
There was a lack of solid documentation and schematics for the Vinculum VDIP1 USB Host Controller module.  In the interest of making things easier for others I put together some documentation a sketch and a schematic.  Most of the posts and other information do not use the RTS / CTS flow control mechanisms which are very important.  I have made sure my examples use this and allow quick and simple access to a flash drive.

I am using the NewSoftSerial library so I can leave my Arduino connected to the computer and have achieved speeds of 57600 baud.

Eventually this will be used for storage for a mini-Mud (yes Multi-user-Dungeon like way back in the day) over jabber.  I will post again when that project is finished.

Here's the blog entry with the schema, pic and sketch: http://rpgduino.wordpress.com/2010/03/27/vdip1-usb-host-controller/


UPDATE:

I forgot to add the CTS control to prevent buffer overflow when the USB device is sending too fast for the arduino interrupts to get all of the data.  i updated the sketch to include:


void loop() {
 if (usb.available() > 32) {
   digitalWrite(CTSPin, HIGH);
 } else {
   digitalWrite(CTSPin, LOW);
 }    
 if (usb.available() > 0) {        // read the incoming byte    
   usbRx = usb.read();
   if (usbRx == 0x0D) {
     Serial.println();
   } else {
     Serial.print(usbRx);
   }
 }

This will set the CTS to high which means we are not ready for more data.  The reason I am going with 50% is because at that rate depending on how long each loop takes we could receive close to all of the bytes for the buffer.  There are three fixes, increase the size of the buffer in NewSoftSerial, slow down the baud rate or increase the number of times you poll the serial.available size giving it less time to fill up.

Go Up