Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 6 of 6

Thread: usb stick and teensy 4.0

  1. #1
    Junior Member
    Join Date
    Feb 2020
    Posts
    14

    usb stick and teensy 4.0

    Hi

    I'm using a teensy 4.0 and I'm wondering if there is a way to send data to a usb stick.
    I tried with a ch376 module that I bought on amazon and some libraries that I found, but it doesn't work.
    Does anyone know a good library or another way to do it.

    Thanks in advance

  2. #2
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    15,274
    The factory micro USB to date is Device only.

    The T_4.0 does have USB Host capabilities on the underside pins marked on the card as D+ and D- under the USB connector.

    When those pins are brought out with GND and 5V it could use USBHost_t36 code library code - perhaps with other libraries to read/write data to a USB stick.

  3. #3
    Junior Member
    Join Date
    Feb 2020
    Posts
    14
    What I tried is with a ch376 module connected to a serial port and it communicates with the USB stick
    see:
    https://github.com/djuseeq/Ch376msc#test

    I see that the teensy communicates with the module, but the module does not see the USB stick

    I looked at what you told me, looked at the library, but it's way too advanced as a program for me, that's why I'm looking for something less complicated, a simpler library, like the one I linked to, but there's something that doesn't work...

  4. #4
    Senior Member wwatson's Avatar
    Join Date
    Aug 2017
    Posts
    598
    Quote Originally Posted by Ian Larouche View Post
    What I tried is with a ch376 module connected to a serial port and it communicates with the USB stick
    see:
    https://github.com/djuseeq/Ch376msc#test

    I see that the teensy communicates with the module, but the module does not see the USB stick

    I looked at what you told me, looked at the library, but it's way too advanced as a program for me, that's why I'm looking for something less complicated, a simpler library, like the one I linked to, but there's something that doesn't work...
    Do you have an example of your code you could show us? What version of Arduino are you using? What version of Teensyduino are you using? The SD library that is used for this device (Ch376) is written for Arduino and not the latest for the Teensy 4.0. Curious about how you know:
    I see that the teensy communicates with the module, but the module does not see the USB stick
    The Teensy 4.0 is much faster than any of the devices this module has been interfaced to so the SPI settings could be a factor along with many other things.

    There a a few breakout boards available for the Teensy 4.0 (some with assembly required) but the easiest one to use would be here:
    https://www.tindie.com/products/logl...ut-revision-a/

    At that point you plug your Teensy 4.0 into the breakout board and the USB Host port becomes available and you can use the latest Arduino 1.85 and Teensyduino 1.54 (Stable) with your USB stick with this library:
    https://github.com/wwatson4506/UsbMs...scFat-FS_DATES

    Check out the examples in the examples folder.
    Last edited by wwatson; 09-05-2021 at 12:46 AM. Reason: Typo...

  5. #5
    Junior Member
    Join Date
    Feb 2020
    Posts
    14
    Quote Originally Posted by wwatson View Post
    Do you have an example of your code you could show us? What version of Arduino are you using? What version of Teensyduino are you using? The SD library that is used for this device (Ch376) is written for Arduino and not the latest for the Teensy 4.0. Curious about how you know:


    The Teensy 4.0 is much faster than any of the devices this module has been interfaced to so the SPI settings could be a factor along with many other things.

    There a a few breakout boards available for the Teensy 4.0 (some with assembly required) but the easiest one to use would be here:
    https://www.tindie.com/products/logl...ut-revision-a/

    At that point you plug your Teensy 4.0 into the breakout board and the USB Host port becomes available and you can use the latest Arduino 1.85 and Teensyduino 1.54 (Stable) with your USB stick with this library:
    https://github.com/wwatson4506/UsbMs...scFat-FS_DATES

    Check out the examples in the examples folder.

    Thank you very much.
    I will try this method and this library, it seems simple to use.

  6. #6
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    15,274
    Re p#4 TallDog/LogLow T_4.0 breakout board.

    I got a beta board I soldered, then a release board I soldered back 'then' before T_4.1 released. And a second release board I soldered a week back to a new T_4.0 board.

    Can confirm they work as noted in p#4 to give access to USB Host ( and SD card on SDIO like T_4.1 ).

    The boards I got did not have SMD components pre soldered like the current version and added to the to the assembly time. It isn't quick - but it works.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •