Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 05:23 26 Nov 2024 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : OBD2 Interfac e?

Author Message
Nick

Guru

Joined: 09/06/2011
Location: Australia
Posts: 512
Posted: 01:27pm 09 Aug 2012
Copy link to clipboard 
Print this post

Is anyone working on an automotive ODB2 interface for the Maximite?

This would be a great project and would promote the Maximite quite well as a useful tool.

Nick
 
MicroBlocks

Guru

Joined: 12/05/2012
Location: Thailand
Posts: 2209
Posted: 04:07pm 09 Aug 2012
Copy link to clipboard 
Print this post

I made a list of all the pic32 pins and how they are used in the colourmm.
Here is the part for the can bus devices:

name conflicts with Pin# MM Description
----------------------------------------------------------- -----
C1RX ETXD1/PMD11/RF0 87 Pin 25 bus receive pin
C1TX ETXD0/PMD10/RF1 88 Pin 26 bus transmit pin
AC1RX SS4/U5RX/U2CTS/RF12 40 nc Alternate bus receive pin
AC1TX SCK4/U5TX/U2RTS/RF13 39 SD - Clock to card (Alternate bus transmit pin)
==
C2RX PMD8/RG0 90 nc bus receive pin
C2TX ETXERR/PMD9/RG1 89 nc bus transmit pin
AC2RX T4CK/RC4 8 nc Alternate bus receive pin
AC2TX T3CK/RC3 7 Pin 34 Alternate bus transmit pin

nc = Not Connected


From this i think you can use the first can bus device on pin 25 and 26.
The second can bus device is not brought out to the connector.
http://ww1.microchip.com/downloads/en/DeviceDoc/61154B.pdf
Edited by TZAdvantage 2012-08-11
Microblocks. Build with logic.
 
Nick

Guru

Joined: 09/06/2011
Location: Australia
Posts: 512
Posted: 04:25pm 09 Aug 2012
Copy link to clipboard 
Print this post

I no nothing about ODB2. Is this a "CAN" interface bus?

If so, is this what is yet to be added to the Maximite firmware? (newbie here)

Nick
 
MicroBlocks

Guru

Joined: 12/05/2012
Location: Thailand
Posts: 2209
Posted: 04:29pm 09 Aug 2012
Copy link to clipboard 
Print this post

CAN-bus usually accessed via 6 and 14 pin of OBD II connector
[code]
OBD 2 CAN pinout
Pin Signal Description
4 CGND GND
5 SGND GND
6 CAN High
14 CAN Low
16 +12v Battery power
[/code]
from:
http://pinoutsguide.com/CarElectronics/obd_can_bus_pinout.sh tml

As far as i understand it the can bus is the interface and odb II is the protocol.
A nice app example that could also be made on an mm:
Android ODB II
I just bought the item showed in the video on amazon for $15
OBDII Bluetooth scanner Edited by TZAdvantage 2012-08-11
Microblocks. Build with logic.
 
Nick

Guru

Joined: 09/06/2011
Location: Australia
Posts: 512
Posted: 04:59pm 09 Aug 2012
Copy link to clipboard 
Print this post

So all we need is a CAN interface on the Maximite, The necessary cable connector and then software that mimics the functions of that ODB II scanner... and then make it better!

Nick
 
donmck

Guru

Joined: 09/06/2011
Location: Australia
Posts: 1313
Posted: 06:08pm 09 Aug 2012
Copy link to clipboard 
Print this post

  Nick said   So all we need is a CAN interface on the Maximite, The necessary cable connector and then software that mimics the functions of that ODB II scanner... and then make it better!

Nick


Nick, regarding CAN, please read:
http://www.thebackshed.com/forum/forum_posts.asp?TID=4889&PN =1&TPN=6

and:
http://priuschat.com/threads/my-duinomite-mega-canview-v4-eq uivalent-project.112429/

Don...


https://www.dontronics.com
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 6098
Posted: 08:50pm 09 Aug 2012
Copy link to clipboard 
Print this post

Silicon Chip February 2010 had an article on OBDII and an OBDII to RS232 converter project.
Worth a read.

Jim

VK7JH
MMedit   MMBasic Help
 
JohnS
Guru

Joined: 18/11/2011
Location: United Kingdom
Posts: 3801
Posted: 05:43am 10 Aug 2012
Copy link to clipboard 
Print this post

The ideas behind OBD II are fairly simple but the details aren't. There are in round terms 4 different Standard interfaces (ISO, VPW, PWM & CAN) and lots of protocols and non-standard interfaces. Well worth a serious read on wikipedia but it is only an intro and only really to the standard.

Many people let an ELM (such as ELM327, USB or Bluetooth) do a lot of the work and then just interface to the elm. That way you don't need a CAN (it's on the elm), just USB or BT, and also most of the speedy stuff is buffered OK by the elm. If you're planning to use DM/MMBasic you have to worry somewhat about the speed.

It's common for car makers to put non-standard stuff on the OBD connector pins, sometimes contrary to the standard, so be very wary about voltages etc which may be present. And of course you can get nasty voltage spikes from a car, up to about 42V.

The kind of code to talk to an elm is in scantool.net for which quite a bit of source code is available.

To use USB you'd need the DM as a host and I don't think MMBasic provides that. Or any BT support?

JohnEdited by JohnS 2012-08-11
 
jdh2550
Regular Member

