- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I need to change the I2C speed while running my program. For example first check on low-speed which slaves are present, and if these slaves are all high-speed I would like to use high speed for the further communication.
I do this by defining 2 I2C components (I2C_Slow and I2C_Fast) and multiplexing between them as indicated in "Figure 8 : I2C Bus Sharing". This example is for slaves but it also works for masters.
For the future, I would like to use a more flexible way to change the I2C speed of the master.
I cannot find and API to change to i2c rate. Am I overlooking it ? I did find the possibility to use external clocking but this seems rather complex.
I'm using PSOC5LP and PSOC Creator 3.3SP1 with I2C Version 3.5
Thanks
Patrick
Solved! Go to Solution.
- Labels:
-
PSoC 5LP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Patrick, I am afraid that the external clock will be the one and only solution, but it is probably not as complicated as you think. You may use a PWM to get clock divider between 2 and 255,
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Patrick, I am afraid that the external clock will be the one and only solution, but it is probably not as complicated as you think. You may use a PWM to get clock divider between 2 and 255,
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Ok, thanks. I'll give it a try. I also found the I2C_IntClock_SetDividerRegister function that I might give a try.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi, Patrick,
I did try I2C_IntClock_SetDividerRegister, it doesn't work for me, how about your side?
I did use CY_SET_REG8(CYDEV_CLKDIST_MSTR0,x), looks work.
Richard
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for the answer, Richard. I now closed that part of the software and kept it as is. As soon as I continue on that part, I'll share my results