Äîêóìåíò âçÿò èç êýøà ïîèñêîâîé ìàøèíû. Àäðåñ îðèãèíàëüíîãî äîêóìåíòà : http://curl.sai.msu.ru/mass/download/doc/new_details_v2.pdf
Äàòà èçìåíåíèÿ: Fri Nov 21 01:28:04 2008
Äàòà èíäåêñèðîâàíèÿ: Mon Oct 1 20:16:16 2012
Êîäèðîâêà:

Ïîèñêîâûå ñëîâà: ï ï ï ï ï ï ð ï ð ï ð ï ð ï ð ï ð ï ð ï ð ï ð ï ð ï ð ï ð ï ð ï
Combined MASS/DIMM instrument for atmospheric turbulence measurements. Electronics and Device control
Version 2
Kornilov V., Shatsky N., Shugarov A., Voziakova O. November 16, 2008


Contents
1 Ele 1.1 1.2 1.3 1.4 1.5 1.6 2 Ele 2.1 2.2 2.3 2.4 2.5 ctronics overview Common characteristics of electronics an Detectors unit . . . . . . . . . . . . . . . Auxiliary electronics . . . . . . . . . . . Requirements to p ower supply . . . . . . Data exchange protocol (physical level) LPT/RS485 converter . . . . . . . . . . ctronic modules Detectors unit . . . Bicounter module . Auxiliary module . Connections . . . . RS485/LPT conver . . . . ter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 6 7 8 8 9 10 11 11 11 16 20 21 26 26 27 29 32

d . . . . . . . . . . u . . .

R . . . . . . . . . .

S . . . . . . . . . .

-485 .. .. .. .. .. . . . . . an . . . . . . . . d . . .

lin .. .. .. .. .. . . . . . . . . . .

e . . . . . . . . . . d . . .

. . . . . . . . . . .

. . . . . . . . . . .

. . . . . . . . . . . . . . .

. . . . . . . . . . . . . . .

. . . . . . . . . . . . . . .

. . . . . . . . . . . . . . .

. . . . . . . . . . . . . . .

. . . . . . . . . . . . . . .

. . . . . . . . . . . . . . .

. . . . . . . . . . . . . . .

. . . . . . . . . . . . . . .

. . . . . . . . . . . . . . .

. . . . . . . . . . . . . . .

. . . . . . . . . . . . . . .

. . . . . . . . . . . . . . .

3 Microprogramming and Instructions set 3.1 Logical level of interaction b etween comp 3.2 Bicounter module . . . . . . . . . . . . . 3.3 Auxiliary module . . . . . . . . . . . . . 3.4 Up dating a microcode . . . . . . . . . .

ter .. .. ..

mo .. .. ..

ules .. .. ..

1


List of Figures
1.1 1.2 2.1 2.2 2.3 2.4 2.5 2.6 2.7 2.8 2.9 2.10 Schematic view of electronics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Illustration of data exchange b etween host computer and modules. . . . . . . . . 7 9 12 13 14 15 15 16 18 19 19 21 23 24 25

Circuit diagram of the Detectors unit electronics. . . . . . . . . . . . . . . . . . . Circuit diagram of the analog part of the Bicounter module electronics . . . . . . Circuit diagram of the digital part of the Bicounter module electronics . . . . . . Placement of the comp onents on the PCB of the PMT voltage divider . . . . . . Placement of the comp onents on the PCB of the Pulse amplifier and discriminator Placement of the comp onents on the PCB of the digital part of the Bicounter. . Circuit diagram of the main part of the auxiliary electronics. . . . . . . . . . . . Placement of the comp onents on the PCB02A of the auxiliary electronics. . . . . Circuit diagrams of the separate parts of the auxiliary electronics . . . . . . . . . Placement of the comp onents on the PCB02C and PCB02D of the auxiliary electronics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.11 Connections b etween the separate b oards of the device . . . . . . . . . . . . . . . 2.12 Printed circuit b oards for the LPT/RS485 . . . . . . . . . . . . . . . . . . . . . . 2.13 Circuit diagram of the LPT/RS485 converter. . . . . . . . . . . . . . . . . . . .

2


List of Tables
2.1 2.2 2.3 2.4 2.5 2.6 2.7 3.1 Sp ecification for Sp ecification for Sp ecification for Sp ecification for Bus colors table Arrangement of Sp ecification for detectors unit electronics. . . . . . . . . an analog part of the Bicounter module. a digital part of the Bicounter module. the Auxiliary electronics. . . . . . . . . ....................... line cable . . . . . . . . . . . . . . . . . the LPT/RS485 converter (see SCH02). .. . .. .. .. .. .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 17 17 20 21 22 22 26

Used signal bytes.

...................................

3


Bibliography
[1] Kornilov V., Combined MASS/DIMM instrument for atmospheric turbulence measurements. A Prop osal to Cerro Tololo Inter-American Observatory. Septemb er 27, 2002 [2] Kornilov V., Potanin S., Shatsky N., Voziakova O., Zaitsev A. Multi-Aperture Scintil lation Sensor (MASS). Final design report. February 2002. [3] Kornilov V., Potanin S., Shatsky N., Voziakova O., Shugarov A. Multi-Aperture Scintil lation Sensor (MASS) Upgrade. Final report. January 2003. [4] Kornilov V., Shatsky N., Voziakova O., Combined MASS/DIMM instrument for atmospheric turbulence measurements. First stage project report April 2003. [5] Kornilov V., Tokovinin A., Voziakova O., Zaitsev A., Shatsky N., Potanin S., Sarazin M. MASS: a monitor of the vertical turbulence distribution. Proc. SPIE, V. 4839, p. 837-845, 2003 [6] A.Tokovinin, V.Kornilov, N.Shatsky, O.Voziakova, Restoration of turbulence profile from scintil lation indices, MNRAS 2003, V. 343, P. 891

