-
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
i2s audio test fails on Raspberry Pi Pico and PCM5102A DAC #9910
Comments
The sine wave data that you're generating is unsigned 16-bit ("H"). I believe that the PCM5102A is expecting signed data ("h"). I'd try changing the array format and remove As for the shape of the clock signal, most all digital signals are not going to have perfect edges for a variety of reasons. I'm not an expert on that topic, and its "fix" is outside of the scope of CircuitPython. Most likely, it will not make a difference unless you're operating at very high sample rates. The PCM5102A tops out at 384Khz, which would require a bit clock rate of 24.5Mhz. |
Hum... If the unsigned or signed 16bit were the issue, shouldn't it also not work with the other board? Since it works with the ESP32 with the exact same code (aside from the pins assignment), doesn't that indicate that the PCM5102A is compatible with unsigned and that the issue lies elsewhere? Same thing with the amplitude? On the ESP32, the bit clock is very square. I would expect a "sawtooth" waveform like this if I were trying to go too fast for the chip I use (RP2040). |
I tried the program above on four boards, all running CircuitPython 9.2.1. All sounded the same:
In addition, I looked at all the I2S signal waveforms coming out of the RP2040, using a 100MHz oscilloscope. The bit clock was a square wave (and so were the other signals). Looking at the actual audio waveform is a mess, because it's not low-pass filtered. BTW, in the program above, you'll get a "doesn't fit in 2 bytes error" if the frequency is exactly divides into 8000, because the largest sample will be 65536. I changed the code slightly to So I'm not sure why you're seeing the issue you're seeing. What are you using to look at the waveform? A shape like what you see would indicate inadequate drive or excessive capacitance on the driven line. |
Damn it. My fault. |
CircuitPython version
Code/REPL
Behavior
This sounds like the busy tone on a phone in north america, not the pure sine wave I should be getting.
I've used this DAC on a ESP32-C3 chip with no issue, I know it works fine. There have been other issues a bit similar to this in the past with the Pi Pico, not sure if it's related. Should I be using those pins?
Description
No response
Additional information
No response
The text was updated successfully, but these errors were encountered: