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

Thread: I want to save files to USB via teensy3.6 board.

  1. #1

    I want to save files to USB via teensy3.6 board.

    I want to save files to USB via teensy board.

    I want a simple example source code and circuit diagram.
    Please help me.

    Hello. I would like to collect data every minute and store the numerical values on USB.
    It will be saved in .csv file format, and it will be large because it needs to collect data for up to 2 years.


    Is there any workaround?
    Also, is there anything provided by teensy3.6?

    Please provide example source code.

  2. #2
    Senior Member
    Join Date
    Feb 2018
    Location
    Corvallis, OR
    Posts
    104
    I'm not sure what you mean by
    I want to save files to USB via teensy board.
    The other end of the USB connection on the Teensy can be connected to any USB host. It would then be the responsibility of that host to save the data in a file.

    Perhaps you really mean to save the data on the Teensy 3.6 SD card. If that is the case, you could easily save that data on an 8GB card. For an 80-byte line each minute for two years you would need
    80 x 60 x 24 x 365 x 2 bytes, or about 85 megaBytes.
    That's not really a large amount of data for a two year logging session. The more important questions that prevent a complete answer to your query are:
    What sensors are you going to use to collect the data?
    How do the sensors connect to the Teensy (Analog, SPI, or I2C)?
    Does the system run off batteries, making power efficiency important?
    What kind of packaging and connectors do you need?

  3. #3
    Dear mborgerson, @mborgerson

    Thanks for the quick answer.

    I know how to store data via SD card. But I don't know how to save it to USB.
    (Attach pictures)

    By the way, what I want to do is to save the data to USB.
    In other words, the user wants to extract data by plugging in the USB.
    Users can receive the data stored for 2 years through USB.
    * -Battery is no problem.
    * -There is no problem in communication between sensors.
    * -Only, I want to save it to USB.


    Click image for larger version. 

Name:	USB.jpg 
Views:	0 
Size:	28.1 KB 
ID:	19484

  4. #4
    Senior Member
    Join Date
    Feb 2018
    Location
    Corvallis, OR
    Posts
    104
    AHA! In US English, what you show is generally referred to as a "thumb drive" or "USB drive". USB alone generally refers to the serial bus itself.

    Now that I know what you want, I'm afraid that there is not a simple answer. To save data to a thumb drive requires a lot of parts that are not readily available on the T3.6. First, you need a hardware connection between the host port pins on the T3.6 and a USB Type A socket. Then you need a driver for the Teensy that knows how to write to the file system on the thumb drive. You could probably hand-wire a connector to the T3.6, but i'm not sure that there is a software driver available to write to the file system on the thumb drive. The latest version of the USB Host library on GITHub doesn't support mass storage drivers, but only HID devices like mice, keyboards, MIDI devices, and USB Serial devices.

    Is there some reason you cannot write to the onboard micro-SD card, then unplug it and read it on a PC? If you have to connect to a USB Type-A socket, there are adapters with a Type A USB plug into which you insert your micro-SD card.

  5. #5
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    11,562
    Yes, there is a way with USB Host on T_3.6.

    See this thread :: pjrc.com/threads/55821-USBHost_t36-USB-Mass-Storage-Driver-Experiments

    This post links to cable and connection option :: Using-Teensy-3-6-as-USB-Host-for-F710-Gamepad

  6. #6
    Dear mborgerson
    Dear defragster

    Something similar to what I want to implement
    link: https://arduinobasics.blogspot.com/2...te-module.html

    The problem with the 'CH376S' above
    1. When there is a lot of data, a problem occurs.
    2. You cannot enter the date of the file.

    So I am looking for a new way. I would like to know if it is possible with 'teensy'.
    Please refer to the attached file for what I want to implement.

    Please advise and consult me.

    Click image for larger version. 

Name:	t1.jpg 
Views:	5 
Size:	52.2 KB 
ID:	19486

  7. #7
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    11,562
    See links in post #5.

    Teensy 3.6 has onboard host connector - see second link for connection and cable - first link is a thread using USBHost code with added river to utilizr high speed USB at some 5 to 10+ MByte per second write speed.

    It seems that p#6 indicated device is some odd way to connect USB that the T_3.6 has native and faster hardware for.

Posting Permissions

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