4


Intro duction
The document presents description of the electronic modules of the MASS/DIMM device. The base of the electronics design is the same as in original MASS: modular structure, data exchange via RS485 interface, PMTs as light detectors. Meanwhile, the real electronics were significantly redesigned: numb er of separate modules was reduced from 7 (in original MASS [2]) to 3 in the current design. In p eriod 2004­2008 some changes in device electronics were produced. Second version of the document incorp orates this changes. First Chapter of this document contains general description of the electronics as well as overview of data exchange protocol b etween the device and PC. So since the DIMM channel of the combined MASS/DIMM device is provided by different typ es CCD cameras, the description of DIMM electronics is omitted. Detailed design of the MASS electronic modules (circuit diagrams, printed circuit b oard views, their sp ecifications) is provided in the second Chapter. Although the description of RS485/LPT converter is available in [3], this information is included in the document also. Last Chapter contains detailed description of the low level command set, which can b e used during handling of non-standard situations, which can arise in test, adjustment or repair process. The description of the microcode up date procedure is presented, too. The document contains the detailed information on MASS device, which may b e needed in case of device malfunctions or fault. The information will b e useful for exact understanding of the device p ossibilities and p otentials.

5


Chapter 1

Electronics overview
Except for the viewer illumination control, which relates to b oth MASS and DIMM channels of the device, the rest electronics is related solely to MASS. The MASS electronics inherits the modular principle of the original MASS device; the photometric modules were united in one detectors unit, some functions of other modules were redistributed due to partial modification of the device construction. In order to promote the device reliability, the numb er of external and inter-PCB connectors was minimized. The basic ATMEL microcontroller model was changed from AT90S2313 to more p owerful and advanced ATMega8, meanwhile the communication protocol of data transfer from MASS to PC was retained unchanged to maintain the software compatibility with the original MASS system.

1.1

Common characteristics of electronics and RS-485 line

As in original design, the architecture of all MASS electronic modules is similar. The kernel of any module is an AVR micro-controller ATMega8 from Atmel company running at 14.746 MHz frequency. In principle, such a clock frequency provides the standard transmitting rate as large as 1840 Kbit/sec instead of 460.8 Kbit/sec in original MASS. A big merit of these controllers is the p ossibilityof their re-programming using the data exchange line. All modules are designed to supp ort this p ossibility. Schematic view of the MASS/DIMM electronics is presented in Fig. 1.1. All information exchange b etween the host computer and the individual modules is executed via RS-485 line working in half-duplex mode. The line connects to LPT p ort of PC via a sp ecial RS485/LPT converter. A pure RS-485 interface is used in the segment "host computer -- MASS". Balanced data lines A and B are prop erly terminated and biased from b oth ends of the long cable to provide safefault data transmission. For inter-communication b etween the electronic modules, RS-485 itself and 2 additional lines are used. These additional lines do not have constant sp ecification and are used to transmit sp ecific local signals: SYNCHRO -- for common hardware synchronization of the modules, and OVERLIGHT -- for fast hardware protection of PMTs against light overflow.

6


1
High voltage

2
Overlight Synchronization

3

Detectors module 1

Detectors module 2

Auxiliary electronics

Illumination, control light, sensor

RS485 serial bus

Computer

Converter RS485/LPT Power +12 DC

Figure 1.1: Schematic view of electronics for MASS/DIMM device. 1 -- detectors unit, 2 -- electronics b ox, 3 -- electronic elements in main MASS/DIMM case.

1.2

Detectors unit

MASS detectors must measure the intensity of light in four channels synchronously with a very short (1 ms) exp osure time and high duty cycle. The numb er of photons detected in an elementary exp osure in each area goes up to tens of thousand dep ending on the channel and star brightness. Preliminary investigation shows that most suitable PMT is bi-alkali Hamamatsu R7400P (see Rep ort [4]). It has a low dark current (< 100 pulse/s), high sensitivity in blue-green sp ectral region, suitable temp oral characteristics and very compact size. Contrary to original MASS, where the detectors were implemented as four separate photometric modules (PMs), four MASS/DIMM device detectors are united in one detector unit, including b oth PMTs and the associated electronics. Detector electronics is sub divided in two indep endent two-channel modules (further -- Bicounter module). Nevertheless, these modules are placed at one PCB, which p ermits to diminish a numb er of inter-connections. Each bicounter consists of two voltage dividers for PMT, two very fast amplifier-discriminators, two counters driven by a single micro-controller and an interface circuit. Both data from the module to a host computer and commands from a computer to the module are transmitted via RS-485 line. Interaction b etween PM and computer is describ ed in Section 1.5. Besides, an additional line connects the photometric (bicounter) and p ower supply modules and immediately shuts down the HV when the PMT flux exceeds the maximum rating. This feature assures the safety of PMTs. The bicounter module executes the following functional commands: set level of the pulse discrimination, run series of microexp osures with a preset exp osures numb er and integration time, set needed integration time or work by external synchro, set length of series, and so on. 7


Data packet from bicounter contains always counts from b oth PMT. Physically, the detector unit is attached to the electronics b ox and they can b e removed from the MASS/DIMM device together. Therefore, electrical connections b etween these b oth units are soldered. Whole electronics unit is fixed at the main b ox with help of plug elements and locked by screws.

1.3

Auxiliary electronics

Auxiliary electronics is mainly placed in the electronic b ox, although a few elements are placed in the main case of the device. The electronics provides following functions: · · · · · · · Device p owering by DC +5 V PMT p owering by high voltage Measurement of internal temp erature Control of illumination of FOV in viewer Polling of viewer mirror p osition Management of control light Monitoring of RS485 line status

