Can I dynamically change I2C master component data rate?

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
yaga_3967241
Level 3
Level 3
50 sign-ins 25 sign-ins 10 replies posted

Hi,

Is there a API or some way to change I2C master component data rate programmatically? We have one I2C master component, that connects to two I2C slave, with one slave needs 400k data rage, another I2C slave needs 50k data rate. How to use one I2C master to deal with this case?

Thanks,

Winston

0 Likes
1 Solution
Len_CONSULTRON
Level 9
Level 9
Beta tester 500 solutions authored 1000 replies posted

Winston,


Is there a API or some way to change I2C master component data rate programmatically? 


Theoretically: Yes.

Note the following schematic using a I2C Master (UDB) component:

Len_CONSULTRON_0-1629388509959.png

Clock_1 frequency can be altered programmatically (on-the-fly) by changing the Divider value 

Clock_1_SetDividerValue(new_value);

Therefore it is possible.

However, the practical problem you may have is that the slower I2C slave (@50K) may not process the I2C communication at the higher rate (@ 400K) when you are trying to communicate with the higher speed slave.

The worst-case event is that the slower slave will misinterpret command info at the higher data rate and get "confused".

The general practice for using one Master with multiple slaves at different data rates is to default to the lowest data rate.

Len
"Engineering is an Art. The Art of Compromise."

View solution in original post

2 Replies
Alakananda_BG
Moderator
Moderator
Moderator
50 likes received 250 sign-ins 250 replies posted

Hi @yaga_3967241 ,

You have to change the Fscb and high and low oversample correctly.

You can also use unconfigured SCB mode and playaround with clock settings

You can refer to the below link, Interface data rate configuration in page6

https://www.cypress.com/file/408071/download

Regards

 

Alakananda
0 Likes
Len_CONSULTRON
Level 9
Level 9
Beta tester 500 solutions authored 1000 replies posted

Winston,


Is there a API or some way to change I2C master component data rate programmatically? 


Theoretically: Yes.

Note the following schematic using a I2C Master (UDB) component:

Len_CONSULTRON_0-1629388509959.png

Clock_1 frequency can be altered programmatically (on-the-fly) by changing the Divider value 

Clock_1_SetDividerValue(new_value);

Therefore it is possible.

However, the practical problem you may have is that the slower I2C slave (@50K) may not process the I2C communication at the higher rate (@ 400K) when you are trying to communicate with the higher speed slave.

The worst-case event is that the slower slave will misinterpret command info at the higher data rate and get "confused".

The general practice for using one Master with multiple slaves at different data rates is to default to the lowest data rate.

Len
"Engineering is an Art. The Art of Compromise."