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

Thread: Teensy with PCM5102a Module via I2S

  1. #1
    Junior Member
    Join Date
    Jun 2018
    Posts
    5

    Teensy with PCM5102a Module via I2S

    Hello,

    I purchased an inexpensive PCM5102a module from ebay.

    Click image for larger version. 

Name:	pcm5102a.jpg 
Views:	2 
Size:	114.0 KB 
ID:	14160

    I put a teensy on a breadboard with it, and connected it using the information on this page
    https://www.pjrc.com/teensy/td_libs_AudioOutputI2S.html

    I used this code to hopefully passthrough the USB->I2S
    Code:
    #include <Audio.h>
    #include <Wire.h>
    #include <SPI.h>
    #include <SD.h>
    #include <SerialFlash.h>
    
    AudioInputUSB            usb1;           //xy=200,69  (must set Tools > USB Type to Audio)
    AudioOutputI2S           i2s1;           //xy=365,94
    AudioConnection          patchCord1(usb1, 0, i2s1, 0);
    AudioConnection          patchCord2(usb1, 1, i2s1, 1);
    AudioControlSGTL5000     sgtl5000_1;     //xy=302,184
    
    void setup() {                
      AudioMemory(12);
    }
    
    void loop() {
      delay(100);
    }
    Here is the breadboard
    Click image for larger version. 

Name:	pcm5102a_breadboard.jpg 
Views:	3 
Size:	106.2 KB 
ID:	14161

    I'm relatively new to this, but I had great success wiring up an Audio Shield to the teensy and proving my application. The above situation is not working. Does anyone have any advice on what I should do to get this to work? Could it be the "long i2s lines" issue? I don't know how much shorter I can get.

    Thanks for your help.
    Jay

  2. #2
    Junior Member
    Join Date
    Jun 2018
    Posts
    5
    Update: I figured it out.

    PCM5102A / Teensy 3.6
    VCC = Vin
    3.3v = NC
    GND = GND
    FLT = GND
    SCL = GND (also works connected to 11 /MCL)
    BCK = BCK (9)
    DIN = TX (22)
    LCK = LCRLK (23)
    FMT = GND
    XMT = 3.3V (HIGH)

    There is a noticeable difference in sound quality over my PC port or audio shield.

    Click image for larger version. 

Name:	PCM5102a_working.jpg 
Views:	1 
Size:	147.3 KB 
ID:	14166

    And now I'm going to work on getting the ADC working. I'll post my results when I know.
    Last edited by JayShoe; 07-11-2018 at 02:44 PM.

  3. #3
    Junior Member
    Join Date
    Jun 2018
    Posts
    5
    I got the ADC working now too on my project. It's a PCM1808 module, another cheap board from ebay.

    Click image for larger version. 

Name:	PCM1808_module.jpg 
Views:	1 
Size:	170.4 KB 
ID:	14169

    Here are the connections for the PCM1808 module.

    FMT = GND
    MD1 = GND
    MD0 = GND
    GND = GND
    3.3V = 3.3V
    5V = VIN
    BCK = BCK (9)
    OUT = RX (13)
    LRC = LRCLK (23)
    SCK = MCL (11)
    GND = GND
    3.3V = 3.3V

    Here is a picture of the breadboard now. Yes, it's a mess but I managed to make it work.

    Click image for larger version. 

Name:	IMG_20180711_112452607.jpg 
Views:	2 
Size:	91.8 KB 
ID:	14170

    It sounds really nice! I'm actually quite impressed by the quality of the sound overall. My application is a simple passthrough USB Audio and I2S input through to the outputs.

    *** On a side note, I seemed to have lost the ability to edit my posts. I hope it wasn't because I deleted a photo in the earlier post. Maybe it's a time-out setting once you've edited? Moderators, can you explain why I've lost that ability and possibly reinstate? I look forward to contributing. Thanks!

  4. #4
    Senior Member
    Join Date
    Dec 2016
    Location
    Montreal, Canada
    Posts
    2,591
    everyone loses the ability to re-edit a post after 2 hours. This was done to prevent some ravage individuals from mass deleting their posts when they were upset

  5. #5
    Junior Member
    Join Date
    Jun 2018
    Posts
    5
    Hello Teensy,

    Would it make sense to create a Teensy Audio Bridge? Would anyone else be interested in that?

    Click image for larger version. 

Name:	TEENSY-AUDIO-HAT-CONCEPT.jpg 
Views:	13 
Size:	171.7 KB 
ID:	14175

    From my experience with my project, and digital audio projects in general it seems that there should be some type of standardized connector for I2C/I2S Audio Connections. From my initial analysis, it appears that the Teensy 3.6 could have 4+ I2C/I2S lines exposed (more research?). If used in tandem with TDM multiplexed lines this could result in an insane amount of inputs/outputs connected to the Teensy.

    I've seen other projects with similar connectors, but I haven't seen an I2S bridge before like what I'm talking about. What's different from the bridge I'm thinking about is that it would have no functionality other than simplifying connections to other sound modules. FreeDSP has a standardized connector but it's almost always fixed to the existing codec/DSP card. I've attached a PDF of their connector diagram (FREEDSP-HEADER-CONNECTOR.pdf). More details can be found at this link. https://github.com/freeDSP/WIKI-AND-...DSP-Guidelines

    The Teensy Audio Bridge connectors would enable system designers to plug in modules with ease. Just solder the end of a ribbon cable onto the module to the right pins, and then connect it to the expansion connector of the bridge. For modules designed for this project the correct pins would be in the right spot making connections even easier. The project may also encourage designers to release more reference modules (codec, adc, and dac, bluetooth, ethernet, hdmi, etc) which would further expand the possibilities of DIY audio engineers to create the system they want/need.

    Possible Features??
    - Single 8+ pin connector to supply power, data, clocks, control, and gpio to any audio module.
    - Optional external 12v dc power supply? (for op amps? more power? cleaner power than USB?)
    - Regulate and Filter the power for high quality 12v?, 5v, 3.3v supplies to each port?
    - Assist with filtering DGND and AGND possibly?
    - Optional external clock? Crystal?
    - Long I2S isolation?
    - TDM modules can have a daisy chain function for daisy chaining the multiplexed I2S lines?
    - Memory socket/port?
    - ?
    Attached Files Attached Files

Posting Permissions

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