From the side of external control, the electronics is one multi-functional module connected to RS-485 line. The module executes the following functional commands: set brightness of b oth light sources (control and viewer), modulates the control light synchronously with microexp osures for statistic test, which is used to test the normal op eration of the detectors and to control the parameters of the photometric channels. Position of viewer mirror is checked to prevent measurements when the mirror is occasionally left on axis. The high voltage converter TA-1.0N-12LS from WME company produces a voltage from 0 to 1000 V for PMT p owering. The converter is p owered by +12 DC and supplies 1 mA current with low ripple. The control of the output voltage is done by software as well. The presence of high voltage is indicated by a sp ecial red LED placed near other indicating LEDs. In an emergency (light overflow) the sp ecial signal from detector unit turns off the high voltage immediately. Additional functions provided by this electronics are the controls of internal temp erature of MASS and of the status of RS-485 line. Line status (data is transmitted or not) is indicated by a yellow LED. The secondary p ower unit (such as DC/DC converter TEM2-1211 or latest TMR-1211 from TRACO Power Company) produces DC +5 V for device electronics and for RS485/LPT converter (p owered thus via the line).

1.4

Requirements to p ower supply

The p ower supply +12 DC may b e either a battery or a line regulator or a switching converter. The maximal total MASS p ower consumption is 300 mA when the high voltage is on. The main requirements for the characteristics of the p ower supply are following:

8


· · · ·

Output voltage: +12 V (Min +11.5 V, Max +13 V) Max output current: greater than 0.6 A Max output voltage pulsations: less than 100 mV Op erating temp erature from -10 to +35 .

A 2-wires cable which p owers the MASS device, must have 0.5 mm2 cross-section (AWG20) and the length not longer than 15 m. Voltage drop at the cable must b e less than 0.2 V p er one wire.

1.5

Data exchange proto col (physical level)

Figure 1.2: Illustration of data exchange b etween host computer and modules. Light grey -- packet with data or command information, dark grey -- signal which confirms packet reception. Three p ossibilities are shown: 1) computer sends a command to module 1, 2) computer sends a request to module 2 and receives the reply, 3) an active module 3 sends a data block to computer. As describ ed ab ove, all information exchange b etween the host computer and MASS is executed via RS-485 line. MASS op eration needs an informational flow as large as 8 Kb/sec or 110 Kbit/sec on a serial line. So, the line with 0.5 Mbit/sec is sufficient for our purp ose. Although ATmega controller provides more faster exchange rate, the p ossibility of usage of a faultless line of 50­100 m length at lower rates is more preferable. Data transmission through RS-485 line is executed serially. Each serial byte contains 1 start bit, 8 data bits, 1 parity bit (used for sp ecial needs only), 1 stop bit. It is the standard protocol, defined at the hardware level of micro-controllers. The method of interaction b etween receiver and transmitter to provide faultless and effective data exchange is called an exchange protocol. The main features of the used protocol of data exchange are following: · Data and commands are transmitted in binary (non-symb olic) form · The bytes of information for transmission are merged in a packet · The inter-module exchange is excluded from protocol, computer always participates in any data exchange · The packet can have a length from 1 to 31 bytes · The packet with length of 1 byte has a sp ecial function ­ signal 9


· Each packet is started with a header byte (except signals). Header byte is marked by 1 in the parity (ninth) bit · Header contains address of the destination or departure module · The last byte of the packet is 8 bits cyclic residual control · Receptor confirms the packet acceptance by sending an acknowledgment signal · A non-confirmed packet is treated as lost and is re-transmitted until reception All MASS modules work commonly as passive devices -- they can transmit data only in resp onse to a request from the host computer. The photometric module can work as an active one, i.e. it can activate the packet transmission. This ability p ermits to reach more effective data acquisition than p olling method. In Fig. 1.2 the three p ossible variants of data exchange are illustrated. Since the same lines of the interface is used for b oth reception and transmission, a collision of packets is p ossible. To avoid collisions, some modification of time windowing method is used. For the needed data flow and transmission rate, the used time window is ab out 500 mksec. In general, the collision problem for an exchange rate of 20% of line capacity and for three active devices (two bicounter modules and host computer) is severe. It was solved in case of MASS by sp ecial induce procedure, when the data transmission from next module is started after passing data packet from the so called inductor module. This way is used in MASS/DIMM, too.

1.6

LPT/RS485 converter

To solve a data exchange problem with a needed rate ( from 460 Kbit/s to 2 Mbit/s ) we use standard LPT p ort working in EPP mode and a sp ecial RS485/LPT converter (see [3]) with a packet processing feature and a large FIFO capacity (512 bytes). Such bufferization p ermits to reduce by more than two orders the PC reaction requirements and to reduce a processor load at the interrupt service by few tens times. In order to send a packet to the MASS device, the driver program writes sequentially all the packet bytes to the LPT data register except the address byte. Then, an address byte is written in the LPT address register which signals that the packet is fully loaded in the converter. Converter computes the CRC byte, adds it to the packet and transmits serially the packet via an RS485 line. Then it waits for the module resp onse and, if no fault results, asks the computer to read the replied data. When a transmission is activated by a (bi)counter module, the converter receives a full packet, checks its CRC, sends back a signal ACK (or NAK in the fault case) to the module and asks the computer to read received data. If computer is busy and can not read data immediately, the received data are placed into the internal FIFO buffer. The buffer can keep up to 15 full packets and provides thus the bufferization as long as 30 ms. When the computer is finally able to read data, all the data, packet by packet, are input during 1 ms. The converter uses optical coupling that insulates electrically the PC computer from the MASS/DIMM instrument. The converter is connected to the LPT p ort of the PC directly and does not require any separate p ower supply. It is p owered from the line voltage +5 DC fed by the MASS device.

