2020-11-05 08:09 AM
Hello,
I would like to implement an I2C master on an STM32F103. It's pretty straightforward to select the IO's using cubeMX and to generate the code, but I don't want to use either of the available pins for I2C (PB7,PB6 or PB9,PB8). I need to use PB5 as SDA and PB4 as SCK. Is there a way to do this in cudeMX/cubeIDE without writing a custom I2C ?
Regards,
Mawaba.
Solved! Go to Solution.
2020-11-05 08:22 AM
No, this is not possible. In your case (I2C1) only the pins you mentioned can be selected.
BTW: with I2C2 you only have two pins, i.e. no alternatives.
When your question is answered, please close this topic by choosing Select as Best.
Good luck!
/Peter
2020-11-05 08:22 AM
No, this is not possible. In your case (I2C1) only the pins you mentioned can be selected.
BTW: with I2C2 you only have two pins, i.e. no alternatives.
When your question is answered, please close this topic by choosing Select as Best.
Good luck!
/Peter
2020-11-05 09:06 AM
Hello @Peter BENSCH ,
Thanks for the reply. I have a board here that is doing I2C on the same chip using PB5 & PB4. I do not have the source code and so I am trying to figure out how this could have been done.
Regards,
Mawaba.
2020-11-09 08:22 AM
Hello @Peter BENSCH ,
Could I use those pins if I bit-banged I2C? If so are there any examples of i2c bitbanging for this chip?
Regards,
Mawaba.