Chip-dat/Analog-dat/MAX98357-dat/MAX98357-code.ino
... ...
@@ -1,13 +1,4 @@
1
-/*
2
- ESP32 SD I2S Music Player
3
- esp32-i2s-sd-player.ino
4
- Plays MP3 file from microSD card
5
- Uses MAX98357 I2S Amplifier Module
6
- Uses ESP32-audioI2S Library - https://github.com/schreibfaul1/ESP32-audioI2S
7
- *
8
- DroneBot Workshop 2022
9
- https://dronebotworkshop.com
10
-*/
1
+
11 2
12 3
// Include required libraries
13 4
#include "Arduino.h"
Chip-dat/Analog-dat/MAX98357-dat/MAX98357-dat.md
... ...
@@ -14,4 +14,4 @@
14 14
15 15
## code
16 16
17
-- [[MAX98357-code.ino]]
... ...
\ No newline at end of file
0
+- [[MAX98357-code.ino]] - [[I2S-dat]]
... ...
\ No newline at end of file
Chip-dat/Cirrus-dat/Cirrus-dat.md
... ...
@@ -0,0 +1,44 @@
1
+
2
+# Cirrus-dat
3
+
4
+## CS4344
5
+
6
+Hi, i2s driver let you map LRCLK BCLK and DATA to any GPIO pins you specify.
7
+
8
+However, CS4344 require MCLK, so you need to generate it! By the way, this is a reason you cannot use CS4344 with esp8266.
9
+
10
+As far as I know esp32 can only generate MCLK on GPIO0:
11
+
12
+ i2s_config_t i2s_config = {
13
+ .mode = I2S_MODE_MASTER | I2S_MODE_TX, // Only TX
14
+ .sample_rate = 44100,
15
+ .bits_per_sample = I2S_BITS_PER_SAMPLE_16BIT,
16
+ .channel_format = I2S_CHANNEL_FMT_RIGHT_LEFT, //2-channels
17
+ .communication_format = (I2S_COMM_FORMAT_I2S | I2S_COMM_FORMAT_I2S_MSB),
18
+ .dma_buf_count = 6,
19
+ .dma_buf_len = 60,
20
+ .intr_alloc_flags = 0, //Default interrupt priority
21
+ .tx_desc_auto_clear = true, //Auto clear tx descriptor on underflow
22
+ .use_apll = true // change to false if it sounds bad (rev0 chip - better set to false, newer chips - set to true)
23
+ };
24
+
25
+ i2s_driver_install(0, &i2s_config, 0, NULL);
26
+
27
+ i2s_pin_config_t pin_config = { .bck_io_num = CONFIG_I2S_BCK_PIN, .ws_io_num = CONFIG_I2S_LRCK_PIN, .data_out_num = CONFIG_I2S_DATA_PIN, .data_in_num = -1 // Not used };
28
+
29
+ i2s_set_pin(0, &pin_config);
30
+
31
+ // generate mclk on gpio0
32
+ REG_WRITE(PIN_CTRL, 0b111111110000);
33
+
34
+ PIN_FUNC_SELECT(PERIPHS_IO_MUX_GPIO0_U, FUNC_GPIO0_CLK_OUT1);
35
+
36
+
37
+Define CONFIG_I2S_BCK_PIN CONFIG_I2S_LRCK_PIN CONFIG_I2S_DATA_PIN as your connected GPIO pins. Connect CS4344 MCLK to IO0. It should work that way, at least it works perfectly for me.
38
+
39
+
40
+
41
+
42
+## ref
43
+
44
+- https://www.reddit.com/r/esp32/comments/g48lzs/esp_32_i2s_and_cs4344_dac/
... ...
\ No newline at end of file
Tech-dat/Interface-dat/I2S-dat/I2S-dat.md
... ...
@@ -13,13 +13,27 @@ This makes I2S a popular choice for high-speed data transfer applications.
13 13
14 14
## Pin
15 15
16
-| Name | also Name | func | RPI GPIO | RPI pin |
17
-| ---- | ------------ | ---------------------------------- | -------- | ------- |
18
-| BCLK | | Bit clock line | G18 | PIN 12 |
19
-| WS | LRCK | Word clock line | G19 | PIN 35 |
20
-| SD | SDIN / SDOUT | At least one multiplexed data line | G21 | PIN 40 |
21
-
22
-
16
+| Name | default ESP32 | also Name | func | RPI GPIO | RPI pin |
17
+| ---- | ------------- | ------------ | ---------------------------------- | -------- | ------- |
18
+| SCK | 26 | BCLK | Serial Data Clock / Bit clock line | G18 | PIN 12 |
19
+| WS | 25 | LRCK / LRC | Serial Data-Word select line | G19 | PIN 35 |
20
+| SD | 22 | SDIN / SDOUT | At least one multiplexed data line | G21 | PIN 40 |
21
+
22
+ I2S Circuit:
23
+ * Arduino/Genuino Zero, MKR family and Nano 33 IoT
24
+ * MAX08357:
25
+ * GND connected GND
26
+ * VIN connected 5V
27
+ * LRC connected to pin 0 (Zero) or 3 (MKR), A2 (Nano) or 25 (ESP32)
28
+ * BCLK connected to pin 1 (Zero) or 2 (MKR), A3 (Nano) or 5 (ESP32)
29
+ * DIN connected to pin 9 (Zero) or A6 (MKR), 4 (Nano) or 26 (ESP32)
30
+ DAC Circuit:
31
+ * ESP32 or ESP32-S2
32
+ * Audio amplifier
33
+ - Note:
34
+ - ESP32 has DAC on GPIO pins 25 and 26.
35
+ - ESP32-S2 has DAC on GPIO pins 17 and 18.
36
+ - Connect speaker(s) or headphones.
23 37
24 38
25 39
## Solution - control (slave module)
... ...
@@ -28,7 +42,7 @@ I2S Output Digital Microphone - [[INMP441-dat]] - [[ICS-43434-dat]] - [[SPH0645-
28 42
29 43
audio amplifer - [[MAX98357-dat]] - [[audio-dat]] - [[amplifier-dat]]
30 44
31
-- [[PCM5122-dat]] - [[MPC1083-dat]] - [[I2S-dat]] - [[PCM5102-dat]] - [[AMP1006-dat]]
45
+- [[PCM5122-dat]] - [[MPC1083-dat]] - [[I2S-dat]] - [[PCM5102-dat]] - [[AMP1006-dat]] - [[CS4344-dat]]
32 46
33 47
- [[ES9023-dat]] - [[MPC1111-dat]] - [[ES9018-dat]]
34 48
Tech-dat/Sensor-dat/liquid-sensor-dat/liquid-sensor-dat.md
... ...
@@ -3,7 +3,7 @@
3 3
4 4
- turbidity [[STH1074-dat]]
5 5
6
-- TDS sensor [[STH1078-dat]]
6
+- TDS sensor [[STH1078-dat]] - [[TDS-sensor-dat]]
7 7
8 8
- non-contact Liquid Level Sensor - [[SMO1095-dat]]
9 9