Hi All,
Has anyone successfully set this register with a value? I have tried all available means and still get random results.
First attempt was using the I2C_Setup structure as follows:
I2C_Setup I2Csetup = {
0, // 7 bit address mode
0x0000, // own address, dont care if master
104, // clkout value (Mhz), need to use the macro under Timing.c
400, // I2C clock rate, 10 to 400 KHz
0, // 8 bits/byte to be received or tansmitted
0, // DLB mode off, 1 = on
1 // FREE mode on, 0 = off
};
then calling
I2C_setup(&I2CSetup);
The prescaler is set to 8 which is correct, the i2cclkl is set to 0xF and I have seen values for i2cclkh as 0x08, 0x05, 0x04 and 0x01. Even with these values I get a consistent 800 ns high pulse width on the clock which is within the spec of the ADV7180 that I am trying to communicate with. No response from the chip even with a General Call.
So, I tried using the I2C_Config structure as follows:
I2C_Config I2Cconfig = {
0x0000, // I2COAR
0x0000, // I2CIER
0xFFFF, // I2CSTR
0x000F, // I2CCLKL
0x000F, // I2CCLKH
0x0001, // I2CCNT
0x0000, // I2CSAR
0x4620, // I2CMDR
0xFFFF, // I2CISRC
0x0008 // I2CPSC
};
with a call to
I2C_config(&I2Cconfig);
Same result when reading the config. Clkh is one of the 4 values listed above.
So, next I try setting the registers directly after the call to I2C_config.
I2C_RSET(I2CMDR, 0x4600);
I2C_RSET(I2CCLKL, 0x1F);
I2C_RSET(I2CCLKH, 0x1F);
I2C_RSET(I2CMDR, 0x4620);
Same result.
Any ideas other than what I have tried so far? Am I doing something out of sequence?
Thanks,
Jim