cancel
Showing results for 
Search instead for 
Did you mean: 

I²C on STM32C011 using PC14 (SDA) not working

jack_daniels
Associate

Hello,

I am working on an STM32C011 (Nucleo-like custom board) and trying to use I2C1 with the following pinout:

  • PB7 → I2C1_SCL (AF14)

  • PC14 → I2C1_SDA (AF14)

According to the reference manual / datasheet, PC14 can be mapped as I2C1_SDA (AF14).
I connected an SHTC3 humidity/temperature sensor (address 0x70) to these lines with 4.7k pull-ups.

Problem:

  • My I²C scanner code never detects the SHTC3 (always NACK at 0x70).

  • If I configure I²C on PB6/PB7 instead, the scanner works.

  • GPIO PC14 seems not to toggle as SDA when I try transactions.

I suspect this might be related to PC14 also being used for LSE (OSC32_IN). In CubeMX, I set LSE = Disabled under RCC.
But I still wonder if PC14 can reliably be used for I²C, or if there are silicon limitations when LSE is involved.

Questions:

  1. Is PC14 fully usable as I²C SDA on STM32C0 when LSE is disabled?

  2. Has anyone successfully used I²C1 on PB7 (SCL) + PC14 (SDA)?

  3. Could this be a hardware limitation / errata, or am I missing a CubeMX clock configuration detail?

Any feedback or working examples would be greatly appreciated 

4 REPLIES 4
TDK
Super User

Configure PC14 as a GPIO output and toggle it. Do you see the signal on a scope?

 

If you feel a post has answered your question, please click "Accept as Solution".

Yes if PC14 configured as GPIO output and if it is toggled , i see the signal

Andrew Neil
Super User

@jack_daniels wrote:

custom board 


So please show your schematic

How to write your question to maximize your chances to find a solution

A complex system that works is invariably found to have evolved from a simple system that worked.
A complex system designed from scratch never works and cannot be patched up to make it work.
STOne-32
ST Employee

Dear @jack_daniels ,

Can you please share the Firmware code generated for the AF14 selection and the Ports Clock Activation ( C and B)  .  it might be an issue on the Code Generation .  Go to file stm32c0xx-hal_msp.c to check it ?

Thank you

STOne-32.