ZHCAEK6 October 2024 TAC5212
本節提供了六個有關如何配置 VAD 的示例。
示例 1:以下示例代碼顯示了在用戶啟動模式下,在 CH1 上使用 VAD 和模擬麥克風所需的配置。
# Key: w A0 XX YY ==> write to I2C address 0xA0, to register 0xXX, data 0xYY
# # ==> comment delimiter
# See the corresponding EVM user guide for jumper settings and audio connections.
################################################################
#
#
# Power up IOVDD and AVDD power supplies
# Wait for 1ms.
#
w A0 00 00 # Goto Page 0
w A0 01 01 # Software reset
d 10 # Wait for 16 ms
w A0 02 09 # Device wake up, Power up VREF and DREG
w A0 42 A0 # Interrupt asserts on live events, active high
w A0 0A 31 # GPIO is IRQ w Drive Strength Active Low and Active High
#
w A0 00 01 # Goto Page 1
w A0 33 DF # Unmask VAD Power Up Detect
w A0 1E 02 # User Initiated power up, VAD on CH1
#
w A0 00 0D # Goto Page D
w A0 0D 00 8F 47 35 # Threshold Value of -5dB
w A0 70 00 4E 20 00 # ILP of 2.5s
#
w A0 00 00 # Goto Page 0
w A0 76 80 # Enable CH1
w A0 78 A4 # ADC,MICBIAS, and VAD Power On示例 2:以下示例代碼顯示了在自動上電和斷電模式下,在 CH1 上使用 VAD 和模擬麥克風所需的配置。
# Key: w A0 XX YY ==> write to I2C address 0xA0, to register 0xXX, data 0xYY
# # ==> comment delimiter
# See the corresponding EVM user guide for jumper settings and audio connections.
################################################################
#
#
# Power up IOVDD and AVDD power supplies
# Wait for 1ms.
#
w A0 00 00 # Goto Page 0
w A0 01 01 # Software reset
d 10 # Wait for 16 ms
w A0 02 01 # Device wake up, Power up only DREG, VAD will power up VREF
w A0 42 A0 # Interrupt asserts on live events, active high
w A0 0A 31 # GPIO is IRQ w Drive Strength Active Low and Active High
#
w A0 00 01 # Goto Page 1
w A0 33 DF # Unmask VAD Power Up Detect
w A0 1E 42 # Automatic Powerup/down, VAD on CH1
#
w A0 00 0D # Goto Page D
w A0 0D 00 8F 47 35 # Threshold Value of -5dB
w A0 70 00 4E 20 00 # ILP of 2.5s
w A0 00 0E # Goto Page E
w A0 08 00 9C 40 00 #Set wakeup wait to 5s
#
w A0 00 00 # Goto Page 0
w A0 76 80 # Enable CH1
w A0 78 24 # VAD, MICBIAS Power On示例 3:以下示例代碼顯示了在自動上電和用戶啟動斷電模式下,在 CH1 上使用 VAD 和模擬麥克風所需的配置。
# Key: w A0 XX YY ==> write to I2C address 0xA0, to register 0xXX, data 0xYY
# # ==> comment delimiter
# See the corresponding EVM user guide for jumper settings and audio connections.
################################################################
#
#
# Power up IOVDD and AVDD power supplies
# Wait for 1ms.
#
w A0 00 00 # Goto Page 0
w A0 01 01 # Software reset
d 10 # Wait for 16 ms
w A0 02 01 # Device wake up, Power up only DREG, VAD will power up VREF
w A0 42 A0 # Interrupt asserts on live events, active high
w A0 0A 31 # GPIO is IRQ w Drive Strength Active Low and Active High
#
w A0 00 01 # Goto Page 1
w A0 33 DF # Unmask VAD Power Up Detect
w A0 1E 82 # VAD Automatic Powerup/User Initiated Powerdown, VAD on CH1
#
w A0 00 0D # Goto Page D
w A0 0D 00 8F 47 35 # Threshold Value of -5dB
w A0 70 00 4E 20 00 # ILP of 2.5s
#
w A0 00 00 # Goto Page 0
w A0 76 80 # Enable CH1
w A0 78 A4 # ADC,VAD, MICBIAS Power On示例 4:以下示例代碼顯示了在用戶啟動模式下,在 CH1 上使用 VAD 和數字麥克風所需的配置。
# Key: w A0 XX YY ==> write to I2C address 0xA0, to register 0xXX, data 0xYY
# # ==> comment delimiter
# See the corresponding EVM user guide for jumper settings and audio connections.
################################################################
#
#
# Power up IOVDD and AVDD power supplies
# Wait for 1ms.
#
w A0 00 00 # Goto Page 0
w A0 01 01 # Software reset
d 10 # Wait for 16 ms
w A0 02 09 # Device wake up, VREF and DREG Powered Up
w A0 0C 41 # GPO1 is PDM Clock output, Active Low and Active High
w A0 0D 02 # GPI1 is enabled
w A0 13 EC # GPI1 is PDM Data Input CH1 and 2
w A0 42 A0 # Interrupt asserts on live events, active high
w A0 0A 31 # GPIO is IRQ w Drive Strength Active Low and Active High
#
w A0 00 01 # Goto Page 1
w A0 33 DF # Unmask VAD Power Up Detect
w A0 1E 02 # User Initiated power up, VAD on CH1
#
w A0 00 0D # Goto Page D
w A0 0D 00 8F 47 35 # Threshold Value of -5dB
w A0 70 00 4E 20 00 # ILP of 2.5s
#
w A0 00 00 # Goto Page 0
w A0 76 80 # Enable CH1
w A0 78 A4 # ADC, MICBIAS, and VAD Power On 示例 5:以下示例代碼顯示了在自動上電和斷電模式下,在 CH1 上使用 VAD 和數字麥克風所需的配置。
# Key: w A0 XX YY ==> write to I2C address 0xA0, to register 0xXX, data 0xYY
# # ==> comment delimiter
# See the corresponding EVM user guide for jumper settings and audio connections.
################################################################
#
#
# Power up IOVDD and AVDD power supplies
# Wait for 1ms.
#
w A0 00 00 # Goto Page 0
w A0 01 01 # Software reset
d 10 # Wait for 16 ms
w A0 02 09 # Device wake up, VREF and DREG Powered Up
w A0 0C 41 # GPO1 is PDM Clock output, Active Low and Active High
w A0 0D 02 # GPI1 is enabled
w A0 13 EC # GPI1 is PDM Data Input CH1 and 2
w A0 42 A0 # Interrupt asserts on live events, active high
w A0 0A 31 # GPIO is IRQ w Drive Strength Active Low and Active High
#
w A0 00 01 # Goto Page 1
w A0 33 DF # Unmask VAD Power Up Detect
w A0 1E 42 # VAD Automatic Power up/down, VAD on CH1
#
w A0 00 0D # Goto Page D
w A0 0D 00 8F 47 35 # Threshold Value of -5dB
w A0 70 00 4E 20 00 # ILP of 2.5s
w A0 00 0E # Goto Page E
w A0 08 00 9C 40 00 #Set wakeup wait to 5s
#
w A0 00 00 # Goto Page 0
w A0 76 80 # Enable CH1
w A0 78 24 # VAD, MICBIAS Power On 示例 6:以下示例代碼顯示了在自動上電和用戶啟動斷電模式下,在 CH1 上使用 VAD 和數字麥克風所需的配置。
# Key: w A0 XX YY ==> write to I2C address 0xA0, to register 0xXX, data 0xYY
# # ==> comment delimiter
# See the corresponding EVM user guide for jumper settings and audio connections.
################################################################
#
#
# Power up IOVDD and AVDD power supplies
# Wait for 1ms.
#
w A0 00 00 # Goto Page 0
w A0 01 01 # Software reset
d 10 # Wait for 16 ms
w A0 02 09 # Device wake up, VREF and DREG Powered Up
w A0 0C 41 # GPO1 is PDM Clock output, Active Low and Active High
w A0 0D 02 # GPI1 is enabled
w A0 13 EC # GPI1 is PDM Data Input CH1 and 2
w A0 42 A0 # Interrupt asserts on live events, active high
w A0 0A 31 # GPIO is IRQ w Drive Strength Active Low and Active High
#
w A0 00 01 # Goto Page 1
w A0 33 DF # Unmask VAD Power Up Detect
w A0 1E 82 # VAD Automatic Powerup/User Initiated Powerdown, VAD on CH1
#
w A0 00 0D # Goto Page D
w A0 0D 00 8F 47 35 # Threshold Value of -5dB
w A0 70 00 4E 20 00 # ILP of 2.5s
#
w A0 00 00 # Goto Page 0
w A0 76 80 # Enable CH1
w A0 78 A4 # VAD, MICBIAS Power On