-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue/confusing feedback creating I2S object on Seeed XIAO RP2040 #8058
Comments
We could include the GPIO numbers in the error message. That may help. |
That sounds sensible! |
Hi @IrregularShed have you tried the "Where's My I2S?" script in the Learn Guide? It's pretty helpful. For the Xiao RP2040, using the above script, I've found that this works: audio=audiobusio.I2SOut(bit_clock=board.SCK, word_select=board.MOSI, data=board.MISO) this is equivalent to: audio=audiobusio.I2SOut(bit_clock=board.D8, word_select=board.D10, data=board.D9) Unfortunately, when |
@todbot Yep, I've used that in the past with a Pi Pico and ESP32-S2 board. I can't believe I didn't think about using it this time... Funnily enough my build uses the exact same pins as you mentioned (not that there's many to choose from on a Xiao!) and it works wonderfully. I used some code that you wrote as a basis and ran with it; I've fallen into the Eurorack universe so it's ended up with a pair of CV inputs, a pair of pots and a rotary encoder. It's in the middle here, and I apologise for going off topic but I'm happy with it! |
@IrregularShed that's very cool! Is this issue closeable for you? |
If this said
would that have been clearer? |
@dhalbert I think that would make it clearer, yeah. Just adding |
@dhalbert @IrregularShed I'm currently working on the mentioned issue, but I'm facing confusion regarding which specific file needs to be modified. I have identified multiple audiobusio files. Could you please provide clarity on the exact file that requires modification for this issue? sumitra@sumitra:~/opensource/circuitpython$ git grep "Bit clock and word select must be sequential pins" . sumitra@sumitra:~/opensource/circuitpython$ git grep "audiobusio" . PS: I am new to this project :) |
You most likely want to look at the |
The only ".c " file with "translate" I see is this "ports/raspberrypi/common-hal/audiobusio/I2SOut.c: mp_raise_ValueError(translate("Bit clock and word select must be sequential pins"));" Do you think that it is the required file? |
@heygauri Yes, just edit the message in quotes there inside the |
@dhalbert Sure, I will do this. |
The error message for creating an I2S object on the rp2040 platform in CircuitPython can be misleading when the word_select and data pins are not sequential. This change updates the error message to provide clearer guidance by specifying "GPIO pins" instead of just "pins". The revised message now reads: ValueError: Bit clock and word select must be sequential GPIO pins Closes adafruit#8058 Signed-off-by: Sumitra Sharma <sumitraartsy@gmail.com>
CircuitPython version
Code/REPL
Behavior
Description
Attempting to create an I2S object in CircuitPython using the pins D8, D9 and D10 seemingly fails despite the parameters being passed matching the requirements (ie
bit_clock
on D8,word_select
on D9).Additional information
I took a look at the pin definitions for the XIAO RP2040 and realised that, behind the scenes, D10 comes before D9 - D10 is GPIO3, D9 is GPIO4. Swapping the
word_select
anddata
pins correctly creates an I2S object.I guess the issue is more that the feedback you get, when trying to create the object, appears on the face of it to be wrong (when in actuality it is differently correct!). I'm not sure what the best thing to do would be to clear this up, so I thought reporting it here would pass it along in front of the eyes of a professional 😄
The text was updated successfully, but these errors were encountered: