Reading USB data with teensy 3.5 with usb host shield

Status
Not open for further replies.

po03087

Member
Hi, so my project requires the microprocessor to receive measurement data from the multimeter via usb connection. I have purchased a usb host shield from sparksfun (https://www.sparkfun.com/products/9947) that operates in SPI.

Right now I am stuck on where to get started with the project. How should I establish connection between the teensy and the usb host shield in order to read the data sent from the multimeter using teensy?

Thanks so much.
Jaewoo
 
Yes, if using that host shield, the first step would be just getting the shield connected and running the "board_qc" example to check if the hardware is really working. Well, that is assuming you've at least uploaded to Teensy and know it works and you can print to the serial monitor!

Which multimeter are you using? Do you know whether it's supported by the USB Host Shield library?
 
I am using rigol 3068 and not sure if it is supported by the host shield library. I haven't been able to find information about it.

Since the USB host shield is designed to fit directly on top of arduino, how should I connect the pins for teensy?

Thanks,
Jaewoo
 
Since the USB host shield is designed to fit directly on top of arduino, how should I connect the pins for teensy?

Based on this shield's schematic (but not having actually used it myself), I'd imagine you would need to connect digital pins 7 to 13 from Teensy to the digital pins on this shield. Of course GND needs to connect to GND. Keep these wires "short". A few inches is ok.

Teensy 3.5 follows the same pinouts as Arduino Uno for the SPI signals, so odds are good this shield will "just work" if you connect the signals directly (7 to 7, 8 to 8, and so on). In the comments, people mention issues with pin 7 on regular Arduino boards. You might need to add a few lines of code at the beginning of setup() to pulse pin 7 low, then keep it high while you actually use the USB Host Shield lib. Pins 11 to 13 will automatically be used for SPI. You might check whatever host shield code you're using to make sure it's defaulting to use of pins 8, 9 and 10 for those other signals.

This shield gets all its power from the VIN pin. My best guess is you could just connect VIN from Teensy 3.5 to VIN on this shield, at least if your USB devices don't need a lot of power.

There's no point connecting 5V, 3.3V, AREF or digital pins 0 to 6, since this shield doesn't use them.

This is all a bit of guesswork, based only on reviewing the info on Sparkfun's site and my previous experience using the host shield lib with other shields. I haven't actually used this Sparkfun one. You might need to adapt things a bit, but hopefully this starts you on the right general path?
 
Hi, so I think I have the USB host shield working. Now, the problem is that I cannot find a way to make the teensy to read serial data from the usb port. I have been searching a way to read serial data using USB host shield connected to Arduino or teensy, but did not have much luck.

Here is the setup:

Rigol 3068 multimeter ----> USB host shield / Teensy 3.5

I know that my multimeter sends 14 byte ASCII serial data, and would like to read that using the USB host shield.

How should I code this? I have looked through the USB host shield library 2.0, but the library provides high level examples (XBOX controller, bluetooth, etc), but not this kind of simple task.

Any help would be appreciated.

Thanks,
Jaewoo
 
Sorry, I have been following this thread more out of curiosity about would are usbhost_t36 code support this.

And I am not sure. I did not see anything in their document that was explicit about what the underlying usbadapter is using.
But I noticed that it was talking about USB-TMC (or USBTMC) when talking about drivers. I also think I saw something like not all Serial drivers support the TMC stuff...

Again not sure if that helps or not.
 
Status
Not open for further replies.
Back
Top