Basic setup: ADZS SC589 mini Board Rev. 2.1, Cross Core Embedded 2.11.1 SHARC bare Metal Framework template project, without the Audio Project Fin setting, no FAUST, and SHARC core 1 in use only.
The audio block size is 32, the sample rate is 48kHz. The project has been run in a Debug configuration using the ICE 1000 emulator.
Problem: The audio framework does not successfully initialize due to the ADAU 1761 codec not initializing correctly (as far as I can tell).
During the ARM core startup process, and audio framework initialization, the ADAU1761 codec is initialized. The function in question is:
bool adau1761_set_samplerate(BM_ADAU_DEVICE *adau1761,
uint32_t sample_rate)
This function implementation is in the bm_adau_driver.c source file.
The specific block of code (below) is where the PLL is set and verified. The while loop used to find the PLL locked bit goes into an infinite loop, and the entire program
obviously hangs.
// 3. wait for PLL to lock
uint8_t addr[2], result[6], value = 0;
addr[0] = ADAU1761_REG_PLL_CONTROL_0 >> 8;
addr[1] = ADAU1761_REG_PLL_CONTROL_0 & 0xff;
while ((value & 0x2) == 0) {
twi_write_block_r(&adau1761->twi, addr, 2, true);
twi_read_block(&adau1761->twi, result, 6);
value = result[5];
}
Question: Why doesn't the PLL lock? I have successfully run the SAM audio starter, and the ADAU1761 codec seems to work fine. I am just not sure where the template SHARC bare metal framework is
missing some configuration files or if there is something wrong in the project setup. The logging is fine, and I have been able to pinpoint this area of code as an issue. I have thought about using the SAM audio starter project as a model for getting this to work, but I
was hoping that someone had a quick fix.
Any help would be appreciated!
Regards,
Chris
Type errors
[edited by: chlander73 at 6:48 PM (GMT -4) on 9 Sep 2023]