I2C not working with STM32F103C6 and STM32F103C8
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-11-18 06:00 AM
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
Solved! Go to Solution.
- Labels:
-
I2C
-
STM32F1 Series
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-11-24 04:19 AM
checked with CRC 0xC2..not seeing any change
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-11-24 04:19 AM
yea.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-11-24 04:25 AM
any other methods to get this???
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-11-24 04:26 AM
I tried with the pattern I had used...but here I am not getting the version number also..
I had deliberately used delay in between...is this necessary..do you see any way there???
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-11-24 04:36 AM
Hi ,
with this code atleast I got version number fine each time...with out CRC..but when I go ahead with periodic measurement...I see change in values...do not from where...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-11-24 04:44 AM
when I flash the previous code I shared with you ..I am able to get the version number..once I had any set interval or periodic measurement...version number values change and also ...periodic measurement fails...not able to understand where the probelm is??
let me know if you get any thought on this...almost close I guess..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-11-24 05:08 AM
Hi,
I changed the code where I coulf get the version number right..but when I read the get data ready..giving me same version number values..let me know where the problem is ??
sometimes when I restart gives me ddddd values..do not know why??
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-11-24 08:50 AM
me too :)
and i am sick...and cannot concentrate.
here the crc8 you need: (if chip refuses to work without crc byte)
> put gencrc() in your test program
and do:
- start continous mode
- in while...
- wait for data ready stat
- read data
- < while
#include <stdio.h>
typedef unsigned char uint8_t;
uint8_t gencrc(uint8_t *data, size_t len)
{
uint8_t crc = 0xff;
size_t i, j;
for (i = 0; i < len; i++) {
crc ^= data[i];
for (j = 0; j < 8; j++) {
if ((crc & 0x80) != 0)
crc = (uint8_t)((crc << 1) ^ 0x31);
else
crc <<= 1;
}
}
return crc;
}
int main()
{
uint8_t data[8] = {0xBE,0xEF,0,0,0,0,0,0};
uint8_t crc;
crc = gencrc(data, 2); /* returns 0x92 */
printf("%1x\n", crc);
crc = gencrc(data+2, 1); /* returns 0xac */
printf("%1x\n", crc);
return 0;
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-11-25 01:16 AM
Hi ,
As suggested I generated the CRC and also the start continuous mode ..
looks like CRC is not generating as 9x92 instead getting 0x7d..any error let me know
I am getting data ready flag as 1.....
regards
Ravi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-11-25 02:40 AM
Hi,
I changed the code a bit ..here I am getting 0x92...but data available function has to return with set as 0x01...let me know if you get anything out of this..