Open Hardware & Software to simplify the creation of distributed control systems.

Public Chat
Similar projects worth following
Project to create protocols, operating on CAN Bus, to simplify the control of a distributed electronic system. To take a simple example: if you had a distributed system where you had both a three way switch (On/Off/On), a simple On/Off switch, as well as four outputs which can be turned Off/On.

The above simple example is in fact the basics of the Indicator/Turn Signals in a vehicle. The On/Off/On switch indicates a Left or Right turn, whilst the On/Off switch is the hazard light switch. If the Hazard switch is On then we want to flash On and Off all of the four outputs. The Hazard switch has higher priority in the system, but if it is Off then the Left/Right switches comes into play. If the Left switch is On then we want to flash On and Off only two outputs, whereas if the Right switch is On we want to flash the other two outputs.

Can we create Nodes on a network and either a simple diagram or textual description to encapsulate the required logic of the system?


This all started with the re-wiring of a 1982 Mexican Volkswagen Beetle, many years ago. The result of that project was a mess. The car functioned, but in terms of an elegant solution to the wiring problem it certainly wasn't that. Fast forward and another project vehicle and another re-wiring problem. The problem space has changed very little over the years, but my proposed solution to the problem has to be an improvement on past attempts. That's when I discovered CAN Bus and what appears to be the obvious solution to the problem, (time will tell).

The Hardware

Given my discovery of CAN Bus protocols what I now needed was a simple micro-controller based board, like the Arduino, which talked CAN Bus and to which I could attach the necessary expansion boards to drive the various 12V electronics of the project vehicle. My search at the time didn't result in a satisfactory answer to my requirements. There were CAN Bus expansion shields for the Arduino family of boards, but once married to the Arduino the shield tied up the expansion slot and further 12V automotive electronics would be difficult to add. I could have created my own Arduino expansion shields, which each had a CAN Bus interface as well as 12V electronics, but that didn't appear to be the best solution. The obvious answer, to me, was to create my own micro-controller board which included all the CAN Bus, and higher level management protocols to which various expansion boards could then be added. The result is the cinnamonBun:

cinnamonBun PCB

Ultimately this device will be Open Hardware but I'm hoping to get it into a vehicle, to test it to some extent before doing so. I'm hoping to catch any obvious, and potentially embarrassing, school boy errors before opening myself up to ridicule ;-) once tested I'll be happier to Open the device as a beta version and who knows perhaps sell a few, to pay some bills.

The Software

The problem space does not simply require Hardware but the Software that simplifies the solutions to distributed control problems. Ultimately the aim is to have an underlying Software Architecture which allows a simple Application code architecture, much like the Arduino, where developers have to create just two functions, one to initialise the CAN Bus Node and the other to add processing to the CAN Node's main even loop. There are three levels to this SW Architecture:


At the lowest level is an Open Source LGPL licensed library of code which offers a simplified interface to the Hardware features of both the Microchip dsPIC33EP256MU806 based cinnamonBun, and the features of the cinnamonBun itself. Currently the library includes Hardware timers, UARTs, SPI, OneWire etc. etc. but more functionality will have to be added as more problems are tackled. At the time of writing, for example, I have still to tackle Analog inputs. This library of code libesoup is already Open to public scrutiny on github.


On top of the low level libesoup library is the code which manages the CAN Node. This code manages the protocols and the housekeeping associated with managing a node on the CAN Bus network. I'm reluctant to use the term OS because, whilst the code does manage lower level functions, so that higher layers can ignore the details, it is intended to be as small as possible, as it's intended target is a micro-controller. There will be no thread scheduling or memory management, those features aren't, at present, required to solve the problem being solved.

The CAN Node management software is Open and licensed under the GPL and can be obtained from github. If libesoup is a work...

Read more »

  • CAN Bus - The Basics

    John Whitmore09/28/2018 at 08:34 0 comments

    After a period of laying the ground work on some simpler protocols in my YouTube channel, I've finally got to the point where I'm dealing with the CAN Bus Protocol. Hopefully this means that new episodes will be appearing slightly more frequently in future. For now it's a start:

    I probably over stress the fact that CAN Bus has no address in its Layer 2 Frame, but it's why the protocol is so useful. Given that the OSI 7 Layer model stipulates that layer 2 frames should contain a source and destination address perhaps the CAN Bus protocol might be considered as being at layer 1.5 of the 7 layer OSI Model? Perhaps but there's no way I'm putting '1.5' into variable and function names ;)

  • Another libesoup fundamentals video

    John Whitmore04/24/2018 at 19:14 0 comments

    I'm getting to the project vehicle, Input and Output boards are on order, so I'll try and get some sort of update on that aspect of the project soon. Mean time another fundamentals video on using some of the API's in libesoup. This time simple UART Transmission. It's basic but I'm trying to build up from the basics to CAN Bus and USB protocols.

View all 2 project logs

Enjoy this project?



Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates