it exist, bus cost way to much elsewere!
All one would need is a USB + CAN enabled mcu with a nice windows front-end to receive and send CAN messages, and maybe some example c code to build program for it…
it exist, bus cost way to much elsewere!
All one would need is a USB + CAN enabled mcu with a nice windows front-end to receive and send CAN messages, and maybe some example c code to build program for it…
Yeah, they’re not hard to make. I whipped up a quick and super simple one on the CCS CAN dev board using RS232. USB would be cool, since you could run CAN at it’s top speed (or if you have a high speed RS232 port… I know some go pretty close to 1Mbps.)
USBCAN Prices in Canadian (A bit cheaper than USD)
1+ = $154.00 each
5+ = $146.30 each
10+ = $142.45 each
25+ = $138.60 each
I Need USB since I need to analyse a 1Mb bus. The idea would be using a simple MCU with integrated CAN and USB device (like much ARM7s), and making the software for it.
The device itself should be no big deal, but the software to look at your packets must be a bit harder to do…
Anyway, I’m pretty sure those dongles could be made and sold with profit for around 50-75$. 150+shipping+taxes is just plain stealing, even when you really need one.
This is something I keep on meaning to make - it really wouldn’t be too terribly difficult. If you look at the photos of the boards you’ll see it consists of nothing more than an FTDI USB chip (I think a FIFO one, not sure, looks like it has an eeprom attached as well), ATMEGA162, some Philips CAN controller, and a CAN transceiver.
I would go a fairly similar route - but ideally I’d use an AT90USB AVR instead of using a FTDI chip (they’re quite expensive), a Microchip MCP-2515 CAN controller, and a CAN transceiver. The only difficult thing would be the software end of things - and even that wouldn’t be too bad.
I think total cost of materials could be under $20 + PCB + assembly + enclosure.
I just looked at their website - they don’t provide any software for that thing at all. They provide sample code to interface to it, otherwise you have to use a terminal interface. It doesn’t seem to do any sort of baud rate detection or anything like that - you have to tell it the baud rate. They don’t seem to give you access to any of the timing parameters - it just glazes over all of that. They must have spent about 30 seconds writing the software for this thing - it has no features whatsoever. It would be incredibly easy to blow them out of the water. I just don’t know if there’s enough of a market for such a device.
it seems that the reason CAN is so popular is that it is quite cheap. It always bothered me that I could buy a target for less than the interface to my computer.NleahciM:
This is something I keep on meaning to make - it really wouldn’t be too terribly difficult. If you look at the photos of the boards you’ll see it consists of nothing more than an FTDI USB chip (I think a FIFO one, not sure, looks like it has an eeprom attached as well), ATMEGA162, some Philips CAN controller, and a CAN transceiver.
Ok, now I’m pissed.
Spark-Fun, or anybody, PLEASE!!! Make one and release it so that anybody will have the same freaking interface, and will be able to develop nice software that people will use.
I want to debug an interface included in a 5$ MCU, with a 1$ physical layer. I bought a 150$ PCAN-USB from peak systems. It works very nicely, but when I came to the point where I needed to just “log” the data streaming at an incredible pace to a text file, they whant me to buy the PCAN-TRACE software for… 400$!!!
Come-on, this is driving me crazy. I’m doing it inside a small office project. I’ve got the time and fund to work with such stupidity, but this is an insult to the whole hobby community.
The CAN bus is the a wonderfull thing. It’s soooo cheaper than Ethernet, more reliable/fast than RS232 and incredibly easy to wire for small automation or in-car project. I would love to see more and more small project from enthousiast arise from that simple bus, but everybody on a budget face an incredible barrier when they tell themselves “huh, how am I gonna know if it works?”.
This dongle could be sould for 50-75$, fully loaded with free software that are actually usefull and open source, and it will sell like crazy, with a huge profit margin.
Sadly, I’m on a schedule, so: anybody, please, build one, sell it, and make a lot of profit so I can buy one and stop ranting here.
-Jay2, going to write a datalogger for an overpriced piece of hardware trying to avoid buying an overpriced piece of software. :roll:
Patience, patience. There’s a bit more to it than what you want, to do it safely. I’ve been meaning to build a USB-CAN bridge for a while, and a Hack-a-Day contest has got me thinking about it again.
To do this right, I’m planning on taking a smaller USB PIC and marrying it with the Microchip external CAN controller. The real secret to this is that you have to create an isolation barrier from the CAN controller to the CAN transciever. I’m planning on doing this with TI galvanic isolators and a TI miniature isolated power supply. Toss in a few screw headers and some jumpers or DIP switches to allow you to turn off the power supply for external power busses, and you’re set.
It’s not necessarily a complex hardware design, but I’ve got a lot of work to do for the firmware image, I’ve barely started planning that.
And this one : http://www.mictronics.de/?page=can_bus 8)
Schematics, pcb with gerber files, docs, firmware and windows application. :shock: :twisted:
Angelo
Nice design, I haven’t looked in the code, but the parts probably cost about 2x what they need to for a basic setup, and I’m a bit hesitant to try something like that without proper isolation.
SOI_Sentinel:
Nice design, I haven’t looked in the code, but the parts probably cost about 2x what they need to for a basic setup, and I’m a bit hesitant to try something like that without proper isolation.
I don’t see anything wrong with the design - How would you suggest lowering the cost? I guess the FTDI chip and accompanying parts could be eliminated if an AT90USB chip was used instead, but that’s not that significant of a cost.
Yes, that’s a good part of it. An AVR USB (I’m going the PIC route myself). You can eliminate both the FTDI chip and the SPI memoryIf you can handle an SPI instead of a memory bus interface, you could go for an MCP 2515 ($5 vs $3).
So, original list:
AVR $6.67
FTDI $4 (guess)
SPI EEPROM $0.38
SJA1000 CAN Controller $5
CAN Transciever $1.95
6MHz Crystal + support $3?
Revised:
AVR-USB $10.88 to $14.83
MCP2515 CAN Controller: $2.98
MCP2551 (because I can): $1.45
I didn’t include everything, but this is a rough set of what’s changing.
So, I’m removing about… $21 in parts and adding on $19.26 worst case or 15.31 best case. Ok, I exaggerated far more than I thought I did, although I also didn’t take into account any reduction in board space required. It also looks like it’d be possible to just forget about the AVR completely and possibly hook the SJA directly to the FTDI. I’m not familiar with either part, however.
Anyway, I’m still in favor of placing isolation between the CAN controller and the transciever. Now I’m going to have to get my rather messy CAN and somewhat incomplete controller schematic up to illustrate.
SOI_Sentinel:
Yes, that’s a good part of it. An AVR USB (I’m going the PIC route myself). You can eliminate both the FTDI chip and the SPI memoryIf you can handle an SPI instead of a memory bus interface, you could go for an MCP 2515 ($5 vs $3).So, original list:
AVR $6.67
FTDI $4 (guess)
SPI EEPROM $0.38
SJA1000 CAN Controller $5
CAN Transciever $1.95
6MHz Crystal + support $3?
Revised:
AVR-USB $10.88 to $14.83
MCP2515 CAN Controller: $2.98
MCP2551 (because I can): $1.45
I didn’t include everything, but this is a rough set of what’s changing.
So, I’m removing about… $21 in parts and adding on $19.26 worst case or 15.31 best case. Ok, I exaggerated far more than I thought I did, although I also didn’t take into account any reduction in board space required. It also looks like it’d be possible to just forget about the AVR completely and possibly hook the SJA directly to the FTDI. I’m not familiar with either part, however.
Anyway, I’m still in favor of placing isolation between the CAN controller and the transciever. Now I’m going to have to get my rather messy CAN and somewhat incomplete controller schematic up to illustrate.
Do you mean to have some sort of optical isolation between the CAN controller and transceiver? I think most CAN transceivers offer something like 10KV protection. I would be very interested to see what you are proposing though.
I wonder if there would be a loss in performance if the MCP2515 was used. I mean - I’m using one on a current board and they work just great - but still - is it possible to completely saturate a bus with an MCP2515, and to read all data coming in on a saturated bus from an MCP2515? I’ve never done the calculations to check - but it seems to me that the serial interface of the chip could be a bit of a problem.
I’m wondering right now if it wouldn’t be cheapest to go the route of using a chip that has integrated USB and CAN. There are a plethora of ARMs that would fit. I’m currently using the SAM7X256 and it would fit the bill quite nicely. Its little brother, the SAM7X128, costs only $12.58 in single quantities from Digi-Key. It would also simplify the hardware side of things considerably, and it would get rid of all of the major factors that I see as hurting performance.
Funny as it sounds, that probably is both the cheapest and best method. Anyway, if you can saturate the 10Mhz SPI (plus you can use external triggers if you want to really streamline it all), you’ll probably have issues with the 12MHz USB bus, too.
Now, as for the isolation, CAN transcievers have the normal protection of 2.5kV static and 250V machine model. I think the Microchip parts provide transient circuit protection to 250V+/-,while the specified Philips part specified 200V+/-.
The circuitry I’ve chosen may cost a bit more, but it doesn’t have the current drive requirements of an optical isolaiton system. This could be retrofit to the supplied design or the all-in-one ARM (which Microchip and Atmel do not do in their 8/16 bit parts oddly) without any program changes. The isolation circuitry I’ve spec’ed out are as follows. I’d rather spend more in parts than fry my PC.
Power: TI DCH010505S ($8.08 each). It’s a “built PCB” 5V to 5V 1W power isolation. Transient and ground plane potential protection to 4kV.
Signal: 2x TI ISO721 ($3.71 each). One way galvanic isolation. Protection spec is the same as the power supply isolation.
My board also provides an unprotected 6 pin [PMOD connector for SPI addition of a daughterboard, and onboard power control of the 5V line to both the CAN and the PMOD, so I can software control which feature is powered at a given time if I have power limitations (500mA or less of course!)
$15 in parts to keep my PC from frying (plus some headers and filter caps). It’ll also help keep the system operating correctly so that you don’t get weird comm problems due to strange ground loops and differing ground potentials.
I’m providing jumpers on each side of the board to allow disconnection of the power module and rerouting external bus power (Industrial CAN provides up to 2A on the cable) in to power the 5V transciever system and isolation hardware. It also wouldn’t be hard to provide a couple of jumpers to bypass the whole isolation completely, so someone could build the boards to their requirements.](http://www.digilentinc.com/Products/Catalog.cfm?Nav1=Products&Nav2=Peripheral&Cat=Peripheral)
I have only just started investigating the CAN bus, but if the protocols and packets are documented somewhere I can do logging software. I hope to be able to wire this into my CarPC (which is really a Mac) and get constant realtime display of various engine parameters. Useless perhaps But fun, and the software could be cross-compiled for those with Windows machines they want to run it on.
My problem is that I can’t find all that much detail on the specs. Do I really have to join some consortium to learn about it? (these guys really want to protect their $400 logging software)
If there was hardware I could build to talk to it, and specs for the protocol I’d love to donate some software to the cause. But it would have to have either a fast serial line, or the FTDI chip as there are Mac drivers for that. I dont think there are Mac drivers for the other USB/Serial chip that was mentioned earlier.
James, if you haven’t looked at Wikipedia, it’s a good start. You could actually be using any of…5 or 6 communication protocols. They also provide some of the codes. The problem you may run into is that since many of the more interesting codes are proprietary, you won’t find them so easily, if at all. I don’t know about now, but in the near past it used to be that they’d only release information for codes pertinent to emmissions and all else would be secret, so you’d have to go to a dealer to get the diagnostics donre correctly.
Does Mac hardware support the standard virtual serial port? Shouldn’t need custom dirvers then.
Microchip, for instance…
SOI_Sentinel:
James, if you haven’t looked at Wikipedia, it’s a good start. You could actually be using any of…5 or 6 communication protocols. They also provide some of the codes. The problem you may run into is that since many of the more interesting codes are proprietary, you won’t find them so easily, if at all. I don’t know about now, but in the near past it used to be that they’d only release information for codes pertinent to emmissions and all else would be secret, so you’d have to go to a dealer to get the diagnostics donre correctly.
Yea, thats what I was afraid of, no way Mazda is going to cough up the documentation for actually talking to my car, or the specifics for more than the error codes huh. Thats a shame, so much information is potentially available on that bus if you could parse it properly! And hacking it would only apply to the specific maker or model probably. Still sounds like a good thing to do though
Does Mac hardware support the standard virtual serial port? Shouldn’t need custom dirvers then.
Microchip, for instance…
yes and no If you use an FDTI chip or something that is really a USB/Serial driver that has drivers I get a regular serial port stream and can read/write to it without any other hoops to jump though. To talk to other HID or virtual serial port devices I have to do some extra work to find them on the USB bus and poll them for information. It’s very dooable, just adds some extra steps to the process. I would also need to supply a “property list” that told the USB system that this device was recognized and handled and what it’s properties were, just like the windows .inf file necessary. I’ve done this for talking to some of the newer USB to X10 interfaces and other home automation type stuff, they work fine.
I’m working with the Microchip hardware. Was working on a bus powered CAN interface for the Hack A Day business card challenge, but ran out of time.
With your specific model and year, you can probably narrow down the exact interface you’d need. It looks like most of the OBD interfaces are actually some way proprietary (mostly nonstandard bus speeds).
Also, take a look here:
http://www.obd-codes.com/trouble_codes/mazda/
and
http://www.obdclearinghouse.com/
It’s a start.
Might be a long dead thread…but…
I’ve got most of the CAN information for Mazda 3’s if anyone is interested.