Controller Area Network (CAN) on propeller?
OakGraphics
Posts: 202
Howdy guys.
I am thinking of a project to read in various things from a CAN Bus (Controller Area Network) (see http://www.canbus.us/·)
In theory - I should be able to get what my car dash would get - and more.· I was hoping to be able to build a circuit that could make a virtual dashboard, as well as make a circuit that I could generate the data to controll a different dashboard.· This would be 2 projects really - as one would be for use to create the lcd screen that F1 steering wheels have on them for racing simulation (something like http://www.hardwaresecrets.com/fullimage.php?image=5501 ), and the other would be controlled via·USB·to be able to make a 'virtual car' dashboard.·(see http://realvirtualcar.blogspot.com/·)
Any thoughts on this?· I looked through the object exchange and I don't see anything there offhand, but looking at the CANbus specs it doesent look like the Propeller would have a problem with it.··· Or should I consider a dedicated CANbus controller and let the propeller do all the other stuff? (lcd, buttons, etc)
·
I am thinking of a project to read in various things from a CAN Bus (Controller Area Network) (see http://www.canbus.us/·)
In theory - I should be able to get what my car dash would get - and more.· I was hoping to be able to build a circuit that could make a virtual dashboard, as well as make a circuit that I could generate the data to controll a different dashboard.· This would be 2 projects really - as one would be for use to create the lcd screen that F1 steering wheels have on them for racing simulation (something like http://www.hardwaresecrets.com/fullimage.php?image=5501 ), and the other would be controlled via·USB·to be able to make a 'virtual car' dashboard.·(see http://realvirtualcar.blogspot.com/·)
Any thoughts on this?· I looked through the object exchange and I don't see anything there offhand, but looking at the CANbus specs it doesent look like the Propeller would have a problem with it.··· Or should I consider a dedicated CANbus controller and let the propeller do all the other stuff? (lcd, buttons, etc)
·
Comments
Leon
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Amateur radio callsign: G1HSM
Suzuki SV1000S motorcycle
I'd take a look at the MicroChip MCP2515; this is a standalone CAN controller with an SPI interface (for which there _is_ an object), so that will just (!) leave you with working out how to control its registers [noparse];)[/noparse]
HTH.
<edit>
Just to clarify: there _is_ an object for SPI - _not_ for the MCP2515!
</edit>
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Cheers,
Simon
www.norfolkhelicopterclub.co.uk
You'll always have as many take-offs as landings, the trick is to be sure you can take-off again ;-)
BTW: I type as I'm thinking, so please don't take any offense at my writing style
Post Edited (simonl) : 10/16/2007 10:19:21 AM GMT
I'm aware of but never used CANbus. It seems fairly straight forward; a bit rate of 10Kbps through 1Mbps, and a Propeller should be able to bit-bang in packets at those rates, with enough processing time to check CRC etc. Packets can be built, buffered and handed over to another Cog for processing. Packet rate is likely more important than actual data rate but I'd expect a Propeller to be at least comparable in processing terms as whatever is fitted into a dashboard display.
The MCP2515 is well worth considering and its datasheet seems a better guide to what's on the CANbus bus than other material I've read. Bit synchronisation and bit stuffing seems to be the ain complexities of CANbus over any other asynchronous data stream so it probably is easier to off-load the work to an external chip which brings other advantages such as packet filtering.
Getting a CANBus receiver working with a MCP2515 then moving to a bit-banged solution would likely be a sensible way to proceed.
http://forums.parallax.com/forums/default.aspx?f=25&m=139971
I think you could develop something with lots of repurposing potential. Every-time I go by a junkyard, with all of those unused carputers, sensors and actuators, I wish I was just a little smarter and that someone would come along and blaze the trail.
Great project for a grad student... or a budding entrepreneur.
www.scantool.net
They have complete OBDII interfaces that will negotiate all the data transfer/commands/etc and ship the data down to you via USB or Serial. They use the ELM chip as a basis for their products, which can be used to develop your own embedded application if necessary.
http://www.elmelectronics.com/index.html
I have the ELM 5 scantool from scantool.net and am in the process of using the prop to build my own aux. instrument cluster on a uLED, which I will mount in an unused part of my dash. Ill post the code up when I get finished.
·· USB <-> FT232R <-> Propeller <-> MCP2515 <-> MCP2551 <-> CAN Bus
I now have a serial-autobaud object and an MCP2515-specific SPI object.· These are appearing to work well
but I'm still in the turning it all on stage... I'll be posting some of these as I get them fully tested.
I'm doing this work for use by myself and my collegues at AMSAT-NA/AMSAT-DL. These are Amateur radio
enthusiasts who build amateur radio satellites.· We are flying the CAN bus as the payload communications
network onboard the next couple of satellites.·· See: http://can-do.moraco.info·and http://projects.moraco.us
I needed a cheaper, faster, driver-flaw-free USB2CAN dongle and I'm now hours away from this being a
reality!
I've been "soaking-up" all things spin and have been in heavy turn-on / learning...· I've been writing software
for a really long time and have many years in developing embedded systems.· I do have to say that
working in spin and the associated assembly language is turning out to be quite fun.· It is also not without
it share of "how in the world do I do..."· events and the accompanying "why is it doing that?" events.
I'll post here when I've awakened the web-site for this new device...·· So far I'm calling it "propCAN".·
(If any of you have suggestions for better names, let me know··)
Anyway, reguarding this thread... we now have information on how to do CAN Bus using the propeller...
- Stephen
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·
Great link. I had heard of AMSAT, but I never actually knew what it was. It sounds like a project that just shouldn't work... but it has... for more than 20 years.
propCAN sounds pretty good to me[noparse]:)[/noparse]
I've been trying to find ways to get my mechanic friends interested in the Prop... propCAN will do that.
Thanks
Rich
Brilliant! I first encountered CAN when reading about rocketry project at PSAS (Portland State Uni?). I see their later projects moved away from CAN due, I think, to it's non-deterministic messaging nature - I guess you're not seeing any problems with that?
propCAN is perfect - because the prop' can CAN (not sure if it can can-can, but if I put it out as a challenge I'm sure someone could make it!).
I look forward to seeing the fruits of your labour - keep up the good work.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Cheers,
Simon
www.norfolkhelicopterclub.co.uk
You'll always have as many take-offs as landings, the trick is to be sure you can take-off again ;-)
BTW: I type as I'm thinking, so please don't take any offense at my writing style
It contains a description of the device as well as a gallery of pictures of my first boards with which I'm developing the code.
· See: http://propcan.moraco.us
Enjoy!
Stephen, KZ0Q
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·
See please the attached ss:
Post Edited (Ale) : 12/27/2007 7:44:51 AM GMT
Recently I have read a couple magazine articles about CANbus and thought I would would raise this tread up and see what Stephen Moraco has been up to or anyone else using the Propeller and CANbus. Tell me about your experience? Any more object to share in the OBEX? And feedback on the posted MCP2515 object from those who have used it? Anyone trying porting CANopenNode (open source, high level layer protocol for CANbus sourceforge.net/projects/canopennode/)
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Timothy D. Swieter, P.E.
www.brilldea.com - Prop Blade, LED Painter, RGB LEDs, 3.0" 16:9 LCD Composite video display, eProto for SunSPOT, PropNET, PolkaDOT-51
www.tdswieter.com
Stephen's website is up but it appears that it has not been updated recently. Maybe he would answer an email or two.
https://id306.securedata.net/machinebus.com/merchantmanager/index.php
My easy-to-use MCP2515 object (with a sniffer demo) is now in ObEx
-- http://obex.parallax.com/objects/832/
I have some spare Propeller Platform MCP2515 PCBs available in this thread:
-- http://forums.parallax.com/showthread.php?137251-Propeller-Platform-CAN-Shield-PCB-Available-%28limit-qty%29