SBAA490A December   2021  – April 2022 PCM6120-Q1 , TAA5212 , TAC5111 , TAC5112 , TAC5211 , TAC5212 , TLV320ADC5120 , TLV320ADC6120

 

  1.   Trademarks
  2. 1Introduction
  3. 2Voice Activity Detector
    1. 2.1 VAD Configurations
    2. 2.2 VAD Parameters
  4. 3VAD Results
  5. 4Examples
  6. 5Related Documentation
  7. 6Revision History

Examples

This section presents two examples for configuring the VAD.

Example 1: The following example code shows configuration for using VAD along with analog microphone on CH1.


# Key: w 9C XX YY ==> write to I2C address 0x9C, 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 9C 00 00 # Goto Page 0
w 9C 02 81 # Wake-up device by I2C write into P0_R2  # Exit Sleep mode
d 10       # Wait for 16 ms
w 9c 00 00 # go to page 9
w 9c 50 00 72 59 dc # -7dB threshold
w 9C 00 00 # Goto Page 0
w 9c 3c a0 # channel 1 set to LINE , SE , AC , 2.5k , DRE disabled
w 9c 73 80 # ip channel 1 enabled
w 9c 74 80 # ASI out ch 1 enabled
w 9c 21 00 # GPIO1 as IRQ (latched only) driving high and low
w 9c 00 01 # go to page 1
w 9c 1e 00 # Channel 1 as VAD input, User mode , internal clk
w 9c 1f 00 # VAD disabled in recording mode
w 9c 00 00 # go to page 0

w 9c 75 21 # Enable VAD

Example 2: The following example code shows the configuration for using VAD along with digital microphone on CH1.

# Key: w 9C XX YY ==> write to I2C address 0x9C, 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 9C 00 00 # Goto Page 0
w 9C 02 81 # Wake-up device by I2C write into P0_R2  # Exit Sleep mode
d 10       # Wait for 16 ms
w 9c 00 00 # go to page 9
w 9c 50 00 72 59 dc # -7dB threshold
w 9C 00 00 # Goto Page 0
w 9c 3c 40 # Ch1 configured as Digital microphone PDM input
w 9c 41 40 # Ch2 configured as Digital microphone PDM input

w 9c 73 C0 # ip channel 1 and channel 2 enabled
w 9c 74 C0 # ASI out ch 1 and ch 2 enabled
w 9c 21 21 # GPIO1 as IRQ
w 9c 22 41 # GPO1 as PDM CLK
w 9c 2b 45 # gpi1 as Ch1/2 DMIC data
w 9c 20 00 # gpi1 neg edge as ch1

w 9c 00 01 # go to page 1
w 9c 1e 00 # Channel 1 as VAD input, User mode , internal clk
w 9c 1f 00 # VAD disabled in recording mode
w 9c 00 00 # go to page 0


w 9c 75 21 # Enable VAD