Hi,
I would like to send ascii strings from arduino leonardo to a usb host shield to a (usb to RS232) converter and then to a laser which uses RS232. (I tried to use a RS232 shield, had no luck).
Prior to trying to communicate with the laser I want to make sure I have the strings sending from start to end ok, I will connect the devices in the following arrangement:
PC1 --> Arduino --> USB host --> USB to RS232 converter --> RS232 plug into PC2
I will use terminal programs at PC1 and PC2 to check that the communication is working.
To start this, I need to know how to use the USB host shield, it appears to be full of more advanced features. There are a lot of example codes for tasks other than what I am trying to do and they vary a lot between each example. If anyone is familiar with the USB host shield, could you please point me to the most relevant example.
Before you can point me in the right direction, I need to provide the hardware details:
- Arduino that I'm using is Leonard
- USB host shield is duinotech usb host shield https://www.jaycar.com.au/arduino-compatible-usb-host-expansion-board/p/XC4456
- Library that I am using: USB Host Shield Library 2.0 - Arduino Libraries
- USB to RS232 converter: https://www.jaycar.com.au/usb-to-db9m-rs-232-converter-1-5m/p/XC4834
So far I've plugged the shield into the leoardo and the USB to RS232 converter into the USB host shield. I then ran the "USB_desc" example provided in the library.
It provided back the following details about the attached USB to RS232 converter:
Device descriptor:
Descriptor Length: 12
Descriptor type: 01
USB version: 0200
Device class: 00
Device Subclass: 00
Device Protocol: 00
Max.packet size: 08
Vendor ID: 0403
Product ID: 6001
Revision ID: 0600
Mfg.string index: 01
Prod.string index: 02
Serial number index: 03
Number of conf.: 01
Configuration descriptor:
Total length: 0020
Num.intf: 01
Conf.value: 01
Conf.string: 00
Attr.: A0
Max.pwr: 2D
Interface descriptor:
Intf.number: 00
Alt.: 00
Endpoints: 02
Intf. Class: FF
Intf. Subclass: FF
Intf. Protocol: FF
Intf.string: 02
Endpoint descriptor:
Endpoint address: 81
Attr.: 02
Max.pkt size: 0040
Polling interval: 00
Endpoint descriptor:
Endpoint address: 02
Attr.: 02
Max.pkt size: 0040
Polling interval: 00
Addr:1(0.0.1)
Your help is greatly appreciated.
Thanks