Skip to content

Module IDs

Hampus Sandberg edited this page Nov 13, 2015 · 29 revisions

Description

The different modules have an ID pin that is used to identify what type of module it is. This is done in an analog way where each module is assigned a voltage range for the ID pin. On each module there is a voltage divider that divides the V_LOGIC supply to whatever voltage that module is assigned to. This is then read by the data processor board with an A/D-converter.

In order to detect when a module is not present the resistor to ground (R2) is located on the connection board which means that the ID pin will be pulled to ground when no module is installed.

Resistor divider for module IDs
Resistor divider for module IDs

Image from [Wikipedia](http://commons.wikimedia.org/wiki/File:Resistive_divider2.svg)

Available IDs

In order to make sure more modules can be added in the future there are in total 32 different voltage levels.

ID Middle 3.3V Middle 5V Middle R2 R1 Error
0 1.5625 % 0.052 V 0.078 V 47 kΩ 2 940 kΩ 0.011 %
1 4.6875 % 0.155 V 0.234 V 47 kΩ 953 kΩ 0.013 %
2 7.8125 % 0.258 V 0.391 V 47 kΩ 549 kΩ 0.073 %
3 10.9375 % 0.361 V 0.547 V 47 kΩ 383 kΩ −0.007 %
4 14.0625 % 0.464 V 0.703 V 47 kΩ 287 kΩ 0.009 %
5 17.1875 % 0.567 V 0.859 V 47 kΩ 226 kΩ 0.029 %
6 20.3125 % 0.67 V 1.016 V 47 kΩ 182 kΩ 0.212 %
7 23.4375 % 0.773 V 1.172 V 47 kΩ 154 kΩ −0.054 %
8 26.5625 % 0.877 V 1.328 V 47 kΩ 130 kΩ −0.009 %
9 29.6875 % 0.98 V 1.484 V 47 kΩ 110 kΩ 0.249 %
10 32.8125 % 1.083 V 1.641 V 47 kΩ 95.3 kΩ 0.216 %
11 35.9375 % 1.186 V 1.797 V 47 kΩ 84.5 kΩ −0.196 %
12 39.0625 % 1.289 V 1.953 V 47 kΩ 73.2 kΩ 0.039 %
13 42.1875 % 1.392 V 2.109 V 47 kΩ 64.9 kΩ −0.186 %
14 45.3125 % 1.495 V 2.266 V 47 kΩ 56.2 kΩ 0.230 %
15 48.4375 % 1.598 V 2.422 V 47 kΩ 49.9 kΩ 0.066 %
16 51.5625 % 1.702 V 2.578 V 47 kΩ 44.2 kΩ −0.027 %
17 54.6875 % 1.805 V 2.734 V 47 kΩ 39 kΩ −0.036 %
18 57.8125 % 1.908 V 2.891 V 47 kΩ 34 kΩ 0.212 %
19 60.9375 % 2.011 V 3.047 V 47 kΩ 30.1 kΩ 0.022 %
20 64.0625 % 2.114 V 3.203 V 47 kΩ 26.1 kΩ 0.233 %
21 67.1875 % 2.217 V 3.359 V 47 kΩ 23.2 kΩ −0.236 %
22 70.3125 % 2.32 V 3.516 V 47 kΩ 20 kΩ −0.163 %
23 73.4375 % 2.423 V 3.672 V 47 kΩ 16.9 kΩ 0.115 %
24 76.5625 % 2.527 V 3.828 V 47 kΩ 14.3 kΩ 0.110 %
25 79.6875 % 2.63 V 3.984 V 47 kΩ 12 kΩ −0.026 %
26 82.8125 % 2.733 V 4.141 V 47 kΩ 9.76 kΩ −0.008 %
27 85.9375 % 2.836 V 4.297 V 47 kΩ 7.68 kΩ 0.017 %
28 89.0625 % 2.939 V 4.453 V 47 kΩ 5.76 kΩ 0.020 %
29 92.1875 % 3.042 V 4.609 V 47 kΩ 4.02 kΩ −0.067 %
30 95.3125 % 3.145 V 4.766 V 47 kΩ 2.32 kΩ −0.016 %
31 98.4375 % 3.248 V 4.922 V 47 kΩ 0.75 kΩ −0.008 %

Table 1. Values for IDs and suitable values for resistor divider

The ID voltages will be different depending on the voltage of V_LOGIC as can be seen in the table above.

  • For 3.3 V there is a difference of 0.103125 V between each ID
  • For 5 V there is a difference of 0.15625 V between each ID

ID measurement

When reading the result from the A/D-converter it should be enough to check the 5 MSB bytes which should detect the 32 different ID values. It is also important to note that V_LOGIC has to be present on the module for the ID value to be read. Because of this the first ID 0 should not be used as it is closest to 0 V and therefore if no module is connected the data processor might think it is ID 0 instead.
On startup the data processor will toggle each modules power on for a while, take a reading of the ID, power the module off and then do the same for all the other modules.

Assigned IDs

The following module IDs have been assigned. In the beginning I've chosen to take every second available ID in case for some reason it's hard to detect. This will be checked later when all the hardware is done. TODO

ID Module Name
1 GPIO Module
3 CAN Module
5 RS-232 Module
15 nRF24L01 Module

Table 2. Assigned module IDs

Clone this wiki locally