10


Chapter 2

Electronic modules
The electronics design is p erformed as the base of the modular conception explained in the Main Document earlier. In the next sections the circuit diagrams of the modules are presented. Generally accepted designations of schematic elements are used, except designation for resistors (we used a russian symb olic for them). The connectors are also marked in a sp ecial way. Connectors to external cable and wires are denoted by a letter "X", internal connectors are divided into four groups: 1) Soldered connectors are marked with a letter "S", 2) Inter-b oard connectors, which link different parts of the same module -- with "I", 3) Connectors to internal bus, which links the different modules -- "Y", 4) Sp ecial connectors for In System Programming technique are denoted as "ISP". The nominal values of passive elements are shown on the schemes. The active element features are shown in sp ecification tables which are included, too. Comp onent manufacturer are not shown in cases of widespread parts. Connectors, which are parts of PCB, don't include in the tables. Also, this chapter contains the schematic views of the module PCBs with the comp onent placement for easy identification of the schematic element with the real comp onent used.

2.1

Detectors unit

As describ ed ab ove, detectors (photometric) unit consists from two identical bicounter modules, placed in parallel at the same PCBs. In the Fig. 2.1 a circuit diagram for whole unit is presented. Bicounter modules are shown schematically by blocks. Comp onents which do not b elong to bicounter modules are shown explicitly. Further, these comp onents are marked by prefix * at the PCB01C.

2.2

Bicounter mo dule

The circuit diagrams of the analog and digital parts of the bicounter are shown in Fig. 2.2 and Fig. 2.3. PCB views are presented in Fig. 2.4, Fig. 2.5 and Fig. 2.6.

11


Dividers A & B

Bicounter 1

I_A ANOD_A GND

Amplifiers A & B
I_B

ANOD_B GND

INP_A VCC CS_B CS_A MOSI SCK INP_B I_B I_A GND

Counters A & B

XTAL1

XTAL2

SCK

SS

MISO

MOSI

Y1
1

*Z1

C2 12p

R1 120

C3 12p

HV GND

1 2

C1 1n

S1

2 1

D1
4

2 3 4 5

XTAL1

MISO

SCK

Dividers A & B

Bicounter 2

I_A ANOD_A GND

Amplifiers A & B
I_B ANOD_B GND

INP_A VCC CS_B CS_A MOSI SCK INP_B I_B I_A GND

Counters A & B

Figure 2.1: Circuit diagram of the Detectors unit electronics. See circuit diagram for a bicounter in the further figures.

SS

MOSI

6

VCC GND LINE A OVLIGHT LINE B STROB

12


13 Figure 2.2: Circuit diagram of the analog part of the Bicounter module electronics. PMT divider, pulse amplifier and discriminator with level control.


C1 100n

VCC
R3 5.6K R4 5.6K C3 10mF C2 100n

I4
INP B VCC CS_A CS_B MOSI SCK INP A I_A I_B GND GND GND
1 3 7 9 4 5 11 8 10 2 6 12 15 9 10 C1 C0 7 1 2 C0 C1

D2:A
Q0 Q1 Q2 MR Q3 3 4 5 6 23 24 25 26 27 PC0 PC1

D3

GND
AVCC 18 20 19 22

PC2 PC3 PC4 PC5 RESET PB0 PB1 PB2/SS OC2/MOSI PB4/MISO PB5/SCK XTAL1 XTAL2

ATMEGA8-AI16

AREF ADC6 ADC7

D2:B
Q0 Q1 Q2 MR Q3 11 12 13 14

28 29 12 13 14 15 16 17

PD0/RXD PD1/TXD PD2/INT0 INT1/PD3

30 31 32 1

STROB

T0/PD4 2 PD5/T1 PD6/AIN0 PD7/AIN1 9 10 11

R5 10K

14
R1 2.2M R2 2.2M VCC D1:A
3 1 2

7 8

OVLIGHT
D4
1

ISP/1 ISP/2 ISP/3 ISP/4 RESET MOSI SCK MISO GND

XTAL0 XTAL1 MOSI SCK MISO SS

RO RE DE DI

6

LINE B LINE A

2 3 4

7

D1:B
5 7 6

ISP/5 ISP/6

Figure 2.3: Circuit diagram of the digital part of the Bicounter module electronics. Counters and microcontroller unit.


PMT side

PMT2 (B)

PMT1 (A)

R7 R9 R11
C1

R16 R18 R20

C2 C3

C4

R13

R22

R2

R1
R8 R5

R3

R4

Bicounter 2

Bicounter 1

Opposite side

I2

R12 R10
*C1

I1

R21 R19 R17 R14
*S1

Figure 2.4: Placement of the comp onents on printed circuit b oard of the PMT voltage divider. Designations are the same as in circuit diagrams in Fig. 2.2.

Figure 2.5: Placement of the comp onents on printed circuit b oard of the Pulse amplifier and discriminator with level control. Designations are the same as in circuit diagrams in Fig. 2.2.

I3

R6

R15

15


Table 2.1: Sp ecification for detectors unit electronics. Item 1 2 3 4 5 6 7 8 9 Part D1 Z1 C1 C2, C3 R1 Y1 PCB01A PCB01B PCB01C Name IC NC7SZ32M5 Quartz 14.746 MHz SMD capacitor 2KV SMD capacitors SMD resistor Line conn. Printed b oard Printed b oard Printed b oard Manufacturer any -- -- -- -- -- Custom Custom Custom Q-ty 1 1 1 1 2 1 1 1 1 Rem SOT-23, Gate OR HC49S 1208 size 0805 size 0805 size Soldered Fig. 2.4 Fig. 2.5 Fig. 2.6

