2018-03-01 01:25 PM
Hi everybody, I would require some help on an I2C link between TSL2591 and my nucleo nano F303K8T6.
I did it working well on the mbed website TSL2591_F3, but I want to use SW4STM32 environment and also CUBEMX.
Using my scope I can see that on in mbed configuration that I have I2S clk and data that can be decoded :
but when I use my code ( was working fine on e stm32F411re ), I get this signal :
I kept the same time base to show you the speed difference.
I generate my project using cubemx and in the system clock configuration, I have this config :
In the top right corner I can see the I2C clock speed at 8MHz, I would like to change it but I do not find any solution to reach 100kHz.
Can I get the system clock configuration from mbed at any way ?
Thanks for your help.
Baptiste
Well, after a lot of investigation, I had a look at the nucleo f303K8T6 schematic. This board is delivered with straps between I2C and SPI signals, the after removing it, it worked well.
#stm32f303k8t6 #i2c #speed2018-03-01 02:06 PM
>>
Can I get the system clock configuration from mbed at any way ?
If you can read memory, read the peripheral register content and print it out.
2018-03-01 02:37 PM
In CubeMx be sure to go over to the 'Configuration' tab and then select I2C from the peripherals. In there you can set the clock speed. By default it should be prescaling the 8MHz clock down to operate the I2C bus at 100kHz.
As stated above, dump out the registers and look up their values in the Reference Manual to confirm what settings you really have on your board.
2018-03-02 01:46 AM
Hi, I moved forward on this problem. I forgot to mention that I also use a SPI link at a 2MHz. I changed the SPI link speed to 100kHz, then I got the I2C link moving from 2MHz to 100Khz. Well that is fine, but the polarity of the signals are not the same in spi and I2C. so If I have spi working, I2C will not work... I tried to to make a spi init before use spi, then a I2C init before using I2C in my while loop. But It still do not write the good I2C data on the line.