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

Thread: High speed options for the data out from/in to Teensy 3.6

  1. #1

    High speed options for the data out from/in to Teensy 3.6

    Hi,

    I need to send the audio data from Teensy to a Raspberry Pi-like board and receive it back (ideally, I'm talking about realtime sending of all 6 channels from TDM input of CS42448 board to Pi and receiving of all 8 channels back to Teensy).
    I'm looking for the appropriate options.

    I've tried SPI first, SPI works, but Raspberry Pi cannot be an SPI slave (at least I couldn't find the suitable driver) and Teensy can do only 12MHz as a slave, which makes it too slow.

    Then I've started to look at the USB-serial. It also works. But also seems to be too slow. It doesn't seem to be enough even for the realtime stereo out/in (either out or in seems to more or less work, but simultaneous out/in is not). Another problem with it is the data loss, it just drops some part of the data. The pseudo code looks like:
    Code:
    class MyIO : public AudioStream
    {
    public:
        ...
        virtual void update(void);
        ...
    };
    
    void MyIO::update(void)
    {
        Do receiveReadOnly() to get the block;
        Send the audio samples from the received block using Serial.write();
        Do Serial.read() to read enough data (if available);
        When enough data is read, allocate() new block, transmit() that block and release();
    }
    My test program on the host was just echoing the data, so I expected to have a pass-through...

    Perhaps the code can be optimized somehow. It's weird that I can't get enough even for stereo.

    So, the question is about other data transfer options which would work. And about the code suggestions. I've seen a mention of a second high speed USB on Teensy, but I haven't found any relevant info for using it (just some USB host example).

    I'm also thinking about an Ethernet adapter for Teensy, though the SPI nature of that adapter makes me wonder... What actual speed it can provide?

    What other options I have? Is it even possible?

    Thanks.

  2. #2
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    20,057
    The 2nd USB port is probably the only viable option. It runs at 480 Mbit/sec speed. But currently the only software support is for USB host mode.

Posting Permissions

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