Bicounter 2
I4
R4 R3
1

Bicounter 1
*C2 C3 *Y1

+

Figure 2.6: Placement of the comp onents on printed circuit b oard of the digital part of the Bicounter. Designation are the same as in circuit diagrams in Fig. 2.3.

R2

R1
C1

R5

D1

*Z1

1

D2
C2

*C3 *D1

D4

D3

ISP
1

*R1

2.3

Auxiliary mo dule

The circuit diagrams of this module are shown in Fig. 2.7 and Fig. 2.9. PCB views are presented in Fig. 2.8 and Fig. 2.10. On the PCB2A main part of the auxiliary module is placed. So as this PCB is installed in removable electronics b ox, it is connected with other parts of auxiliary electronics, placed in the main case of the device, with help of connector I5. The connector is mounted on cross-plate PCB02B. Further connections made soldered.

16


Table 2.2: Sp ecification for an analog part of the Bicounter module. Item 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 Part D1, D2 D3 D4, D5 D6, D7 R1-R4 R5-R22 C1, C2 C3, C4 C5-C8 C9-C19 C20-C22 L1-L4 R23-R33 PMT1,2 I1-I3 I4 Name IC AD8350AR IC AD1580ART IC AD8400AR1 IC AD8611AR SMD resistors SMD resistors SMD capacitors SMD capacitors SMD capacitors SMD capacitors SMD Tantal capac. SMD inductances SMD resistors E678-12 Pins connector Pins connector Manufacturer Analog Analog Analog Analog -- -- -- -- -- -- -- Bourns -- Hamam -- -- Dev Dev Dev Dev . . . . Q-ty 2 1 2 2 4 18 2 2 4 10 3 4 11 2 3 1 Rem

atsu

0805 size 1208 size 0805 size 1208 size, 250V 0603 size 0805 size A size 1812 size 0805 size PMT sockets PBS2-2, soldered PLD2-12

Table 2.3: Sp ecification for a digital part of the Bicounter module. Item 1 2 3 4 5 6 7 8 Part D1 D2 D3 D4 R1-R5 C1, C2 C3 I4 Name IC 74HC4520D IC LM2903M IC ATMega8-16AI IC ADM1485AR SMD resistors SMD capacitors SMD Tantal capac. Pins connector Manufacturer Philips Nat.Semicond. Atmel Analog Dev. -- -- -- -- Q-ty 1 1 1 1 5 2 1 1 Rem

0805 size 0805 size B size PBD2-12

17


X1 +12 GND
1 2

V8
16

D1
9

+5 C3 100nF C2 10 F R2 51K R1 130

C1 100 F

D2:A
R3 270

V9

TEL2-1211
1 10

I5
12 11

R5 10K

D2:B
R6 270

10 9 8 7

+12L

RED

2

YELLOW

GREEN

S2 HV GND

D3
1 7 1

V1 TA-1.0N-12LS
6 2

V2

V3

6

R7 1K

5 4

R10 1.3K

D6
PC0 PC1 PC2 PC3 PC4 ATMEGA8-AI16 PC5 RESET PB0 PB1 PB2 MOSI MISO SCK XTAL1 XTAL2 AVCC AREF ADC6 ADC7
18 20 19 22

R8 1.3K

R9 1.3K

3

3

4

5

R11 5.6K

C6 100n

23 24 25 26

2 1

D4
2

3

GND +5 IL_K IL_A CL_K CL_A HALL STROB LINE B LINE A +12 GND

C4 10 F

C5 1.5 F

R4 1K

LINE_BUSY R12 2K R13 2K

t
1

o

27 28

C8 100n

D5
R14 1.6K R15 10K

29 12 13 14 8 7 9 10 6 1 15 16 17 7 9

C7 100n
30 31 32 1 2 9 10 11 1 2 3 4 1 2 3 4 5

R16 2K

R17 4.7K

2

B2 AGN

DE DI

7

B R19 1.2K

Z1 RESET MOSI MISO C10 16p GND

LINE_BUSY

R18 120

SCK

C9 16p

+5

ISP/1

ISP/2

ISP/3

ISP/4

ISP/5

ISP/6

18

Y2 +5 GND LINE A OVLIGHT LINE B STROB

RXD TXD INT0 INT1 T0 T1 PD6 PD7

D7
13 12 14 3 4

A1 SDI W1 CS B1 CLK A2 RS

D8
RO RE A
6

6

W2 SD

X2
1

R20 1.2K

2 5 9

LINE A LINE B GND +5

Figure 2.7: Circuit diagram of the main part of the auxiliary electronics.


Figure 2.8: Placement of the comp onents on the main printed circuit b oard PCB02A of the auxiliary electronics. Designations are the same as in circuit diagrams in Fig. 2.7.

Figure 2.9: Circuit diagrams of the separate parts of the auxiliary electronics: a) control light LED, b) field of view illumination LEDs, c) Hall sensor of the p osition of viewer mirror.

19


