Hi,
I'm tryin' to send vehicle speed message to the mkV cluster, there's an example code on the Internet, where tacho dial works ok but there's problem with speed dial.
I've written simple CAN logger on STM32 and logged some traffic on 0x5a0 and 0x1a0 adresses, now I'm able to cyclically send vechicle speed to the cluster but it works very strange, ie. code works perfectly with predefined speed 100km/h or 200km/h but with 140km/h it works only for short period and dial goes to 0...
In (probably) CRC byte I've placed 0x0 or some values from log but even without it, on some speeds its ok and on some other not...
Code for adding distance looks like:
uint32_t distance;
while(1) //main loops
{
//sending frames to 0x1a0 (twice) and 0x5a0 (once) here
//........
distance+=speed*multiplier;
if(distance > 0xf0000) distance = 0; //should it start from 0?
delay(...) //tried different beetween 1 and 200ms
}
Now multiplier is experimentally adjusted to 655(dec) and delay to 200ms.
Can anybody check if I'm thinking correctly or doin' it wrong?
Is there any "FR" available to read about it?
This solution is for testing only, if it would work, I'd use interrupts for communication.
Thanks.