Sunday 20 November 2011

Controller Area Network - Development Process

DEVELOPMENT PROCESS

As the application is designed to be as simple as possible, the first thing to start with is a simple code which uses buttons for connecting to the board (“Connect”) and disconnecting from it (“Disconnect”).

For displaying the information received from the board, a RichEdit is placed into the application. The source code should have functions for opening ports, closing them, reading from and writing to the buffer as well as error handling.

Code Snippet
//-----Code Snippet from the TCommPort Constructor-----//
TCommPort::TCommPort()
: m_CommOpen(false),
m_CommPort(“COM5”),
m_hCom(0)
{
m_dcb.DCBlength = sizeof(DCB);
m_dcb.BaudRate =1382400;
m_dcb.ByteSize =8;
m_dcb.Parity =NOPARITY; //NOPARITY and friends are #defined in windows.h
m_dcb.StopBits =ONESTOPBIT; //ONESTOPBIT is also from windows.h
}
//----end of TCommPort constructor-----//
The first step of implementing the communication library into the application is to assign the “OpenCommPort()” function to the “Connect” Button.

Tuesday 8 November 2011

Controller Area Network(CAN ) Hardware

The Development Board:

The analyzer itself is a LPC-E2294-RB development board from Olimex. This development board uniquely features four CAN controllers and a UART to USB conversion chip capable of RS-232 with speeds exceeding 1Mbits/s.


Picture courtesy of www.olimex.com

CAN-Controller Area Network -A Graphical User Interface

Introducing CAN

Controller Area Network (CAN) is the de-facto protocol for communication between embedded devices. It was developed by Bosch in 1983 and was designed originally to be used in automotive industry where many systems within a car need to be communicated with a central ECU.


CAN or CAN-bus is a vehicle bus standard design to allow microcontrollers and devices to communicate within a vehicle without a host computer.


CAN is a high integrity serial data communications bus for real time control applications. Operates at data rates up to 1Mbits/s over links up to approximately 40m.