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 from 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 (see later).
    • 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 and in use). The created 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)
    • The CAN Control will create a virtual Sensor module (for 8 sensors) and the CAN Control Eeprom location DEC 305 will be put at 1 (one sensor programmed and in use). The created sensor is now linked at the first input of this virtual input module. Depending on the location of this sensor module input list, the real sensor number can be found (for example, if the virtual sensor module is the 2nd sensor module found in the input list, then this new created sensor in the Master will be input nr 8).
    • The next input being pressed will generate ID 1 that will be programmed in the corresponding Eeprom location for this input. The CAN control nr of inputs being used will be increased to 2.
    • etc
    • The Virtual inputs and sensors can only be used when a module discover process has been done and the virtual input and sensor modules have been added to the Master

Erasing uCAN's

The uCAN's of a bus can get an erase when the Eeprom values of the CAN control are modified:

  • At CAN Control Eeprom location HEX 130, put value 0 (nr of inputs for this CAN bus)
  • At CAN Control Eeprom location HEX 131, put value 1 (nr of sensors for this CAN bus)

When the above value are being modified using a programmer, and the CAN Control is restarted, it will distribute a message to the uCAN's to erase all input and sensor values in their eeproms.