ZHCAEJ8 October 2024 TAC5412-Q1
處于手動模式下的 SG2 會生成連續脈沖,用戶可以使用 ADSR 注釋啟用和禁用該脈沖。這意味著在手動模式腳本的開頭和結尾處寫入 ADSR 注釋。請參閱節 3.1。此處不提供重啟和延音計時器。
在手動模式下,對生成的脈沖每秒采樣的樣本數根據工作采樣頻率確定。例如...
...表示在一秒鐘之內有 96K 個樣本。
在手動模式下,每個脈沖跨越一秒,然后重復。手動模式在進行頻率掃描時會出現混疊。請參閱下面的公式以生成干凈的信號。這些公式可推導出發生混疊的樣本、每個脈沖所需的樣本數以及每個頻率上升的時間。
這組公式適用于所有 SG2 模式。
對手動模式編程時,首先執行 ADSR 確認腳本,然后,執行其他 ADSR 參數,并在手動模式腳本的最后執行 ADSR 啟用命令。
# Key: w a0 XX YY ==> write to I2C address 0xa0, to register 0xXX, data 0xYY
# # ==> comment delimiter
#
#The following list gives an example sequence of items that must be #executed in the time between powering the device up and reading data #from the device. Note that there are other valid sequences depending #on which features are used.
#See the corresponding EVM user guide for jumper settings and audio #connections.
#
# Line-Out Fully-Differential 2-channel : OUT1P_M- Ch1, OUT2P_M- Ch2.
# FSYNC = 48 kHz (Output Data Sample Rate), BCLK = 12.288 MHz (BCLK/FSYNC = 256) ###################################################################
#manual mode example script
#acknowledge ADSR engine then enable it with x01 at the end of the script
w a0 00 00 # locate page x00
w a0 01 01 # device reset
w a0 02 09 # come out of sleep mode with VREF and DREG up
w a0 00 01 # locate page 0x01
w a0 2d 04 # enable SG2 only
#Using chirp start frequency formula
w a0 00 17 # locate page 0x17
w a0 7c 02 18 2a 47 # SG2 start frequency at 1 KHz
#Using chirp delta frequency formula
w a0 00 18 # locate page 0x18
w a0 08 00 00 00 44 a1 #delta frequency of 0.5 Hz not causing aliasing
#Acknowledge ADSR envelope
w a0 00 1c # locate page 0x1c
w a0 40 00 00 00 00 # ADSR note, set 0 when powering
# up dac and set it to 1 to enable chirp
#Set sustain and restart timer the same
w a0 50 00 00 00 00 # restart_timer
w a0 54 00 00 00 00 # sustain_timer
w a0 00 17 # locate page 0x17
w a0 74 00 00 00 00 # power up delay
#SG2 channel selection and amplitude level configuration
w a0 00 11 # locate page 0x11
w a0 70 40 00 40 00 # OUT1
#w a0 74 40 00 40 00 # OUT2
#Output configuration
w a0 00 00 # locate page 0
w a0 76 0c # enable OUT1
w a0 78 40 # enable all DACs
#Turn on ADSR envelope
w a0 00 1c #locate page 1c
w a0 40 00 00 00 01 # ADSR note, set 0 when powering
# up DAC and set it to 1 to enable chirp
# for manual mode
圖 4-4 SG2 手動模式范圍捕獲:2Vrms 滿量程時對 1KHz 信號進行 0.5Hz 掃描