Skip to main content
RShiv.1
Associate III
November 18, 2022
Solved

I2C not working with STM32F103C6 and STM32F103C8

we have been trying to get the I2C up on both the controller and no responses from anyone the cubeMx issue if I2C is really a problem..Kindly respond as we are trying to get I2C up ..

requesting the experience forum experts to respond.

Thanks

Ravi

This topic has been closed for replies.
AScha.3
AScha.3Best answer
Super User
November 25, 2022

from the ds you posted, i cannot say, what to do better.

now lets stop  to play blind cow . :)

so look, what drivers exist and learn/copy from them :

here sensirion gives driver for their sensor:

https://github.com/Sensirion/embedded-i2c-scd30

and many others...(also in c++, rust etc.)

https://github.com/paulvha/scd30

https://github.com/sparkfun/SparkFun_SCD30_Arduino_Library

https://github.com/RequestForCoffee/scd30

https://github.com/adafruit/Adafruit_SCD30

https://github.com/Seeed-Studio/Seeed_SCD30

https://github.com/watterott/CO2-Ampel

https://github.com/sinewave-ee/scd30-rs

the driver by sensirion should show you, what to do.

If you feel a post has answered your question, please click on " Best Answer ".

63 replies

RShiv.1
RShiv.1Author
Associate III
November 24, 2022

added the code for reference

RShiv.1
RShiv.1Author
Associate III
November 24, 2022

when there are no values and printing only dddd..I used to do the power cycle and then get the version number properly...but here I am not seeing any values.....let me know any change...thanks

RShiv.1
RShiv.1Author
Associate III
November 24, 2022

I was referring to my earlier code when I had the version number print ON

AScha.3
Super User
November 24, 2022

Oo, sensor want/need crc byte also... ****.

If you feel a post has answered your question, please click on " Best Answer ".
RShiv.1
RShiv.1Author
Associate III
November 24, 2022

I thought initially...but in my earlier I used to get the version number fine without sending 0xC2 as the CRC...well...let me know the change..so that I will try making here...just at the start we shall add or for every SCD30_cnt_measurement[0] = 0xC2 buffer value??

RShiv.1
RShiv.1Author
Associate III
November 24, 2022

SCD30_cnt_measurement[0]=0xC2;

  SCD30_cnt_measurement[1]=0x00;

  SCD30_cnt_measurement[2]=0x10;

  SCD30_cnt_measurement[3]=0x04; //0x400 = 1020 mbar

  SCD30_cnt_measurement[4]=0x00;

is this the change you are referring??

RShiv.1
RShiv.1Author
Associate III
November 24, 2022

code reference to check version number also..

0693W00000WJQlnQAH.png 

..I have added different pattern like..sending stop bit first ..then soft reset..then 2s interval..then firmware...then start...then get ready ...then read....is this pattern correct..do we need to follow this...comparing this with workiing Rpi model we have...let me know your thoughts...

RShiv.1
RShiv.1Author
Associate III
November 24, 2022

checked with CRC 0xC2..not seeing any change

AScha.3
Super User
November 24, 2022

yea.

If you feel a post has answered your question, please click on " Best Answer ".
RShiv.1
RShiv.1Author
Associate III
November 24, 2022

any other methods to get this???