Safeload on the ADAU1701
I think I need some help on the safeload functionality of the ADAU1701. I know this has been discussed quite some times already, and I read all those posts too, but I am still lost.
Found Brett's description in message 30372 and an example in message 21051, but still I am not sure I get the clear picture of how to use it.
I have a couple of parametric filters I need to update from my microcontroller, so 5x 4byte values to transfer.
Step 1: write parameter address to one of the safeload address registers
Putting the SPI latch pin low, writing 5 bytes to the DSP, DSP address, 2 register address, 2 data address, then SPI pin high again
Step 2: write parameter data to one of the safeload data registers:
Putting the SPI latch pin low, writing 7 bytes to the DSP, DSP address, 2 register address, 1 dummy, 4 data, then SPI pin high again
Doing this for the 5 different safeload registers
Initate safeload transfer:
Step 3: the IST bit is set
Putting the SPI latch pin low, writing 4 bytes to the DSP, 0x08,0x1C with value 0x00, 0x3C, then SPI pin high again. Wait 1 cycle, and then I check the filter registers.
After doing this I see absolutely no change. The filter data is the same after as it was before. Even reading the safeload registers, both address and data, just gives me zeros.
How many bytes are actually transfered from the safeload data registers? I only need 5 x 4 bytes, what happens to the last byte? If only 4 bytes are written to the safeload registers, only 4 bytes will be transferred?
Does anyone have an idea about what I am doing wrong here?
Thanks in advance
Danny
Audio Signal Processors
SigmaDSP Audio Processors
adau1701
Danny,
Sorry, I was out on vacation last week. Is this issue still open?
Hi Brett,
Yes, this is still an issue. I found a few posts on this issue, but neither of them really helped me in the right direction.
Reading and writing to the RAM using the "raw" mode works, as I can change filter values. I could also read out values through the readback blocks.
The only thing I could come up with was that maybe there is some kind of "lock"-bit that I have to flip before I can write to the safeload registers?
Danny
Not really. There's the trigger bit that you must flip AFTER you wrote the registers.
The safeload on ADAU1701 is not straight forward, it's a little tricky:
First, you perform a write to the safeload ADDRESS register. This write must be addressed to the safeload address register and contain the address of the parameter memory region that you would like to safeload your data. Attention, this writing contains TWO addresses: The "safeload address register" address and the "parameter memory region" address.
THEN, you perform another write to the safeload DATA register. This write must be addressed to the safeload data register and contain the data, up to four bytes. So THIS write contains the "safeload data register" address and the DATA itself, that can't be more than 4 bytes long. Actually it is 28-bit long, but that doesn't really matter...
You have FIVE safeload address registers and another FIVE safeload data registers. That allows you to update an entire biquad for example. 5x 4bytes = up to five "float to fixed" coefficient numbers. So, FOR EACH coefficient of a biquad, you must perform the procedure above.
After you're done sending all that stuff, you must flip the 6th bit of the DSP Core Control Register. The easiest way to do that is updating the entire register that is 16-bit long. With this info right here and the datasheet, I'm sure you can do it! Sorry not to dive into the details, I'm pretty short on time and working on a project right now, but the datasheet has all the details, the addresses, bit names, etc.
Good luck and come back here if you have to.
Cheers!
Apparently the safeload data and address registers are write-only, so reading them back to see that they actually got written, that will not work. I think I got stuck a little too long here
Secondly, writing 4 bytes in every safeload data register doesn't seem to do anything. 5 bytes are needed before anything happens, the first byte is a filler 0x00, of the second byte only the first 4 bits are transferred. So writing 0x00FF858365 to the safeload data register, becomes 0x0F858365 in the filter memory.
Thanks guys for taking the time to look at this.
Yeah, this 4 bits difference is due to the fact that the processor is 28-bit resolution, so you can't write 32-bit parameter data. You're welcome and Good luck!
Please log in to reply.