Pages: [1]
Author Topic: VAG CAN vehicle speed and others...  (Read 2547 times)
666tdi
Newbie
*

Karma: +0/-0
Offline Offline

Posts: 12


« on: October 31, 2021, 04:43:38 AM »

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:
Code:
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.
Logged
fknbrkn
Hero Member
*****

Karma: +177/-18
Offline Offline

Posts: 1401


mk4 1.8T AUM


« Reply #1 on: November 01, 2021, 04:47:08 AM »

Med9 FR
CANECUR
1A0
Vamsr_c

Checkout factor and so on
Logged
666tdi
Newbie
*

Karma: +0/-0
Offline Offline

Posts: 12


« Reply #2 on: November 02, 2021, 01:49:58 AM »

Very thanks. It turned out that 5a0h message also has "systick timer" field, now with red FIS cluster it works perfectly.
I'm tryin' also to run it on white FIS but with these clusters 5a0h message is different, for example instead of systicks there's 4bit message counter. I unfortunatelly don't know if I'm searchin' it wrong but in MED17 5a0h message isn't fully described.

Another problem is enabling ilumination.
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Page created in 0.013 seconds with 16 queries. (Pretty URLs adds 0s, 0q)