HA-I05.01

Part description

Current development revision.

This document describes the communication protocol between the USB/CAN converter HA-B02 and the control PC computer program ha_iod.

All numerical values are decimal unless explicitly stated otherwise.

Transport layer

  1. The messages between ha_iod and HA-B02 are exchanged over a USB-serial link, running at 19200 bps, 8 data bits, no parity, 1 stop bit ("8N1").
  2. No method for flow-control is used.

Data format

  1. Data is transmitted using ASCII characters ranging from 33-160.
  2. Control characters are to be interpreted as such, and are always the first character of a transmitted datagram.
  3. Datagrams are terminated by the character sequence cursor-return, line-feed (\n).

  4. Numerical data is transmitted as two byte characters. Their ASCII codes are calculated on encoding by adding the value of ! (33) to the upper and lower four bit of the byte to be transmitted. The first byte transmitted represents the upper four bit of the data byte, the second byte transmitted therefore represents the lower four bit of the data byte.

  5. The elements of one datagram, that is control character and each two-byte ASCII encoded character, are separated by space characters (ASCII value 32).

Datagrams

Data needs to be transmitted in different directions between different parts of the stack. In the following section, "CAN" means the CAN bus and its attached devices, so a message "to CAN" is a packet of data that needs to be sent out through the CAN bus. On the other hand, a message "to HA-B02" is a message that needs to be interpreted by the HA-B02 controller itself, and does not have to be forwarded to CAN (but may trigger other actions on the CAN bus).

In the following format specifications, capital letters are placeholders for data explained in the respective description, small letters are control characters and transmitted as-is. Numerical values given here are transmitted as their ASCII representation.

ha_iod to CAN

m

HH

LL

NN

DD

DD

DD

DD

DD

DD

DD

DD

r

HH

LL

NN

DD

DD

DD

DD

DD

DD

DD

DD

CAN to ha_iod

n

HH

LL

NN

DD

DD

DD

DD

DD

DD

DD

DD

e

HH

LL

NN

DD

DD

DD

DD

DD

DD

DD

DD

Control messages

CAN controller reset

a

b

Reset and re-configure the CAN controller for either bus A or B.

CAN bus power switching

p

BB

PP

HA-B02 response codes:

HA-B02 identification

i

The control character i can be sent from ha_iod to HA-B02 to request hardware and firmware version information. The response string will be prefixed with the character i as well.

For reference, the current response to this command is the following:

inz@thiemo.net:HA-B02.01:HA-P04.01:dev

The response string is terminated with the two-character sequence cursor-return, line-feed.

Reserved

The following control characters are reserved for testing purposes and should not be used in regular operations:

t

Sends a test CAN message in development build. Later to be used for entering a test mode.


CategoryElectronics


THIS DATA IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS DATA, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

All product and brand names mentioned on there pages and in the source code are registered names and/or trademarks of the respective owner and are mentioned for identification purposes only.

For a full copyright notice, please see this link. For imprint and contact information, please see http://www.thiemo.net/.

HomeAutomation/Parts/HA-I05/HA-I05.01 (last edited 2011-08-06 12:14:26 by ThiemoNordenholz)