cancel
Showing results for 
Search instead for 
Did you mean: 

PSoC 5, 3 & 1

yaga_3967241
New Contributor II

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
Honored Contributor II

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

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
Honored Contributor II

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