epc120
11. Address Programming
General Description
The device address is initially set to “00000” and the devices are not parametrized. However, all devices hold a unique chip ID. However, due
to the 2-wire bus concept, the physical location of an individual device is not known to the microcontroller. In order to operate the light
curtain, the microcontroller needs to allocate a specific receiver to a specific emitter. Usually, the receiver at one end of the 2-wire bus gets
the address 1, the next receiver the address 2 and so on. The same must be done on the emitter side. Once all devices on the receiver and
on the emitter side got their address, the microcontroller can operate the light curtain. The address allocation, meaning the allocation of a
physical location to a logical address, is usually done in the factory of the light curtain manufacturer.
To do so, a specific address allocation procedure together with the parametrization of the devices must be executed first. The following
procedure is an example how to allocate a unique address and how to parametrize each device.
No.
Step
Description
1
Set the address of
the interface
device
Set the address of the interface device with a direct command to a fix number, which should not be 0. It is
recommended to use generally the address 1023 for the interface device.
2
Parametrize the
devices on the 2-
wire bus
The data rate DRATE of the 2-wire interface is initially set to 300 kbit/s. It shall be set to the correct value
by addressing all devices, which are initially at address 0, simultaneously.
During this step, all other parameters in register 16 can also be set.
3
4
Parametrize the
interface device
The data rate of the 2-wire interface is initially set to 300 kbit/s. It has to be set to the same value like the
other devices on the same 2-wire bus.
Set all other
registers
For the address allocation the following parameters should be set:
TPER = 2
SENSN = 7
SLOW=1
This can be done to all devices at the same time by writing the registers to device 0.
5
Address allocation
Since the devices have an open receive window, all of them are able to receive light pulses. This mode is
used to allocate the logical address to the physical location. The procedure is as follows:
• Issue the command ADRA using address n
• flash a light pulse to the photo diode which is connected to the chip at the physical position n (make sure
that all the other photo diodes cannot receive a light pulse). By receiving a light pulse, the address n is
stored into the RAM of the element at the physical position n. Thus, the device, which receives a light
pulse, memorizes the address n as its own address in the final system.
This procedure has to be repeated for every individual element on the 2-wire bus. It is recommended to
start with the address 1 for the element which is closest to the controller and increment the address by 1
with every individual element. In the case of a 20-beam light curtain, addresses from 1 to 20 on the receiv -
er and on the emitter side are accessible. However, the interface chip is usually located at address 1023.
6
7
Address check
It is recommended to check the correct address setting by addressing every device in the system using the
READ command. All devices addressed shall response to the READ command.
Address
programming
Once all addresses of all devices at the 2-wire bus are stored into the RAM (register 23), the address
should be transferred to the ROM (register 7) for each device separately by using the command PROG.
Please refer to chapter 11. Address Programming.
8
Set parameters
Parameters like TSTMP, MODE, VMODE, TPULSE etc. are stored into the RAM of all devices using the
command WRITE. If the global address “0” is used, all devices receive the parameters at the same time.
Since the internal voltage regulator of the interface device is not needed, the parameter SOFF has to be
set to “1” (refer to Table 3). All other devices at the 2-wire bus must have a “0” for SOFF.
9
Check
The parameters should be checked by reading them back from each device using the READ command.
parameters
10
11
Program
parameters
If all parameters are stored correctly, store the parameters into the non-volatile memory by using the
command PROG.
Test
To check the programming of addresses and parameters, turn off the power supply or reset all devices and
readout all addresses and parameters again.
programming and
addressing
© 2011 ESPROS Photonics Corporation
Characteristics subject to change without notice
22
Datasheet epc12x - V2.1
www.espros.ch