6 posts / 0 new
Last post
yterasaki
Offline
Last seen:4 years 7 months ago
Joined:2015-05-08 09:28
I2C clock

Hi Dialog,

I'd like to ask some questions about I2C clock (SCL).
Q1: SCL is automatically generated when the user writes the I2C register to download the FW code from EEPROM?
Q2: In the idle state, SCL output is kept HiZ? (because this pin is open drain buffer)
Q3: When user excutes i2c_eeprom_release(), SCL is also kept as HiZ?
void i2c_eeprom_release(void)
{
SetWord16(I2C_ENABLE_REG, 0x0); // Disable the I2C controller
SetBits16(CLK_PER_REG, I2C_ENABLE, 0); // Disable clock for I2C
}

Best Regards,
yukio

Device:
MT_dialog
Offline
Last seen:1 month 2 weeks ago
Staff
Joined:2015-06-08 11:34
Hi yterasaki,

Hi yterasaki,

1.sci的时钟是尽快开始生成condition is met from the master.

2. When the bus is idle both the SCL and SDA signals are pulled high through external pull-up resistors on the bus.

3. When the user executes the release command the clock is disabled and both line return to high from the pull-ups.

Thanks MT_dialog

yterasaki
Offline
Last seen:4 years 7 months ago
Joined:2015-05-08 09:28
Thanks Dialog staff,

Thanks Dialog staff,

I understand your comment and most of my concerns are solved, but please let me ask one more question.
I observed sleep current is more than specification and found leak current is running into the SCL pin through the pull up
resistor. (Source code is reference design of Beacon 3.40.6, I didn't change any code) This is because SCL pin is re-configured
as "input with pull down" after FW code is downloaded from I2C EEPROM.

My question is when the SCL configuration is changed from output buffer (SCL) to input buffer. I think two possibilities, namely
1: HW or software reset initialised pin configuration (initial pin config is input with pulldown)
2: ROM? or boot loader? reconfigure the pin during completion of FW download and main_func() starts to execute.
I coudn't find the code which does neither above 1 nor 2.

Best Regards,

MT_dialog
Offline
Last seen:1 month 2 weeks ago
Staff
Joined:2015-06-08 11:34
Hi yterasaki,

Hi yterasaki,

The bootloader and the secondary bootloader when booting via I2C sets your SCL_PIN in INPUT_PULLDOWN state after reading the binary from the memory and starts your application.

Thanks MT_dialog

yterasaki
Offline
Last seen:4 years 7 months ago
Joined:2015-05-08 09:28
Thanks Dialog staff,

Thanks Dialog staff, everything is clear. maybe reference code is changed to reconfigure the SCL pin as output or input with pullup
after starting code so that sleep current keeps small.

Best Regards,

MT_dialog
Offline
Last seen:1 month 2 weeks ago
Staff
Joined:2015-06-08 11:34
Hi yterasaki,

Hi yterasaki,

Yes, i believe you can do that. Just configure your GPIO to the state you want when your FW starts.

Thanks MT_dialog