CAN Bus Application Guide

From Flowcode Help
Revision as of 10:08, 1 September 2014 by LeighM (talk | contribs) (Created page with " == Introduction == These examples demonstrate the use of the Flowcode CAN Bus component. In particular they make use of two sets of the EB018 E-blocks CAN Bus board, conne...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

Introduction

These examples demonstrate the use of the Flowcode CAN Bus component.

In particular they make use of two sets of the EB018 E-blocks CAN Bus board, connected to EB006 E-blocks PICmicro multiprogrammers fitted with a 16F1937 microprocessor.

However, the examples are easily changed in Flowcode to support other microprocessors and platforms.

The Matrix TSL EB628SI6 Easy CAN Bus bundle has all the items required for these sample applications and is an ideal introduction to CAN Bus technology.


Setting up the project hardware

Connect the E-Blocks as indicated in the table below.

The CAN Bus, LCD and Switch E-Blocks all need to be powered via wire connections to the +V on their respective EB006 upstream processor board.

The CANH signal terminals should be linked together.

The CANL signal terminals should be linked together.

The EB006 Ground terminals should be linked together.

The jumper on each CAN board should be set to "End Node".


Hardware Setup
Node Node
1 EB006 PICmicro multiprogrammer 2 EB006 PICmicro multiprogrammer
1 EB005 E-blocks LCD board Port B 2
1 EB018 E-blocks CAN board Port C 2 EB018 E-blocks CAN board Port C
1 EB007 E-blocks push-to-make switch board Port D 2 EB004 E-blocks LED board Port D


Example 1: Simple single data message transfer

FC6 Icon.png Simple Message Transfer Example (Node 1) FC6 Icon.png Simple Message Transfer Example (Node 2)

Example 1 shows how to send and receive a message identifier complete with a single data byte.

The node 1 with the LCD and Switch E-Blocks will send out a CAN message every second containing the value of the switches.

The receiving node 2 will then display any incoming data to the LED board.