Joined: 16/07/2012
Location: United States
Posts: 62
Posted: 07:22am 10 Aug 2012
Copy link to clipboard 
Print this post

  TZAdvantage said   I made a list of all the pic32 pins and how they are used in the colourmm.
Here is the part for the can bus devices:

name conflicts with Pin# MM Description
----------------------------------------------------------- -----
C1RX ETXD1/PMD11/RF0 87 Pin 25 bus receive pin
C1TX ETXD0/PMD10/RF1 88 Pin 26 bus transmit pin
AC1RX SS4/U5RX/U2CTS/RF12 40 nc Alternate bus receive pin
AC1TX SCK4/U5TX/U2RTS/RF13 39 SD - Clock to card (Alternate bus transmit pin)
==
C2RX PMD8/RG0 90 nc bus receive pin
C2TX ETXERR/PMD9/RG1 89 nc bus transmit pin
AC2RX T4CK/RC4 8 nc Alternate bus receive pin
AC2TX T3CK/RC3 7 Pin 34 Alternate bus transmit pin

nc = Not Connected


From this i think you can use the first can bus device on pin 25 and 26.
The second can bus device is not brought out to the connector.
http://ww1.microchip.com/downloads/en/DeviceDoc/61154B.pdf


Note that C1RX & C1TX would need to go to a CAN transceiver chip before attaching to the CAN bus. The transceiver takes the TX/RX signals and actually puts out the CAN-High / CAN-Low signals on the bus. At least I think that's how it works. I think the DM must have a transceiver in between C1 and it's CAN port.

If you were to make a hardware add-on for the MM to add a transceiver then if you want to make a "better" solution than the DM add in opto-isolation (or some other form of isolation). That's currently "missing" from the DM solution.

When you have the hardware in place you should be able to use Frank Voorburgs CAN implementation.Edited by jdh2550 2012-08-11
 
JohnS
Guru

Joined: 18/11/2011
Location: United Kingdom
Posts: 3801
Posted: 11:21pm 10 Aug 2012
Copy link to clipboard 
Print this post

There's no need for opto-isolation. Have a look at the data sheet for the chip used by the DM Mega :) It can withstand all the nasty stuff.

John
 
jdh2550
Regular Member

Joined: 16/07/2012
Location: United States
Posts: 62
Posted: 02:29pm 11 Aug 2012
Copy link to clipboard 
Print this post

  JohnS said   There's no need for opto-isolation. Have a look at the data sheet for the chip used by the DM Mega :) It can withstand all the nasty stuff.

John

I'll have a look. However, I'd be bridging between a Prius HV battery pack's ground and the chassis ground of the 12V system. If there were an "event" it wouldn't be pretty...
 
JohnS
Guru

Joined: 18/11/2011
Location: United Kingdom
Posts: 3801
Posted: 06:19am 13 Aug 2012
Copy link to clipboard 
Print this post

For safety are they not very very thoroughly bonded together?

I'm puzzled anyway, why do you want to bridge between them?

For OBD you would not be, would you?

John
 
jdh2550
Regular Member

Joined: 16/07/2012
Location: United States
Posts: 62
Posted: 10:39am 13 Aug 2012
Copy link to clipboard 
Print this post

I'm no EE so my terminology is probably not right. I'm doing a project on the Prius which requires creating two separate CAN buses.

The HV pack has it's own ground. I.e. it's a completely separate circuit from the normal 12V circuit. This means it takes two failures in the HV circuit to create a live chassis. This is a "good thing"

The CAN bus operates relative to the vehicle ground. In the normal Prius there's a battery ECU that measures HV pack voltage and communicates this on the main CAN bus. I'm assuming that the battery ECU has isolation in it to keep the two circuits electrically isolated.

In my project I want to replace the normal small NiMH pack with a big LiFePO4 pack. Furthermore I want to be able to use EV only power when driving at highway speeds. The normal Prius will top out at around 50mph. To go faster you have to change the behavior of the main hybrid ECU. The way I change that behavior is to separate the ICE ECU onto it's own bus and to create a new battery ECU. I intercept messages between hybrid ECU and ICE ECU and instead inject my own messages - hence the need for the bridge. And if I replace the battery ECU then I need to make sure I still have isolation (fried vehicle occupants are just too messy to clean up). In fact, I'm thinking of repurposing the existing battery ECU so that should address the isolation issue for me.

All this is explained in more detail over at:

http://priuschat.com/threads/yapip-recreating-peefs-approach .109724/

In particular see:

http://priuschat.com/threads/yapip-recreating-peefs-approach .109724/page-8#post-1595655

http://priuschat.com/threads/yapip-recreating-peefs-approach .109724/page-9#post-1611497

It's this Prius project that lead me to the DM Mega (thanks to Bruce on Priuschat.com).
 
JohnS
Guru

Joined: 18/11/2011
Location: United Kingdom
Posts: 3801
Posted: 09:37pm 13 Aug 2012
Copy link to clipboard 
Print this post

OK. You're not really doing OBD2. It sounds interesting but a separate thread might really have been helpful, with the background to help people see that you're doing something else.

I'd study the way the (allegedly?) separate systems are electrically wired over the CAN bus since it's terribly central to not getting anything or anyone fried.

Several guys here are pretty good electically & electronically so may well have ideas. I'm wondering if this really should go in a new thread, though, because even the CAN messages the Prius uses for things like battery SoC are not actually OBD2.

If a mod is reading... how about splitting this stuff off please?

John
 
Print this page


To reply to this topic, you need to log in.

© JAQ Software 2024