Post Go back to editing

Software safeload examples

In order to use software safeload to write data to parameter RAM, at least three writes must be performed. First, the data is loaded into the safeload data registers (addresses 0x0001 through 0x0005), then the safeload target address register (address 0x0006), and finally the number of words / trigger register (address 0x0007). So, in order to execute a safeload write, there are at least 3 register writes that need to occur.

Single address safeload write

For example, if I wanted to write one word of data to address 0x000B…

There are 3 total writes:

  • Address 0x0001, write 4 bytes of data.
  • Address 0x0006, write 0x0000000A (this is my target address of 0x000B minus one).
  • Address 0x0007, write 0x00000001 (because you are writing one word of data).

This will trigger the safeload write on the next frame.

Note that the target address is actually shifted down by one, as mentioned in the datasheets for devices using software safeload. So, even though I’m writing to address 0x000B, I write 0x000A to the target address register.

Multiple address safeload write

Here’s another example, where I will write 3 words of data instead of 1 word. The target addresses for the 3 words of data are 0x001C, 0x001D, and 0x001E.

There are 5 total writes:

  • Address 0x0001, write 4 bytes of data that will be safeloaded to address 0x001C.
  • Address 0x0002, write 4 bytes of data that will be safeloaded to address 0x001D.
  • Address 0x0003, write 4 bytes of data that will be safeloaded to address 0x001E.
  • Address 0x0006, write 0x0000001B (this is 0x001C minus one).
  • Address 0x0007, write 0x00000003 (because you are writing three words of data).

This will trigger the safeload write on the next frame.

Note that multi-word safeload writes can only be accomplished when the target addresses are sequential.

  • Hi Brett! I'm about to implement the Safeload write. I already successfully implemented the direct write. After reading this post I got confused, because it's completely different than what the datasheet says.

    Step 1:

    ADAU1701 Datasheet, page 37:

    "The first step in performing a safeload operation is writing the parameter address to one of the safeload address registers (2069 to 2073)".

    Your post:

    "First, the data is loaded into the safeload data registers (addresses 0x0001

    through 0x0005)"

    Step 2:

    ADAU1701 Datasheet, page 37:

    "After this address is written, the 28-bit data-word can be written to the corresponding safeload data register (2064 to 2068)."

    Your post:

    "then the safeload target address register (address 0x0006)"

    Step 3:

    ADAU1701 Datasheet, page 37:

    "After the address and data registers are loaded, set the initiate safeload transfer bit in the core control register to initiate the loading into RAM" - That would be at address 2076, 6th bit.

    Your post:

    "finally the number of words / trigger register (address 0x0007)."

    So I ask:

    --> So, which one should I write first? Address or Data registers?

    --> What about the addresses? Datasheet says address reg is at 2069 to 2073, your post says it's at 0x0006. Datasheet says Data reg is at 2064 to 2068, your post says it's at 0x0001 to 0x0005.

    --> The "trigger" is a register at address 0x0007 like you said, that I need to send the number of words to be safeloaded, or, is that just the 6th bit at address 2076? In case the second is true, do I have to re-write the entire core control register word, or is there a way that I can only update the 6th bit alone?

    Thank you!

  • Did I get this right? (see photo bellow)

    The questions above still remain though... Especially the last one, regarding how to trig the safeload.

    Thanks!

  • It's working! But honestly I think it's poorly documented on the datasheet. And the info on this post is not applicable for adau1701. Was this post targeted to another dsp part? In this case it would be nice to make it clear... Thanks!!

  • Hi Nando.One. I'm sorry that I didn't reply to you last week. I was on vacation.

    My post above actually applies to software safeload, which is available on the ADAU1442/5/6, ADAU1761, and ADAU1781. The ADAU1701 that you are using actually has a hardware safeload implementation (as does the AD1940), so the usage is quite different.

    Sorry if that confused you. Maybe I should edit the title of this post to make it clear which SigmaDSPs have software safeload available.

    By the way, the answer to your question about the trigger:

    You can set the initiate safeload transfer bit by simply writing the whole 16-bit word to the DSP Core Control Register, with the 6th bit (i.e. bit D5) set to 1.

  • Hey, no problem. Everyone deserves some time off, even ADI guys!

    Ahhhh OK, I had no idea that there was this difference between the DSPs. I was under the impression that "Software safeload" is "what you're supposed to do on your software to safeload the parameters". Pherhaps a list of DSPs that this method is applicable could be a good idea.

    The hardware safeload is working perfectly fine here. If you don't mind, when I have some time (will take a while) I'd like to come back here and post a quick tutorial about it

    Cheers!

  • Yes, a tutorial would be great! I can even put it on our Wiki when you are finished with it.

  • Finally had the time! Check it out:

    http://ez.analog.com/thread/15537

    Feel free to edit it as you want or suggest changes.

    Best wishes!

  • Excellent. Thank you. I will go over it when I have the time... I'm currently traveling on business so it's a bit difficult to stay up to date with the forum!

  • Hello,

    this is nice, but does not really help us to build the C code which does software safeload writes on a real world ADAU1467; or maybe I missed some other code shared somewhere  else ?

    Please those who did write the corresponding C code give us more hints on how you did it.

    Tks

    Regards.

  • Hello iravelo,

    This was an old post from 2012 explains how to do Safeload write using an ADAU1701 DSP. This is a Sigm100 DSP. It does not apply to the ADAU1467. We improved the way to do it and made it easier. The 1701 is a Sigma100 core. We improved it on the Sigma200 core then made further improvements on the Sigma300 core. The ADAU1467 is a Sigma350 core but the safeload write system is the same as the Sigma300. 

    I wrote this post explaining how safeload works but not the code. In your earlier post you had the defines and that is all you really need. Read this post:

    (+) I2C Safeload problem on ADAU1452 - Q&A - SigmaDSP Processors & SigmaStudio Dev. Tool - EngineerZone (analog.com)

    But I see in another post you wrote that you made it work. 

    Dave T