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

Thread: Teensy 4 PCM5242 Audio Shield - Stereo Balanced/Single Ended DAC Module

  1. #1

    Teensy 4 PCM5242 Audio Shield - Stereo Balanced/Single Ended DAC Module

    Hello,

    I'd like to introduce a Teensy 4 PCM5242 Audio Shield.

    It's part of a larger project to create a digital mixer based on the Teensy 4. I've experimented with a few different designs, but this one seems to make the most sense. It's a low-cost, high-performance DAC module for the Teensy 4 that features both Balanced and Single Ended output. It is long, thin, and designed to be stacked. This, and other similar audio modules (ADC, etc) can also be combined to create just the right combination of inputs and outputs for the intended use. The stack can be placed inside a project box on its side to save space and still fit inside a 1U enclosure. I'm also hoping that by stacking the boards, the I2S lines will stay short enough to work in multiples. I have created some prototypes of similar models, but this particular model hasn't yet been created. I'm interested in any feedback before I build it. Please feel free to comment. Thanks!


    Click image for larger version. 

Name:	TEENSY_4.0_PCM5242_AUDIO_SHIELD_v0.5.jpg 
Views:	22 
Size:	139.4 KB 
ID:	19622

    Key Features

    • Small PCB - The Shield is 62mm by 22.5mm (2.44” by .89”)
    • Stereo DAC with a high theoretical performance as specified in the PCM5242 datasheet.
    o SNR 114dB
    o Dynamic Range 114dB
    o THD+N at - 1dBFS –94dB
    o Full Scale Differential Output 4.2VRMS (GND center, 2.1VRMS per channel)
    • Stereo Balanced Output (+4 dBu professional)
    • Stereo Padded Single Ended Output (-10dBV consumer)
    • Outputs via header pins (no audio jacks or connectors on board).
    o Output 2 +
    o Output 2 –
    o Output 1 +
    o Output 1 –
    o Padded Output 1 +
    o Padded Output 2 +
    o Ground
    • Stackable Design. The stackable design and jumper options will allow multiple units to be used simultaneously.
    • Selectable Data Pins - The Teensy has 2 SAI sets, one with 2 serial data lines, and one with 5 serial data lines. Not all the exposed jumpers will work, because I believe 2 of the serial data pins are input only. I left them in there because I had the space. The other data lines are either intended by PJRC to be outputs, or are switchable between inputs and outputs (software support pending). Therefore, exposing jumpers for these data lines should make prototyping numerous boards together easier. A configuration of this board may be either multiple data lines via regular I2S or it can use TDM to have multiple units on the same line (4 units per data pin, 8 channels of audio). The jumper pads are a “hand solderable” 0603 pad for a 0 Ohm resistor.
    • Selectable Master Clock Pins - The Teensy has 2 master clocks. There are two jumper pads which can be used to select which master clock is used. This is only experimental.
    • Selectable I2C Pins - The Teensy 4 has 2 sets of I2C pins, and the board allows selecting use of either set. This may come in handy when having more than 4 of these boards stacked (The PCM5242 has up to 4 addresses on one I2C bus). (experimental).
    • Selectable Address Jumpers - For changing between the 4 available addresses.


    Board Schematic and BOM

    TEENSY_4.0_PCM5242_AUDIO_SHIELD_v0.5.pdf



    IO Board - XLR + RCA

    And finally, there is a corresponding IO board for the audio output jacks.

    Click image for larger version. 

Name:	TEENSY_4.0_PCM5242_AUDIO_SHIELD_IO_BOARD.jpg 
Views:	7 
Size:	57.4 KB 
ID:	19624


    Any Feedback?

  2. #2
    Senior Member+ MichaelMeissner's Avatar
    Join Date
    Nov 2012
    Location
    Ayer Massachussetts
    Posts
    3,674
    I am not an expert, particularly in doing anything audio, other than doing some simple hookups.

    One thought might be to have a second larger board that incorporates a micro-SD card using pins 34-39, and also the USB host pins. From the first photo, it looks like you have a cutout to allow attaching either of those devices, but it may be a lot easier if the PCB can incorporate the connection directly.

    The Audio shield has 8 pins for soldering a flash memory chip. It is faster than a micro-SD card, but limited in space. I don't know if it would be useful for you to have space to add the common SOIC chips. Typically pin 6 is used for the CS pin (which means you could not connect OUT1D via jumper cable if you use flash memory).

    I glanced at the PDF file, and it looks like you have jumpers for connecting OUT1A, OUT1B, OUT1C, OUT1D, IN1, OUT2, IN2 to the PCM5242_DATA pin. If you are going to be hooking up the OUT2 (Teensy pin 2) and/or IN2 (Teensy pin 5) to the PCM5252_DATA pin, you will need jumpers to switch between the other I2S1/I2S2 control pins (MCLK1/23 vs. MCLK2/33; LRCLK1/20 vs. LRCLK2/3; BCLK1/21 vs. BCLK2/4).

    I don't know if you want to have other jumpers for SCL2/SDA2 to I2C (pins 24/25).

    Speaking of I2C, you list 2K pull-up resistors, but the typical value I see on the internet is 2.2K for 3.3v buses.

  3. #3
    Quote Originally Posted by MichaelMeissner View Post
    I am not an expert, particularly in doing anything audio, other than doing some simple hookups.
    Thanks for your input. It's very helpful.

    micro-SD card using pins 34-39, and also the USB host pins
    Chris on facebook suggested both micro-SD and flash memory. I think another board that can be inserted into "the stack" would be better than stuffing it onto this board. The idea being that you wind up with a stack of boards. For example, 2 PCM5242, 1 ADC module (work in progress), 1 Bluetooth module (work in process), and maybe a memory module. The result being Bluetooth input, 4 outputs, and 4 inputs (from the ADC board i'm working on).

    The Audio shield has 8 pins for soldering a flash memory chip. It is faster than a micro-SD card, but limited in space. I don't know if it would be useful for you to have space to add the common SOIC chips. Typically pin 6 is used for the CS pin (which means you could not connect OUT1D via jumper cable if you use flash memory).
    That's good information to know. I could maybe install yet another jumper to jump OUT1D to another pin? Which pin would be the alternate pin if using flash memory? Or does it just mean no OUT1D at all? For my use case i'm OK with that.

    If you are going to be hooking up the OUT2 (Teensy pin 2) and/or IN2 (Teensy pin 5) to the PCM5252_DATA pin, you will need jumpers to switch between the other I2S1/I2S2 control pins (MCLK1/23 vs. MCLK2/33; LRCLK1/20 vs. LRCLK2/3; BCLK1/21 vs. BCLK2/4).
    Yes, I missed that. I just incorporated the extra jumpers into the design. I also decided to add 9 pins for an "SAI expansion" to the board. It takes up very little space, and it may come in handy when prototyping other peripherals.

    I don't know if you want to have other jumpers for SCL2/SDA2 to I2C (pins 24/25).
    I'm starting to run out of space. But I could maybe consider exposing it. There is still a theoretical maximum number of individually controlled devices you would use in the stack, right? 2 I2C busses gets up to 8 individually controlled PCM5242s. You would only really need to individually control one "universe" of 4 PCM5242's just to set the TDM timing for each set of 4. Besides individual volume control, or maybe individual "miniDSP" settings, there would probably be very little reason to control all 8 individually. Plus, the way this board is designed, a jumper wouldn't be the end of the world. I'll think about it. :-)

    Speaking of I2C, you list 2K pull-up resistors, but the typical value I see on the internet is 2.2K for 3.3v buses.
    Nice catch. i just fixed that. I just realized that the PCM5242EVM datasheet has it as 4.99k (ERJ-2RKF4991X). I currently have the BOM set to 2.21 k Ohm (ERJ-PA2F2211X). Good?

    Also, when stacked I assume we don't want pull up resistors on each card. That would mean each card is doing a pull up, do we want that? I have a PU_EN1 jumper to disable the pull up resistors in case we don't. Although it's slightly pointless because one could also remove the resistors. i figured this was easier because I'm using 0402 size resistors for that so they are very small.


    Updated Picture
    Specifically to show more of the jumper selects.

    Click image for larger version. 

