i2s.setup

Give it a try, it costs you nothing !
Post Reply
flowil
Posts: 3
Joined: Sat Apr 06, 2024 12:45 pm
Has thanked: 1 time
Been thanked: 1 time

i2s.setup

Post by flowil »

Hi!
I'm using the cyd (ESP32-2432S028).
I want to use an audio output. Problem is, that I definitly run into problems due to the strange "setup"/layout" of the CYD.
Using the "audio out" I ran into the problem, that annex32 uses IO25 and IO26 but IO25 is in conflict / wired to the touch SCLK meaning that the resitive touch is then not really responding any more.

Using i2s is also in conflict with other functions already used like IO2 which is used as serial data for i2s but is wired as LCD "DC/RS" line.

So maybe there is possibility to implement something like the i2c.setup command:
i2c.setup sda_pin, scl_pin --> i2s .setup sd_pin, lrclk_pin, bclk
which would make things much more easy for me and maybe a few others, using the CYD which is getting more and more popular :-)

Thanks - Flo
User avatar
cicciocb
Site Admin
Posts: 2055
Joined: Mon Feb 03, 2020 1:15 pm
Location: Toulouse
Has thanked: 439 times
Been thanked: 1354 times
Contact:

Re: i2s.setup

Post by cicciocb »

HI FLo,
if I remember well the audio should work as I did a special patch for this specific model; if it is not the case, please give me more details on how you are testing it and the Annex32 version that you are using.

About the I2S, as this module has very few free IO available I didn't considered the use of an external I2S DAC.

Instead of creating a "generic" I2S.setup, as this can be normally done in the config page, maybe you can just propose a pinout for this specific module and I'll include in a next release
flowil
Posts: 3
Joined: Sat Apr 06, 2024 12:45 pm
Has thanked: 1 time
Been thanked: 1 time

Re: i2s.setup

Post by flowil »

Hi cicciocb, thanks for your reply

If I use gui_radio3.bas, with the play.setup 0... command and replacing the 0Ω resistors in the audio path with the correct resistors I get an acceptable audio output. But then the "touch" isn't working any more. I will get a touch response very occasionally. I have to press eg the play button many many times before I get a reaction.
This ist not the case when after powerup I run eg bounce.bas. The reason you can see in the appended images. IO25 in this module is wired to XPT2046 clk pin but is also used as audio output when play.setup 0 is used.

This is why I tried to use a pcm5102 module via i2s realising that I cannot use this because I cannot reroute I2s. Using "custom module" and defining the IOs there won't work either because I cant configure all used components on that module.

Proposing other outputs for i2s on this module is difficult. I would have used P3 - IO22 and CN1 IO27 and - have to solder it - IO26 on the audio-chip. I cannot use P3 - IO21 because of the braindead design of the module where IO21 is also wired to the brightness-control of the display (reference: https://macsbug.wordpress.com/2022/08/1 ... -2432s028/)

But this requires routable I2S - IOs, that why I asked

Thanks - Flo
You do not have the required permissions to view the files attached to this post.
User avatar
cicciocb
Site Admin
Posts: 2055
Joined: Mon Feb 03, 2020 1:15 pm
Location: Toulouse
Has thanked: 439 times
Been thanked: 1354 times
Contact:

Re: i2s.setup

Post by cicciocb »

I'll give an eye with the scope on the pin25 as it should not deliver the sound (it is supposed to be used only as an I/O pin :roll: ).

Anyway, try the version 1.52.6 that I've just uploaded, it contains a new OPTION.I2S command :
OPTION.I2S BCLK_pin, WSEL_pin, DOUT_pin
flowil
Posts: 3
Joined: Sat Apr 06, 2024 12:45 pm
Has thanked: 1 time
Been thanked: 1 time

Re: i2s.setup

Post by flowil »

Hi cicciocb!

I installed firmware 1.52.6, wired up the PCM5102 module. It did not work (read on :-) )

After a bit of research I realised, that there are 5 solderjoints to be done first on the pcm5102 module .
For others who want to give it try:
component side:
next to the sck connection, see annex helpfile, image of the pcm5102,
rear side:
H1 set to L
H2 set to L
H3 set to H
H4 set to L

because it did not work in the first place I looked with a scope at the set io-pins (22, 26, 27). Running the mentioned inet-radio script that executed the new
OPTION.I2S BCLK_pin, WSEL_pin, DOUT_pin
one line before play.setup but without pressing play. There will be no clk output on the bclk and wsel pins.
Only after pressing the play-button thus executing the play.stream command there is a 1.41 MHz and a 44.1KHz signal

So in the end - everything is working!!

Thanks alot for your improvement :P
There at least one happy person more on this planet!
User avatar
cicciocb
Site Admin
Posts: 2055
Joined: Mon Feb 03, 2020 1:15 pm
Location: Toulouse
Has thanked: 439 times
Been thanked: 1354 times
Contact:

Re: i2s.setup

Post by cicciocb »

NIce, I'll put this information in the Help file, I think I received the PCM5102A modules I have already set like that.
User avatar
cicciocb
Site Admin
Posts: 2055
Joined: Mon Feb 03, 2020 1:15 pm
Location: Toulouse
Has thanked: 439 times
Been thanked: 1354 times
Contact:

Re: i2s.setup

Post by cicciocb »

Anyway, I've just tested on my module ESP32-2432S028 and the touch work perfectly with the radio running in background :!:
Post Reply