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

Thread: newb question: can I use audio shield and OctoWS2811 w/ Teensy 4.1 on same project?

  1. #1
    Junior Member
    Join Date
    Sep 2022
    Posts
    10

    newb question: can I use audio shield and OctoWS2811 w/ Teensy 4.1 on same project?

    Truly sorry to ask such a basic question, but I tried searching for an answer and didn't find it: can I stack the audio shield and OctoWS2811 w/ Teensy 4.1 on the same project? I.e., are there pin conflicts that I can't work around? I've done a few limited projects on my Arduino but don't have experience adding shields.

    It looks to my unknowledgeable eye that there are bound to be conflicts, and looking at the OctoWS2811 in particular, I can't tell which ones I need to keep free. Maybe I can use both but not stack them on top of each other??

    Thanks!

  2. #2
    Senior Member
    Join Date
    Feb 2016
    Location
    Australia
    Posts
    284
    You could and should look at schematic of audio sheild and octows2811 to see but I think there is not. I found issues with interrupts needing to be disabled for led updates which caused audio glitches when i was playing from an sd card.

  3. #3
    Senior Member+ MichaelMeissner's Avatar
    Join Date
    Nov 2012
    Location
    Ayer Massachussetts
    Posts
    4,275
    Quote Originally Posted by Gibbedy View Post
    You could and should look at schematic of audio sheild and octows2811 to see but I think there is not. I found issues with interrupts needing to be disabled for led updates which caused audio glitches when i was playing from an sd card.
    If you are using the Octows2811 library with the Octows2811 board, it should write the LEDs without having to disable interrupts for the entire period (like the Adafruit_Neopixel library does). Similarly you could use the WS2812Serial library for the 8 pins that are serial UART TX pins to write the LEDs without disabling interrupts.

    Looking out at the pinout, the Octows2811 uses the following pins which are used by the audio board:
    • Pin 7: Audio output
    • Pin 8: Audio input
    • Pin 20: LRCLK1
    • Pin 21: BCLK1

  4. #4
    Senior Member
    Join Date
    Feb 2016
    Location
    Australia
    Posts
    284
    I as probably using fastled now I think about it.

  5. #5
    Junior Member
    Join Date
    Sep 2022
    Posts
    10
    Thanks so much for the guidance, you guys!! Really appreciate it. Regarding these conflicts, are the pin assignments not adjustable in the relevant libraries?

    E.g. pins 7 & 8, can the audio library not use two different pins for audio in/out? This is where my ignorance comes into play. 🙂

  6. #6
    Senior Member+ MichaelMeissner's Avatar
    Join Date
    Nov 2012
    Location
    Ayer Massachussetts
    Posts
    4,275
    Quote Originally Posted by RenMan View Post
    Thanks so much for the guidance, you guys!! Really appreciate it. Regarding these conflicts, are the pin assignments not adjustable in the relevant libraries?

    E.g. pins 7 & 8, can the audio library not use two different pins for audio in/out? This is where my ignorance comes into play. ��
    In terms of the audio, it quickly becomes a mess. The audio shield only has connections for pins 7 and 8. I believe the hardware also support pins 6 (OUT1D), 9 (OUT1C), 32 (OUT1B) and 39 (alternate OUT1A). But you might need to do some deep diving into the data sheet to learn the details to change these values.

    There is a second I2S bus that uses other pins. Unlike the first I2S bus, I believe there are no alternative pins that you can use. The pins are 2 (OUT2), 3 (LRCLK2), 4 (BCLK2), 5 (IN2) and 33 (MCLK2).

    Now, in terms of the octows2811 library, on the Teensy 4.x boards, you can change the pins used. But the actual shield was designed for Teensy 3.x, and reflects the choices on that machine. You presumably could use patches to connect the new pins to the existing board.

    If you have a S/PDIF audio converter, you could use pins 14 and 15 to provide audio.

    If you aren't using the first SPI port (i.e. typically for a display), pins 10 and 12 support MQSR/MQSL, which provides lower grade sound output through pins 10/12. Teensydunio 1.57 added a new option to do mono sound to any PWM pin. I presume the quality would not be as good as the audio shield produces.

    From me, this is all I know, as i haven't delved further into the low level details.

  7. #7
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    26,800
    The pinlist example might help. In Arduino, click File > Examples > OctoWS2811 > Teensy4_PinList.

  8. #8
    Junior Member
    Join Date
    Sep 2022
    Posts
    10
    Wow. Yes, sounds complicated. Am I to understand that no one on this forum has tried using both shields/libraries on one project? I would have guessed that any number of people would have either done this by now or not tried because it's not doable.

  9. #9
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    26,800
    Sounds like you haven't yet tried or looked at the pinlist example?

    In Arduino, it's just a few mouse clicks away: File > Examples > OctoWS2811 > Teensy4_PinList.

    It's really not very complicated. (at least to just use it... how it works internally inside OctoWS2811 with DMA buffers is another matter, but you don't need to know how to rebuild an engine just to drive a car).


    and to specifically answer your question....

    Am I to understand that no one on this forum has tried using both shields/libraries on one project?
    Yes, plenty of people have used them together. That's what the pinlist example is all about (well, and flexibility for so much more), but the pins chosen in the example let you use it together with the audio shield.

    Before OctoWS2811 was supported on Teensy 4, and before the pinlist feature, this issue did indeed come up many times. But it's not a big deal on the forum much these days, because pinlist give you a way to make OctoWS2811 use any group of pins of your choosing. This makes Audio and OctoWS2811 work together pretty easily, just a little fiddling with wires to route the signals. It's not a common question anymore, because there is a pretty simple solution. All you have to do is actually open the example and make use of that feature.

  10. #10
    Junior Member
    Join Date
    Sep 2022
    Posts
    10
    Ahh, thank you so much. I obviously haven't experimented with it yet - just got the boards in the mail recently. Since I don't know how much I don't know, I wasn't sure that it was even possible and wanted verification before I chose a microprocessor. Again, thanks for helping.

    I see now I should have posted this in the Project Guidance forum. My bad.

    Ed

  11. #11
    Junior Member
    Join Date
    Sep 2022
    Posts
    10
    LOL! From said example: "This example shows how to use only 4 pins, which are the 4 pins of the Octo28 shield which do not conflict with the Audio shield."

    That's hilarious. Of course, I never would have stumbled across that without guidance.

Posting Permissions

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