Skip to content

Commit

Permalink
fix: invert GP27 logic and rename from AUDIO_MUTE_CTRL to AUDIO_DAC_E…
Browse files Browse the repository at this point in the history
…NABLE
  • Loading branch information
elehobica committed Jul 3, 2021
1 parent cb16e5d commit f36e736
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ This project features:
| 22 | GP17 | LRCK | to PCM5102 LRCK (15) |
| 23 | GND | GND | GND |
| 24 | GP18 | SDO | to PCM5102 DIN (14) |
| 32 | GP27 | AUDIO_MUTE_CTRL | to PCM5102 XSMT (17) |
| 32 | GP27 | AUDIO_DAC_ENABLE | to PCM5102 XSMT (17) |
| 36 / 40 | 3V3(OUT) / VBUS | VCC | to VIN of PCM5102 board |

From DAC noise's point of view, it is recommended to provide the power of PCM5102 from VBUS (5V).
Expand Down
Binary file modified doc/RPi_Pico_WAV_Player_schematic.pdf
Binary file not shown.
18 changes: 9 additions & 9 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@

//#define INITIALIZE_CONFIG_PARAM

const char *VersionStr = "0.8.0";
const char *VersionStr = "0.8.1";

// PIN setting
static const uint32_t PIN_LED = 25;
static const uint32_t PIN_POWER_KEEP = 19;
static const uint32_t PIN_DCDC_PSM_CTRL = 23;
static const uint32_t PIN_AUDIO_MUTE_CTRL = 27;
static const uint32_t PIN_AUDIO_DAC_ENABLE = 27;

static inline uint32_t _millis(void)
{
Expand Down Expand Up @@ -186,7 +186,7 @@ static void power_off(const char *msg, bool is_error = false)
if (msg != NULL) { lcd.setMsg(msg, is_error); }
uint32_t stay_time = (is_error) ? 4000 : 1000;
uint32_t time = _millis();
gpio_put(PIN_AUDIO_MUTE_CTRL, 1);
gpio_put(PIN_AUDIO_DAC_ENABLE, 0);
audio_codec_deinit();
while (_millis() - time < stay_time) {
sleep_ms(LoopCycleMs);
Expand Down Expand Up @@ -215,10 +215,10 @@ int main() {
gpio_set_dir(PIN_DCDC_PSM_CTRL, GPIO_OUT);
gpio_put(PIN_DCDC_PSM_CTRL, 1); // PWM mode for less Audio noise

// Audio Mute ON
gpio_init(PIN_AUDIO_MUTE_CTRL);
gpio_set_dir(PIN_AUDIO_MUTE_CTRL, GPIO_OUT);
gpio_put(PIN_AUDIO_MUTE_CTRL, 1);
// Audio DAC Disable (Mute On)
gpio_init(PIN_AUDIO_DAC_ENABLE);
gpio_set_dir(PIN_AUDIO_DAC_ENABLE, GPIO_OUT);
gpio_put(PIN_AUDIO_DAC_ENABLE, 0);

audio_clock_96MHz();

Expand Down Expand Up @@ -273,8 +273,8 @@ int main() {
ui_mode_enm_t init_dest_mode;
loadFromFlash(dir_stack, &init_dest_mode);

// Audio Mute OFF
gpio_put(PIN_AUDIO_MUTE_CTRL, 0);
// Audio DAC Enable (Mute Off)
gpio_put(PIN_AUDIO_DAC_ENABLE, 1);
// Audio Codec Initialize
audio_codec_init();

Expand Down

0 comments on commit f36e736

Please sign in to comment.