Post Go back to editing

difficulty writing to Indirect Parameters

Category: Software
Product Number: ADAU1451

Issue

I am experiencing some difficulty when using the address in the IPAT table to try and change a variable.

The code block I have attached is able to toggle an LED on and off by changing the value inside a DC source. The code also works for changing the gain of the system. This code block only work when I am pointing it to the direct parameter address. When I change the address to the indirect address listed in the IPAT table it stops working. 

I2C sending function

uint64_t sigsend(u_int16_t addr,u_int16_t param,u_int32_t value) {
    
    //DSP Address
  Wire.beginTransmission(addr); //address high byte

  //Address of parameter
  Wire.write(byte((param >> 8) & 0xff));
  Wire.write(byte((param) & 0xff));
 
  //Data to be written
  Wire.write(byte(value >> 24) &0xff);
  Wire.write(byte(value >> 16) &0xff);
  Wire.write(byte(value >> 8) &0xff);
  Wire.write(value & 0xff);
  
  //End transmission
  Wire.endTransmission();
    return(uint16_t)addr;

Usage in main program
"
sigsend(0x38,24585,dec2sig(1));"

my IPAT

If anyone has any experience using the IPAT table your help would be greatly appreciated. 

Best,

Thread Notes

  • I think I may have figured out my initial issue.

    looking at the capture window after writing a 0 to the red_led parameter 

    in my code I decided to try to replicate this behavior by writing the data to the exact addresses. 

        sigsend(0x38,24585,0x00000000);
        sigsend(0x38,24583,0x6009);
        sigsend(0x38,24584,0x00000001);
    This appeared to work perfectly
    so it seems the data should be sent in the following order
    1. write desired value to address listed in IPAT 
    2. write address listed in IPAT to 0x6007
    3. write 1 to 0x008 to trigger load
  • Hello Noahiscool,

    Glad that it's working, thanks for reporting back.

    so it seems the data should be sent in the following order
    1. write desired value to address listed in IPAT 
    2. write address listed in IPAT to 0x6007
    3. write 1 to 0x008 to trigger load

    Yeah that's correct.

    You will store the values into the address given in the table and then load in the target address, then the number of words to trigger the write. 

    You can find the respective addresses in the exported files.

    Regards,

    Harish