[Ovmsdev] Extended CAN Frame support on CAN2/3
mark at webb-johnson.net
Tue Oct 24 09:34:56 HKT 2017
This didn’t seem to work, so I made some further refinements. Documentation on MCP2515 datasheet is not very clear. From what I can tell, the receive registers are setup like this:
Register Standard Extended
SIDH (0x61) 7:0 28:21
SIDL (0x62) 7:5 20:18, 17:16
EID8 (0x63) n/a 15:8
EID0 (0x64) n/a 7:0
and the SIDL bit 3 (IDE) is 1 for extended and 0 for standard.
I implemented it like that, and it now seems to co-exists between the MCP2515 and ESP32 native CAN in both standard and extended modes. Of course, both implementations could now be wrong, but at least they match ;-) Need to try it out on something real, to be certain it is fixed now.
> On 10 Oct 2017, at 4:20 AM, Greg D. <gregd2350 at gmail.com> wrote:
> Hi folks, (Mark, in particular),
> I've tweaked the mcp2515.cpp code to support Extended CAN frames on CAN
> 2 & 3. Needed this for the OBD2ECU code, but it's there for anyone else
> who may want it.
> Mark - I did a bit of this by trial & error, since some of what I was
> doing wasn't working as I expected it would. Bits upside down, that
> sort of thing... So I expect some of the middle bits around the three
> frame flags is wrong, particularly on the transmit side, but for the
> PIDs I use, the results I get match what Wireshark decodes. So, I think
> it's close.
> p.s. Got my first CAN 3 bus hang too... hope it's not related. :)
> OvmsDev mailing list
> OvmsDev at lists.teslaclub.hk
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the OvmsDev