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

I2C/uP how to Store/Restore parameters

SigmaDSP & SigmaStudio Gordon May 17, 2010 00:00 2 replies Original on forum ↗
Subscribe
Gordon Question
May 17, 2010 00:00

uP and low level programming are completely new to me so I'll apologize in advance if this is a dumb question.

What I want to do with the ADAU1446 is much the same as the ADAU1701 does when performing a write back, storing parameters such as interface read but being new to low level stuff I'm not sure how it's done. I'll get my head round the assembler eventually I'm just not quite sure of the method. Retrieving the data from the ADAU seems reasonably straight forward as I have the address and value (I think!) from *.params, such as

Cell Name = Interface Read1
Parameter Name = GPIO_INTFACE_0_RDWR
Parameter Address = 8
Parameter Value = 5
Parameter Data :
0X00, 0X00, 0X00, 0X05,

but where is it in the eeprom? Do I have to iterate through all the eeprom addresses to locate the parameter address to rewrite the value? Or would you just rewrite the lot, if possible?

tia

Gordon

Audio Signal Processors

i2c

adau1446

SigmaDSP Audio Processors

parameter

adau1701

restore

Show More

ADIApproved Reply
May 18, 2010 00:00

Hi Gordon,

This is quite tricky. The EEPROM format stores data in a way that essentially emulates a series of block writes to the SigmaDSP. This data can be generated by using the capture window and sequencer, as shown in this post: https://ez.analog.com/message/5759#5759

SigmaStudio downloads the parameters in order, in a very large block write. The size of this block depends on the number of parameters used in the project. So, the address in the EEPROM is not static; it can change with each new compilation of a modified SigmaStudio project.

My suggestion would be to use the *.params file in conjunction with the capture window to find exactly where in the parameters block the data of interest is located. You could do this by inserting a "dummy" DC input cell and changing that parameter to a specific, known, unique value. For example, I could change its parameter value to 0x12 0x34 0x56 0x78, or something similar. Then, after compilation, I could search the parameter block for that exact string (0x12 0x34 0x56 0x78) and then I would know that its location in the parameter block aligns with the parameter address given in the *.params file, and I could also find this string in the eeprom.hex file so I know exactly what address in the EEPROM contains this parameter.

Incrementing or decrementing from this parameter address would then give me access to other parameters at known addresses.

Sounds confusing? That's beacuse it is.

I'd suggest an alternate route - store important parameters in a different, unused area of the EEPROM (or better yet, somewhere in your microcontroller, if it has nonvolatile memory). This means you won't have to tamper with the self-boot portion of the EEPROM memory and you can simply pick any unused address to save the data you need. After self-boot, the microcontroller could grab the writeback parameters from the EEPROM and manually write them to the device before un-muting the audio.

Gordon Reply
May 18, 2010 00:00

Thanks Brett. Exactly what I wanted to know. Since posting I'd managed to locate where the data was in the eeprom in much the same way as you outlined, by setting one of the InterfaceRead to one>write eeprom>save data then doing it with the InterfaceRead set to five and wrote a small program to locate the difference. Might tidy it up and make it available if it's useful to anyone else and there's enough interest.

The confusion was mainly caused by the expectation of the DSP address being stored along with the data and the expectation of there being an easy way. Now I know it's long hand I can get on with it. uP not chosen yet so I'll make sure it's got some eeprom.

Much obliged

Gordon