AnsweredAssumed Answered

Sigma Studio Mode export does not use defined register locations

Question asked by JohnAmpetronic on Mar 25, 2014
Latest reply on Mar 26, 2014 by JohnAmpetronic

Hi All

 

I have had a problem with generating 'C' code for inclusion in my micro-controller program to control the SigmaDSP.    To be more specific I am using SigmaStudio 3.10 Beta to write a program for a ADAU1701.  I need the Beta version as I am using the Hilbert transform that does not work on the 3.9 version of the code.  I have a micro-controller project that accepts SigmaStudio 'C' output files.  I can change my SigmaStudio "program", output the revised header files and recompile the micro-controller project with no manual changes to the 'C' code.  So far so good.

 

I have volume controls that I want to be able to set to an accuracy of 0.1 dB.  I used the Mode capture system to capture a volume change.  I then export the code to change the .h file created is below:

 

------------------------------------------------------------------------------------------------------------------------------------------------

ADI_REG_TYPE CHANA_GAIN_0[4] = {0x00, 0x04, 0x0C, 0x37};

 

 

void CHANA_GAIN_download(){

SIGMA_WRITE_REGISTER_BLOCK( DEVICE_ADDR_, 0x0013, 6, CHANA_GAIN_0);                              /* Gain1940AlgNS3 */

}

------------------------------------------------------------------------------------------------------------------------------------------------

Fine if I want to set the gain to a specific level but I need 800 for 80dB control at 0.1dB accuracy.  It is easy to calculate the value of the attenuation in the 5.28 format but the address of where it needs to be written is just the constant in the program (0x0013).  So I thought I needed to harvest the address locations into an array of volume control locations in order to access the volume controls in my system.  If I changed anything and the locations move, then I needed to repeat this process.

 

However I realised that the addresses are available (but not used in the auto-generated 'C' code) in the PARAM.H file

 

#define MOD_SINGLE1_GAIN1940ALGNS3_ADDR                19  //(Which is 0x13)

 

by using these, I do not need to change my code and I can automatically change my program as before.  I hope this helps anyone else that is having the same problem.

 

John

 

As an aside, the DEVICE_ADDR_ should have the IC number appended DEVICE_ADDR_IC_1 which I cannot make happen in the Mode export although it works fine in the program export?

Outcomes