Post Go back to editing

DM0 and DM1 after reset in ADAU1450

Hi all,

A while ago, I posted a question about the state of the RAM registers in the ADAU1450 after reset: DM0 and DM1 RAM content after RESET ADAU1450 

Dave responded that RAM is initialized just before the core starts running. That's what I found later also in the datasheet (i overlooked it at first...). But I don't think that both are correct.

I use a microcontroller to program the ADAU1450 via an I2C bus. I use the output xml file, generated by SigmaStudio and write all registers mentioned in that xml file. But for DM0 and DM1 I do it a little different. Because I use a lot of RAM for delay, that registers are all filled with zero's. And, according to the answers I got, I do not need to write zero's, so I skipped doing that when programming the DSP.

But after releasing the hibernate state, the DSP is giving strange signals :-) So, to test my theory, I wrote all zero's to DM0 and DM1 in the range SigmaStudio wrote in the xml outputfile and then I write the non zero values. With that sequence, the DSP is working fine.... So my conclusion is that RAM isn't initialized, or at least not at the time I expect.

Maybe someone can shine some light here? That would be appreciated :-) My program is running fine now, but I could speed up the bootprocess when omitting writing the zero's to DM0 and DM1 at startup (I2C isn't very fast...). OK, I could switch to SPI, but that isn't an option, I use more I2C chips :-)

Addition: I found the following in the datasheet under paragraph "

POWER SUPPLIES, VOLTAGE REGULATOR, AND HARDWARE RESET"

"Hardware Reset

An active low hardware reset pin (RESET) is available for externally triggering a reset of the device. When this pin is tied to ground, all functional blocks in the device are disabled, and the current consumption decreases dramatically. The amount of current drawn depends on the leakage current of the silicon, which depends greatly on the ambient temperature and the properties of the die. When the RESET pin is connected to IOVDD, all control registers are reset to their power-on default values. The state of the RAM is not guaranteed to be cleared after a reset, so the memory must be manually cleared by the DSP program. The default program generated by SigmaStudio includes code that automatically clears the memory."
Hmm, I was sure I read somewhere else in the same datasheet that RAM is cleared, but I can't find it anymore... So maybe I have to clear the RAM registers myself...

Thanks again for all your input

With kind regards,

Reini

Parents
  • All of the DSP's memories are uninitialized after power-up. Buffers are zero-filled by the DSP program generated by SigmaStudio when it starts. Parameters are not, and have to be explicitly initialized during programming even if they are zero.

    Another thing I noticed is that reading uninitialized memory (or a memory location that's immediately followed by uninitialized memory) via SPI/I²C has a high probability of triggering a spurious parity error in the panic manager. For that reason I prefer to fill all memories completely during programming (but I use SPI, which is much faster than I²C).

    If you want to save programming time, after setting up the PLL upload and run this little program to zero-fill DM0 and DM1:

    00000002
    0880dcdc
    c0002830
    8000xxxx
    0c30dcdc
    01000008
    064c0000
    064c5040
    00000005
    00000000
    00000000
    02010008
    00000000
    00000000

    where xxxx in the fourth word should be the number of words per DM divided by 4, i.e. 0400 for the ADAU1450, 0800 for the ADAU1451, and 1400 for the ADAU1452. This program zero-fills memory at a rate of 4 words per core clock cycle and then halts. You can then upload your actual program without having to write zeros in DM0/DM1.

Reply
  • All of the DSP's memories are uninitialized after power-up. Buffers are zero-filled by the DSP program generated by SigmaStudio when it starts. Parameters are not, and have to be explicitly initialized during programming even if they are zero.

    Another thing I noticed is that reading uninitialized memory (or a memory location that's immediately followed by uninitialized memory) via SPI/I²C has a high probability of triggering a spurious parity error in the panic manager. For that reason I prefer to fill all memories completely during programming (but I use SPI, which is much faster than I²C).

    If you want to save programming time, after setting up the PLL upload and run this little program to zero-fill DM0 and DM1:

    00000002
    0880dcdc
    c0002830
    8000xxxx
    0c30dcdc
    01000008
    064c0000
    064c5040
    00000005
    00000000
    00000000
    02010008
    00000000
    00000000

    where xxxx in the fourth word should be the number of words per DM divided by 4, i.e. 0400 for the ADAU1450, 0800 for the ADAU1451, and 1400 for the ADAU1452. This program zero-fills memory at a rate of 4 words per core clock cycle and then halts. You can then upload your actual program without having to write zeros in DM0/DM1.

Children
  • Hello Matthijs,

    We use your clearing DM0/DM1 option for over 4 years now :-) Recently I updated the DSP application, concerning the delay components (the compiler gave a warning that new components were available). In the new delay components, we can now also select PM (program data memory) to store the delayed samples.

    Is it possible to clear a part (or all) of the program memory too? Or is that done automatically? I did see that there are new compiler options that could clear unused memory, but do they also clear program data?

    With kind regards,

    Reini

  • I haven't used SigmaStudio in a while, so I can't tell you what those compiler options do. My suggestion would be to just test them.

    Should it be needed, here's a variant of my program that also clears PM (except for the program itself obviously):

    00000002
    0880dcdc
    c0002830
    8000xxxx
    c0002870
    8000yyyy
    c00028b0
    80000018
    00f7d112
    0c30dcdc
    0100000d
    064c0000
    064c5040
    0000c062
    01010011
    06446020
    00000000
    00000005
    00000000
    00000000
    02010011
    00000000
    00000000
    00000000

    where xxxx in the fourth word is the number of words per DM divided by 4 (same as before, e.g. 0400 for the ADAU1450) and yyyy in the sixth word is the number of words in PM divided by 2 (e.g. 1000 for the ADAU1450). Total execution time is 1 cycle per 4 words of each DM and 2 cycles per 2 words of PM, i.e. 2*x+2*y cycles.

  • Thanks again Matthijs for your quick response! I will try this and will report here :-)

    We use both the ADAU1450 and ADAU1452, they all have 8kWords Program Memory, so per 2 words yyyy should be 8192/2 = 4096 = 0x1000

    With kind regards,

    Reini