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

Two ADAU1761 in one project, how to code and compile in C?

SigmaDSP & SigmaStudio Dany Aug 14, 2011 00:00 14 replies Original on forum ↗
Subscribe
Dany Question
Aug 14, 2011 00:00

Hello,

I have one project containing two ADAU1761; when I generate *.h header files from SigmaStudio, I get one set for IC1 and one set for IC2.

It goes in a much larger C-project with the main calling about 20 modules.

How would you code this:

- In one C-language program, as the symbols have the same name in the two sets of *.h files ?

- With two modules, called from main, I am afraid the the linker would claim errors with duplicate symbols.

I already checked :

Project ADAU1761_Demo

...which gave me a HW schematic with two such chips

and the discussion

"Using two SigmaDSP evaluation boards simultaneously with one USBi board"

with

1761AnalogIn-DigitalOut_1781DigitalIn-AnalogOut.dspproj

and the excellent PDF" SigmaStudio Basic uC Integration Tutorial"

...but none of these suggest how to steer the two chips in C-code.

Have an idea or example?

Thanks

Dany

Audio Signal Processors

SigmaDSP Audio Processors

adau1761

ADIApproved Reply
Aug 15, 2011 00:00

I'm not an expert on this, so I will forward the question to two of our software engineers who might be more familiar with this use case. They will post a response here shortly.

ADIApproved Reply
Aug 19, 2011 00:00

Hello,

The software team is making new IC-specific names for these definitions and this will be updated in the next release.

Dany Reply
Aug 19, 2011 00:00

Hello,

I appreciate the effort of easing the C-development of a microcontroller application for this very interesting ADAU1761!

The graphical development environment is really good!

When do you think that the next release could be due?

Thanks again

Dany

ADIApproved Reply
Aug 19, 2011 00:00

We typically release betas every two weeks or so. The most recent 3.5.3 was released a few days ago, so 3.5.4 (including these changes) should be out in approximately 1.5 weeks... perhaps 2 weeks.

Dany Reply
Oct 7, 2011 00:00

Hello,

The version SigmaStudio 3.5.4 BETA 64-Bit OS, with the promised corrections is still not available.

To increase my confidence I could go ahead and finish the design of the schematic and physical board with two ADAU1761's, and before I could continue programming my 32-bit microcontroller, I did this:

I wrote a Windows - command-line program in the C language to put a chip number on field and routine names SigmaDsp generates in all header and mode files.

I was succesful in that and now can compile without errors; this does not mean I lost hope to get a better release from ADI.

Thanks anyway for all the good work.

Best regards

ADIApproved Reply
Oct 19, 2011 00:00

Hi Dany,

This feature has been updated in SigmaStudio Beta 3.5.5. I attached an example project for your reference. The text "IC_1" and "IC_2" has been added to all definitions in each exported file. I included an example attachment.

Currently, this version is not appearing on the website. I will check with our web group about getting the website version updated as soon as possible.

Dany Reply
Oct 27, 2011 00:00

Hello Brett !

EXCELLENT !

..nice effort, but not perfect.

In the contribution to a better software, I allow myself to give you the following info:

1)

In the CRF2_IC_1.h file, go at the end where the default_download is, and see that the fields in bold and italic are not defined according to the IC number, while the real fields are!

The rest in the file is outstanding in terms of chip numbering!

SIGMA_WRITE_REGISTER_BLOCK( DEVICE_ADDR_IC_1, PROGRAM_ADDR, PROGRAM_SIZE, Program_Data_IC_1 );

SIGMA_WRITE_REGISTER_BLOCK( DEVICE_ADDR_IC_1, PARAM_ADDR, PARAM_SIZE, Param_Data_IC_1 );

2)

The mode file indexed 353 is of the Beta 3.5.3.

Now, I could have infulenced the register Byte names and the download function name by giving a header file with the chip number in it.

Now compare with the mode file Beta 355:

Still to be done : The device address "DEVICE_ADDR_" is still not indexed with the chip name.

REGRESSION : The memory addresses are now set to ZEROES ! This is important, and need to be corrected.

Brett, I would like to encourage the development person(s) to go on doing good work !

Best regards

Dany

ADIApproved Reply
Oct 27, 2011 00:00

Hi Dany,

I think the addresses are set to zero because you might not have compiled before clicking the export button. Can you please try again? First, Link-Compile-Download, and then click the Export System Files button.

Dany Reply
Oct 28, 2011 00:00

Hello Brett,

You are right, the addresses appreared when I did the right sequence of actions.

Sorry about the wrong point.

The other remarks are right, though.

Best regards

Dany

ADIApproved Reply
Oct 28, 2011 00:00

Got it! We're going to change this soon. We're also going to update the function calls to include the IC. That way, everything will be compatible with multiple IC systems.

For example...

default_download() will become default_download_IC1()

Dany Reply
Oct 30, 2011 00:00

Hello Brett,

This may be a long litany to our other readers, but I think that we all may be reaching an interesting goal "soon"!

The remaining points (other than the above ones that still need to be corrected) are:

Please check the two JPG files attached, you will see that all the black (REG) symbols are not found in the xxxx_IC_1_REG.h and xxxx_IC_2_REG.h files

Your programmer will see the difference.

Also, the NON_MODULO_xxx symbols do not match.

Thanks for effort!

Best regards

Dany

Dany Reply
Dec 16, 2011 00:00

Hello,

The release 3.5 ADI released December 6, 2011 did not resolve the problems discussed above.

The two series of errors still appear as shown in the message just above.

I do not see how one could compile and link a C-program running in a microcontroller driving two ADAU1761, as drawn in your drawing dating back from September 20, 2010, attached.

in the xxx_IC_2.h file:

Again, some register names got their ic names quite right as in here:

SIGMA_WRITE_REGISTER_BLOCK( DEVICE_ADDR_IC_2, REG_PLLCRLREGISTER_IC_2_ADDR, REG_PLLCRLREGISTER_IC_2_BYTE, R3_PLLCRLREGISTER_IC_2_Default );

As seen from the appended files in the message above, most of the errors are of that style, where the IC2_ is missing :

SIGMA_WRITE_REGISTER_BLOCK( DEVICE_ADDR_IC_2, REG_CRC_IDEAL_1_ADDR , R17_CRC_REGISTERS_IC_2_SIZE, R17_CRC_REGISTERS_IC_2_Default );

...and should be:

SIGMA_WRITE_REGISTER_BLOCK( DEVICE_ADDR_IC_2, REG_CRC_IDEAL_1_IC_2_ADDR , R17_CRC_REGISTERS_IC_2_SIZE, R17_CRC_REGISTERS_IC_2_Default );

...but the following line got its IC name wrong, to be corrected the other way:

SIGMA_WRITE_REGISTER_BLOCK( DEVICE_ADDR_IC_2, NON_MODULO_RAM_ADDRIC_2, NON_MODULO_RAM_SIZEIC_2, NON_MODULO_RAM_DataIC_2 );

No progress since then

Please comment

PS: Of course, I adapted my batch program mentioned Oct. 19th, so that I could compile right...

Keep the good work!

Regards

Dany

Dany Reply
Mar 10, 2012 00:00

Hello Brett and whole team!

I just tested version 3.6.2 of SigmaStudio, and -good news- I can now generate and compile for two ADAU1761 with correct header files!

All OK!

A big thanks to you and the whole team!
Greetings

Dany

ADIApproved Reply
Mar 14, 2012 00:00

Excellent! Thanks Dany!