Table 2.4: Sp ecification for the Auxiliary electronics. Item 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 Part D1 D2 D3 D4 D5 D6 D7 D8 D9 Z1 R1-R23 C1 C2, C4 C5 C3-C12 V1-V3 V4, V5 V6, V7 V8 V9 IS P X1 X2 Y2 I5(A) I5(B) PCB02A PCB02B PCB02C PCB02D Name Mod. TEL2-1211 IC LM2904M Mod. TA-1.0N-12LS IC TMP36 IC LM7101BM5 IC ATMega8-16AI IC AD8402AR10 IC ADM1485AR IC SS441 Quartz 14.746 MHz SMD resistors Alum.capacitor SMD tantal capac. SMD tantal capac. SMD capacitors L513(SV,SG,SY) KPL3015G KPL3015R Manufacturer Traco Power Nat.Semicond. WME Analog Dev. Nat.Semicond. Atmel Analog Dev. Analog Dev. Honeywell -- -- -- -- -- -- Kingbright Kingbright Kingbright Any Any Custom -- -- -- -- -- Custom Custom Custom Custom Q-ty 1 1 1 1 1 1 1 1 1 1 22 1 2 1 7 3 1 2 1 1 1 1 1 1 1 1 1 1 1 1 Rem DIL-16 See sp ec. TO-93

ISP connector Power conn. DJK-02B Line conn. DB9F Pins conn. (pins) Pins conn.(pins) Pins conn.(sockets) Printed b oard Printed b oard Printed b oard Printed b oard

HC49S 0805 size 16V, D=8 mm B size A size 0805 size LEDs Green Red Schottky 1A Suppressor 18V PCB holes d=2.5mm PLD2-6 PLD-12 PBD-12

2.4

Connections

Arrangement of cable connections b etween separate PCBs of the device is shown in Fig. 2.11. Connections b etween cross-plate PCB02B and PCB02C, PCB02D, and LEDs of FOV illumination (no PCB) are made by single-core wire. Length of each wire is defined in place. High voltage cable (Fig. 2.11b) is a multi-cored cable with teflon insulation which shield serves as a common wire. It has an outer diameter 3 mm and length 100 mm. The bus b etween Y1 and Y2 connectors (Fig. 2.11c) consists of 6 multi-core wires placed in a plastic tub e. This cable has a length 100 mm. The conductors are lab eled by color tub e 20


Figure 2.10: Placement of the comp onents on the separate printed circuit b oards b) PCB02C and c) PCB02D of the auxiliary electronics. Additional cross plate a) PCB02B is shown, too. Designations are the same as in circuit diagrams in Fig. 2.9.

according to Table: Table 2.5: Bus colors table Conn. pin 1 2 3 4 5 6 Signal +5V GND Line A Overlight Line B Synchro Color red black white yellow green black

Next Table contains information on the line cable b etween the device and the host computer (RS485/LPT converter). Sp ecial RS485 cable Belden 8132 is used.

21


Table 2.6: Arrangement of line cable DB9F pin device side 1 2 5 9 5 Signal Line A Line B GND +5V Shield Wire color blue blue-white orange orange-white DB9M pin PC side 1 2 5 9 -- Rem. p p p p air air air air 1 1 2 2

2.5

RS485/LPT converter

The circuit diagram of the converter is shown in Fig. 2.13. PCB views are presented in Fig. 2.12. Table 2.7: Sp ecification for the LPT/RS485 converter (see SCH02). Item 1 2 3 4 5 6 7 8 9 10 11 12 Part D1 D2 D3 D4 R1­R9 C2 C4 C2, C3 C5 X1 X2 PC B Name IC ADM1485AR IC ATMega8-16AI IC HCPL0611 IC HCPL0630 Chip resistors Tantal chip capac. Alum.chip capac. Chip capacitors Chip capacitors DB25M connector DB9M Printed b oard Manufacturer Analog Dev. Atmel HP HP -- -- -- -- -- -- -- Custom Q-ty 1 1 1 1 1 1 3 2 2 1 1 1 Rem

0805 size A size B size 1208 size 1208 size L PT Line

22


Figure 2.11: Connections b etween a) cross-plate and separate parts of the auxiliary electronics, b) main PCB and PMT dividers and c) main PCB and bicounters PCB. Designations corresp ond to the circuit diagrams in Fig. 2.1 and Fig. 2.9.

23


Figure 2.12: Printed circuit b oards for the LPT/RS485. Placement of the comp onents is shown. Designations corresp ond to circuit diagrams in Fig. 2.13

24


25 Figure 2.13: Circuit diagram of the LPT/RS485 converter.


Chapter 3

Microprogramming and Instructions set
3.1 Logical level of interaction b etween computer and mo dules

As describ ed in Section 1.5, the command and/or data exchange b etween the computer and the modules is implemented by byte packet transmissions. Each full cycle of exchange is started with a header byte and terminated with acknowledgment signal. Header byte contains 5-bits address of the destination or departure module and 2-bits cyclic packet numb er to distinguish a transmission rep eat from a new packet. Both header and signal bytes are marked by the parity bit. For distinction b etween them, the header byte is a p ositive numb er and the signal is a negative. Normally two signals are only used: ACK -- acknowledgment of successful data receiving and NAK -- non acknowledgment, which is equivalent to unsuccessful data receiving message. The used logical protocol includes several additional signals to provide a larger information flow rate. The signals contain a self-checked code with 8 p ossible values. These signals are listed in Table 3.1. Last two signals are not used in MASS exchange protocol and included for a further extension. Table 3.1: Used signal bytes. Signal ACK NAK NOD ACN ACY ACW SINC DNG Hex. code 0x87 0x96 0xA5 0xB4 0xC3 0xD2 0xE1 0xF0 Meaning Successful receiving of data Damaged packet was received Required data are not ready Command is successfully received but such a command does not exist Command is successfully received and executed Command is successfully received but can not b e executed right now Synchronization signal Danger signal

26


