Skip to content
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

audio/sine_wave/CMakeLists.txt wrong I2S pins #27

Open
Gustavomurta opened this issue Jul 30, 2022 · 3 comments
Open

audio/sine_wave/CMakeLists.txt wrong I2S pins #27

Gustavomurta opened this issue Jul 30, 2022 · 3 comments

Comments

@Gustavomurta
Copy link

Gustavomurta commented Jul 30, 2022

I think it is impossible to test this I2S audio application with these pins configurations:

https://github.com/raspberrypi/pico-playground/tree/master/audio/sine_wave

audio/sine_wave/CMakeLists.txt

            USE_AUDIO_I2S=1
#            PICO_AUDIO_I2S_DATA_PIN=22   - is acessible 
#            PICO_AUDIO_I2S_CLOCK_PIN_BASE=23 - not acessible 

/audio/sine_wave/sine_wave.c

#if PICO_ON_DEVICE
#include "pico/binary_info.h"
bi_decl(bi_3pins_with_names(PICO_AUDIO_I2S_DATA_PIN, "I2S DIN", PICO_AUDIO_I2S_CLOCK_PIN_BASE, "I2S BCK", PICO_AUDIO_I2S_CLOCK_PIN_BASE+1, "I2S LRCK"));
#endif

OK = PICO_AUDIO_I2S_DATA_PIN, "I2S DIN" = GPIO22
Not acessible = PICO_AUDIO_I2S_CLOCK_PIN_BASE, "I2S BCK" = GPIO23
Not acessible = PICO_AUDIO_I2S_CLOCK_PIN_BASE+1, "I2S LRCK" = GPIO24

Thanks

@Gustavomurta
Copy link
Author

Gustavomurta commented Nov 3, 2023

The only way to discover the pins on the Raspberry Pico dedicated to the I2S interface in this project was using an oscilloscope.

  • I2S DIN = GPIO28 (audio data)
  • I2S BCK = GPIO26 (768 KHz)
  • I2S LRCK = GPIO27 (24KHz)

Audio output (Stereo) = 375 Hz 3,1 V pp

@Gustavomurta
Copy link
Author

image

@Gustavomurta
Copy link
Author

Gustavomurta commented Nov 3, 2023

Finally, i found:

src/rp2_common/pico_audio_i2s/include/pico/audio_i2s.h

#ifndef PICO_AUDIO_I2S_DATA_PIN
//#warning PICO_AUDIO_I2S_DATA_PIN should be defined when using AUDIO_I2S
#define PICO_AUDIO_I2S_DATA_PIN 28
#endif

#ifndef PICO_AUDIO_I2S_CLOCK_PIN_BASE
//#warning PICO_AUDIO_I2S_CLOCK_PIN_BASE should be defined when using AUDIO_I2S
#define PICO_AUDIO_I2S_CLOCK_PIN_BASE 26
#endif

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant