cancel
Showing results for 
Search instead for 
Did you mean: 

I2C not working with STM32F103C6 and STM32F103C8

RShiv.1
Senior

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

63 REPLIES 63

yes absoulutely...3V3 ..we are seeing high...4K7 pulls up ..

RShiv.1
Senior

Hi,

As I was continuing with my effort to read the sensor values using C8...I observed that when I do the HAL_write and HAL_Read...there seems to be values which are not coming out of sensor properly..

attached is the code for the same.I am seeing values like dd, dd once I read from the memory.

HAL_write is passing..I am comparing the same result with Rpi when I connect the sensor..so it is not matching with Rpi..Let me know your thoughts on this.

Thanks and regards

Ravi

RShiv.1
Senior

also would like to add..according to the sensor doc ...there is CRC start...so we need to add this??..

I also added the same but did not seem to make much difference

RShiv.1
Senior

when I do I2C_Mem_write it passes..but not I2C_Master_Transmit??...anyways I am not getting the intended answer in the buffer...thanks

ONadr.1
Senior III

It's time to take the logic analyzer out of the drawer and look at the bus to see what's going on there.

AScha.3
Chief II

yea, i said 3 days ago:

if still not working - its time, to look at the signal:

take DSO, 1 ch sck , 1 ch sda ; trigger on clk.

then show, what happens on I2C lines.

but he prefers to play blind cow . 🙂

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

Hi,

sorry I had updated ...I2C is working fine...and I am also able to get the version of the sensor fine.

After which I am trying to read the status ready ..where I am not seeing the flag .

if I just enable version number all is fine..but when I try to get the get ready flag there seems to be problem...more to do with I2C_Mem_write and Mem_read...any suggestion with the way it is called kindly let me know.

Thanks

Ravi

RShiv.1
Senior

it looks more a pointer management issue I guess...I am able to get the version number of the sensor fine if I run only that..but when I enable get ready flag ...even the version number values changing..

let me know..

If I get this properly I will be able to read the perodic mesurement as well as the actual values from sensor...

AScha.3
Chief II

try...

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

Hi,

I tried with this which says

0693W00000WJQaaQAH.png 

only dddd

but after start periodic measurement need to check for data ready??

anyways will try that also..not getting the values....let me know the change