Within the packet, the command byte follows after the header byte. This byte contains a command to the module, or b oth a command and op erand, or length of the following data block, dep ending on its code. The encoding procedure is simple and fast. Most of commands are read/write op erations of working variables with or without execution of associated functions. Rest part only run some functions. Naturally, the same function for different modules has the same command. For example, request of the module identification has the command code 0xA2 for all modules. If the command byte is less than 0x20 then following bytes represent a block of data with the length equal to this command byte value. Contrary to the command transmissions (from computer to module only, see an exception b elow), the data transmission can go in b oth directions. The maximal length of the data block is 31 bytes. This p ermits to provide a good buffered data transmission leaving the line free during long time. Since a cyclic residual control byte (CRC byte) is app ended during transmission and cut off during receiving by a system driver, in the further description of the commands (instructions), CRC byte is omitted. Also, the first byte of a transmitted packet (header byte) is not shown as a rule. Additionally, fault transmission cases are not considered, correct situations are presented only. The instruction sets for the all the modules in use are presented b elow. For each instruction, a name (and its code in parentheses), arguments used (if exist) are written. Normal reply from a module is shown after a left arrow. The resp onse alternatives are put in brackets.

3.2

Bicounter mo dule

Main problem for photometric modules is the synchronization of integration and subsequent transmissions. To solve this, one module (Master) generates a synchronization clock. Another module (Slave) uses this signal to organize its work at the same rate. To avoid line collisions, the data transmission procedure works in inductive mode. One module is set in Active mode of data transmission and starts the transmission as soon as the block of data is ready. Another Bicounter is set in Inductive mode and starts the transmission of integrated data after the packet from its module-Inductor have passed the line. Current status of the Bicounter module is indicated by its Status word accessible for reading. It has the following format: B B B B B B B i i i i i i i t t t t t t t 0 1 2 3 4 5 7 a i s i d d i c n h n e a n t d o t c t t i u r e r a e ve mode on ctive mode t format of gration usi emental tes block is r gration in

on data transmission on ng external clock t on eady for transmission progress.

The instructions set is presented b elow. · Pulse discrimination threshold setting for counter A: SET LEVEL A (0x41) level <- ACY, where level is obtained from threshold T in mV with help of 2 constants programmed in 27


the module: level = low(max(0,min(255,255+const2-T*(255+const2-const1)))) · Pulse discrimination threshold setting for counter B: SET LEVEL B (0x42) level <- ACY · Current threshold request for counter A: GET LEVEL A (0xE1) <- level, then T = (255+const2-level)/(255+const2-const1). · Current threshold request for counter B: GET LEVEL B (0xE2) <- level · Micro-exp osure (integration time) setting: SET EXPOS (0x54) low(exposure) high(exposure) <- ACY where exposure is calculated from microexp osure t in ms with help of 2 constants programmed in the module: exposure = (t*(const3+const4<<8)-1)/8 · Current micro-exp osure request: GET EXPOS (0xF4) <- low(exposure) high(exposure) then t in ms is equal (8*exposure+1)/(const3+const4<<8) · Series length setting: SET NUMBER (0x36) low(number) high(number) <- ACY where number from 1 to 32767, in the case of number = 0 the infinite series is set. · Current series length request: GET NUMBER (0xF6) <- low(number) high(number). · Module status request (see the meaning of the Status bits ab ove): GET STATUS (0xE0) <- status. · EEPROM CRC check: GET CRC (0xEF) <- crc. There are no errors if crc = 0. · Data block size setting: SET BLSIZE (0x28) size <- ACY, where size can b e from 1 to 16, recommended value is 16. · Data block size request: GET BLSIZE (0xE8) <- size. · Inductor address setting: SET INDUC (0x29) address <- ACY. · Inductor address request: GET INDUC (0xE9) <- address. · Request of a new data block: GET DATA (0xA0) <- data block (NOD). Returns NOD if no new data ready. · Module identification request: GET IDENT (0xA2) <- id1 id2 id3 id4. Returns unique identification of the module. 28


· Module constants request : GET CONST (0xA3) <- const1 const2 const3 const4. Returns four constants for threshold and exp osure calculations. · Start up exp osure series: RUN (0x80) <- ACY (ACW). Returns ACW when integration does not finish yet. · Halt of exp osure series: STOP (0x81) <- ACY. Used to terminate infinite series or to break current integration. · Generation of synchro clock on: MASTER ON (0x83) <- ACY (ACW). · Use an external synchro clock on: MASTER OFF (0x82) <- ACY (ACW). · Active mode on: ACTIVE ON (0x88) <- ACY (ACW). · Active mode off: ACTIVE OFF (0x89) <- ACY (ACW). · Inductive mode on: INDUCE ON (0x8A) <- ACY (ACW). · Inductive mode off: INDUCE OFF (0x8B) <- ACY (ACW). · One byte p er count format on: SHORTER (0x84) <- ACY (ACW). · Two byte p er count format on: LONGER (0x85) <- ACY (ACW). · Start up decremental test: RUN TEST (0x86) <- ACY (ACW). The numbers from number-1 to 0 are generated instead of normal counts to check exchange faultiness. Previous instructions return ACW signal if the integration is in progress. · Software restart: RESET (0x87) <- ACY

3.3

Auxiliary mo dule

A brightness of the ap erture illumination is changed step by step and is describ ed by a following equation: illumination = floor(2^(8*n/15.01)+0.5) if n = 0, illumination = 0 if n = 0. The procedure of a rep etitive turning on of the high voltage after the overlight detection is following: HV turn off, Safety turn off, Safety turn on and then HV turn on. This procedure is made in such a complex way to protect from occasional turning on of the high voltage. 29


Current status of this module is indicated by its Status word accessible for reading. It has the following format: B B B B B B B B i i i i i i i i t t t t t t t t 0 1 2 3 4 5 6 7 h s o h c i m v i a v i o l o i g f e g n l d e h e r h t u u w voltage turned on ty on (overlight protection on) light indicator voltage locking rol light on mination on lation of the control light on er mirror of axis

