-
Notifications
You must be signed in to change notification settings - Fork 857
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
nucleo-l432kc, nucleo-l031k6, nucleo-f722ze seemingly lack the ability to change I2C frequency #2311
Comments
@kenbell I was looking at this briefly, and saw that we are using some constant values based on clock speed generated by STM32CubeMX. We could keep doing this as an interim solution if we can also generate those 4 values for the typical standard and fast mode speeds for each of the boards this is currently being used for. I was looking at STM32CubeMX but it was not immediately obvious how to regenerate those values. Could you show me how you did that and/or help out to generate values for the various |
@deadprogram you first have to set the peripheral clock to the correct MHz in the 'Clock Configuration' tab. For L432, it's this (80MHz on PCLK1): Resolve the clock configuration. Then enable I2C1 peripheral, you'll now see in gray the magic value in the 'timing' setting (0x10909CEC in this case for 100kHz standard mode): |
Thanks @kenbell that is exactly what I was looking for. PR coming later. |
This was released with |
For both of these boards there are consts for TWI_FREQ, however the I2CConfig type has no Frequency field and thus it is not apparent how to configure bus speed for I2C.
https://tinygo.org/docs/reference/microcontrollers/machine/nucleo-l432kc/
https://tinygo.org/docs/reference/microcontrollers/machine/nucleo-l031k6/
https://tinygo.org/docs/reference/microcontrollers/machine/nucleo-f722ze
Thank you for your consideration of this fix/enhancement.
The text was updated successfully, but these errors were encountered: