Friday, April 25, 2014

Getting on the CAN bus

I co-worker from waaay back (199?) contacted me a while ago about helping out with some issues he had with a linux system that talks with a CAN bus. A very interesting system. But I won't go into specifics here on that point.

Anyway, CAN bus. Most will probably think OBD-II, cars and ELM327, understandable as that is what it was designed for. And that was just about all I did know about it myself too. Researching into it some more was very enlightening and I got some cool ideas on how to use CAN for one of my own little forever projects.

Now, CAN bus is quite simple, two wires, differential. All you need is a transceiver, a controller and something to tie that into your computer, USB, RS232, PCI, etc. Some Linux friendly and cheap boards even have CAN bus integrated in their SoC. And there are some easy to interface SPI controllers that you can use with your favourite microcontroller.

What makes it really interesting is that most of the low-level stuff is handled on-chip. Software does not need to care about timings, arbitration, bit-stuffing, CRC and all that. It is all on the chip. And you have a wide choice of bandwidth/length options. Need to connect that sensor a 100 meters away ? No problem. And thanks to being designed for hostile environments it should work over just about any two wires, or so I've heard.

There are some limits of course. Maximum data packet size is a whooping 8 bytes. And messages have only have a message ID, no sender or receiver ID. So the network is a 1:N broadcast network. But still, that is quite OK for a sensor network.

I ordered a couple of MCP2515 and MCP2551 chips and I hope I have some time do play with them soon.

Y-Radio updated, new icon and Facebook page!

I finally got Y-Radio update in harbour, already a couple of weeks ago (QA approved April 8th). New features include:
  • All available YLE Radio channels now available and nicely grouped
  • For channels that offer it, program information (Note: this uses the undocumented API still, so it might have issues from time to time)
  •  Channel information with quick links to various on-line service the radio channel offer (Twitter, YouTube, etc)
  • Preliminary translations to Finnish and Swedish
  • Major internal changes
  • And Y-Radio is now on Facebook
Channel list
Program details

Program information
Also a very helpfull Jolla community member offered to create a much nicer icon for the application. This version does not use it yet, but the next update will have it. But take a look at this, awesome isn't it ?!
New Y-Radio icon