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

Thread: MQS output from SD card

  1. #1

    MQS output from SD card

    I'm trying play WAV file from SD card. I connect SD to SPI2 (CS pin 36). There are 2 dinamics on 10 and 12 pins (left and right channels). But working left channel only.
    Attached Files Attached Files

  2. #2
    Senior Member
    Join Date
    Apr 2014
    Location
    -
    Posts
    9,756
    I guess you confused left and right?
    10 is the right channel.
    12 does not work, because it is MISO from SPI

    As far I know there is no way to fix that - other than just not to use SPI. The T4 has a by far better port, where you connected CS. Connect the sd-socket there (with all pins)

  3. #3
    Channel 12 is working (MISO from SPI). Don't work channel 10 (CS from SPI).

  4. #4
    In sketch I defined CS pin 36

  5. #5
    Senior Member
    Join Date
    Apr 2014
    Location
    -
    Posts
    9,756
    Please post the connections in more detail - are you using a Teensy 4.0 ? Or 4.1? To which pins is the SD Slot connected? Post all connected pins.
    Also, which Teensyduino-version?

  6. #6
    Teensy 4.0
    Teensyduino v1.54

    CS - pin 36
    MISO - pin 34
    MOSI - pin 35
    SCK - pin 37
    These pins connected to SD card.

    I using audio amplifier "arduino module amplifier PAM8403 mini 5V 2x3W". It connected to 10 and 12 pins.
    There is sound from pin 12. Pin 10 don't work, no sound.

  7. #7
    Senior Member
    Join Date
    Apr 2014
    Location
    -
    Posts
    9,756
    Sorry, I have no Idea how can hear any sound anywhere, and I don't know how the SD libary automagically uses SPI2. Perhaps I'm not up to date regarding the new SD Library. From my understanding nothing should work.
    For SDIO you need _all_pins on the backside (4-bit parallel transfer), but you don't use it anyway, because you use CS=36.

    So, I hope some else can answer your question.

    You have pinMode(10,OUTPUT); (!<-- remove that!) , too - this stops any mqs on pin 10 - but it does not matter, because the program should stop before that...and print the error message. So, it's over my head.

    @Others: Does the SD Library automatically use SPI2 ??

  8. #8

  9. #9
    Yes, automagically and 12 pin working, music from SD card playing in speaker.

  10. #10
    pinMode(10,OUTPUT) I've tried to delete. Did not helped

  11. #11
    Senior Member
    Join Date
    Apr 2014
    Location
    -
    Posts
    9,756
    Okay.. seems the new lib is smart ..

    But I don't know why MQSR does not work after removing pinMode. It should.

  12. #12
    Senior Member
    Join Date
    Apr 2014
    Location
    -
    Posts
    9,756
    Your file is stereo? :-)
    Edit, ah yes, you're using the examples.

  13. #13
    Senior Member
    Join Date
    Apr 2014
    Location
    -
    Posts
    9,756
    Try to output a sine or any ther signal (nothing from SD), perhaps...

  14. #14
    well, actually, I've added pinMode trying to solve problem with sound So problem was before I added this.

  15. #15
    okay, I'm trying

  16. #16
    Quote Originally Posted by Frank B View Post
    Try to output a sine or any ther signal (nothing from SD), perhaps...
    It works. So problem in using SD or incorrect using gui

  17. #17
    Senior Member
    Join Date
    Apr 2014
    Location
    -
    Posts
    9,756
    Quote Originally Posted by taltsutamatu View Post
    It works. So problem in using SD or incorrect using gui
    Interesting!

    Looks like a bug in the SD lib. I'll take a closer look this evening. Perhaps it accesses pin 10 - but shouldn't

  18. #18

  19. #19
    Quote Originally Posted by Frank B View Post
    Try to output a sine or any ther signal (nothing from SD), perhaps...
    Speaker on pin 10 stops working after SD card initialization (SD.begin(SDCARD_CS_PIN))

  20. #20
    Senior Member
    Join Date
    Apr 2014
    Location
    -
    Posts
    9,756
    Yup... but i could not find the exact problem so far.. Please post that in the current 1.55 beta thread. It really seems to be a bug, that needs to be fixed.

  21. #21
    1.55 version of what?

  22. #22

  23. #23
    thank you a lot

Posting Permissions

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