The instructions set is presented b elow. · Illumination brightness setting: SET ILLUM (0x41) illumination <- ACY illumination is calculated from relative brightness IL (from 0 to 1.0): illumination = low(max(0,min(255,255*IL))) · Illumination brightness request: GET ILLUM (0xE1) <- illumination where IL = illumination/256 · Control light brightness setting: SET LIGHT (0x42) light <- ACY light is calculated from relative brightness CL (from 0 to 1.0): light = low(max(0,min(255,255*IL))). The brightness setting instructions do not turn on light. · Control light brightness request: GET LIGHT (0xE2) <- light where CL = light/256 · Module status request (see the meaning of the Status bits ab ove). GET STATUS (0xE0) <- status · EEPROM CRC check GET CRC (0xEF) <- crc. There are no errors if crc = 0. · Control light modulation amplitude setting: SET VAMPL (0x23) delta <- ACY where delta = low(max(0,min(255,255*DL*CL))) and DL is a relative amplitude. · Control light modulation amplitude request: GET VAMPL (0xE3) <- delta, then DL = (delta/256)/CL. · Illumination turn on: ILLUM ON (0x80) <- ACY (ACW) · Illumination turn off: ILLUM OFF (0x81) <- ACY (ACW). 30


· Control light turn on: LIGHT ON (0x82) <- ACY (ACW). · Control light turn off: LIGHT OFF (0x83) <- ACY (ACW). · Control light modulation turn on: VARY ON (0x84) <- ACY (ACW). · Control light modulation turn off: VARY OFF (0x85) <- ACY (ACW). · High voltage value setting: SET VOLTAGE (0x44) high <- ACY, where high is calculated from needed voltage in V with help of 2 programmed constants: high = low( max( 0, min(255, 0.001*U*const1 -cons2))). The instruction does not turn on the high voltage. · High voltage value request: GET VOLTAGE (0xE4) <- high. Then U = 1000*(high+const2)/const1. · High voltage turn on: HIGH ON (0x88) <- ACY (ACW). Returns ACW in a case of locking, and does not turn anything on the high voltage. · High voltage turn off: HIGH OFF (0x89) <- ACY. · Safety turn on: SAFETY ON (0x8A) <- ACY (ACW). Executes only if the HV is turned off. · Safety turn off: SAFETY OFF (0x8B) <- ACY (ACW). Executes only if the HV is turned off. · Device temp erature request: GET TEMPER (0xE5) <- temperature. Temp erature in C is equal to -20+(temperature)/4. · Module identification request: GET IDENT (0xA2) <- id1 id2 id3 id4. Returns unique identification of the module. Also, this instruction switches module from autonomous work to under computer control. · Module constants request: GET CONST (0xA3) <- const1 const2 const3 const4. Returns four constants. · Software restart: RESET (0x87) <- ACY.

31


3.4

Up dating a micro co de

The ATMega8 microcontroller has a useful feature -- Boot Loader Supp ort (BLS), which p ermits to change part of microcode for application with help of another part of the microcode - so called b oot loader. In practice, the microcontroller is programmed for the first time only by the b oot loader software with help of any ISP programmator. This loader program starts each time after p ower on. This code supp orts a numb er of sp ecial commands which p ermit to load the new version of the needed application software in the flash memory. In order to switch from the microcode up date state to the working state, the module must receive the RESET command. In the normal work when Turbina software is started, it sends RESET as first command for each module. After that, module goes into application mode and op erates further in this mode. There is a p ossibility to return into b oot loader mode with a sp ecial command: BOOT (0xC0) <- ACY. Boot loader itself can't b e reprogrammed this way, what guarantees the p ossibility to rep eat the application software up date even if a serious problem has occurred during the up dating process. Since the up dating procedure uses the same RS485 line for data transfer, no additional cabling or device disassembling are required. MASS/DIMM software distribution contains an utility avrup in the directory avrup of the RS485 driver package. Before its usage the needed steps for RS485 driver installation must b e done and MASS/DIMM device must b e connected and p owered on. To reprogram any module, its application code Naprimer.hex in Generic format must b e prepared. For example, conversion of the assembler application text into the generic (hex) format may b e done with help of Atmel AVR assembler avrasm32.exe started via wine software under Linux OS directly. The avrup utility has 3 options: · -b bootaddress -- indicates that the module will b e up dated with the b oot loader address = bootaddress (hex). · -a appladdress -- indicates that module will have address = appladdress (hex) after up dating. · -r baudrate -- indicates that module will have new exchange rate = baudrate (Kbaud) after up dating. We recommend to always save appladdress the same as bootaddress, b oth corresp onding to the module address in device.cfg file. For example, to up date Bicounter1 with new code, execute: .\avrup -a1 -b1 bicounter.hex Note, that the same microcode bicounter.hex is used for b oth Bicounters. Being started, the utility detects the state of the module (application or up date) accessing it via the b oot address. Note that problem may arise if the b oot and application addresses of this module differ. If needed, the module is switched into up date state. In case the application address or baudrate are given in command options, the resp ective code words are modified b efore uploading. Then avrup loads the application code page by page from the zero address and checks it by back reading and comparison. This progress of this uploading and checking is shown in console. After end of uploading the module is reset into application state. 32


Note, that for control needs, the utility modifies the 3rd and 4th bytes of the mo tification replacing them with the encoded current programming date. This new tion is displayed in the end of reprogramming and should b e written in resp ective device.cfg. If forgotten, the next start of Turbina will output the warning message invalid identification of the reprogrammed module.

dule idenidentificasection of ab out the

33