Name:	TEENSY_4.0_PCM5242_AUDIO_SHIELD_v0.5.2.jpg 
Views:	16 
Size:	121.2 KB 
ID:	19634


    Updated Board Schematic
    1. Added SAI0 expansion header (3.3v, VIN, Data2, Data1, BCLK, LRCLK, SDA, SCL, MCK, GND)
    2. Added "Data 2" serial data line to expose a second SAI input/output to the expansion header.
    3. Added the Clock Select for BCLK, LRCLK, MCLK.

    (I didn't export the BOM for this one, the only change from the first post was to replace the pull up resistor specs).

    TEENSY_4.0_PCM5242_AUDIO_SHIELD_v0.52.pdf

  4. #4
    Senior Member+ MichaelMeissner's Avatar
    Join Date
    Nov 2012
    Location
    Ayer Massachussetts
    Posts
    3,674

    Cool

    Quote Originally Posted by JayShoe View Post
    Thanks for your input. It's very helpful.



    Chris on facebook suggested both micro-SD and flash memory. I think another board that can be inserted into "the stack" would be better than stuffing it onto this board. The idea being that you wind up with a stack of boards. For example, 2 PCM5242, 1 ADC module (work in progress), 1 Bluetooth module (work in process), and maybe a memory module. The result being Bluetooth input, 4 outputs, and 4 inputs (from the ADC board i'm working on).
    There is nothing special about pin 6. Any pin can be used if you want to incorporate it. It just happens to be the CS pin used by the prop and audio shields. But it can be useful to use the same pin in other code, particularly if people might be switching between your board and the audio shield. I just didn't know if you needed some faster memory to store things like background mono sounds. Right now, the only thing in the audio library that I'm aware of that uses flash memory is the RAW player. I suspect it may add complications unless you needed it. It may be better to leave it out initially, but if you find the SD cards are too slow, it can be used for rev 2 of the board.

    Quote Originally Posted by JayShoe View Post
    That's good information to know. I could maybe install yet another jumper to jump OUT1D to another pin? Which pin would be the alternate pin if using flash memory? Or does it just mean no OUT1D at all? For my use case i'm OK with that.
    If you provide the area for the flash memory and you use pin 6, it would mean the user could not also use pin 6 for I2S work. But unless the flash memory is always soldered on to the board, it is the user's choice. Either they can use pin 6 for flash memory and not use OUT1D, or they can use OUT1D, and ignore the flash memory pads.

    In playing around with flash memory (soldered onto a Sparkfun breakout board that I attach with wires), it was convenient to use the same pin as the audio shield uses. This was because I would move the revision D audio shield to my older Teensys (3.2, 3.5, or 3.6) to run the TeensyTransfer sketch. The TeensyTransfer sketch allows me to read/write the flash memory from the computer. Unfortunately it does not work on the Teensy 4.0. So for either the separate flash memory or for the flash memory I soldered onto the audio shield, I could use the program to populate the flash memory, and then move it back to the Teensy 4.0. But there are other programs that will copy the contents of a SD card to the flash memory.

    Quote Originally Posted by JayShoe View Post
    Yes, I missed that. I just incorporated the extra jumpers into the design. I also decided to add 9 pins for an "SAI expansion" to the board. It takes up very little space, and it may come in handy when prototyping other peripherals.
    I'm not sure adding jumpers for a 3rd I2C bus would be worth it. It really depends on how many I2C devices you want to talk to. I suspect it is overkill.

    Quote Originally Posted by JayShoe View Post
    I'm starting to run out of space. But I could maybe consider exposing it. There is still a theoretical maximum number of individually controlled devices you would use in the stack, right? 2 I2C busses gets up to 8 individually controlled PCM5242s. You would only really need to individually control one "universe" of 4 PCM5242's just to set the TDM timing for each set of 4. Besides individual volume control, or maybe individual "miniDSP" settings, there would probably be very little reason to control all 8 individually. Plus, the way this board is designed, a jumper wouldn't be the end of the world. I'll think about it. :-)
    I don't know anything about the PCM5242, but you probably aren't doing much I2C work in the main loop. I suspect it is more for setup. In that case, even having 2 different I2C buses might be overkill. While the user may want to add sensors and things to the I2C bus also, it may be better to not over-design things. If you aren't sure it is needed, wait for the user request, and then you can add it to rev 2 when you are sure what is needed.

    Quote Originally Posted by JayShoe View Post
    Nice catch. i just fixed that. I just realized that the PCM5242EVM datasheet has it as 4.99k (ERJ-2RKF4991X). I currently have the BOM set to 2.21 k Ohm (ERJ-PA2F2211X). Good?
    I'm a software guy, so I can't say what is needed electrically. It is just I see things like the audio and prop shields using 2.2K resistors. For a really complex I2C bus, you may need to calculate which resistor to use.

    Quote Originally Posted by JayShoe View Post
    Also, when stacked I assume we don't want pull up resistors on each card. That would mean each card is doing a pull up, do we want that? I have a PU_EN1 jumper to disable the pull up resistors in case we don't. Although it's slightly pointless because one could also remove the resistors. i figured this was easier because I'm using 0402 size resistors for that so they are very small.
    Yep, I see complaints of people who are stacking multiple I2C devices on a single bus, that each device's 4.7K resistor is overkill (4.7K is the default value used for pull-ups to 5v buses), and some have gone to lengths to remove the resistors from some of their devices. You can have multiple pull-up resistors, but the resistors are additive, and you can get to the point where it means you can't do higher speed I2C's. So it is good that you have a jumper for whether you do the pull-ups or not. It is your call whether the jumper is on or off by default.

  5. #5
    Quote Originally Posted by MichaelMeissner View Post
    provide the area for the flash memory
    Since I had many requests for memory, sd, and other features, I designed another board to stack on top. It's the Teensy 4.0 Audio Toolkit Shield. These PCM5242 cards are really meant to do one thing. The design is lean and mean. They are meant to stack, select the I2S/I2C bus, and play 2 channels of high quality audio. By separating it out, we just stack on the Audio Toolkit up top, and then we stack as many of these boards as will work at one time (testing pending, lol).

    Update

    Here is the side view, with the stacking headers.

    Click image for larger version. 

Name:	TEENSY_4.0_PCM5242_Audio_Shield_1_side.jpg 
Views:	4 
Size:	41.8 KB 
ID:	19728

    For example, the first board should run most standard 2 channel audio sketches by jumping the MCLK1, BCLK1, LRCLK1, OUT1A, SDA0, SCL0 jumpers. The second card can run in TDM mode with the same jumpers enabled. The second card needs one address jumper enabled to change it's channel (PCM5242 has 4 I2C channels). Or if the second card uses OUT1B instead of OUT1A then it can stay in I2S mode... Theoretically this works in my tests. The problem I was having was the breadboard problem (unreliable wires). So I'm hoping this board will have short enough lines to work correctly.

    Click image for larger version. 

Name:	TEENSY_4.0_PCM5242_Audio_Shield_1_front.jpg 
Views:	5 
Size:	61.8 KB 
ID:	19732

    Click image for larger version. 

Name:	TEENSY_4.0_PCM5242_Audio_Shield_1_back.jpg 
Views:	5 
Size:	45.4 KB 
ID:	19735

    By the way, I added an extra row to the standard Teensy headers. Instead of being 14 pins, mine are 15 pins. This is helping me sent the OUT1B and MC2 along to daughtercards without pogopins. We'll install pogopins on the first card (maybe the Audio Toolkit) and then pass those extra pins along that way to the rest of the cards.

    I decided that 0.0 Ohm resistors were too much work to trace. I eliminated half the pads by creating jumpers off the existing through-hole connectors. The result is a jumper system that should allow us to easily jump the desired serial audio data channel, the matching clocks, and an I2C bus.

    The PCM5242 only uses one data line. However, the "Teensy Audio Footprint" I've designed has a second data line. The front is Data 1 (X1) and the back is Data 2 (X2). This is for the ADC card I'm working on, or any other card that has 2 data lines (in/in, out/out, in/out, etc). So the backside jumpers, any jumpers without a through-hole, are actually two sided. This is just a little note as to how I'm designing it. Again, the PCM5242 only has 1 data line, so the back channel selects won't really do anything.

    Think the jumpers are the correct shape and size? I reckon they turned out OK? I was a little worried that they were too close to the headers, but these jumpers aren't going to change outside of the lab. I stretched the jumpers out from the headers as much as I felt comfortable doing. I don't want to cut any further into the space on the sides.

    Click image for larger version. 

Name:	TEENSY_4.0_PCM5242_Audio_Shield_1_jumpers3.jpg 
Views:	4 
Size:	70.4 KB 
ID:	19730

    Click image for larger version. 

Name:	TEENSY_4.0_PCM5242_Audio_Shield_1_jumpers2.jpg 
Views:	3 
Size:	84.1 KB 
ID:	19733

    I may send this over to the fabrication house tomorrow. Long day, good night.
    Last edited by JayShoe; 04-16-2020 at 04:26 AM.

  6. #6
    Senior Member
    Join Date
    Aug 2016
    Location
    Australia
    Posts
    145
    Jay,

    Sorry to come in late to this discussion.

    An excellent design - and I like the "lean and mean" concept. When I was working on the new CS42448 board, I had several helpful suggestions for what should be included - including SD card, +/- 12v Eurorack power, etc. In the end, I ended up adding only the features I needed - 2 extra input channels to bring the total to 8, SPI header for Ethernet, and headers for more complex preamps (Combo jack mic/line with gain pot) and buffers. I'll publish these soon, once the boards are back and I've got specs on them.
    https://forum.pjrc.com/threads/58836...hlight=cs42448

    I found that 0603 COG capacitors are a bit of a rarity. It would be worth checking supply before committing to a footprint. Mouser could source 0805's for the filter caps.

    If you want multipole output filter/buffers, Will Hollender designed some nice balanced ones for his Super Audio Board https://github.com/whollender/SuperAudioBoard based on TH4521s.

  7. #7
    Quote Originally Posted by palmerr View Post
    Sorry to come in late to this discussion.
    No worries. It's nice to hear from you, I recognize your work on the new CS42448 board.

    Quote Originally Posted by palmerr View Post
    I had several helpful suggestions for what should be included - including SD card, +/- 12v Eurorack power, etc. In the end, I ended up adding only the features I needed - 2 extra input channels to bring the total to 8, SPI header for Ethernet, and headers for more complex preamps (Combo jack mic/line with gain pot) and buffers.
    I was browsing around your work and appreciated your header pins. Including the power in them will help you with your input/output cards. Ethernet? Are you planning on doing Audio Video Bridging (AVB)? I am planning Bluetooth Audio via ESP32.

    Quote Originally Posted by palmerr View Post
    I found that 0603 COG capacitors are a bit of a rarity. It would be worth checking supply before committing to a footprint. Mouser could source 0805's for the filter caps.
    I've been able to source them. The PCBA order will be finalized shortly. Since I'm going that route, the smaller parts don't scare me. I also have a scope and 0603 is managable, 0402 was doable under the scope but if you lose the part good luck finding it. :-) The only reason I would want to remove a part is for fixing errors. I've triple checked my values on everything. I hope it's right.

    Quote Originally Posted by palmerr View Post
    If you want multipole output filter/buffers, Will Hollender designed some nice balanced ones for his Super Audio Board https://github.com/whollender/SuperAudioBoard based on TH4521s.
    Thank you for the helpful link and information. I included all needed components for it to be connected directly to a Powered Speaker with balanced cables (Balanced +4 dB), or to an amp via RCA (Padded Output - 10 dB).The PCM5242 has DirectPath.

    From the datasheet:
    The PCM5242 provides 4.2VRMS ground-centered differential outputs, allowing designers to eliminate DC blocking capacitors on the output, as well as external muting circuits traditionally associated with single supply line drivers.
    The EVM module sounded great and has the same output circuit as this board does. The only thing i plan on adding to this board is a Headphone Amp.

  8. #8
    Senior Member
    Join Date
    Aug 2016
    Location
    Australia
    Posts
    145
    I already have Teensy Library Ethernet Audio working (without AVB).

    https://github.com/palmerr23/EtherAudio

    This version (V1) carries stereo pairs of audio, plus a general protocol for messaging between hosts.

    I'm avoiding things like Dante and formal AVB at this stage, as the Ethernet adapters (WIZ5500 based 8510 modules) and stack (Paul's latest Ethernet library) I'm using can't support them, and AVB qualified switches are in the $200+ range. I'm using a $20 domestic 10/100 switch on an isolated network, with 3 or 4 hosts, for now.

    It runs reliably when all the Teensys are of the same generation. With mixed T3s & T4s there are occasional dropped packets due to slightly different 44.1kHz clocks (T3's 44.1 KHz clock is an approximation, about 0.07% off, i.e. 1 packet in every 1500).

    I'm currently working on V2, which is a bit faster and neater and will have quad objects, and maybe single channels as well. V2 updates are still underway, but this repo should is the one to use if you want to play as it doesn't hang sometimes when I2S/TDM and Ethernet are both enabled (V1 does).

    https://github.com/palmerr23/audio

  9. #9
    Can anyone please tell me the clock speed for MCLK, BLCLK, and LRCLK when the Teensy is in I2S mode? What's the clock speeds on TDM mode?

  10. #10
    Senior Member PaulS's Avatar
    Join Date
    Apr 2015
    Location
    Netherlands
    Posts
    136
    See halfway this page: https://www.pjrc.com/store/teensy3_audio.html

    Click image for larger version. 

Name:	Capture.PNG 
Views:	3 
Size:	8.8 KB 
ID:	20199

    Regards,
    Paul

  11. #11
    This looks awesome : ) is I2S quad currently working for T4? came across this thread looking for the answer. A

  12. #12
    Looks like its just in in the new version! Did you get one of your boards made JayShoe, is it up and running?

  13. #13
    Hello,

    Yes it's up and running!!! I'll post more about it sometime next week. I'll be ordering my re-spun board, along with the ADC this week. :-)

    https://m.facebook.com/groups/147012...99775843665937

    Seriously, the DAC sounds excellent. I haven't heard sound this good out these speakers ever. It's just so clean, and has excellent dynamic range. I was rocking out Pink Floyd (among others) last night, very fun.

    Jay

  14. #14
    That is awesome! Nice work, how many can you daisy chain at the moment and do you have to SMD solder to get them up and running or do they come populated from the fabricator? hype!

  15. #15
    Hello alrj,

    Once the project is complete, I will sell the boards via Tindie. You'll be able to buy pre-populated kits. My goal is to sell them affordably, but with some profits to support the project. I can build 100+ at a time and hopefully get them inexpensively on my end. I have a need for a bunch of these anyway, so I'll be building multiples at a time (of each part) anyway. I might need to come up with a project name, at the moment I'm just calling them by their main part numbers (PCM5242, etc). This is JayShoe's Teensy Digital Audio Mixer, but the modules can be used for other purposes.

    All the parts are small, and (may I say) impossible to hand solder. I spun up one board with my hot air rework station, but it was somewhat painful, and never really panned out. By the time I built it I was shot, and never got it working. I am contemplating a reflow oven so I can iterate faster. I've been doing straight up PCBA by pcbway at the moment which has a 25-35 day lead time from the time of the order. But the benefit is that I had 5 built boards to hack up and it led me to a working prototype. It was OK this time around because while I waited for the build, I worked on my other board designs, but this next order is going to be painful. I might take the time to build my toaster oven. Since I'm doing PCBA I have committed to using 0402 parts.... Which is good for space, but horrible for hand soldering. 0602 is the absolute smallest I would have gone if it weren't for the fact I'm getting it done via a fab house PCBA.

    My next step is to fix the rest of the 5 boards I already have and see how many can stack on top of eachother. I don't expect much issue with having 4 of them running TDM off OUT1A. But that's the test I'll try this week. Theoretically this system could have 32 output channels, possibly more. OUT1A, OUT1B, OUT1C, OUT1D = 4 data lines x 8 channels each = 32 channels. Then there is the second SAI line (OUT2) that could technically equate to 40 output (or input) channels total. The class mixer I'm designing is ~32 input channels, and up to 8 output channels. This project should at least be the hardware solution to test that functionality. Honestly, personally I don't need that many channels at the moment, so if it doesn't work out I'm not going to be upset. I only need like 8 inputs and 2 outputs. But when I realized I could, I figured I would design it for that maximum flexibility.

    For those of you wondering how the I2S lines are going to fair with that many stacked up, I have a possible solution for that too. So if we maxed this system out with 8 output channels, and 32 inputs this is what it would look like.

    - 4xPCM5242 = 8 outputs
    - 8xTLV320ADC6140 = 32 inputs

    So there would be 12 modules stacked on top of each other. That's making the I2S have a heavy load, and also long lines. So I've also designed a I2S transceiver that could possibly strengthen the clocks and data lines. That will be the last board I finalize, because as I've said, I don't really need that many lines. :-) But the board is completely spec'd out and designed, waiting to be built. I might order it, along with my re-spun DAC and first build ADC this week.

    Just to get some additional thoughts in the air... The plan is to control the mixer using OSC protocol similar to behringer's line of digital mixing products. Their documentation is here. Although, I don't necessarily need this functionality to have a Minimum Viable Product. My MVP doesn't need anything fancy, just simple volume control tied to the windows volume mixer.

    By the way, I apologize. I accidentally posted about my boards in the wrong thread last week. If you want to see my original post with some code describing how i'm getting this working you can go here: https://forum.pjrc.com/threads/60694...l=1#post240255

    PPS - I've moved from the PCM1865 to the new TLV320ADC6140. This change happened while I was waiting for my DAC. So that thread is basically nothing at this point. I'll just keep posting to this thread instead. Again, sorry for the multiple posts, just trying to have fun and work with other like-minded people. :-)

    Jay

    Posting some additional shots of the boards below.
    Click image for larger version. 

