Line: 1 to 1 | ||||||||
---|---|---|---|---|---|---|---|---|
The T-Watch 2020 sound system | ||||||||
Changed: | ||||||||
< < | The t-watch has an integrated loudspeaker which is be driven by a MAX9835a PCM Input Class A Audio Power Amplifier. This system allows us to play wav files on the t-watch. | |||||||
> > | The t-watch has an integrated loudspeaker which is driven by a MAX9835a PCM Input Class A Audio Power Amplifier. This system allows us to play wav files on the t-watch. | |||||||
The MAX9835a uses I2S communication invented by Philips in the late 1980 ies for the transfer of digital sound samples. The protocol uses 3 signals:
| ||||||||
Line: 23 to 23 | ||||||||
Enabling the sound systemIn the t-watch the MAX9835a is powered through the AXP202 power manager and the power line to the sound chip must be enabled before using it. Here is the initialization procedure I use: | ||||||||
Changed: | ||||||||
< < | ||||||||
> > | | |||||||
from machine import Pin,I2S import ttgo from axp_constants import AXP202_VBUS_VOL_ADC1,AXP202_VBUS_CUR_ADC1,AXP202_BATT_CUR_ADC1,AXP202_BATT_VOL_ADC1 watch = ttgo.Watch() watch = watch tft = watch.tft power = watch.pmu power.adc1Enable(AXP202_VBUS_VOL_ADC1 | AXP202_VBUS_CUR_ADC1 | AXP202_BATT_CUR_ADC1 | AXP202_BATT_VOL_ADC1, True) watch.lvgl_begin() watch.tft.backlight_fade(100) print("enable power") watch.enable_audio_power() Mike Teachman's example programs with the power initialization added in, have been uploaded to https://github.com/uraich/twatch2020_firmware/tree/main/hardware/sound. |
Line: 1 to 1 | |||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Added: | |||||||||||||||||||
> > |
The T-Watch 2020 sound systemThe t-watch has an integrated loudspeaker which is be driven by a MAX9835a PCM Input Class A Audio Power Amplifier. This system allows us to play wav files on the t-watch. The MAX9835a uses I2S communication invented by Philips in the late 1980 ies for the transfer of digital sound samples. The protocol uses 3 signals:
The softwareWe use the I2S driver developed by M. Teachman. Unfortunately this driver has not been integrated into the MicroPython sources and a few modifications to the ESP32 port must be made to include it:
import machine.I2S Enabling the sound systemIn the t-watch the MAX9835a is powered through the AXP202 power manager and the power line to the sound chip must be enabled before using it. Here is the initialization procedure I use: from machine import Pin,I2Simport ttgo from axp_constants import AXP202_VBUS_VOL_ADC1,AXP202_VBUS_CUR_ADC1,AXP202_BATT_CUR_ADC1,AXP202_BATT_VOL_ADC1 watch = ttgo.Watch() watch = watch tft = watch.tft power = watch.pmu power.adc1Enable(AXP202_VBUS_VOL_ADC1 | AXP202_VBUS_CUR_ADC1 | AXP202_BATT_CUR_ADC1 | AXP202_BATT_VOL_ADC1, True) watch.lvgl_begin() watch.tft.backlight_fade(100) print("enable power") watch.enable_audio_power() Mike Teachman's example programs with the power initialization added in, have been uploaded to https://github.com/uraich/twatch2020_firmware/tree/main/hardware/sound. Before running these however you should create a directory /wav on the ESP32 file system and copy the sound file https://github.com/miketeachman/micropython-esp32-i2s-examples/blob/master/wav_files/taunt-16k-16bits-mono-12db.wav to this directory. -- Uli Raich - 2021-01-25 Comments |