ΣSigmaStudio Ask AI Русский Log in

Sweep Log with On/off

SigmaDSP & SigmaStudio Michel95 Jan 21, 2023 00:00 1 replies Original on forum ↗
Subscribe
Michel95 Question
Jan 21, 2023 00:00

Hello,

I tried to use the Sweep log with on/off with an microcontroler. Through Sigma studio, I can configure and start the sweep correctly.

With my software not. It seems to me after analyze it with a I2C trace from my scope that I don't send two parameters MOD_SWEEP_ALG0_FREQ_INCREMENT_ADDR and MOD_STATIC_SWEEP_ALG0_MASK_ADDR

au address 19 and 20. The problem for me is not to send a value to those address but to understand what I have to send. I found nothing in the documentation explaning that parameters

I have post all the parameters file of my DSP.

/* Module Sweep - Sweep (Log) with on/off switch*/
#define MOD_SWEEP_COUNT 7
#define MOD_SWEEP_ALG0_START_FREQ_ADDR 16
#define MOD_SWEEP_ALG0_START_FREQ_FIXPT 0x00001B4E
#define MOD_SWEEP_ALG0_STOP_FREQ_ADDR 17
#define MOD_SWEEP_ALG0_STOP_FREQ_FIXPT 0x006AAAAA
#define MOD_SWEEP_ALG0_NUMCYCLES_PER_STEP_ADDR 18
#define MOD_SWEEP_ALG0_NUMCYCLES_PER_STEP_FIXPT 0x00000014
#define MOD_SWEEP_ALG0_FREQ_INCREMENT_ADDR 19
#define MOD_SWEEP_ALG0_FREQ_INCREMENT_FIXPT 0x05000000
#define MOD_STATIC_SWEEP_ALG0_MASK_ADDR 20
#define MOD_STATIC_SWEEP_ALG0_MASK_FIXPT 0x000000FF
#define MOD_SWEEP_ALG0_NUMSTEPS_ADDR 21
#define MOD_SWEEP_ALG0_NUMSTEPS_FIXPT 0x00000004
#define MOD_SWEEP_ALG0_ON_ADDR 22
#define MOD_SWEEP_ALG0_ON_FIXPT 0x00800000

and the code I use to setup all the other parameters

void SetStartFreq (uint16_t Freq){
float FreqStart = (Freq * (1/24000.0));
Serial.print("StartFreq: ");
Serial.println(FreqStart,8);
dsp.safeload_write(MOD_SWEEP_ALG0_START_FREQ_ADDR, FreqStart);
}

void SetStopFreq (uint16_t Freq){
float FreqStop = (Freq * (1/24000.0));
Serial.print("StopFreq: ");
Serial.println(FreqStop,8);
dsp.safeload_write(MOD_SWEEP_ALG0_STOP_FREQ_ADDR, FreqStop);
}

void SetCyclesPerStep (uint16_t Value){
Serial.print("CyclesPerStep: ");
Serial.println(Value);
dsp.safeload_write(MOD_SWEEP_ALG0_NUMCYCLES_PER_STEP_ADDR, Value);
}

void SetSteps (uint16_t Value){
Serial.print("Steps: ");
Serial.println(Value);
dsp.safeload_write(MOD_SWEEP_ALG0_NUMSTEPS_ADDR, Value);
}

There is the snapshot of the scope that come from sigma studio sweep log control

I2C
Time
Address
R/W
Data

1
-98.6280us
0x34
W
0x08 10 00 00 00 1B 4F

2
1.00987ms
0x34
W
0x08 15 00 10

3
1.73237ms
0x34
W
0x08 1C 00 3C

4
2.44740ms
0x34
W
0x08 10 00 00 00 2F C9

5
3.51854ms
0x34
W
0x08 15 00 11

6
4.21774ms
0x34
W
0x08 1C 00 3C

7
4.92274ms
0x34
W
0x08 10 00 00 00 00 0A

8
5.96391ms
0x34
W
0x08 15 00 12

9
6.65641ms
0x34
W
0x08 1C 00 3C

10
7.36644ms
0x34
W
0x08 10 00 00 88 36 2E

11
8.42008ms
0x34
W
0x08 15 00 13

12
9.11262ms
0x34
W
0x08 1C 00 3C

13
9.88011ms
0x34
W
0x08 10 00 00 00 00 0A

14
10.9588ms
0x34
W
0x08 15 00 15

15
11.6588ms
0x34
W
0x08 1C 00 3C

16
12.3580ms
0x34
W
0x08 10 00 00 00 00 00

17
13.3966ms
0x34
W
0x08 15 00 16

18
14.0917ms
0x34
W
0x08 1C 00 3C

I didn't find the way to calculate the value in bold .

Can somebody help on that point?

Audio Signal Processors

Sigma Studio 4.7 Build 0 Rev 1831

software

adau1401

SigmaDSP Audio Processors

DaveThib Reply
Feb 13, 2023 00:00

Hello Michel95,

SigmaStudio will often write to parameters it does not need to write to and the Sweep_Algo_Mask is one of those. I watched the parameters in SigmaStudio when making changes to the block and it never changes. It is always = 255. Therefore, no need to update that parameter.

The other parameter "MOD_SWEEP_ALG0_FREQ_INCREMENT_FIXPT" is calculated this way.

Since it is difficult to write equations in text I thought I would just draw it on a whiteboard and attach the picture. This is how I derived the equation:

I hope you can read my writing OK.

There may be a better way to do the calculation but this is the formula that gives you the multiplier.

Dave T

Sweep-Frequency-Increment-Calculation.jpg
Sweep-Frequency-Increment-Calculation.jpg