Seeed Studio XIAO nRF52840 Sense support for memory->pwm output #976
-
I am attempting to play a .wav file from memory of the XIAO nRF52840 Sense to a PWM output pin. The XIAO board is nearly the same as the Nano 33 BLE, but also includes an IMU which I require. Here is a link to the board: I have tried compiling the "streams-memory_wav-pwm.ino" using both the Arduino Mbed Nano 33 BLE board and the Seeed XIAO nRF52840 Sense Mbed board and get the same error on both attempts:
Here is the complete output of the compile attempt:
I have searched the discussions and the only related thread I found was this one where someone was having difficulty compiling for the XIAO nRF82540 as well, but was having a different error with the I2S portion. In that discussion, @pschatzmann said he committed some changes to support ARDUINO_SEEED_XIAO_NRF52840_SENSE. It ran into I2S problems, but as I am using PWM, I hope to be able to get this to work. Any help would be appreciated! EDIT: As a test, I switched to the XIAO_ESP32S3 board target, and it compiles without error for that board. I then tried the Arduino Nano RP2040 Connect (Mbed) which was unable to locate I2S.h, so did not compile. |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 12 replies
-
Double check the AudioConfig.h and make sure that the relevant processor contains a #define USE_INT24_FROM_INT |
Beta Was this translation helpful? Give feedback.
-
Not sure where the confusion comes from: All pins are can/should be specified with the Arduino conventions. To make a sketch more speaking I propose to use an explicit method to set the pins by calling setPins() on the config object. As far as the volume is concerned you have all the tools to analyse the situation: Maybe the recorded volume in your wav is just too low and you can consider to amplify it with the VolumeStream. If you output a sine wave that oscillates between negative 32768 through positive 32767 you should see a sine wave oscillating between 0V and 3.3V on the pwm pins. |
Beta Was this translation helpful? Give feedback.
-
The following should work as well:
|
Beta Was this translation helpful? Give feedback.
-
I assume that the log is from the version before my correction. The log confirms that the WAV has the correct information, so I pretty confident that my correction will help The partition scheme is an ESP32 thing, so this will not help you. In your case, I suggest that you look into other codecs: ADPCM or WAV with ADPCM might be an interesting option, or you could use an 8bits binary file instead. I doubt that there is enough memory for using mp3. |
Beta Was this translation helpful? Give feedback.
-
I activated the USE_INITIALIZER_LIST in the config. |
Beta Was this translation helpful? Give feedback.
Double check the AudioConfig.h and make sure that the relevant processor contains a #define USE_INT24_FROM_INT
If you use the latest commit, this should already be there.