CAN Eeprom pages

From OpenMotics
Jump to navigation Jump to search

Introduction

This section talks about the input and sensor location data of the uCAN and CAN Control. More settings however exist that are not described in this page.

The Micro controller (Microchip 18F46K80) used in the CAN Control and uCAN has a built-in Eeprom. This Eeprom is used to store multiple setting of the module.

Eeprom locations

Below, you'll find the locations where the input and sensor data is stored:

For the CAN Control:

Location DEC Location HEX Description
304
130
Total number of CAN inputs
305
131
Total number of CAN sensors

For the uCAN:

Location DEC Location HEX Description
0
0
programmed input nr for this CAN Bus for input 0
1
1
programmed input nr for this CAN Bus for input 1
2
2
programmed input nr for this CAN Bus for input 2
3
3
programmed input nr for this CAN Bus for input 3
4
4
programmed input nr for this CAN Bus for input 4
5
5
programmed input nr for this CAN Bus for input 5
8
8
programmed sensor nr for this CAN Bus for sensor 0
9
9
programmed sensor nr for this CAN Bus for sensor 1

How does it work

Every CAN bus has its own numbering that starts with 0. So if you have 2 CAN Controls, each CAN Controls will start numbering its inputs and sensors starting at 0.

If you want to modify Eeprom values, it's important to understand how the Eeprom values are changed.

These are the different steps happening when a new installation is initialised:

  • When no inputs have been pressed (and thus no sensors nor inputs have been added), CAN Control Eeprom location DEC 304 and DEC 305 will contain 0 (or 255 which mean never been used). The uCAN Eeprom locations DEC 0-5 and DEC 8-9 will contain 255.
  • When an input is pressed, following will happen:
    • One of the input Eeprom locations (DEC 0-5) depending of the input being pressed of uCAN will get value 0 (first input). So this input gets ID 0 for this CAN bus. This is NOT input 0 for the Master.
    • The CAN Control will create a virtual input module (for 8 inputs) and the CAN Control Eeprom location DEC 304 will be put at 1 (One input programmed). The create input is now linked at the first input of this virtual input module. Depending on the location of this input module, the real input number can be found (for example, if the virtual input module is the 3rd module (module nr 2) of the input list, then this new created input in the Master will be input nr 16).
    • When the uCAN has a sensor linked, the sensor will get an ID as well. Since this is the first sensor of this CAN bus, it will get ID 0 that is programmed in the uCAN Eeprom location DEC 8 or 9 (depending if its the first or second sensor of this uCAN)