[Ovmsdev] CANBus code

Mark Webb-Johnson mark at webb-johnson.net
Mon Sep 23 15:03:40 HKT 2013


Good to have you involved. The GEVCU is an impressive project.

I guess the answer to your question comes from the growth of OVMS from a project supporting one single EV to where it is today.

When we switched from the single-vehicle model, to the vehicle.{h,c} plugin(sic) vehicle module arrangement, we did largely abstract out the interrupt handler and CAN message reception (so that the vehicle module gets the incoming CAN bus message in a simple subroutine callback), but we haven't done much to abstract either message transmission or CAN bus initialisation. Both would be sensible to do at this stage, as there is now considerable duplication in the individual vehicle modules. I think this can be cleanly done by extensions to vehicle.{h,c}. In particular, the polling arrangements for OBD-II style arrangements are good candidates for this. We do have to be careful, as that would be shared code and would increase firmware size for modules not using it (in particular the v1 hardware support we are trying to maintain).

Regarding using a CAN bus library, the answer is that I don't know of a good one. There is a Microchip PIC18C version, but it really does little other than very trivial abstraction. Do you, or anyone else, know of any good PIC18 CAN/ECAN libraries suitable for adoption?

Regards, Mark.

On 22 Sep, 2013, at 5:35 AM, Collin Kidder <collink at kkmfg.com> wrote:

> Hello, its my first time posting here. I'm the primary developer for the GEVCU project. I have been watching the discussion about canbus filtering. This reminded me of the first time I found this project. I have to wonder why the OVMS project does not abstract away hardware implementation details. I find it odd that code to interface with a certain car is expected to directly use hardware registers. Why is that? Wouldn't it be better to have a canbus library that handles hardware access for everything else? 
> -- 
> Sent from my Android phone with K-9 Mail. Please excuse my brevity._______________________________________________
> OvmsDev mailing list
> OvmsDev at lists.teslaclub.hk
> http://lists.teslaclub.hk/mailman/listinfo/ovmsdev

More information about the OvmsDev mailing list