ADAU1450 save parameters to the EEPROM
Hi everyone!
I'm working on a very interesting project.
This project is based on the dsp adau1450. The main board has 8 channels adc and dac.
Also this project has one more board, it's remote board for changing any parameters of the dsp, like volume, filters coefficients, delay etc.
this remote board is based on the stm32 mcu and has a small display and rotary encoder.
this is a screenshot:
this is the channel 1, others are the same:
the main idea is:
there are a lot of these dsp boards and one or more the remote. when the user connects remote to dsp board, he is able to sets some parameters. after that he should be able to save these parameters not only to the ram of the dsp, but to eeprom, that connected to the dsp via spi (like on the classic schematic).
I did almost all. I can save parameters: volume (all 8 channels), delay, filters (a lot of parameters, since I have 8 channels, each channel has HPF (20 frequencies) and LFP(also 20)), etc.
I use the files, SigmaStudio generated. such as h-files and I use hex file so that have an actually data. all of this I use in firmware of the stm32. so stm32 can upload the hex file to eeprom via dsp, like this doing SigmaStudio. I copied the algorithm
to the access to params I use the addresses of the SigmaStudio blocks from file _IC_1_PARAM.h.
all of this works well.
But I face the problem:
some of the addresses in file _IC_1_PARAM.h have too much value, for example:
/* Module DC1 - DC Input Entry*/
#define MOD_DC1_COUNT 1
#define MOD_DC1_DEVICE "IC1"
#define MOD_DC1_DCINPALG145X2VALUE_ADDR 3192
#define MOD_DC1_DCINPALG145X2VALUE_VALUE SIGMASTUDIOTYPE_8_24_CONVERT(-85.6640777588)
#define MOD_DC1_DCINPALG145X2VALUE_TYPE SIGMASTUDIOTYPE_8_24
the normal value looks:
/* Module Volume CH8 - Single Volume*/
#define MOD_CH8_VOLUMECH8_COUNT 2
#define MOD_CH8_VOLUMECH8_DEVICE "IC1"
#define MOD_CH8_VOLUMECH8_ALG0_TARGET_ADDR 29
#define MOD_CH8_VOLUMECH8_ALG0_TARGET_VALUE SIGMASTUDIOTYPE_8_24_CONVERT(1)
#define MOD_CH8_VOLUMECH8_ALG0_TARGET_TYPE SIGMASTUDIOTYPE_8_24
#define MOD_CH8_VOLUMECH8_ALG0_SLEW_MODE_ADDR 30
#define MOD_CH8_VOLUMECH8_ALG0_SLEW_MODE_FIXPT 0x00002085
#define MOD_CH8_VOLUMECH8_ALG0_SLEW_MODE_VALUE SIGMASTUDIOTYPE_INTEGER_CONVERT(8325)
#define MOD_CH8_VOLUMECH8_ALG0_SLEW_MODE_TYPE SIGMASTUDIOTYPE_INTEGER
this param in hex just shifted on 10 addresses, so I can calculated where it located in hex. it;s not a problem and it's works well. I save the params and after reset or power on/off all params the same like I configured.
but I don't understand how I can calculated the index in hex file where this param (with address 3192) located. Could you please help me?
Audio Signal Processors
Audio Products
software
eeprom
ADA1450
adau1450
SigmaStudio 4.6
SigmaDSP Audio Processors
Show More
Hello josaami,
Are you saying you can't control the parameter which is in the address 3192?
I hope you are aware that the addresses given in the PARAM.h file are in decimal.
Can you please tell us a little more about your last three lines of your post?
josaami said:
this param in hex just shifted on 10 addresses, so I can calculated where it located in hex. it;s not a problem and it's works well. I save the params and after reset or power on/off all params the same like I configured.
but I don't understand how I can calculated the index in hex file where this param (with address 3192) located. Could you please help me?
Sorry, I didn't quite understand it.
Regards,
Harish
Hello Harishgowtham
Thank you for your answer.
Sorry for the confusing explanation from my side.
Will try to explain what I mean.
I have a lot of address in _IC_1_PARAM.h-file.
I see the consistent pattern between these addresses and a location of the parament in hex file, that generated SigmaStudio.
this is 10 32-bit worlds from the start of the hex.
the first 6 was described in the datasheet on the page 53.
what is 4 I don't know and now doesn't matter for me (but if you know, let me know).
what I do:
address from _IC_1_PARAM.h-file minus 10 = where this param is located in the hex file.
I change this param and save to the eeprom the full hex. this works well right not. but only for the addresses, which value in the range 0 to aprox 400.
if I try calculate with value 3000 and more, I see that this param out of the hex.
I have a copy of hex file, that I include to h-file. this hex I separated on arrays. each array has 256 byte:
uint8_t Page_A0_S256_N25_idx0[256] = { 0xAA , 0x00 , 0x00 , 0x10 , 0x00 , 0x02 , 0x00 , 0x60 ,
0x00 , 0x67 , 0x00 , 0x05 , 0x00 , 0x00 , 0x00 , 0x08 ,
0x00 , 0x00 , 0x00 , 0x10 , 0x01 , 0x24 , 0x00 , 0x00 ,
0x00 , 0x00 , 0x01 , 0x34 , 0x00 , 0x00 , 0x01 , 0x34 ,
0x00 , 0x00 , 0x0B , 0x44 , 0x00 , 0x00 , 0x00 , 0x00 ,
0x00 , 0x00 , 0x00 , 0x28 , 0x00 , 0x00 , 0x00 , 0x28 ,
0x00 , 0x00 , 0x0C , 0x08 , 0x00 , 0x00 , 0x00 , 0x00 ,
0x00 , 0x00 , 0x18 , 0x7C , 0x00 , 0x00 , 0x18 , 0x7C ,
0x00 , 0x00 , 0x07 , 0x84 , 0x00 , 0x00 , 0x00 , 0x00 ,
0x00 , 0x00 , 0x00 , 0x00 , 0x01 , 0x00 , 0x00 , 0x00 ,
0x00 , 0x00 , 0x20 , 0x85 , 0x00 , 0x00 , 0x00 , 0x00 ,
0x01 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x20 , 0x85 ,
0x00 , 0x00 , 0x00 , 0x00 , 0x01 , 0x00 , 0x00 , 0x00 ,
0x00 , 0x00 , 0x20 , 0x85 , 0x00 , 0x00 , 0x00 , 0x00 ,
0x01 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x20 , 0x85 ,
0x00 , 0x00 , 0x00 , 0x00 , 0x01 , 0x00 , 0x00 , 0x00 ,
0x00 , 0x00 , 0x20 , 0x85 , 0x00 , 0x00 , 0x00 , 0x00 ,
0x01 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x20 , 0x85 ,
0x00 , 0x00 , 0x00 , 0x00 , 0x01 , 0x00 , 0x00 , 0x00 ,
0x00 , 0x00 , 0x20 , 0x85 , 0x00 , 0x00 , 0x00 , 0x00 ,
0x01 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x20 , 0x85 ,
0x00 , 0x00 , 0x00 , 0x00 , 0x01 , 0x00 , 0x00 , 0x00 ,
0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 ,
0x01 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 ,
0x00 , 0x00 , 0x00 , 0x00 , 0x01 , 0x00 , 0x00 , 0x00 ,
0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 ,
0x01 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 ,
0x00 , 0x00 , 0x00 , 0x00 , 0x01 , 0x00 , 0x00 , 0x00 ,
0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 ,
0x01 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 ,
0x00 , 0x00 , 0x00 , 0x00 , 0x01 , 0x00 , 0x00 , 0x00 ,
0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 ,
};
I did this like did Sigma when save to eeprom.
I have 25 of these arrays.
I have this in _IC_1_PARAM.h-file (pay attention on red values):
/* Module CH3_CH4 - Audio Signal Router*/
#define MOD_CH3_CH4_COUNT 10
#define MOD_CH3_CH4_DEVICE "IC1"
#define MOD_CH3_CH4_ALG0_AUDIOSIGNALROUTER34S300ALG1INPUTGAIN0_ADDR 298
#define MOD_CH3_CH4_ALG0_AUDIOSIGNALROUTER34S300ALG1INPUTGAIN0_VALUE SIGMASTUDIOTYPE_8_24_CONVERT(1)
#define MOD_CH3_CH4_ALG0_AUDIOSIGNALROUTER34S300ALG1INPUTGAIN0_TYPE SIGMASTUDIOTYPE_8_24
#define MOD_CH3_CH4_ALG0_AUDIOSIGNALROUTER34S300ALG1INPUTGAIN1_ADDR 299
#define MOD_CH3_CH4_ALG0_AUDIOSIGNALROUTER34S300ALG1INPUTGAIN1_VALUE SIGMASTUDIOTYPE_8_24_CONVERT(1)
#define MOD_CH3_CH4_ALG0_AUDIOSIGNALROUTER34S300ALG1INPUTGAIN1_TYPE SIGMASTUDIOTYPE_8_24
#define MOD_CH3_CH4_ALG0_AUDIOSIGNALROUTER34S300ALG1OUTPUTGAIN0_ADDR 300
#define MOD_CH3_CH4_ALG0_AUDIOSIGNALROUTER34S300ALG1OUTPUTGAIN0_VALUE SIGMASTUDIOTYPE_8_24_CONVERT(1)
#define MOD_CH3_CH4_ALG0_AUDIOSIGNALROUTER34S300ALG1OUTPUTGAIN0_TYPE SIGMASTUDIOTYPE_8_24
#define MOD_CH3_CH4_ALG0_AUDIOSIGNALROUTER34S300ALG1OUTPUTGAIN1_ADDR 301
#define MOD_CH3_CH4_ALG0_AUDIOSIGNALROUTER34S300ALG1OUTPUTGAIN1_VALUE SIGMASTUDIOTYPE_8_24_CONVERT(1)
#define MOD_CH3_CH4_ALG0_AUDIOSIGNALROUTER34S300ALG1OUTPUTGAIN1_TYPE SIGMASTUDIOTYPE_8_24
#define MOD_CH3_CH4_ALG0_AUDIOSIGNALROUTER34S300ALG1CROSSGAIN00_ADDR 302
#define MOD_CH3_CH4_ALG0_AUDIOSIGNALROUTER34S300ALG1CROSSGAIN00_VALUE SIGMASTUDIOTYPE_8_24_CONVERT(1)
#define MOD_CH3_CH4_ALG0_AUDIOSIGNALROUTER34S300ALG1CROSSGAIN00_TYPE SIGMASTUDIOTYPE_8_24
#define MOD_CH3_CH4_ALG0_AUDIOSIGNALROUTER34S300ALG1CROSSGAIN01_ADDR 303
#define MOD_CH3_CH4_ALG0_AUDIOSIGNALROUTER34S300ALG1CROSSGAIN01_VALUE SIGMASTUDIOTYPE_8_24_CONVERT(0)
#define MOD_CH3_CH4_ALG0_AUDIOSIGNALROUTER34S300ALG1CROSSGAIN01_TYPE SIGMASTUDIOTYPE_8_24
#define MOD_CH3_CH4_ALG0_AUDIOSIGNALROUTER34S300ALG1CROSSGAIN10_ADDR 304
#define MOD_CH3_CH4_ALG0_AUDIOSIGNALROUTER34S300ALG1CROSSGAIN10_VALUE SIGMASTUDIOTYPE_8_24_CONVERT(0)
#define MOD_CH3_CH4_ALG0_AUDIOSIGNALROUTER34S300ALG1CROSSGAIN10_TYPE SIGMASTUDIOTYPE_8_24
#define MOD_CH3_CH4_ALG0_AUDIOSIGNALROUTER34S300ALG1CROSSGAIN11_ADDR 305
#define MOD_CH3_CH4_ALG0_AUDIOSIGNALROUTER34S300ALG1CROSSGAIN11_VALUE SIGMASTUDIOTYPE_8_24_CONVERT(1)
#define MOD_CH3_CH4_ALG0_AUDIOSIGNALROUTER34S300ALG1CROSSGAIN11_TYPE SIGMASTUDIOTYPE_8_24
#define MOD_CH3_CH4_ALG0_AUDIOSIGNALROUTER34S300ALG1ALPHA0_ADDR 306
#define MOD_CH3_CH4_ALG0_AUDIOSIGNALROUTER34S300ALG1ALPHA0_VALUE SIGMASTUDIOTYPE_8_24_CONVERT(0.770730381231748)
#define MOD_CH3_CH4_ALG0_AUDIOSIGNALROUTER34S300ALG1ALPHA0_TYPE SIGMASTUDIOTYPE_8_24
#define MOD_CH3_CH4_ALG0_AUDIOSIGNALROUTER34S300ALG1ALPHA1_ADDR 307
#define MOD_CH3_CH4_ALG0_AUDIOSIGNALROUTER34S300ALG1ALPHA1_VALUE SIGMASTUDIOTYPE_8_24_CONVERT(0.229269618768252)
#define MOD_CH3_CH4_ALG0_AUDIOSIGNALROUTER34S300ALG1ALPHA1_TYPE SIGMASTUDIOTYPE_8_24
/* Module DC1 - DC Input Entry*/
#define MOD_DC1_COUNT 1
#define MOD_DC1_DEVICE "IC1"
#define MOD_DC1_DCINPALG145X2VALUE_ADDR 3192
#define MOD_DC1_DCINPALG145X2VALUE_VALUE SIGMASTUDIOTYPE_8_24_CONVERT(-85.6640777588)
#define MOD_DC1_DCINPALG145X2VALUE_TYPE SIGMASTUDIOTYPE_8_24
so, if we calc with address 298:
number of array = ((298-10) * 4)/256 = 4.5. so, this param located in 4th array. after that I calc where in this array is located this param.
if we calc with address 3192:
number of the array = ((3192-10) * 4)/256 = 49.71875. so, the param is located in 49 array, but it's impossible, because the amount of the array is 25!
I just need to understand how I can use this 3192 and find this param in hex file.
I hope I explained better
if no, let me know
BR, josaami.
Hello Josaami,
Thank you for your detailed explanation. I will look into this and reply to your post in a while.
Regards,
Harish
Hello Harish
thank you!!!
Reply on behalf Harishgowtham
Hello Josaami,
Thank you for your patience.
what is happening here is that you are using eight delay modules, so a memory (a word for a sample) is created in DM0 and DM1 (whichever memory you choose). You can see those allocated memory in capture window (if it's DM0) as well as the exported files (Name_IC_1.h). But the delay memory is not included in the EEPROM hex file.
you can verify the value in the capture window attached above.
I saw in your screenshot that you are using 20ms delay for each channel which is 960 samples at 48KHz. For eight channels it will overflow both DM0 and DM1 since initialization code and other modules will take some memory. So, In my example channel 1 is delayed by only 2ms and in my example I used DM0 for first four channels, ch1 - 2ms (96 samples), ch2 - 20ms (960 samples) , ch3 - 20ms (960 samples), ch4 - 20ms (960 samples) I used DM1 for next four channels, ch5 - 20ms (960 samples) , ch6 - 20ms (960 samples), ch7 - 20ms (960 samples), ch8 -20ms (960 samples).
The capture window only covers DM0 memory which is 4096 words.
Here my parameters (filter Coeff's, volume controls etc..) took up to address 319 (few parameters are left which is placed after the delay memory)
Please refer below pictures,
Here my parameters (filter Coeff's, volume controls etc..) took up to address 319 (few parameters are left which is placed after the delay memory)
Please refer below pictures,
Here is the channel four delay memory named as delay1_4 starts from 320 and ends at 1280 (960 words)
Here is the channel three delay memory named as delay1_3 starts from 1281 and ends at 2241 (960 words)
Here is the channel two delay memory named as delay1_3 starts from 2242 and ends at 3202 (960 words)
Here is the channel one delay memory named as delay1 starts from 3203 and ends at 3299 (96 words)
I have this project and write it to the EEPROM and got that hex file. I separated it into 24 arrays. Each array will have 64 words (256 bytes). My hex file exactly has 1536 words. so, it got contained within 24 (0 - 23) arrays.
24 * 64 = 1536.
Now as you explained, if you want to access the address 319 then you will do ((319-10) *4)/256 = 4.8 so it's in the 4th array. If you want to access the parameters which is placed after the delay memory, then subtract those delay memory.
For ex, I have used delays from 320 to 3299 = 2979. so, if you want to access the address 3300 then ((3300-10-2979) *4)/256 = 4.8. It is also in the 4th array as shown in my hex file screenshot.
Just watch out what are all the parameters which are placed after the delay memory and when you are accessing those parameters then include this logic of subtracting the delay numbers like above.
You can verify this by seeing the capture window and remember capture window only has DM0 data.
In my example, I used first four channels where I used DM0 memory, and I didn't explain about DM1 space where other four channels are using their delays.
Note that I haven't tested this thoroughly, but I can assume that this is what causing the problem that you are facing. if you have any comments please do reply.
I was just wondering that how you are using this much memory in this processor. If you are using 8 channels and 20ms at 48KHz for each channel then it will be around 7680 sample spaces so your DM0, DM1 are almost over, and initialization code and other modules will take some so you will be running out of memory. And you are using it at 96KHz which doubles the space, are you planning to use any external SPI memory for delays?
Please log in to reply.








