SLAAED8 October 2024 TAC5111 , TAC5112 , TAC5211 , TAC5212 , TAC5412-Q1 , TAD5112 , TAD5212
SG2 in manual mode generates a continuous pulse users enable and disable using the ADSR note. This means writing the ADSR note at the beginning and end of the manual mode script. Refer to Section 3.1. Restart and sustain timers are not available here.
In manual mode, pulses generated are sampled into the number of samples based on an operating sampling frequency per second. For example...
...means there are 96K samples within a second.
In manual mode, each pulse spans one second and then repeats. Manual mode is subject to aliasing when frequency sweeping. Refer to the formulas below to generate clean signals. These formulas deduct the sample at which aliasing occurs, number of samples required per pulse and time per frequency rise.
This set of formulas are applicable to all SG2 modes.
When programming manual mode, the ADSR acknowledgment script is executed first. Then follows other ADSR parameters and the ADSR enable command at the end of manual mode script.
# 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