I built a custom board around a XUE216 chip, a good part of the design is based on the reference designs for the same chip. I have the same PLL (CS2100) for the low jitter clock as on the microphone array dev board. it's programmed via I2C, and it's connected to a 4bit port on the chip ( see schematic ). My problem is when I I try to program the chip, it never works. I only get NACKs back. The signal looks good, within the requirements of the chip, the address looks good and still it never responds. I don't know what I'm doing wrong, my code is similar to the one from the examples.. Any help is appreciated, I've attached a scope view as well as schematics.
Thank you!
Fabien.
I2C init call
Code: Select all
//I2C configuration
port p_i2c = XS1_PORT_4A;
i2c_master_if i2c[1];
par
{
i2c_master_single_port(i2c, 1, p_i2c, 80, 0, 1, 0xc);
configure_pll(i2c[0]);
}
Code: Select all
void configure_pll(client i2c_master_if i2c)
{
unsigned int delay_in_ms = 500;
i2c_regop_res_t ret;
uint8_t cs2100_regAdd[5] = {0x02, 0x03, 0x05, 0x17, 0x02};
uint8_t cs2100_regVal[5] = {0x01, 0x00, 0x00, 0x10, 0x00};
uint8_t pll_address_w = 0x9c>>1; //device address is 100111 | 0 | 0 <- AD0 value and last zero for write mode. Not sure why I need to shift it to get the right address out...
for(int i = 0; i < 5; i++)
{
ret = i2c.write_reg(pll_address_w, cs2100_regAdd[i], cs2100_regVal[i]);
if(I2C_REGOP_SUCCESS == ret)
printf("success: %d \n", ret);
else if(I2C_REGOP_DEVICE_NACK == ret)
printf("NACK: %d \n", ret);
else
printf("incomplete: %d\n", ret);
}
}