can hacking_ the hardware

Upload: stefanvas

Post on 11-Oct-2015

163 views

Category:

Documents


1 download

TRANSCRIPT

  • 5/20/2018 CAN Hacking_ the Hardware

    1/23

    8/31/2014 CAN Hacking: The Hardware

    http://hackaday.com/2013/11/05/can-hacking-the-hardware/ 1/23

    Hackaday

    Fresh hacks every day

    Home

    Hackaday Projects

    Our Videos

    Submit a Tip

    Forums

    AboutAugust 31, 2014

    See the Semifinalists || Learn about The Hackaday Prize

    CAN Hacking: The Hardware

    November 5, 2013 By Eric Evenchick33 Comments

    Follow

    http://hackaday.io/list/2864-The-Hackaday-Prize%3A-Semifinalistshttp://hackaday.io/list/2864-The-Hackaday-Prize%3A-Semifinalistshttp://hackaday.io/list/2864-The-Hackaday-Prize%3A-Semifinalistshttp://hackaday.io/list/2864-The-Hackaday-Prize%3A-Semifinalistshttp://hackaday.io/list/2864-The-Hackaday-Prize%3A-Semifinalistshttp://void%280%29/http://hackaday.com/author/ericevenchick/http://hackaday.io/list/2864-The-Hackaday-Prize%3A-Semifinalistshttp://hackaday.io/prizehttp://hackaday.io/list/2864-The-Hackaday-Prize%3A-Semifinalistshttp://hackaday.com/about/http://forums.hackaday.com/http://hackaday.com/contact-hack-a-day/http://www.youtube.com/subscription_center?add_user=hackadayhttp://hackaday.io/?from=had&utm_source=hackaday&utm_medium=menu&utm_campaign=bloghttp://www.hackaday.com/http://adclick.g.doubleclick.net/aclk?sa=L&ai=BDlRDyDUDVLaCM4en-wa1g4D4AQAAAAAQASAAOABQqoDZ6gRYyr7QG2CDpeGF6BuCAQljYS1nb29nbGWyAQxoYWNrYWRheS5jb23IAQKoAwHgBAKgBj7gBrn8hgE&num=0&sig=AOD64_2WmdlRsWg7AusubeX55asxYSAlJw&client=&adurl=http://ads.supplyframe.com/openads/www/delivery/ck.php%3Foaparams%3D2__bannerid%3D74494__zoneid%3D426__cb%3D1df68f5b34__oadest%3Dhttp%253A%252F%252Fanalytics.supplyframe.com%252Ftrackingservlet%252Ftrack%252F%253Faction%253DadClick%2526value1%253D%7Btaxonomy_enc%7D%2526value2%253D74494%2526value3%253D652%2526zone%253D426%2526extra%253Dcontextualmatch%253Dnolimitation%257Ccookietax%253D0%257Ccb%253D1df68f5b34%257Ch_value%253Dedec4b2530a1dc9f1409496520%257Ch_crc%253D4057766122%257Cgeo%253Dro%257Ccnt%253Deu%257Cbp%253D0.051721244625426%257Cbpf%253D53.974795583717%257Ccp%253D10%257Ch_i%253Dy%2526zone%253D426%2526url%253Dhttp://www.ti.com/lit/spmy011http://hackaday.com/
  • 5/20/2018 CAN Hacking_ the Hardware

    2/23

    8/31/2014 CAN Hacking: The Hardware

    http://hackaday.com/2013/11/05/can-hacking-the-hardware/ 2/23

    So far we have discussed thebasics of CAN, in-vehicle networks, andprotocols used over CAN. Were going to wrap up with a discussion of CAN

    tools, and parts to build your own CAN hardware.

    Wiring

    Unfortunately, theres no set standard for CAN connections. The most common connector for high-speed CAN is a DE-9, with CAN high on pin 7

    and CAN low on pin 2. However cables will differ, and many are incompatible.

    CAN needs to be terminated, preferably by a 120 ohm resistance on either end of the bus. In practice, you can stick a single 120 ohm resistor across

    the bus to deal with termination.

    Follow Hackaday

    Get every new post delivered

    to your Inbox.

    Join 92,220 other followers

    Enter your email address

    Sign me up

    Pow ered by WordPress.com

    https://wordpress.com/?ref=lofhttp://hackaday.com/2013/10/29/can-hacking-protocols/http://hackaday.com/2013/10/22/can-hacking-the-in-vehicle-network/http://hackaday.com/2013/10/21/can-hacking-introductions/
  • 5/20/2018 CAN Hacking_ the Hardware

    3/23

    8/31/2014 CAN Hacking: The Hardware

    http://hackaday.com/2013/11/05/can-hacking-the-hardware/ 3/23

    Tools

    A good CAN tool will let you transmit and receive CAN messages, interpret live data using CAN databases, and talk CAN protocols. The tools with

    this feature set are proprietary and expensive, but some hacker friendly options exist.

    GoodThopter

    Based on [Travis Goodspeed's] GoodFET, the GoodThopterby [Q] uses the Microchip MCP2515CAN to SPI controller to access the bus. The

    open hardware tool lets you send and receive messages using Python scripts.

    CAN Bus Triple

    http://www.microchip.com/wwwproducts/Devices.aspx?dDocName=en010406http://goodfet.sourceforge.net/hardware/goodthopter12/http://hackaday.com/2013/11/05/can-hacking-the-hardware/goodthopter/
  • 5/20/2018 CAN Hacking_ the Hardware

    4/23

    8/31/2014 CAN Hacking: The Hardware

    http://hackaday.com/2013/11/05/can-hacking-the-hardware/ 4/23

    The CAN Bus Tripledevice provides an interface to three CAN buses, and can be programmed in an environment similar to Arduino. The open

    source code provided lets you muck with the second generation Mazda 3. Unfortunately, the hardware does not appear to be open source.

    Saleae Logic

    http://www.canb.us/http://hackaday.com/2013/11/05/can-hacking-the-hardware/canbustriple/
  • 5/20/2018 CAN Hacking_ the Hardware

    5/23

    8/31/2014 CAN Hacking: The Hardware

    http://hackaday.com/2013/11/05/can-hacking-the-hardware/ 5/23

    Its not open source, but the Saleae Logicis a very handy and cheap tool for looking at CAN buses. It can capture, decode, and display CAN traffic.

    This is most useful when youre building your own CAN hardware.

    DIYThe Parts

    If you want to design your own hardware for CAN, youll need two things: a CAN controller, and a CAN transceiver.

    The CAN controller generates and interprets CAN messages. Theres many microcontrollers on the market with built-in CAN controllers, such as the

    Atmel ATmega32M1

    , Freescale S08D, and the TI Tiva C Series. When using a built-in CAN controller, youll have to use an external oscillator,

    internal oscillators are not sufficiently accurate for high-speed CAN. If you want to add CAN to an existing microcontroller, the MCP2515 is an

    option. Its a standalone CAN controller that communicates over SPI.

    http://www.ti.com/lsds/ti/microcontroller/tiva_arm_cortex/c_series/overview.pagehttp://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=S08Dhttp://www.atmel.com/devices/atmega32m1.aspxhttp://www.saleae.com/http://hackaday.com/2013/11/05/can-hacking-the-hardware/saleaelogic/
  • 5/20/2018 CAN Hacking_ the Hardware

    6/23

    8/31/2014 CAN Hacking: The Hardware

    http://hackaday.com/2013/11/05/can-hacking-the-hardware/ 6/23

    The transceiver translates signals from the controller to the bus, and from the bus to the transceiver. Different transceivers are needed for high-speed

    and low-speed CAN networks. TheNXP TJA1050works with high-speed buses, and the ON Semi NCV7356works with low-speed, single wire

    buses.

    Dev Boards

    Theres a ton of development boards out there featuring microcontrollers with a CAN controller. The Arduino Dues SAM3 processor has acontroller, but theres no transceiver on the board. You can pick up a CAN bus shield, and the Due CAN Libraryto get started.

    The ChipKIT Max32is similar to the Due. It has two CAN controllers, but youll need to provide external transceivers to actually get on a bus.

    Fortunately theres a shield for that. The ChipKIT is officially supported by Fords OpenXC Platform

    , so you can grab their firmware.

    That concludes our discussion of CAN Hacking. Hopefully youre now ready to go out and experiment with the protocol. If you have questions, send

    them along to our tip linewith CAN Hacking in the subject, and well compile some answers. If you liked this series and want to suggest a topic for

    the next set of posts wed love to hear that as well!

    CAN Hacking

    Introductions

    The In-vehicle Network

    CAN Protocols

    Building CAN Hardware

    Filed Under: Featured,Network HacksTagged With: Arduino DUE

    , automotive, CAN, can bus triple

    , CAN Hacking, chipkit

    ,GoodFET, goodthopter

    , saleae logic

    http://hackaday.com/tag/saleae-logic/http://hackaday.com/tag/goodthopter/http://hackaday.com/tag/goodfet/http://hackaday.com/tag/chipkit/http://hackaday.com/tag/can-hacking/http://hackaday.com/tag/can-bus-triple/http://hackaday.com/tag/can/http://hackaday.com/tag/automotive/http://hackaday.com/tag/arduino-due/http://hackaday.com/category/network-hacks/http://hackaday.com/category/featured/https://plus.google.com/share?text=CAN+Hacking%3A+The%C2%A0Hardware&url=http%3A%2F%2Fhackaday.com%2F2013%2F11%2F05%2Fcan-hacking-the-hardware%2F&via=Hackadayhttps://www.facebook.com/sharer.php?t=CAN+Hacking%3A+The%C2%A0Hardware&u=http%3A%2F%2Fhackaday.com%2F2013%2F11%2F05%2Fcan-hacking-the-hardware%2F&via=Hackadayhttps://twitter.com/intent/tweet?text=CAN+Hacking%3A+The%C2%A0Hardware&url=http%3A%2F%2Fhackaday.com%2F2013%2F11%2F05%2Fcan-hacking-the-hardware%2F&via=Hackadayhttp://hackaday.com/2013/11/05/can-hacking-the-hardware/http://hackaday.com/2013/10/29/can-hacking-protocols/http://hackaday.com/2013/10/22/can-hacking-the-in-vehicle-network/http://hackaday.com/2013/10/21/can-hacking-introductionshttp://hackaday.com/contact-hack-a-day/https://github.com/openxc/vi-firmwarehttp://openxcplatform.com/http://www.digilentinc.com/Products/Detail.cfm?Prod=CHIPKIT-MAX32https://github.com/collin80/due_canhttp://arduino.cc/en/Main/arduinoBoardDuehttp://www.onsemi.com/PowerSolutions/product.do?id=NCV7356)http://www.nxp.com/products/automotive/transceivers/can_transceivers/series/TJA1050.html)
  • 5/20/2018 CAN Hacking_ the Hardware

    7/23

    8/31/2014 CAN Hacking: The Hardware

    http://hackaday.com/2013/11/05/can-hacking-the-hardware/ 7/23

    Comments

    1. Anybodysguesssays:

    November 5, 2013 at 10:13 am

    DUDE! You got to start using breaks!

    ReplyReport comment

    FrankTheCatsays:

    November 5, 2013 at 12:00 pm

    Seriously, a break right before the Wiring section would be best. Please.

    ReplyReport comment

    2. Gdoggsays:

    November 5, 2013 at 10:22 am

    Looks like they connected the saleae wrong

    ReplyReport comment

    NiNsays:November 5, 2013 at 2:41 pm

    http://hackaday.com/2013/11/05/can-hacking-the-hardware/comment-page-1/#comment-1092186http://hackaday.com/2013/11/05/can-hacking-the-hardware/?replytocom=1092030#respondhttp://hackaday.com/2013/11/05/can-hacking-the-hardware/comment-page-1/#comment-1092030http://hackaday.com/2013/11/05/can-hacking-the-hardware/?replytocom=1092082#respondhttp://hackaday.com/2013/11/05/can-hacking-the-hardware/comment-page-1/#comment-1092082http://hackaday.com/2013/11/05/can-hacking-the-hardware/?replytocom=1092023#respondhttp://hackaday.com/2013/11/05/can-hacking-the-hardware/comment-page-1/#comment-1092023http://adclick.g.doubleclick.net/pcs/click?xai=AKAOjsuHkBpuGrXai5p3guDY9CBiUM72XhfimKgCLBxab07Zq7mv88wfhEua5DRAZiAgLdn8nkrKRTcbGhohK1SMOQtd0I5U7w&sai=AMfl-YSzcL63cw_0IPDSwWrI1y8dc2f4pJDsxhlu5cB8nuvAXyRBcdtevAv0N_pyzzY&sig=Cg0ArKJSzOw6p8aXn1a6&adurl=http://ads.supplyframe.com/openads/www/delivery/ck.php%3Foaparams%3D2__bannerid%3D72065__zoneid%3D429__cb%3Df8da7c5362__oadest%3Dhttp%253A%252F%252Fanalytics.supplyframe.com%252Ftrackingservlet%252Ftrack%252F%253Faction%253DadClick%2526value1%253D%7Btaxonomy_enc%7D%2526value2%253D72065%2526value3%253D874%2526zone%253D429%2526extra%253Dcontextualmatch%253Dnolimitation%257Ccookietax%253D0%257Ccb%253Df8da7c5362%257Ch_value%253D39e8418b57f1f4f41409496520%257Ch_crc%253D4057766122%257Cgeo%253Dro%257Ccnt%253Deu%257Cbp%253D0.054756105290951%257Cbpf%253D146.30098923346%257Ccp%253D10%257Ch_i%253Dy%2526zone%253D429%2526url%253Dhttp://www.ti.com/tool/msp430-iqmathlib
  • 5/20/2018 CAN Hacking_ the Hardware

    8/23

    8/31/2014 CAN Hacking: The Hardware

    http://hackaday.com/2013/11/05/can-hacking-the-hardware/ 8/23

    They didnt, grey wire is ground, as you can see on the wire label. I suppose it would be more logical if black one was ground, with

    channels color-coded same as resistor colors but hey, its Saleae(s) logic. :)

    BTW, very nice clone, works with SL software&driver, but costs $9 : http://www.banggood.com/USB-Saleae-24M-8CH-24MHz-

    8Channel-Logic-Analyzer-Latest-Support-1_1_15-p-74101.html

    ReplyReport comment

    xpertsays:

    November 5, 2013 at 4:02 pm

    and what about inside ? is circuit same ? dave from EEVBlog teared-down original

    ReplyReport comment

    Tyler Bletschsays:

    November 5, 2013 at 4:11 pm

    My understanding is that they all use the same Cypress chip, so whether its a Saleae or a USBee is just a matter of the

    firmware. Now the ancillary components are probably worse, but my knockoff works just fine.

    ReplyReport comment

    NiNsays:

    November 7, 2013 at 8:34 am

    Yup, same Cypress chip. Isolation chip is also present.

    ReplyReport comment

    3. Jcereckesays:November 5, 2013 at 10:26 am

    Does anyone know the difference/compatibility with the BMW iBus and standard CAN? Ive got a USB-iBus adaptor but wanted a dev board

    that lives in the car permanently providing automation.

    ReplyReport comment

    denissays:

    November 5, 2013 at 1:07 pm

    I used a Canbus shield to play with the 100kb k-bus on my E60. toook some faffing but worked eventually. I dont think the i-bus is a

    http://hackaday.com/2013/11/05/can-hacking-the-hardware/comment-page-1/#comment-1092132http://hackaday.com/2013/11/05/can-hacking-the-hardware/?replytocom=1092033#respondhttp://hackaday.com/2013/11/05/can-hacking-the-hardware/comment-page-1/#comment-1092033http://www.ceretech.co.nz/http://hackaday.com/2013/11/05/can-hacking-the-hardware/?replytocom=1093710#respondhttp://hackaday.com/2013/11/05/can-hacking-the-hardware/comment-page-1/#comment-1093710http://hackaday.com/2013/11/05/can-hacking-the-hardware/?replytocom=1092246#respondhttp://hackaday.com/2013/11/05/can-hacking-the-hardware/comment-page-1/#comment-1092246http://discspace.org/http://hackaday.com/2013/11/05/can-hacking-the-hardware/?replytocom=1092241#respondhttp://hackaday.com/2013/11/05/can-hacking-the-hardware/comment-page-1/#comment-1092241http://hackaday.com/2013/11/05/can-hacking-the-hardware/?replytocom=1092186#respondhttp://www.banggood.com/USB-Saleae-24M-8CH-24MHz-8Channel-Logic-Analyzer-Latest-Support-1_1_15-p-74101.html
  • 5/20/2018 CAN Hacking_ the Hardware

    9/23

    8/31/2014 CAN Hacking: The Hardware

    http://hackaday.com/2013/11/05/can-hacking-the-hardware/ 9/23

    can bus in the sence of differential signalling etc but it is really well documented online, with only a quick google throwing up schematics

    and ready-made interfaces, sure you can hook something to a microcontroller?

    ReplyReport comment

    4. ejonessssays:

    November 5, 2013 at 10:43 am

    CAN needs to be terminated, preferably by a 120 ohm resistance on either end of the bus.

    then does scsi qualify as a can device?

    ReplyReport comment

    ASsays:

    November 5, 2013 at 1:04 pm

    No Whered you get that idea? All transmission lines need to be terminated, otherwise you get reflections from the ends.

    ReplyReport comment

    5. Hubert S. Cumberdalesays:

    November 5, 2013 at 10:46 am

    what about OBD2 cables

    ReplyReport comment

    6. wardysays:

    November 5, 2013 at 12:00 pm

    +1 for the Saleae Logic. Ive had mine for a couple of years and its still the go-to tool when messing with digital circuits. I was using mine even

    today to prove that my Propeller chip was outputting well-formed asynchronous serial data at 2666667 baud. It was :)

    I dont care that the Saleaes not open source, because its really very useful indeed.

    It is a pity that Saleae are not developing the software anymore though.

    ReplyReport comment

    7. Drakesays:November 5, 2013 at 12:22 pm

    http://hackaday.com/2013/11/05/can-hacking-the-hardware/comment-page-1/#comment-1092097http://hackaday.com/2013/11/05/can-hacking-the-hardware/?replytocom=1092083#respondhttp://hackaday.com/2013/11/05/can-hacking-the-hardware/comment-page-1/#comment-1092083http://wardyprojects.blogspot.com/http://hackaday.com/2013/11/05/can-hacking-the-hardware/?replytocom=1092040#respondhttp://hackaday.com/2013/11/05/can-hacking-the-hardware/comment-page-1/#comment-1092040https://www.facebook.com/hubertscumberdalehttp://hackaday.com/2013/11/05/can-hacking-the-hardware/?replytocom=1092130#respondhttp://hackaday.com/2013/11/05/can-hacking-the-hardware/comment-page-1/#comment-1092130http://hackaday.com/2013/11/05/can-hacking-the-hardware/?replytocom=1092039#respondhttp://hackaday.com/2013/11/05/can-hacking-the-hardware/comment-page-1/#comment-1092039http://hackaday.com/2013/11/05/can-hacking-the-hardware/?replytocom=1092132#respond
  • 5/20/2018 CAN Hacking_ the Hardware

    10/23

    8/31/2014 CAN Hacking: The Hardware

    http://hackaday.com/2013/11/05/can-hacking-the-hardware/ 10/23

    Dont think it has been mentioned before but the 2CAN is able to bridge a CAN network to ethernet as well. Then sending and receiving data

    can be done via UDP packets.

    ReplyReport comment

    8. nleahcimsays:

    November 5, 2013 at 12:50 pm

    Id suggest doing a little more research about proper CAN termination before giving blatantly wrong information. CAN is run on a 120 ohm diffpair typically and thus needs to be terminated with 120 ohm resistors on *both* ends of the bus. Failure to do so will cause signal integrity

    issues. With a short and/or slow bus, you probably will be fine with improper termination. But very frequently improper termination will cause

    major problems.

    ReplyReport comment

    randomcoderdudesays:

    November 6, 2013 at 12:53 am

    +1

    ReplyReport comment

    adhsays:

    November 6, 2013 at 1:50 am

    While I generally agree with 120R resistors on both ends being the only correct solution, it does seem to not matter much for short buses.

    As with short runs of slow speed RS-485 the termination resistors are more important for correct idle bias than transmission line

    termination itself. Two wire CAN also in fact isnt true differential bus because of how the protocol works, but two independent single

    ended signals that are most of the time sensed as one differential pair, this has to do with how the arbitration and clock recovery works.

    In all: I have seen some short-ish CAN buses with single 60R resistor in middle instead of 120R termination on ends (and that was

    mostly in vehicles, so it seems to be pretty reliable solution, although weird and I would certainly not recommend doing that).

    ReplyReport comment

    9. Tyler Bletschsays:

    November 5, 2013 at 1:09 pm

    Two questions I havent been able to find answers for:

    http://hackaday.com/2013/11/05/can-hacking-the-hardware/comment-page-1/#comment-1092134http://discspace.org/http://hackaday.com/2013/11/05/can-hacking-the-hardware/?replytocom=1092548#respondhttp://hackaday.com/2013/11/05/can-hacking-the-hardware/comment-page-1/#comment-1092548http://hackaday.com/2013/11/05/can-hacking-the-hardware/?replytocom=1092527#respondhttp://hackaday.com/2013/11/05/can-hacking-the-hardware/comment-page-1/#comment-1092527http://randomcoderdude.wordpress.com/http://hackaday.com/2013/11/05/can-hacking-the-hardware/?replytocom=1092115#respondhttp://hackaday.com/2013/11/05/can-hacking-the-hardware/comment-page-1/#comment-1092115http://hackaday.com/2013/11/05/can-hacking-the-hardware/?replytocom=1092097#respond
  • 5/20/2018 CAN Hacking_ the Hardware

    11/23

    8/31/2014 CAN Hacking: The Hardware

    http://hackaday.com/2013/11/05/can-hacking-the-hardware/ 11/23

    1. Is the CAN typically used by OBD-2 low- or high-speed, and what are these speeds? Ive seen 125kbps, 250kbps, and 500kbps

    mentioned

    2. Is there any reason why you couldnt just bitbang this on a regular old microcontroller without extra chips? Its just 0-5V, two pins, and a

    resistor, right? Im surprised that all the designs I see involve dedicated CAN chips without mention of manual signaling.

    ReplyReport comment

    nleahcimsays:November 5, 2013 at 2:18 pm

    Tyler CAN could definitely be bitbanged on an MCU that did not have the peripheral. However, you would be best served by having

    a CAN transceiver in between the MCU and the CAN bus to handle the physical layer. Your typical CAN nus sits at 2.5V when idle

    (weakly pulled to 2.5V), and then the CANL line will go below that and the CANH line will go above that during communication. So

    thatd be tricky to replicate with just an MCU.

    ReplyReport comment

    Tyler Bletschsays:November 5, 2013 at 3:41 pm

    Why would that be tricky? Wouldnt this circuit do it?

    http://i.imgur.com/lRXqo5H.jpg

    ReplyReport comment

    Tyler Bletschsays:

    November 5, 2013 at 3:48 pm

    Oh wait, I think I get it now it would be hard to detect the 2.5V state, you mean, right?

    You could use the analog inputs on an AVR to do this they also function as digital IOs, so you can put a ground or 5V on a

    line, or flip it to an analog in to differentiate 0 from 2.5 from 5.

    Am I missing something?

    ReplyReport comment

    Foxdiesays:

    http://www.carmodder.com/http://hackaday.com/2013/11/05/can-hacking-the-hardware/?replytocom=1092231#respondhttp://hackaday.com/2013/11/05/can-hacking-the-hardware/comment-page-1/#comment-1092231http://discspace.org/http://hackaday.com/2013/11/05/can-hacking-the-hardware/?replytocom=1092226#respondhttp://i.imgur.com/lRXqo5H.jpghttp://hackaday.com/2013/11/05/can-hacking-the-hardware/comment-page-1/#comment-1092226http://discspace.org/http://hackaday.com/2013/11/05/can-hacking-the-hardware/?replytocom=1092173#respondhttp://hackaday.com/2013/11/05/can-hacking-the-hardware/comment-page-1/#comment-1092173http://hackaday.com/2013/11/05/can-hacking-the-hardware/?replytocom=1092134#respond
  • 5/20/2018 CAN Hacking_ the Hardware

    12/23

    8/31/2014 CAN Hacking: The Hardware

    http://hackaday.com/2013/11/05/can-hacking-the-hardware/ 12/23

    November 5, 2013 at 9:44 pm

    Hi Tyler,

    1. CAN has become a bit of an ambiguous term in the real world, when people say that their car has CAN or CANBUS this will,

    more often than not, be a high speed two-wire CAN Bus operating at 500 Kbps. There are many different implementations however,

    single wire, different speeds like youve already found.

    2. Although on paper it looks like this is possible, again real world environments differ. Firstly, automotive electrical systems are full of

    electromagnetic interference (typically from ignition systems and the alternator), additionally (particularly when a car engine is cranked by

    a starter motor) massive surges can be sent through the power supply system (aka +VE or +12V) as the alternator starts to kick in, these

    voltages often easily spike as high as +40V before settling down

    What hasnt been covered in this document is single-wire CAN bus networks. They often bridge +VE (12.. well up to 40V) on the bus

    to assert a wake-up signal to ECUs, they also dont use a 120 Ohm resistor to terminate each end of the bus (some implementations use

    a 60 Ohm, some dont even use anything but I digress).

    ReplyReport comment

    10. Harrysays:

    November 5, 2013 at 3:22 pm

    I think NXP needs some love here, their LPC11C24 is a great little ARM micro that has an on board CAN transceiver and can be had on a

    dev board (LPCxpresso) with a built in programmer for about $30. Fairly straightforward to program using NXPs open source libs as well.

    ReplyReport comment

    11. tekkieneetsays:November 5, 2013 at 4:53 pm

    Tyler: You could simplify the circuit (i.e. save 2 resistors) by having

    a 10K pull up on one CAN bus line and a 10K pull down on the other one.

    While you could hook up the AVR directly to the CAN bus, I would caution

    to read the electrical spec on the CAN bus pins to make sure that they

    would not exceed the maximum electrical spec on the AVR side!

    http://www.ti.com/general/docs/lit/getliterature.tsp?baseLiteratureNumber=sloa101

    http://www.ti.com/general/docs/lit/getliterature.tsp?baseLiteratureNumber=sloa101http://hackaday.com/2013/11/05/can-hacking-the-hardware/comment-page-1/#comment-1092269http://hackaday.com/2013/11/05/can-hacking-the-hardware/?replytocom=1092222#respondhttp://hackaday.com/2013/11/05/can-hacking-the-hardware/comment-page-1/#comment-1092222http://hackaday.com/2013/11/05/can-hacking-the-hardware/?replytocom=1092415#respondhttp://hackaday.com/2013/11/05/can-hacking-the-hardware/comment-page-1/#comment-1092415
  • 5/20/2018 CAN Hacking_ the Hardware

    13/23

    8/31/2014 CAN Hacking: The Hardware

    http://hackaday.com/2013/11/05/can-hacking-the-hardware/ 13/23

    CAN bus transceivers from TI can handle -2V to 7V CMM range and handle

    +/-36V shorts. I would use a proper transceiver for the protection.

    ReplyReport comment

    12. Bradleysays:

    November 5, 2013 at 5:36 pm

    Unfortunately, theres no set standard for CAN connections.

    Umm, what about J1939? Yea, there is a standard. Just because some dont follow it, doesnt make the standards disappear.

    ReplyReport comment

    xadhsays:

    November 6, 2013 at 2:00 am

    J1939 is higher level protocol built on top of CAN that happens to specify some kind of connectors. That does not make these

    connectors standard for other uses for CAN.

    ReplyReport comment

    Francoissays:

    November 7, 2013 at 3:39 am

    +1 J1939 is way more than just a connector, it provide a solution to the issues with Message Id, sender Id, priority and multi

    packet messages. It also include a big set of predefined PGN (message) and SPN(channel) that should be sent on a truck.

    i work every day with J1939 and i think its a very good high level protocol, even if the whole standard is adapted to Trucks, most

    of the high level concepts could be used within any other projects. even if you dont use the J1939-71 messages descriptions, you

    could do your own PGNs and SPN descriptions, just dont connect this on a real J1939 network on a truck, you could cause

    troubles resulting in injuries or death

    ReplyReport comment

    13. texanesays:

    November 5, 2013 at 11:43 pm

    Hi,

    http://hackaday.com/2013/11/05/can-hacking-the-hardware/comment-page-1/#comment-1092485http://hackaday.com/2013/11/05/can-hacking-the-hardware/?replytocom=1093440#respondhttp://hackaday.com/2013/11/05/can-hacking-the-hardware/comment-page-1/#comment-1093440http://hackaday.com/2013/11/05/can-hacking-the-hardware/?replytocom=1092560#respondhttp://hackaday.com/2013/11/05/can-hacking-the-hardware/comment-page-1/#comment-1092560http://hackaday.com/2013/11/05/can-hacking-the-hardware/?replytocom=1092294#respondhttp://hackaday.com/2013/11/05/can-hacking-the-hardware/comment-page-1/#comment-1092294http://hackaday.com/2013/11/05/can-hacking-the-hardware/?replytocom=1092269#respond
  • 5/20/2018 CAN Hacking_ the Hardware

    14/23

    8/31/2014 CAN Hacking: The Hardware

    http://hackaday.com/2013/11/05/can-hacking-the-hardware/ 14/23

    if it can be useful to someone, I implemented dspic33f based serial to can

    bridge whose code can be found here:

    https://github.com/texane/scab

    Documentation here:

    https://github.com/texane/scab/blob/master/doc/latex/main.pdf

    Cheers,

    Texane.

    ReplyReport comment

    14. Vaidassays:

    November 6, 2013 at 1:11 pm

    Hi everyone,

    some time ago I started working on a new hacker-friendly board that would have CAN connectivity, microcontroller with integrated CANperipheral and Arduino compatibility. I came up with something I would call Elduino CAN128 :) If anyone is interested, more information can

    be found on my blog:

    http://www.electronicsworkshop.eu/Elduino-CAN128-assembly-in-process

    It is just in a prototyping stage now and it would be nice to get your opinions about it :)

    Thanks!

    Vaidas

    ReplyReport comment15. Paul Stoffregensays:

    November 18, 2013 at 6:15 am

    Im curious to try CAN, but my car is 19 years old.

    I suppose I could just hook 2 microcontrollers together, but thats not very interesting. Im seen some ECU simulators, from $200 to $3000,

    which seems pretty spendy.

    Can any recommend a cheap source for an actual ECU or other CAN stuff I could just power up on my desk with 12 volts and have it send

    CAN messages? Hoping to keep this under $50, if possible?

    http://hackaday.com/2013/11/05/can-hacking-the-hardware/comment-page-1/#comment-1104613http://www.pjrc.com/teensy/http://hackaday.com/2013/11/05/can-hacking-the-hardware/?replytocom=1092956#respondhttp://www.electronicsworkshop.eu/Elduino-CAN128-assembly-in-processhttp://hackaday.com/2013/11/05/can-hacking-the-hardware/comment-page-1/#comment-1092956http://www.electronicsworkshop.eu/http://hackaday.com/2013/11/05/can-hacking-the-hardware/?replytocom=1092485#respondhttps://github.com/texane/scab/blob/master/doc/latex/main.pdfhttps://github.com/texane/scab
  • 5/20/2018 CAN Hacking_ the Hardware

    15/23

    8/31/2014 CAN Hacking: The Hardware

    http://hackaday.com/2013/11/05/can-hacking-the-hardware/ 15/23

    ReplyReport comment

    Foxdiesays:

    November 18, 2013 at 6:54 am

    Hi Paul,

    Take a look at these pages;

    http://mbed.org/handbook/CAN

    http://www.skpang.co.uk/catalog/canbus-breakout-board-p-754.html

    To set up a basic network, youll need 2 of the breakout boards and one or more mbed LPC1768s. I say one or more because the

    LPC1768 has 2 CAN controllers and you can use them both at the same time (ie. get it to talk with itself), or you can use two

    LPC1768s and have 2 distinct nodes to play with.

    When you connect the breakout boards together, dont be tempted to cross the CAN_H and CAN_L lines (CAN_H should go to

    CAN_H etc) and make sure the 120 Ohm jumper is fitted on both boards. If you use one of the boards with a car, 99% of the time youwont need this jumper fitted, its only for when youre building a network outside of an existing one that would already have these

    terminating resistors fitted.

    When youre ready to step up to deeper stuff, heres a working GMLAN-specific packet sniffer that outputs data to a USB serial port

    that comes with the mbed; https://mbed.org/users/foxdie/code/GMLAN-Sniffer/

    Although its geared towards GMLAN SWCAN (General Motors implementation of a single-wire CAN Bus) you should be able to pull

    a lot out of it for your own gains.

    Ps. Yes, you can use one to simulate an ECU or a diagnostic tool, Ive reprogrammed Holden VE head units and done some other

    stupid crap with mine; http://www.youtube.com/watch?v=98h9qULPRus

    ReplyReport comment

    Paul Stoffregensays:

    November 18, 2013 at 11:11 am

    Great. I have an mbed, so far sitting unused. But thats still just having a microcontroller talk to itself.

    Im hoping to do something like what this guy did. Scroll down to the photos in week 2:

    http://hackaday.com/2013/11/05/can-hacking-the-hardware/comment-page-1/#comment-1104823http://www.pjrc.com/teensy/http://hackaday.com/2013/11/05/can-hacking-the-hardware/?replytocom=1104639#respondhttp://www.youtube.com/watch?v=98h9qULPRushttps://mbed.org/users/foxdie/code/GMLAN-Sniffer/http://www.skpang.co.uk/catalog/canbus-breakout-board-p-754.htmlhttp://mbed.org/handbook/CANhttp://hackaday.com/2013/11/05/can-hacking-the-hardware/comment-page-1/#comment-1104639http://www.carmodder.com/http://hackaday.com/2013/11/05/can-hacking-the-hardware/?replytocom=1104613#respond
  • 5/20/2018 CAN Hacking_ the Hardware

    16/23

    8/31/2014 CAN Hacking: The Hardware

    http://hackaday.com/2013/11/05/can-hacking-the-hardware/ 16/23

    http://mbed.org/users/Just4pLeisure/notebook/frdm-kl25z-library-for-seeed-studio-can-bus-shield/

    Hes got a real ECU from some car or truck hooked up. Its sending messages, which the test on the microcontroller is receiving.

    Any idea where I might buy such a thing? And also find enough info about it to get it powered up on my desk without the rest of

    the intended car attached?

    ReplyReport comment16. Paul Stoffregensays:

    November 18, 2013 at 11:12 am

    This:

    http://mbed.org/media/uploads/Just4pLeisure/seeed_can_and_t7_ecu.jpg

    ReplyReport comment

    Leave a Reply

    Enter your comment here...

    http://hackaday.com/2013/11/05/can-hacking-the-hardware/?replytocom=1104824#respondhttp://mbed.org/media/uploads/Just4pLeisure/seeed_can_and_t7_ecu.jpghttp://hackaday.com/2013/11/05/can-hacking-the-hardware/comment-page-1/#comment-1104824http://www.pjrc.com/teensy/http://hackaday.com/2013/11/05/can-hacking-the-hardware/?replytocom=1104823#respondhttp://mbed.org/users/Just4pLeisure/notebook/frdm-kl25z-library-for-seeed-studio-can-bus-shield/
  • 5/20/2018 CAN Hacking_ the Hardware

    17/23

    8/31/2014 CAN Hacking: The Hardware

    http://hackaday.com/2013/11/05/can-hacking-the-hardware/ 17/23

    Never Miss a Hack

    Search

    Search this website Search

    Categories

    Select Category

    In case you missed it

    http://hackaday.com/2014/08/27/the-inaugural-hackaday-io-meetup/https://twitter.com/hackadayhttps://plus.google.com/+hackadayhttps://www.facebook.com/pages/Hack-a-Day/136115233068429http://adclick.g.doubleclick.net/aclk?sa=L&ai=BgfUuzTUDVOq1BMqN-waE8IGIAQAAAAAQASAAOABQqteLrgNY6Lj4G2CDpeGF6BuCAQljYS1nb29nbGWyAQxoYWNrYWRheS5jb23IAQKoAwHgBAKgBj7gBrn8hgE&num=0&sig=AOD64_3_ZnU85ZquDao4AjmseYBOkTR5oA&client=&adurl=http://ads.supplyframe.com/openads/www/delivery/ck.php%3Foaparams%3D2__bannerid%3D72072__zoneid%3D428__cb%3D8e39b780c1__oadest%3Dhttp%253A%252F%252Fanalytics.supplyframe.com%252Ftrackingservlet%252Ftrack%252F%253Faction%253DadClick%2526value1%253D%7Btaxonomy_enc%7D%2526value2%253D72072%2526value3%253D854%2526zone%253D428%2526extra%253Dcontextualmatch%253Dnolimitation%257Ccookietax%253D0%257Ccb%253D8e39b780c1%257Ch_value%253Dc30d92ffdca693521409496520%257Ch_crc%253D4057766122%257Cgeo%253Dro%257Ccnt%253Deu%257Cbp%253D0.26964166041743%257Cbpf%253D311.96113168199%257Ccp%253D10%257Ch_i%253Dy%2526zone%253D428%2526url%253Dhttp://www.ti.com/product/am4379
  • 5/20/2018 CAN Hacking_ the Hardware

    18/23

    8/31/2014 CAN Hacking: The Hardware

    http://hackaday.com/2013/11/05/can-hacking-the-hardware/ 18/23

    The Inaugural Hackaday.io Meetup

    5 Comments

    DEFCON: Blackphone

    35 Comments

    [Bil's] Quest for a Lost Finger: Episode I

    86 Comments

    50 Semifinalists Selected for Next Stage of The Hackaday Prize

    151 Comments

    Fear and Loathing at DEFCON 22

    http://hackaday.com/2014/08/22/fear-and-loathing-at-defcon-2014/http://hackaday.com/2014/08/22/fear-and-loathing-at-defcon-2014/http://hackaday.com/2014/08/25/50-semifinalists-selected-for-next-stage-of-the-hackaday-prize/#commentshttp://hackaday.com/2014/08/25/50-semifinalists-selected-for-next-stage-of-the-hackaday-prize/http://hackaday.com/2014/08/25/50-semifinalists-selected-for-next-stage-of-the-hackaday-prize/http://hackaday.com/2014/08/27/bils-quest-for-a-lost-finger-episode-i/#commentshttp://hackaday.com/2014/08/27/bils-quest-for-a-lost-finger-episode-i/http://hackaday.com/2014/08/27/bils-quest-for-a-lost-finger-episode-i/http://hackaday.com/2014/08/27/defcon-blackphone/#commentshttp://hackaday.com/2014/08/27/defcon-blackphone/http://hackaday.com/2014/08/27/defcon-blackphone/http://hackaday.com/2014/08/27/the-inaugural-hackaday-io-meetup/#commentshttp://hackaday.com/2014/08/27/the-inaugural-hackaday-io-meetup/
  • 5/20/2018 CAN Hacking_ the Hardware

    19/23

    8/31/2014 CAN Hacking: The Hardware

    http://hackaday.com/2013/11/05/can-hacking-the-hardware/ 19/23

    11 Comments

    More Posts from this Category

    Our Columns

    Hacklet #13 Chopper Royalty

    6 Comments

    Droning On: Maiden Flights

    4 Comments

    Retrotechtacular: Turn On the Magic of Colored Light

    12 Comments

    http://hackaday.com/2014/08/26/retrotechtacular-turn-on-the-magic-of-colored-light/#commentshttp://hackaday.com/2014/08/26/retrotechtacular-turn-on-the-magic-of-colored-light/http://hackaday.com/2014/08/26/retrotechtacular-turn-on-the-magic-of-colored-light/http://hackaday.com/2014/08/28/droning-on-maiden-flights/#commentshttp://hackaday.com/2014/08/28/droning-on-maiden-flights/http://hackaday.com/2014/08/28/droning-on-maiden-flights/http://hackaday.com/2014/08/29/hacklet-13-chopper-royalty/#commentshttp://hackaday.com/2014/08/29/hacklet-13-chopper-royalty/http://hackaday.com/2014/08/29/hacklet-13-chopper-royalty/http://hackaday.com/category/featured/http://hackaday.com/2014/08/22/fear-and-loathing-at-defcon-2014/#comments
  • 5/20/2018 CAN Hacking_ the Hardware

    20/23

    8/31/2014 CAN Hacking: The Hardware

    http://hackaday.com/2013/11/05/can-hacking-the-hardware/ 20/23

    Ask Hackaday: Can Paper USB Business Cards Exist?

    70 Comments

    Hacklet #12 Last Minute Hackaday Prize Submissions

    10 Comments

    More Posts from this Category

    Recent comments

    metai on Purely Mechanical Display Uses 804 Balls To Create a Kinetic Display

    Eirinnon Homemade Triple Monitor Mount Looks Professionally MadeDainBramage1991 on Green Light Your Commute with Americas Unsecured Traffic Lights

    Mike Schaale on Jeep Wrangler gets pressurized water right out of the bumper

    ANON on Custom Racing Chair with a Kinect and Haptic Feedback

    Michael on Green Light Your Commute with Americas Unsecured Traffic Lights

    Paul on Green Light Your Commute with Americas Unsecured Traffic Lights

    gregkennedyon Rapid Fire Mod For A Wireless Mouse

    Tony on Proximity Sensing LEDs Can Add a New Dynamic To Your Projects

    Tony on Proximity Sensing LEDs Can Add a New Dynamic To Your Projects

    Find Hacks by Date

    http://hackaday.com/2014/08/30/proximity-sensing-leds-can-add-a-new-dynamic-to-your-projects/comment-page-1/#comment-1771117http://hackaday.com/2014/08/30/proximity-sensing-leds-can-add-a-new-dynamic-to-your-projects/comment-page-1/#comment-1771119http://hackaday.com/2014/08/30/rapid-fire-mod-for-a-wireless-mouse/comment-page-1/#comment-1771120http://greg-kennedy.com/http://hackaday.com/2014/08/31/green-light-your-way-to-an-easy-commute/comment-page-1/#comment-1771121http://hackaday.com/2014/08/31/green-light-your-way-to-an-easy-commute/comment-page-1/#comment-1771125http://hackaday.com/2014/08/26/custom-racing-chair-with-a-kinect-and-haptic-feedback/comment-page-1/#comment-1771137http://hackaday.com/2013/04/12/jeep-wrangler-gets-pressurized-water-right-out-of-the-bumper/comment-page-1/#comment-1771139http://hackaday.com/2014/08/31/green-light-your-way-to-an-easy-commute/comment-page-1/#comment-1771148http://hackaday.com/2014/08/31/homemade-triple-monitor-mount-looks-professionally-made/comment-page-1/#comment-1771161http://www.facebook.com/shinythingspropshttp://hackaday.com/2014/08/30/purely-mechanical-display-uses-804-balls-to-create-a-kinetic-display/comment-page-1/#comment-1771166http://hackaday.com/category/hackaday-columns/http://hackaday.com/2014/08/22/hacklet-12-last-minute-hackaday-prize-submissions/#commentshttp://hackaday.com/2014/08/22/hacklet-12-last-minute-hackaday-prize-submissions/http://hackaday.com/2014/08/22/hacklet-12-last-minute-hackaday-prize-submissions/http://hackaday.com/2014/08/25/ask-hackaday-can-paper-usb-business-cards-exist/#commentshttp://hackaday.com/2014/08/25/ask-hackaday-can-paper-usb-business-cards-exist/http://hackaday.com/2014/08/25/ask-hackaday-can-paper-usb-business-cards-exist/
  • 5/20/2018 CAN Hacking_ the Hardware

    21/23

    8/31/2014 CAN Hacking: The Hardware

    http://hackaday.com/2013/11/05/can-hacking-the-hardware/ 21/23

    November 2013

    S M T W T F S

    Oct Dec

    1 2

    3 4 5 6 7 8 9

    10 11 12 13 14 15 16

    17 18 19 20 21 22 23

    24 25 26 27 28 29 30

    http://hackaday.com/2013/11/30/http://hackaday.com/2013/11/29/http://hackaday.com/2013/11/28/http://hackaday.com/2013/11/27/http://hackaday.com/2013/11/26/http://hackaday.com/2013/11/25/http://hackaday.com/2013/11/24/http://hackaday.com/2013/11/23/http://hackaday.com/2013/11/22/http://hackaday.com/2013/11/21/http://hackaday.com/2013/11/20/http://hackaday.com/2013/11/19/http://hackaday.com/2013/11/18/http://hackaday.com/2013/11/17/http://hackaday.com/2013/11/16/http://hackaday.com/2013/11/15/http://hackaday.com/2013/11/14/http://hackaday.com/2013/11/13/http://hackaday.com/2013/11/12/http://hackaday.com/2013/11/11/http://hackaday.com/2013/11/10/http://hackaday.com/2013/11/09/http://hackaday.com/2013/11/08/http://hackaday.com/2013/11/07/http://hackaday.com/2013/11/06/http://hackaday.com/2013/11/05/http://hackaday.com/2013/11/04/http://hackaday.com/2013/11/03/http://hackaday.com/2013/11/02/http://hackaday.com/2013/11/01/http://hackaday.com/2013/12/http://hackaday.com/2013/10/
  • 5/20/2018 CAN Hacking_ the Hardware

    22/23

    8/31/2014 CAN Hacking: The Hardware

    http://hackaday.com/2013/11/05/can-hacking-the-hardware/ 22/23

    Return to top of page

    Copyright 2014 Genesis Framework WordPress Log in

    https://hackadaycom.wordpress.com/wp-login.phphttp://wordpress.org/http://www.studiopress.com/http://adclick.g.doubleclick.net/aclk?sa=L&ai=BWigrzzUDVODBH4vs-gbfmYDQAQAAAAAQASAAOABQha2KwQZY49byG2CDpeGF6BuCAQljYS1nb29nbGWyAQxoYWNrYWRheS5jb23IAQKoAwHgBAKgBj7gBrn8hgE&num=0&sig=AOD64_0euraUH1JtgMRq75V0md0Dn4o7OQ&client=&adurl=http://ads.supplyframe.com/openads/www/delivery/ck.php%3Foaparams%3D2__bannerid%3D71372__zoneid%3D427__cb%3D0404a7c7d4__oadest%3Dhttp%253A%252F%252Fanalytics.supplyframe.com%252Ftrackingservlet%252Ftrack%252F%253Faction%253DadClick%2526value1%253D%7Btaxonomy_enc%7D%2526value2%253D71372%2526value3%253D872%2526zone%253D427%2526extra%253Dcontextualmatch%253Dnolimitation%257Ccookietax%253D0%257Ccb%253D0404a7c7d4%257Ch_value%253D11735c0a7f15bea51409496520%257Ch_crc%253D4057766122%257Cgeo%253Dro%257Ccnt%253Deu%257Cbp%253D0.051721244625426%257Cbpf%253D53.974795583717%257Ccp%253D10%257Ch_i%253Dy%2526zone%253D427%2526url%253Dhttp://www.ti.com/pwr-dcs-swift-tps544-pmbus-bs-eu
  • 5/20/2018 CAN Hacking_ the Hardware

    23/23

    8/31/2014 CAN Hacking: The Hardware

    http://hackaday.com/2013/11/05/can-hacking-the-hardware/ 23/23

    Hackaday, Hack A Day, and the Skull and Wrenches Logo are Trademarks of Hackaday.com

    Our Policies

    Powered by WordPress.com VIP

    http://vip.wordpress.com/http://hackaday.com/policies/