Name:	PCM5242_PROTOTYPE_2020-05-24.jpg 
Views:	4 
Size:	265.7 KB 
ID:	20245

    Oh, and here are some input/output boards that show how I'm hooking up to the jacks.
    Click image for larger version. 

Name:	DIGITAL_AUDIO_MIXER_BOARDS_2020-05-24.jpg 
Views:	3 
Size:	102.8 KB 
ID:	20246

    Click image for larger version. 

Name:	DIGITAL_AUDIO_MIXER_BOARDS_2_2020-05-24.jpg 
Views:	6 
Size:	126.7 KB 
ID:	20247

    Here is my "I2S Audio Breakout" board which I've also been using to hook up to EVM modules easier. :-)

    Click image for larger version. 

Name:	I2S_Audio_Breakout_2020-05-24.jpg 
Views:	5 
Size:	124.6 KB 
ID:	20248

    Click image for larger version. 

Name:	I2S_Audio_Breakout_2_2020-05-24.jpg 
Views:	7 
Size:	54.4 KB 
ID:	20249

  16. #16
    awesome stuff! I will keep an eye on progress and most likely get a couple once they are available : ) i only need 4 outs per teensy but keen for high quality.

  17. #17
    deleted as duplicate

  18. #18
    Seems this is late but the PCM5242 chips has a built-in DSP, and you could use the GPIO pins as extra I2S data lines to another DAC (sharing the clock lines). That way you could build for an example a 2 in 4 out DSP crossover for active speakers. I see there isn't much space for anything but maybe for for a pin or two to GPIO pins, but that would be enough for a cheap PCM5102A DAC card from aliexpress.

  19. #19
    Quote Originally Posted by mhelin View Post
    Seems this is late but the PCM5242 chips has a built-in DSP, and you could use the GPIO pins as extra I2S data lines to another DAC (sharing the clock lines). That way you could build for an example a 2 in 4 out DSP crossover for active speakers. I see there isn't much space for anything but maybe for for a pin or two to GPIO pins, but that would be enough for a cheap PCM5102A DAC card from aliexpress.
    The miniDSP was just extra... The Teensy has the "DSP" so having the miniDSP on the PCM5242 is overkill I think for most things. But I selected this chip for it's simple and effective quality. I believe most of the audio processing would be done in the Teensy and the miniDSP would be turned off for most projects. I have yet to come up with a good reason to use it unless we are doing simple EQ functions and want to take the load off the Teensy.

    A teensy, plus 2 PCM5242, plus the pending adc card gives you 4 in, 4 out. All balanced. If you mix in a PCM5102A you then have single ended. Your idea is interesting, but stacking two on top of eachother would also be easy. Then you can still program the miniDSP to do your crossover routine it would just be done twice - once on each of the PCM5242 units.

    If you are looking for inexpensive, then you can still use two PCM5102A (no PCM5242) and just do your DSP in the teensy. Why would the PCM5242 DSP be helpful at that point? That being said... You did say this in time. I might be able to expose pins 19, 20, and/or 21 to a VERY small pad. I haven't ordered it yet. I might just expose a small solder pad, maybe even just on the underside. What's the smallest solder pad reasonable? If you only want to have one extra PCM5102A, you only need one pad, right? You are just jumping the data lines. Which pin do you need?

    I can see an I2S Breakout card + PCM5242 + cheap PCM5102A being soldered up pretty easily to do what you want (assuming I add the additions pin). The I2S breakout card would just make it easier to expose your clock lines. In fact, I've planned on soldering an I2S Breakout to PCM5102A to demonstrate why this I2S breakout is so useful. One of my first posts on this forum was regarding my experience with the PCM5102A. It was a simple test at the beginning of this project - but I need balanced stuff.

    I opened the project file and for certain those pins are exposed easily.

  20. #20
    mhelin,

    Still not convinced that it will be helpful. But it's interesting nonetheless and was easy to add. I added 4 pins, corresponding to the 4 data lines required for clocks and data.

    Click image for larger version. 

