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.
2022-11-24 04:19 AM
checked with CRC 0xC2..not seeing any change
2022-11-24 04:19 AM
yea.
2022-11-24 04:25 AM
any other methods to get this???
2022-11-24 04:26 AM
2022-11-24 04:36 AM
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..
2022-11-24 05:08 AM
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:
#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 01:16 AM
2022-11-25 02:40 AM