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

Boot DSP

SigmaDSP & SigmaStudio hjelveh Sep 16, 2014 00:00 7 replies Original on forum ↗
Subscribe
hjelveh Question
Sep 16, 2014 00:00

Hi

I am using ADAU1761 and our design is working as expected in Sigmastudio. Now, I want to boot the DSP from MCU.

I have exported all the necessary files from sigmastudio and integrated to our MCU SW.

I use I2C and checked that data sent from MCU to DSP is correct. I am able to execute default_download_IC_1 fuction and send successfully both Progam and parameter data to DSP. Every things seems to be working, but nothing happen, after default_download_IC_1function is executed.

I have included a sine tone in the design, so I expect that I have a tone out after the default_download_IC_1 is executed

I don’t have any idea about what can be wrong!

Audio Signal Processors

SigmaDSP Audio Processors

adau1761

hjelveh Reply
Sep 16, 2014 00:00

Please find attached the generated file by sigmatudio.

The below function is called five times? Is it something wrong?

SIGMA_WRITE_REGISTER_BLOCK( DEVICE_ADDR_IC_1, PROGRAM_ADDR_IC_1, PROGRAM_SIZE_IC_1, Program_Data_IC_1 );

hjelveh Reply
Sep 18, 2014 00:00

The project file attached for your reference.

ADIApproved Reply
Sep 19, 2014 00:00

HI:

A common problem in some designs is that the uC is not waiting long enough for the PLL to lock. Can you look into this? SigmaStudio uses the USBi and the USBi is not the fastest device to write either I2C or SPI and therefore it adds some delay. This delay is convenient when trying to lock the PLL. We have also added some delays in some of our sequences to compensate for that.

Regards

Miguel

JohnTo Reply
Sep 19, 2014 00:00

Hello Hossein,

Miguel brings up a good point. Can you try to hold off the I2C or SPI accesses in the download function while waiting for the PLL to lock? Refer to theSigmaStudioFW.h (included in the SIgmaStudio installation path) which should also be included in the host MCU project. This file contains the two write macro fuctions you need to dowload the code/parameter data into the DSP using the default_download() function. In this file we need to write the host micro code for the SIGMA_WRITE_REGISTER_BLOCK() and SIGMA_WRITE_DELAY () functions.

Here is a small reference example which was used to initialze the ADAU1761 eval board using a ST STM32F10x host MCU in I2C mode, which shows the I2C transfer and delay function, which is just a simple for{} loop to create the delay.

void SIGMA_WRITE_REGISTER_BLOCK(int devAddress, int address, int length, ADI_REG_TYPE *pData )
{

int ii = 0;
int zz = 0;
Tx_Idx = 0;

/*----- Transmission Phase -----*/
ThisBufferSize = Address_Length + length;

I2C1_Buffer_Tx[0] = (address & 0xFF00)>>8;
I2C1_Buffer_Tx[1] = address & 0x00FF;

for(zz=0;zz<length;zz++)
{
I2C1_Buffer_Tx [zz + Address_Length] = pData[zz];
}
Tx_Idx = 0;
for(ii =0;ii < ThisBufferSize;ii++)
{

NextBufferEnd = ThisBufferSize;//I2C1_numbytes[ii];
if(ii == 0) I2C_GenerateSTART(I2C1, ENABLE);
/* Send data */
while(Tx_Idx < NextBufferEnd)
{

}

}
}

void SIGMA_WRITE_DELAY(int devAddress, int length, ADI_REG_TYPE *pData )
{
int nCount=0;
//nCount=0xFFFFFF;
//nCount=0x15752A00; //5 secs approx
//nCount=0x05F5E100; //5 secs approx
nCount=0xFFFFF;
for(; nCount != 0; nCount--);

}

Inside of your default_download() function (located in your xxx_IC1_1.h file) you can add the delay function right after programming the PLLCTRLREGISTER.

void default_download() {

SIGMA_WRITE_REGISTER_BLOCK( DEVICE_ADDR_IC_1, REG_SAMPLE_RATE_SETTING_ADDR, REG_SAMPLE_RATE_SETTING_BYTE, R0_SAMPLE_RATE_SETTING_Default );

SIGMA_WRITE_REGISTER_BLOCK( DEVICE_ADDR_IC_1, REG_DSP_RUN_REGISTER_ADDR, REG_DSP_RUN_REGISTER_BYTE, R1_DSP_RUN_REGISTER_Default );

SIGMA_WRITE_REGISTER_BLOCK( DEVICE_ADDR_IC_1, REG_CLKCTRLREGISTER_ADDR, REG_CLKCTRLREGISTER_BYTE, R2_CLKCTRLREGISTER_Default );

SIGMA_WRITE_REGISTER_BLOCK( DEVICE_ADDR_IC_1, REG_PLLCRLREGISTER_ADDR, REG_PLLCRLREGISTER_BYTE, R3_PLLCRLREGISTER_Default );

SIGMA_WRITE_DELAY( DEVICE_ADDR_IC_1, R4_DELAY_SIZE, R4_DELAY_Default );

SIGMA_WRITE_REGISTER_BLOCK( DEVICE_ADDR_IC_1, REG_SERIAL_PORT_CONTROL_0_ADDR , R5_SERIAL_PORT_CONTROL_REGISTERS_SIZE, R5_SERIAL_PORT_CONTROL_REGISTERS_Default );

SIGMA_WRITE_REGISTER_BLOCK( DEVICE_ADDR_IC_1, REG_ALC_CONTROL_0_ADDR ,

(...) ...

-JT

JohnTo Reply
Sep 19, 2014 00:00

Sorry, I just realized that the SIGMA_WRITE_DELAY() call is already included in the auto-generated ADAU1761 default_download() function after the PLL register is programmed. Perhaps try to add a longer delay time. Are you able to read any of the on-chip registers?

-JT

hjelveh Reply
Sep 21, 2014 00:00

Thank you very much for your comments, Miguel and John.

I have added some delays and tried with different delay time, but it doesn't help.

I have noticed that SigmaStudio generates different functions when using "export system files" compare to what is displayed in the capture window. the attached file shows what is displayed in the capture window.

With the "export system files", the five following fuctions are called.

SIGMA_WRITE_REGISTER_BLOCK( DEVICE_ADDR_IC_1, PROGRAM_ADDR_IC_1, PROGRAM_SIZE_IC_1, Program_Data_IC_1 );

SIGMA_WRITE_REGISTER_BLOCK( DEVICE_ADDR_IC_1, PROGRAM_ADDR_IC_1, PROGRAM_SIZE_IC_1, Program_Data_IC_1 );

SIGMA_WRITE_REGISTER_BLOCK( DEVICE_ADDR_IC_1, PROGRAM_ADDR_IC_1, PROGRAM_SIZE_IC_1, Program_Data_IC_1 );

SIGMA_WRITE_REGISTER_BLOCK( DEVICE_ADDR_IC_1, PROGRAM_ADDR_IC_1, PROGRAM_SIZE_IC_1, Program_Data_IC_1 );

SIGMA_WRITE_REGISTER_BLOCK( DEVICE_ADDR_IC_1, PROGRAM_ADDR_IC_1, PROGRAM_SIZE_IC_1, Program_Data_IC_1 );

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