Name:	PCM5242_GPIO.png 
Views:	0 
Size:	21.9 KB 
ID:	20281

    Is a 1 x .05 mm solder pad big enough?

    Jay

  21. #21
    Hello,

    I have a question regarding my project overall, and I'm hoping to get input from people who have a lot of experience with the Teensy Audio Library.

    What is the best pin to use for a hardware "RESET" pin on the teensy, assuming that I don't want to waste any pins that might be helpful for other purposes?

    On my ADC I need such a pin. It's a "RESET" pin that must be low when active and high when reset it not active. I've seen this on other modules, and therefore might need it if i design other audio parts.


    What's the most sensible pin to commit to the hardware "RESET"?


    Jay

  22. #22
    Senior Member+ MichaelMeissner's Avatar
    Join Date
    Nov 2012
    Location
    Ayer Massachussetts
    Posts
    3,674
    Quote Originally Posted by JayShoe View Post
    Hello,

    I have a question regarding my project overall, and I'm hoping to get input from people who have a lot of experience with the Teensy Audio Library.

    What is the best pin to use for a hardware "RESET" pin on the teensy, assuming that I don't want to waste any pins that might be helpful for other purposes?

    On my ADC I need such a pin. It's a "RESET" pin that must be low when active and high when reset it not active. I've seen this on other modules, and therefore might need it if i design other audio parts.


    What's the most sensible pin to commit to the hardware "RESET"?


    Jay
    You didn't mention which Teensy you have. The simplest way is to look at the pinout card that came with your Teensy, or:


    And find the digital pins that don't have any colored boxes next to them:
    • On the Teensy 4.1, that would be pins 40 and 41. If you don't think you will be using CAN devices, pins 22, 30, and 31 could be used;
    • On the Teensy 4.0, all of the exterior pins have some use, but if you don't plan to use CAN devices, there is pin 22.
    • On the Teensy 3.5-3.6, pins 24-25;
    • On the Teensy 3.2, pin 2.


    Realistically, you might need to decide if for instance you plan to use all serial devices, more than one I2C bus, how many PWM pins you might use, how many analog input pins you might use.

    I generally use a spreadsheet to lay out the Teensy and the prototype boards, and I will move things around. While a lot is just wishfull thinking and such, here is the google docs that I've laid out the various Teensies. The one I'm actively looking at right now is the Teensy 4.1, I2S1, 2 SPI, where I want to have 2 SPI ports to connect two displays, sound, 2 serial ports, etc. all soldered into a prototype board that I can plug things into as needed:
    • Google docs for prototype board layouts: https://docs.google.com/spreadsheets...#gid=940680151
    • Google docs comparing all Teensy pin assignments: https://docs.google.com/spreadsheets...gid=1683806103
    • Prototype board I'm planning to use; https://www.tindie.com/products/draz...roject-boards/;
    • I will have a breakout area to connect Serial1;
    • I will have a breakout area to connect Serial3, which can also bring out 2 more analog inputs, or S/PDIF hardware support;
    • I will have a breakout area to connect I2C devices to the main I2C port;
    • I will have two breakout area to connect the first and second SPI area with default pins via jumpers (I will also be able to override the SPI pins by changing the jumpers);
    • I will have two level shifters for hooking up WS2812B LEDs. There are jumpers, but the two default pins are both TX pins, so that I can also use either the W2812BSerial library or standard Adafruit library;
    • I will have a breakout area for connecting I2S1 if I'm not using the audio shield;
    • I will have two breakout areas for analog inputs, set up so I can plug a potentiometer directly into the breakout;
    • I will have two push buttons, one that connects to pin 3 (which I typically use as a button in many of my layouts), and another that you use a jumper to connect it;
    • I will have two LEDs that I can connect with jumper wires.


    Now, I haven't soldered it up yet, I may completely change my mind and do something else. The idea is to be one step above a breadboard, where there will be default pin assignments, but they can be changed. For connecting displays, I've been moving towards using a standard pinout for the SPI breakout, and then making a custom cable for each display. That way I can easily swap displays, or move them around.

    In this last iteration, I've added a VIN breakout to each of the devices, so things can decide whether to use 3.3v or VIN. In the past, I tended to fix the choice, or put a separate switch to control the power.

    Alternatively, just get a 60 pin breadboard and lay things out, and experiment until you come up with a design you like. While I use breadboards, I find at times the wires will come out over time. That's why I tend to prefer the tinker toy approach with prototype boards. In general, the Teensy is always removable, so I can move the Teensy from one prototype board to another. If a board doesn't work out, or I change my mind, I can just resolder up a new prototype board and move the Teensy over to it.
    Last edited by MichaelMeissner; Yesterday at 05:47 PM.

  23. #23
    Jay, just to make sure: you want a teensy pin to drive the reset pin of your ADC: so it's not about resetting the teensy, right?

  24. #24
    Hello,

    Thank you for your thoughtful responses.

    Quote Originally Posted by jpk View Post
    Jay, just to make sure: you want a teensy pin to drive the reset pin of your ADC: so it's not about resetting the teensy, right?
    That is correct. My target is the TLV320ADC6140. It's about 95% completed, and hope to order this week. The SHDNZ pin (aka RESET, as far as I'm concerned) needs to stay low at startup and pull high during operation. This is true for many TI codecs, dacs, and adcs. So I figured I would pick a reset pin and use it for all modules in the future. I do have some other modules planned. Maybe I should include a slice point so if absolutely necessary one can jump it easier.

    On the Teensy 4.0, all of the exterior pins have some use, but if you don't plan to use CAN devices, there is pin 22.
    OK, so maybe just use Pin 22? My project does not use CAN. My project will be both 4.0 and 4.1 compatible. I'm trying to pick a pin that would have the least possible side effects for anyone looking to integrate audio into a project. Here are some "wish list" items, but nothing is completely committed, nor necessary for every project.

    - USB Host
    - Ethernet
    - SD Card
    - I2C0 and I2C1
    - SPI (to ESP32)
    - ALL I2S lines

    Pin 22 checks out as far as I can see, agree? :-) Thanks for the advice!

    Jay

  25. #25
    Senior Member+ MichaelMeissner's Avatar
    Join Date
    Nov 2012
    Location
    Ayer Massachussetts
    Posts
    3,674
    Quote Originally Posted by JayShoe View Post
    Pin 22 checks out as far as I can see, agree? :-) Thanks for the advice!

    Jay
    One other possibility is that you could stick something on the I2C bus (MCP23008, MCP23017) that can bring out one or more pins to use as hardware reset pins. It isn't like that would be performance critical.

    Obviously for Teensy 4.0, you don't have access to OUT1B (for 1st I2S bus) and MCLK2 (for 2nd I2S bus) or to the USB host support unless you either solder wires to the pads or use one of the breakout boards. The 4.0 breakout board that I like best is the trainer4edu boards. They have the nice feature that pins 24-33 on those boards match up with the Teensy 4.1 pins. Teensy 4.1 pins 34-41 are different than the pins from the SD interface on the trainer4edu board, but it can simplify things:


    Note, since you mentioned USB Host and Ethernet, you probably want to include those pins on your board, so if you stack your devices, the user can bring these pins out to the top of the stack.

    It would be nice to your users if you also brought out the Program pin, On/Off pin, and Vbat pins, so that they can be accessed without de-stacking your boards.

Posting Permissions

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