Page 1 of 1
i2cv1 or i2cv2 ?
Posted: Mon Nov 25, 2013 8:19 am
by enly1
Just a quick question as I've been struggling to work out timing values for 72Mhz sysclock on a STM32f3discovery board.
What is the difference between I2Cv1 and I2Cv2 hal drivers ?
One configures speed and the like using simple directives and the other hardcodes the timing register ( amoungst other differences
Can either be used / which is best to be using.
I've seen comments in CH3 about issues on I2Cv1, so assume its still current.
Please advise.
Thanks
Re: i2cv1 or i2cv2 ?
Posted: Mon Nov 25, 2013 8:22 am
by enly1
Also, am I the only one having issues getting the excel spreadsheet from STM for the I2C Configuration calculations working ?
Macros enabled but sheet just protected and non-editable on the settings on 2010.
I wasn't expecting to have to debug excel as well

Re: i2cv1 or i2cv2 ?
Posted: Mon Nov 25, 2013 9:19 am
by Giovanni
I2Cv1 is for F1, F2, F4, L1.
I2Cv2 is for F0 and F3.
The settings are very critical and reading the reference manual is required, there is a table with all values. You may also try the settings in the I2C F373 demo.
I don't know about the spreadsheet

Giovanni
Re: i2cv1 or i2cv2 ?
Posted: Mon Nov 25, 2013 11:06 am
by enly1
Thanks - understand now.
The settings I know are critical

, which is why ive been trying to understand where they came from as my sample value plugged in didn't analyse correctly at a 16Mhz.
Just one final Chibios related question - for the F3 devices, can you confirm that the I2C bus is run at SYSCLOCK and SYSCLOCK is linked to PLL and therefore running at 72Mhz and not 8Mhz from HCI ( think I tracked that down in the headers )
The spreadsheet seems to be limited to just my dev laptop as it works fine on other machines I have.

Re: i2cv1 or i2cv2 ?
Posted: Mon Nov 25, 2013 11:32 am
by Giovanni
The clock source depends on settings in mcuconf.h, the default is from PLL.
Giovanni