For example that default_download which is run from my stm32 excatly does this confirguration command for power clocking, in this case things need to be ok in relation to that input0 and output0, booth is enable, but still adau do not sends any pulse
See capture window, excatly tha same 1d11 command bytes as like from default_download. Migh be that my adau is broken, all is possible! Adau on my pcb is at center between all 3 comtrue ic, all 3 comtrue died and I replaced them but I didn't replaced adau since i2c comunicatio with them is ok, and also no short circuits as like on all 3 comtrue was.
See capture window, excatly tha same 1d11 command bytes as like from default_download. Migh be that my adau is broken, all is possible! Adau on my pcb is at center between all 3 comtrue ic, all 3 comtrue died and I replaced them but I didn't replaced adau since i2c comunicatio with them is ok, and also no short circuits as like on all 3 comtrue was.
Attachments
Yes, right, thanks, I will definitelly need to solder ipex and connect USBi somehow, without it the only gues can be done without any progress
It's hard for me to give a precise answer. Your master clock frequency is 12.88 MHz, but you work at a sampling frequency of 48 kHz. If your master clock was 12 MHz, then we can say for sure that ASRC would not be needed.
Just replaced adau, the same thing no output, so this is definitelly unrelated to hw but software isue on adau. Measured master clock again by osciloscope, its present there, 12.288MHz. Verified input, lrck=48kHz, bclk is 3.xxMHz, and data line ok too. No output from adau. Things goes hard since stm32 is master i2c and if I add USBi i2c there probably will be problem because of two master devices at the same time, I will need to remove stm32 but in that case I don't know how to test adau since only sigma studio will be available on i2c, Don't know what to do, seems dead project. The main problem is I'm using adau for the first time.
What happen on your project when you click "compile and download" in sigma studio, does adau start sound imediatelly or you need to adjust something further after "compile and download" ?
If everything is correct in the project, then adau starts working as it is supposed to by the project.What happen on your project when you click "compile and download" in sigma studio, does adau start sound imediatelly or you need to adjust something further after "compile and download" ?
Search the network for projects for stm32 that simulate the work of USBi, i.e. allow Sigma Studio to work with ADAU via stm32.Things goes hard since stm32 is master i2c and if I add USBi i2c there probably will be problem because of two master devices at the same time, I will need to remove stm32 but in that case I don't know how to test adau since only sigma studio will be available on i2c, Don't know what to do, seems dead project.
I will do i2c deinit on stm32 and put i2c pins as a input so that after stm32 on boot initialise all i2c devices free i2c function so that it is now suitable for USBi otherwise two master devices can't work at the same time. Found some solutions on the net -> https://ez.analog.com/dsp/sigmadsp/f/q-a/65983/specifications-for-sigma_write_delay-function in relation to default_download (see post 3) , tried solution 2 (without self boot) by commenting out some lines from default_download function but neither helped. I'm believing sigma studio steals some usb writes so that it is not shown in the capture window of the sigma studio, all is possible otherwise things is all the same, for example aaaaaaaa is packets from capture log and bbbbbbbbbb is capture from default_download, things is 100% identic, so I do not see reason why uploading things from i2c from stm32 can't work, it must be something tricky from sigma studio for example some commands is hidden and not shown in capture window nor in exported header files?
When I do i2c hack and somehow connect USBi I will do usb packet capture in case things start to work when using USBi and we will know if sigma studio steal something!
This is my lrck pulses, till before adau inputs, nice squares, wth is going on with adau! I'm shocked that an simple thing is now night mare!
When I do i2c hack and somehow connect USBi I will do usb packet capture in case things start to work when using USBi and we will know if sigma studio steal something!
This is my lrck pulses, till before adau inputs, nice squares, wth is going on with adau! I'm shocked that an simple thing is now night mare!
Attachments
Last edited:
I didn't even notice that these were the asrc buttons, I thought they were some cubes, only when I click on the cube does the asrc configuration window open! Could that have been the problem? It seems to me that everything has to go through asrc? What need to select on the right side inside serial output ports configuration?
Attachments
Until you get feedback from ADAU, you will be walking in the dark and guessing on coffee grounds. During this time of guessing, you could have already connected USBi to adau.
You can take a look at the settings of ASRC in my project.
You can take a look at the settings of ASRC in my project.
Do you have successful PLL lock? According to datasheet (Rev. C page 24, Power-up sequence) all further write attempts to control port will fail until PLL is locked. Should be relatively easy to check with STM32 using I2C: just write to registers 0xf000-0xf003 and read result from 0xf004.Unable to get adau1462 working, tested i2s input and it makes pulse, pulse goes to the adau1465 but on their output there is nothing.
I.m started debuging it, now I have debuged panic code, this is a result:
This is what say uart
Panic code: 00 00
Realy strance, no panic code, seems everything is ok but still no pulses at adau out, must be something misconfigured in relation to input-output in sigma studio.
PHP:
default_download_IC_1(); // DSP initialisation
HAL_Delay(100);
uint8_t nn[2] = {0xf4, 0x28};
HAL_I2C_Master_Transmit(&hi2c1, 0x70, nn, 2, 500);
HAL_I2C_Master_Receive(&hi2c1, 0x71, nn, 2, 500);
char bufercic[64];
snprintf(bufercic, 64, "Panic code: %02X %02X\r\n", nn[0], nn[1]);
UART_TX(bufercic, strlen(bufercic));
This is what say uart
Panic code: 00 00
Realy strance, no panic code, seems everything is ok but still no pulses at adau out, must be something misconfigured in relation to input-output in sigma studio.
PHP:
default_download_IC_1(); // DSP initialisation
HAL_Delay(100);
uint8_t nn[2] = {0xf4, 0x28};
HAL_I2C_Master_Transmit(&hi2c1, 0x70, nn, 2, 500);
HAL_I2C_Master_Receive(&hi2c1, 0x71, nn, 2, 500);
char bufercic[64];
snprintf(bufercic, 64, "Panic code: %02X %02X\r\n", nn[0], nn[1]);
UART_TX(bufercic, strlen(bufercic));
nn[0] = 0xf0; nn[1] = 0x04;
HAL_I2C_Master_Transmit(&hi2c1, 0x70, nn, 2, 500);
HAL_I2C_Master_Receive(&hi2c1, 0x71, nn, 2, 500);
snprintf(bufercic, 64, "PLL lock: %02X %02X\r\n", nn[0], nn[1]);
UART_TX(bufercic, strlen(bufercic));
Panic code: 00 00
PLL lock: 00 00
Searching for I2C devices on the bus...
Device found: 0x24
Device found: 0x26
Device found: 0x28
Device found: 0x70
Device found: 0xC0
Total found devices: 5
I2c address 0x70 is our dsp!
Attachments
Last edited:
Looks like PLL lock is no lock, at least bit0 is zero, that mean unlocked, hmm but why, misconfiguration somewhere in sigma studio? I'm checked mclk, it has 12.288MHz stable, as all two comtrue is working ok which uses the same mclk
Can I poll register 0xf004 with i2c read during default_download?
Can I poll register 0xf004 with i2c read during default_download?
Interesting is that even this way while adding error check for i2c, i2c tells that i2c have comunication and no error in read-write!
PHP:
HAL_StatusTypeDef status;
char bufercic[64];
HAL_Delay(100);
uint8_t nn[2] = {0xf4, 0x28};
status = HAL_I2C_Master_Transmit(&hi2c1, 0x70, nn, 2, 500);
if(HAL_OK == status)
{
status = HAL_I2C_Master_Receive(&hi2c1, 0x71, nn, 2, 500);
if (HAL_OK == status)
{
snprintf(bufercic, 64, "0xF428 Panic code: %02X %02X\r\n", nn[0], nn[1]);
UART_TX(bufercic, strlen(bufercic));
}
else
{
snprintf(bufercic, 64, "error2!\r\n");
UART_TX(bufercic, strlen(bufercic));
}
}
else
{
snprintf(bufercic, 64, "error!\r\n");
UART_TX(bufercic, strlen(bufercic));
}
I2c communication have no chance to tolerate any error because error_handler restarts stm32 and I see led status when error and when no error, this is how I have doing i2c function:
But looks like all dsp registers is zero! Looks like nothing is written to dsp! DSP is in read only mode?? Why is that I realy have no idea, very strange situation!
PHP:
void SIGMA_WRITE_REGISTER_BLOCK(uint8_t addr, uint16_t regAddr, uint16_t length, uint8_t *value)
{
HAL_StatusTypeDef status;
uint8_t timeout = 0;
uint8_t rr[2];
rr[0] = (regAddr >> 8) & 0xff;
rr[1] = regAddr & 0xff;
while(1)
{
status = HAL_I2C_IsDeviceReady(&hi2c1, addr, 3, 500);
if (HAL_BUSY == status)
{
// 1.5 seccond timeout
if (timeout == 3)
{
Error_Handler();
return;
}
timeout++;
continue;
}
if (HAL_ERROR == status || HAL_TIMEOUT == status)
{
Error_Handler();
return;
}
if (HAL_OK == status)
{
if (HAL_OK != HAL_I2C_Master_Transmit(&hi2c1, addr, rr, 2, 500))
{
Error_Handler();
return;
}
if (HAL_OK != HAL_I2C_Master_Transmit(&hi2c1, addr, value, length, 2000))
{
Error_Handler();
return;
}
}
else
{
Error_Handler();
return;
}
break;
}
}
PHP:
void Error_Handler(void)
{
HAL_NVIC_SystemReset();
}
But looks like all dsp registers is zero! Looks like nothing is written to dsp! DSP is in read only mode?? Why is that I realy have no idea, very strange situation!
Last edited:
Might be here something missing?
The first step which I do is DSP_RES high, that put dsp to ON mode, after some moments I''m doing reset cycle, DSP_RES low than 20ms than DSP_RES high, than function default_download to write-fill the dsp registers, no errors in i2c communication at all! After that if you can see whatewer I read from dsp it returns zero, still no errors in i2c communication at all, realy crazy! I'm measured all voltages, 3.3V=ok, 1.2V +-5% = 1.15V = ok, so everything seems ok.
The first step which I do is DSP_RES high, that put dsp to ON mode, after some moments I''m doing reset cycle, DSP_RES low than 20ms than DSP_RES high, than function default_download to write-fill the dsp registers, no errors in i2c communication at all! After that if you can see whatewer I read from dsp it returns zero, still no errors in i2c communication at all, realy crazy! I'm measured all voltages, 3.3V=ok, 1.2V +-5% = 1.15V = ok, so everything seems ok.
Last edited:
As I said according to datasheet that is to be expected if PLL lock fails (see attachment).Looks like nothing is written to dsp!
According to datasheet this is what you should probably write to PLL registers:
0x02 -> 0xF001 (divide by 4)
0x00 -> 0xF002 (clock from XTALIN)
0x01 -> 0xF003 (enable)
I'm not sure what to write to 0xF000.
Attachments
Allready done trought default_download function which is generated trought sigma studio, see:
Code:
addr: 0x70, regAddr: 0xF400, len: 0x2, values: { 0x00, 0x00 }
addr: 0x70, regAddr: 0xF400, len: 0x2, values: { 0x00, 0x01 }
waiting 5312 us
addr: 0x70, regAddr: 0xF403, len: 0x2, values: { 0x00, 0x00 }
addr: 0x70, regAddr: 0xF403, len: 0x2, values: { 0x00, 0x01 }
addr: 0x70, regAddr: 0xF003, len: 0x2, values: { 0x00, 0x00 }
addr: 0x70, regAddr: 0xF001, len: 0x2, values: { 0x00, 0x02 }
addr: 0x70, regAddr: 0xF002, len: 0x2, values: { 0x00, 0x00 }
addr: 0x70, regAddr: 0xF005, len: 0x2, values: { 0x00, 0x01 }
addr: 0x70, regAddr: 0xF003, len: 0x2, values: { 0x00, 0x01 }
waiting 5312 us
Last edited:
- Home
- Amplifiers
- Class D
- Direct Digital Power DAC (DDPD)