ENCYCLOPEDIA OF RADIO ELECTRONICS AND ELECTRICAL ENGINEERING Flat cable dialer. Encyclopedia of radio electronics and electrical engineering Encyclopedia of radio electronics and electrical engineering / Measuring technology The first idea that came to my mind was to make a simple "dialer": connect each pin of the connector installed at one end of the cable through a 330 ... 510 Ohm resistor with a voltage source of 5 V, and at the other - with an LED. Unfortunately, in this way only the integrity of the wires is checked. You may not notice that adjacent wires are interconnected.
It was decided to complicate the verification algorithm and make the device on a microcontroller. On fig. 1 shows a diagram of such a device. It uses the ATtiny13 microcontroller that was at hand. It can be replaced by another, but for this the device may have to be slightly redone. For example, in ATtinyl 1, ATtiny 12, ATtiny15L microcontrollers, the PB5 line cannot work as an output, it will have to be configured as an input, and the PB4 or PB13 line as an indicator blanking signal output. In addition to the microcontroller, it took only two shift registers, a transistor and two linear LED scales showing the error code. Let's take a closer look at the features of the I / O port of the ATtiny5 microcontroller. Its POY-PB0 lines can transmit signals in both directions. Each of them is configured separately using the DDRB register. For example, if the three least significant bits of DDRB[2]-DDRB[2] are written as ones, and the remaining bits are zeros, then the PBO-PB5 lines will become outputs, and the PBXNUMX-PBXNUMX lines will become inputs. There are two more registers for port control - PINB and PORTB. The first of them serves to enter information into the microcontroller. In its digits, the actual, currently valid logical voltage levels at the microcontroller outputs are displayed as ones and zeros. It does not matter whether this voltage came from an external source or from the output buffer of the microcircuit itself. The PORTB register is used to output information from the microcontroller. If the port line is configured as an output, it will be set to a voltage level similar to the value written to the corresponding bit of this register. Since the microcontroller in question has only six I / O lines, and you need to check cables up to 14-wire, and even display the results of the test on the indicator, I had to supplement it with two microcircuits - shift registers. Such a register is a set of D-flip-flops, the output of each of which is connected to the input of the next. The main purpose is to convert serial code into parallel. When the low voltage level at the clock input C is changed to a high one, the information stored in the register is shifted by one bit (D-trigger) towards the older one, and the state of the information input is entered into the released low bit. The used shift register chip 74LS164 has two information inputs D combined with an AND function. To use only one of them, a constant high level (+5 V) is applied to the second one. To write a seven-bit binary code to the shift register (this is exactly what is required for the operation of the device), you must first enable the register by setting the R input to high, and the C input to a low level, and apply the value of the most significant (D6) bit of the output code to the information input . Then generate a clock pulse at the input C (set a high, and then again a low level). As a result, the value of the D6 bit will be written to the least significant bit of the register and output to its output 1 (pin 3). Further, the value of the D5 bit is supplied to the information input and the clock pulse is formed again. The value of D6 will be transferred to the next bit of the register and will appear at output 2 (pin 4). The value of D5 will be output to output 1. Each new clock pulse shifts the code in the register by one more bit, and after the seventh pulse it will take its proper place: at output 1 - DO, at output 7 (pin 12) - D6. Timing diagrams in fig. 2 illustrate how the shift register converts the serial code 1011001 to the same parallel one.
To increase the shift register capacity to 14 (the maximum number of wires in the cable), two eight-bit 74HC164 registers (DD1 and DD2) are connected in series, each of them using seven bits. Complete code conversion takes 14 clock pulses. When developing the circuit and the program of the device, the following distribution of the microcontroller port lines according to the functions performed was adopted: PBO - shift register timing output;
Depending on the number of wires in the tested cable, they are connected to 14-pin connectors XP1 and XP10 or 2-pin XP4 and XP1. The indicators HL2 and HL1 are connected to the same outputs of the shift registers as the wires of the tested cables. To avoid flickering of the indicators, they must be turned off while the microcontroller is performing the verification procedure, and turned on only after the code displaying its result is loaded into the registers. This is done using the transistor VTXNUMX, controlled by the microcontroller signal. When checking a cable, it is necessary to "ring" each of its wires and make sure that it is not connected to one of the neighboring ones. There are no other defects in flat cables. The verification procedure begins by writing a unit to an external shift register. As a result, the first pin of the XP1 connector is set to a high level. If the cable wire connected to it and to the first pin of the XRP connector is good, then a high-level voltage will be applied to the PB4 input of the microcontroller, and it will remain low at the PB input. If this condition is met, the program will write 0 to the least significant bit of the n_err variable, otherwise it will write 1. Next, another clock pulse is generated and the second wire is checked. Since its number is even, the result is written to the ch_err variable. To check all fourteen wires, the procedure is repeated seven times, and before checking the next pair of wires, the values of the variables n_err and ch_err are shifted by one binary digit. Upon completion of the check, the obtained values of the variables n_err and ch_err are loaded into an external shift register and indicators are turned on. After a pause, the test is repeated. Checking a ten-wire cable connected to the XP2 and XP4 connectors is similar, but four wires (two on each side) are shown as missing on the indicator. If the microcontroller's internal 4,8 MHz clock generator is used, the cable test (before the indicator turns on) takes about 70 µs and repeats with a period of about 240 µs. Therefore, it seems that the indicators are always on. Diodes VD1-VD14 are needed in order to decouple the outputs of the registers. The appearance of the "dialer", assembled on a breadboard, is shown in fig. 3. LED assemblies (scales) GNA-R102510ZS-11 can be replaced with the required number of single LEDs; transistor KT3156 - any of the series KT315, KT3102 or other low-power transistor of the npn structure with an allowable collector current of at least 100 mA. Instead of 74NS164 microcircuits, 74LS164 or domestic K555IR8 can be installed. The ATtiny13-10PU microcontroller can be replaced with ATtiny13-10PI, ATtiny13-20PU, ATtiny13-20PI. The microcontroller program is written in assembly language in the AVR Studio environment. Its codes for loading into the program memory of the microcontroller are given in Table. 1. The configuration of the microcontroller must correspond to that specified in Table. 2. The zero value of the RSTDISBL bit is necessary for the operation of pin 1 of the microcontroller as a port line, and not as a setup signal input. This, unfortunately, makes the microcontroller unavailable for programming via the SPI interface. Therefore, it is necessary to apply the "high-voltage" programming method. It is provided by most universal programmers. The speed of the test and the frequency of repetition of its cycles can be doubled by increasing the clock frequency of the microcontroller from 4,8 to 9,6 MHz. To do this, it is enough to set the value of the configuration bit CKSEL1 to 1, and CKSEL0 to 0. The device does not require adjustment and immediately after proper assembly is ready for use. The program of the microcontroller "dialer" can be downloaded here. See other articles Section Measuring technology. Read and write useful comments on this article. Latest news of science and technology, new electronics: Machine for thinning flowers in gardens
02.05.2024 Advanced Infrared Microscope
02.05.2024 Air trap for insects
01.05.2024
Other interesting news: ▪ Seoul Semiconductor SunLike LED is the safest ▪ Asustor AS3102T and AS3104T NAS with 4K video support ▪ CAMM is the new standard for ultrabook RAM ▪ Meat steak grown from tenderloin ▪ Created the most accurate scales in the world News feed of science and technology, new electronics
Interesting materials of the Free Technical Library: ▪ site section Field strength detectors. Article selection ▪ article The state is me. Popular expression ▪ article Packing equipment. Travel Tips ▪ article Television, video equipment. Directory ▪ article Napkin bouncing off the floor. Focus secret
Leave your comment on this article: All languages of this page Home page | Library | Articles | Website map | Site Reviews www.diagram.com.ua |