Mp3car Home Page The mp3Car.com Forums The mp3Car.com Store The mp3Car.com Blog About mp3Car.com    

Sponsored links

Go Back   MP3Car.com > Mp3Car Technical > Engine Management, OBD-II, Engine Diagnostics, etc.

Notices

Reply
 
Share Thread Tools Display Modes
Old 11-20-2005, 02:11 PM   #1
Newbie
 
Join Date: Aug 2005
Posts: 2
CAN programming help

This is probably a long shot but I thought I'd ask anyway.

I've been playing around with the Multiplex Engineering T16-014 OBD interface. It supports all the major protocols, CAN included. I wrote a simple Perl script to talk through the device using the ISO 9141 protocol for the standard OBD parameters.

Now I'd like to explore the CAN functions on the adapter. I've been googling around trying to learn about CAN. While I've come across some helpful resources I still have some pretty basic questions left unanswered, so I'll just start with the first:

Anybody understand how CAN masks and filters work? I understand the network is of the broadcast type and I imagine setting the mask and filter for a node on the network determines what messages it pulls from the bus, but how exactly are they used. Are they somehow applied to the SID/EID addresses of each CAN message?

BTW, all the stuff I'm doing is open source (Apache license), so any help I can get will I'm sure be appreciated by others as well.
__________________
Bala Sambandam
2004 G35 Coupe, 6MT, nav, aero
http://www.idanim.com/main/autocross/videos.mcont
balaguru is offline   Reply With Quote
Advertisement
 
Advertisement
Sponsored links

Old 11-20-2005, 02:33 PM   #2
phc
Variable Bitrate
 
phc's Avatar
 
Join Date: Aug 2003
Location: SoCal
Posts: 299
You can set the filters to only allow certain messages to be received. Or you can let them all in.

I've not done CAN for vehicles, but devloped my own network. CAN messages can have an 11 bit or 29 bit identifier. I've only done 11 bit.

The filter hardware is such that you can have either
2 x 32 bit filters
4 x 16 bit filters
8 x 8 bit filters

I've done 8 x 8 filters. The 8 bit filters only look at the first 8 bits of the identifier.

Each filter has 2 registers you have to program, a mask register (MR or CANIDMR) and an acceptance register (AR or CANIDAR).

Mask Register = set bit to 1 if you don't care
Acceptance Register = match to bit you

So if you want to receive a message 10101010 (first 8 bits of ID)

You can set the Mask = 00000000
And the AR = 10101010

If you want to receive a group of messages 1010XXXX (x = dont care)

MR = 00001111
AR = 10100000
__________________
www.mechatroniks.com/wrx - Car PC Project/Dash Kits

Last edited by phc; 11-20-2005 at 03:07 PM.
phc is offline   Reply With Quote
Old 11-20-2005, 02:40 PM   #3
Newbie
 
Join Date: Aug 2005
Posts: 2
Awesome! Exactly what I needed. Thanks.
__________________
Bala Sambandam
2004 G35 Coupe, 6MT, nav, aero
http://www.idanim.com/main/autocross/videos.mcont
balaguru is offline   Reply With Quote
Sponsored links
Advertisement
 
Advertisement
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Programmer needs recommendation on WHAT programming lang... mmdb Software & Software Development 22 10-25-2005 07:04 PM
Wanting to learn some programming, help me pick a language! RS3RS Software & Software Development 32 10-15-2004 05:38 PM
C++: GUI Programming with >NET Framework [iG] Software & Software Development 3 05-24-2004 07:57 PM
batch file programming LCD's mosh LCD/Display 6 05-19-2002 01:55 AM
Need to start somewhere with Hardware programming 168db Software & Software Development 7 01-11-2002 09:35 AM


All times are GMT -5. The time now is 12:55 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.2.0
Copyright © 1999 - 2008 Mp3Car.com Inc.Ad Management by RedTyger
Message Board Statistics