Thursday, 29 September 2016

CAN Bus Project Part 1 : Introduction

CAN is one of my favourite interfaces.

Not because it’s simple to get running. It isn’t! 

Not because its fast. It isn't! 

What it is, is just so damn elegant! Chock-full of neat error-detection and handshake stuff. It's also the darling of the car industry and their friends the car-hackers.

Anyhow, wanting adventure, I decided to have a crack at getting my Arduino Uno to “talk CAN” to my TI Tiva Launchpad.



Everyone from planet Earth (and probably those of you not) knows the Uno. The Tiva Launchpad may be unfamiliar for some. If so, think of it as an Uno-on-steroids. More on Tiva's another time.

One of the first things to know about CAN is that you can’t just upload a chunk of code to your Uno / Tiva and have it spit out CAN. One reason is that CAN needs special (“dominant / recessive”) voltages that an Arduino / Tiva simply can’t generate. 

To send a CAN message you need a way to translate the (in)output voltages of your Arduino / Tiva into CAN-speak

Fortunately, translating Arduino to CAN is cheap-as-chips. For a couple of quid (“bucks” to some of you) I picked up the dinky little interface board in Photo 2 off eBay. It features a Microchip MCP2515 IC.


To translate CAN to Tiva there's the MCP2551.

So, totally, my planned system was Figure 1.



I decided to send temperature data on the CAN link (hence the sensor). Finally, it turned some parts in Figure 1 needed 5V. Tiva pins are 3.3V maximum however, so to avoid blowing them I added a SN74LVC245A (Octal bus transceiver) 3.3V-to-5V logic voltage level shifter.

Next post, I'll talk more about how I got on hooking things up...



No comments:

Post a Comment