‎2022-11-18 6: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.
‎2022-11-24 4:19 AM
checked with CRC 0xC2..not seeing any change
‎2022-11-24 4:19 AM
yea.
‎2022-11-24 4:25 AM
any other methods to get this???
‎2022-11-24 4: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???
‎2022-11-24 4: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...
‎2022-11-24 4: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..
‎2022-11-24 5: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??
‎2022-11-24 8: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:
#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;
}
‎2022-11-25 1: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
‎2022-11-25 2: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..