ΣSigmaStudio Ask AI Русский Log in

Anyway to download program to ADAU1761 with small-RAM size micro controller?

SigmaDSP & SigmaStudio Kelvin-Shieh Apr 27, 2015 00:00 16 replies Original on forum ↗
Subscribe
Kelvin-Shieh Question
Apr 27, 2015 00:00

I had ever been successfully downloading several smaller programs into ADAU1761 and all they worked fine.

And now I had finally completed the dsp code of ADAU1761 which used almost all its on-chip resources, that is great fun.

But now the program size is large: PROGRAM_SIZE_IC_1 3115

However, as the dsp program grows larger and larger, my choice of micro controller (ARM M0) now failed to

have a single large enough array to store the whole dsp program and download it into the ADAU1761.

I then tried to break the dsp program code into smaller pieces and iterately call i2c writes several times within the

SIGMA_WRITE_REGISTER_BLOCK(uint8_t devAddress, uint16_t address, uint16_t length, ADI_REG_TYPE *pData),

but, I had no luck to make ADAU1761 work....

Can anyone help on this situation? A piece of sample program will be much appreciated.

Thanks in advance.

Kelvin

Audio Signal Processors

SigmaDSP Audio Processors

adau1761

ADIApproved Reply
Apr 27, 2015 00:00

HI Kelvin:

Please try breaking the program in chunks of 4 bytes. Recall that the word size for the program / parameter and data is 4 bytes and the address space increment once every 4 bytes on the program. Same goes for parameter memory and non modulo memory.

For debugging try reading the program results every new write, to make sure you are correctly writing into memory.

Let us know the results.

Regards

Miguel

Kelvin-Shieh Reply
Apr 27, 2015 00:00

Hi Miguel,

Thanks for the quick response. I will give it a try soon.

One more question --- Will I have to use non-stop i2c condition in the successive writes (so the 2 dsp program address bytes only goes with the first i2c write), or I have to treat each i2c write as a independent seperate write (so in this case, I will have to write the 2 dsp address bytes before each dsp code chunks?)

Thanks.

Kelvin

wsaba Reply
Apr 28, 2015 00:00

I too am working on this very issue, except using an Arduino board. Let me know if you have any success breaking the I2c message into chunks. I get a dynamic memory issue trying to buffer the entire progrom into I2c.

Regards,

Will

genp Reply
Apr 30, 2015 00:00

Hi Kevin,

may I ask you why do you worry about the RAM size of a microcontroller ?

I've done quite a few projects where the dsp is completely (program and parameter memory, registers) initialized from the micro. All data for this are stored in a flash memory on a micro. So you just read data from flash and send them to the dsp.

It implies that your micro is not otp, but has a reprogrammable flash. If flash size is not large enough, you always can connect cheap external data memory (SPI, I2C).

I haven't used I2C for dsp communication, just SPI, but it shouldn't make a big difference.

Regards,

Gennady

wsaba Reply
Apr 30, 2015 00:00

The problem is that all 4-6 kB of program memory is being loaded into "dynamic memory" when I try to send the data sequentially over i2c, the 2 kB dynamic memory is much less than the extent of the Prog Rom of the ADAU and hence Arduino throws an error that it ran out of memory. It won't compile until I find a way to split the data into chunks and avoid loading the entire boot sequence into function memory space. If anyone has experience doing this with the wire library (splitting pData on the block write function) or know how to i2c interface without it using an Arduino I would be eternally grateful!

Thanks,

Will

wsaba Reply
Apr 30, 2015 00:00

This I am unsure of, I'm not 100% sure how to do non-stop iterative data stream over i2c without one large buffer - which causes memory issues. I'll respond when I find out.

wsaba Reply
Apr 30, 2015 00:00

Side question (related) which pin/jumper is SCl and SDA for the adau 1702 eval board? I can't seem to find it in the manual explicitly stated. I feel that this should be in the interfacing section in bold.

wsaba Reply
Apr 30, 2015 00:00

One solution to memory problems (if they are dynamic memory overflow related) is to store the boot sequence in progmem (arduino term) and read them out sequentially using a variable to store the memory location of each array's starting address. That's currently what I'm doing to solve a similar issue. Still having issues with i2c but that's for another thread.

Kelvin-Shieh Reply
May 12, 2015 00:00

Hi Miguel,

I had been successfully breaking the program data and parameter data and download them into DSP.

The program data word is "5" bytes in size and parameter data word is "4" bytes in size, as mentioned on page 47 of ADAU1761.pdf

Note, the ADAU1761.pdf technical document did not mention data ram word size, so I still have no way to shrink the data buffer for sending data words that are for "DATA RAM". I hope Analog Device can specify what is the "word size" of "DATA RAM".

By the way, non-stop i2c transmission did not work which may be caused by the incompatibility between the micon i2c library and the DSP i2c circuits, so I had given up. What I did is sending word by word to DSP for both program and parameter types of data (with i2c stop between the words). As I had no idea on the word size of "data ram", I still need to prepare a bigger buffer to send this type of data, the is the area where I want to improve.

Kelvin

Kelvin-Shieh Reply
May 12, 2015 00:00

Hi Will,

Had you fixed your problem? I fixed the issue as in the above post, by breaking program data into "5 byte" words and parameter data into "4 byte" words. However I had no idea the word size for "non modulo memory"....any idea?

Kelvin

Kelvin-Shieh Reply
May 12, 2015 00:00

Hi Gennady,

Do you have any idea about the word size for "non modulo memory" (DSP Ram Data) ?

Thanks,

Kelvin

ADIApproved Reply
May 13, 2015 00:00

Hi Kelvin

Non module memory is the same width as the parameter memory (28 bits). So 4 bytes should be enough.

Regards

Miguel

wsaba Reply
May 14, 2015 00:00

When sending one word at a time do you have to send address:4/5 bytes, address:4/5 bytes, or can the second address be left out? Did you write a subfunction to execute each word write?

Kelvin-Shieh Reply
May 26, 2015 00:00

Hi Miguel,

Thanks, yes, 4 bytes works for Non module memory access.

Kelvin

Kelvin-Shieh Reply
May 26, 2015 00:00

You have to send "address"+4/5 bytes each time for a chunk of data -- That is what I did and it worked.

Kelvin

EZAdministrator Reply
Aug 2, 2018 00:00

This question has been assumed as answered either offline via email or with a multi-part answer. This question has now been closed out. If you have an inquiry related to this topic please post a new question in the applicable product forum.

Thank you,
EZ Admin