Hi guys this will be an easy question for someone but
can messages are still a minefield in my brain not helped by the fact they are sometimes in hex, decimal etc, it makes my brain hurt and want to go back to welding something.
Anyway I’m trying to send out from the vcu the motor rpm to the RX8 can bus this info is needed importantly to start the PAS and run the Rev counter,
All information I’ve found indicates that the message needs to be sent to address 0x201 (513) and is determined by
Rpm x 3.85 with the resulting value is split across 2 8bit values highbyte to byte 0 and low byte to byte 1.
Now I presume as it wants to 2 separate 8bit values to work that this isn’t possible via the can mapping as I can only map one message per spot value and I can’t sent it a 16 but value starting at byte 0 because that’s a different format to the 2 8bit values it wants, this is where my head starts to hurt,
Im thinking I need to add another device on my can bus, send a can message for rpm to that from the vcu and have it spit it back out in the correct format for the car, this is the route I’ll be perusing unless anyone can see through the stupid and tell me stop your doing it wrong!
Can mapping question
Re: Can mapping question
The more I read about can bus and 16bit messages being 2 8 bit messages with values of up to 255 each which are arrived at by bit shifting? The more confused I become! Seems like it should be possible
- johu
- Site Admin
- Posts: 5791
- Joined: Thu Nov 08, 2018 10:52 pm
- Location: Kassel/Germany
- Has thanked: 157 times
- Been thanked: 1025 times
- Contact:
Re: Can mapping question
hibyte, lobyte - Sounds like "big endian" to me. So not the native little endian of the stm32. That's why you cannot map it as one 16-bit value.
Not sure if it works, you can try sending speed*256*3,85 on hibyte and speedx3.85 on lobyte
I think the current CAN module doesn't allow gain>32 so may not work. I will release an updated CAN module soon.
Not sure if it works, you can try sending speed*256*3,85 on hibyte and speedx3.85 on lobyte
I think the current CAN module doesn't allow gain>32 so may not work. I will release an updated CAN module soon.
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
- EV_Builder
- Posts: 1199
- Joined: Tue Apr 28, 2020 3:50 pm
- Location: The Netherlands
- Has thanked: 16 times
- Been thanked: 33 times
- Contact:
Re: Can mapping question
its not that it are seperate messages its just that in a std message there is room for 8 bytes.
So to transmit a 16bit value you need to interpret the order the same. Which of the 8bits represents the *256 number...
and on top of that CanBus even makes use of every bit so in reallife a 16bit digit could start at bit nr 3...etc..
Converting an Porsche Panamera
see http://www.wdrautomatisering.nl for bespoke BMS modules.
see http://www.wdrautomatisering.nl for bespoke BMS modules.
Re: Can mapping question
Thanks guys I’ve got my head mostly round this and dash and power steering is working now, I’m using an arduino nano to receive speed data from the open inverter board on one can Id then sending out a message on the correct id for the dash with the bytes swapped around, seems to do the job, I’m going to also use the arduino to perform some other useful functions like switching the auxiliary oil pump on and off etc