Design of B-ultrasound detection tooling based on single chip microcomputer and CPLD

Publisher:MysticGlowLatest update time:2011-11-26 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

introduction

Ultrasound propagates in the human body. Due to the differences in acoustic properties of various tissues in the human body, ultrasound will produce physical characteristics such as reflection, refraction, scattering, diffraction, attenuation, and Doppler frequency shift caused by the relative movement between the sound source and the receiver at the interface between two different tissues. Different types of ultrasonic diagnostic instruments are used, and various scanning methods are adopted to receive these reflected and scattered signals, display the morphology of various tissues and their lesions, and combine pathology and clinical medicine to observe, analyze, and summarize different reflection laws, so as to make a diagnosis of the location, nature, and degree of functional impairment of the lesion. B-ultrasound is a display mode in ultrasonic diagnostic instruments.

The working process of B-ultrasound is as follows: when the probe receives the excitation pulse, it emits ultrasonic waves (at the same time, the probe is controlled by the focusing delay circuit to achieve acoustic focusing of the sound waves). After a period of delay, the probe receives the reflected echo signal, which is then processed by filtering, logarithmic amplification, etc. Then, the DSC circuit performs digital conversion to form a digital signal, which is further processed under the control of the CPU, and then synthesized with the image forming circuit and the measuring circuit to form a video signal and sent to the display, forming the B-ultrasound image we are familiar with, also known as a two-dimensional black and white ultrasound image.

In order to enhance the image resolution, B-ultrasound has more channels, mostly 16, 24, 48, 64 or even more channels. The electronic components of these channels are exactly the same, and the consistency of each channel is required to be good. Before assembling the whole machine, it is best to have testing means and methods to test all channels to eliminate problems in the device itself and the soldered circuit board. For this purpose, I designed the B-ultrasound detection tooling.

Tooling design requirements

This tooling design requires testing the AFE9624 ultrasound board with 24 channels and a 96-element probe. The AFE9624 includes a high-voltage transmitting circuit, relay switching, high-voltage analog switch switching, a preamplifier circuit, and a VGA circuit.

Launch tooling requirements

High-voltage transmitting circuit, high-voltage analog switch circuit, and relay switching circuit tests must be tested at the same time. It is necessary to design a transmitting tooling board, relay control test circuit, high-voltage analog control circuit, and probe interface high-voltage waveform measurement circuit. Specifically, it includes: high-voltage transmitting circuit tooling (referred to as transmitting tooling), 1~24 channel transmitting drive and switching circuit; high-voltage analog switch control circuit tooling (referred to as switch tooling), which controls the opening or closing of any channel. In actual use, it only controls the opening of a certain channel, and the other channels are closed. Correspondingly, the transmitting control also only opens the corresponding one channel, and the other drive settings are invalid; relay control test tooling (referred to as relay tooling), which provides control signals for opening or closing the relay group; the waveform measurement circuit tooling of the probe interface (referred to as probe waveform tooling), which includes a 96~1 switching circuit, so that the waveform of the transmitted array element position can be switched to the oscilloscope for display and measurement.

Receiving tooling requirements

VGA test: VGA test mainly verifies the function and accuracy of the amplifier circuit. It needs to provide each VGA analog input signal and detect it through an oscilloscope. The test signal can be applied through the probe interface, but the high-voltage analog switch must be controlled accordingly so that each VGA can obtain accurate input. Specifically, it includes: waveform generator tooling, which provides 96 analog sine waveforms with a frequency of 3.5MHz and an amplitude PP of 1V~1.2V. It can achieve load short-circuit protection and allow an output impedance of tens of ohms; high-voltage analog switch control and VGA gain control tooling (referred to as switch gain tooling), which provides control signals for the high-voltage analog switch circuit on AFE9624 and provides gain control signals for VGA. The gain control signal can be a sawtooth wave with a minimum amplitude value greater than 0.2V and a maximum value less than 2.5V. The sawtooth wave period is 50µs.

Hardware circuit design

Figure 1 shows the schematic diagram of the main control part in the design circuit of the transmitting and receiving tooling. The schematic diagram of the transmitting part is shown in Figure 2, and the schematic diagram of the receiving part is shown in Figure 3. It should be noted that some circuits of the transmitting and receiving parts are shared. These three circuits mainly include the microprocessor AT89S52 for controlling automatic detection, and the first two digits of the digital tube display the probe 00 or 01, that is, PROBE A or PROBE B. The last two digits of the digital tube display 1~96, that is, 1~96 channels. Alter's CPLD (EPM7064) is used to generate two pulses with opposite directions and dead time with a period of 20ms and a pulse width of 330ns, which are used for the transmitting waveform of the transmitting channel. The tooling board uses 18 8-channel high-voltage switches HV20220, of which 6 are used to control the dual 1~24 channel digital switch switching circuit, and the remaining 12 are used for the switching of the 96 array elements of the probe to select 1. The control circuits of transmission and reception are basically the same. What needs to be changed is the direction of the two double-pole double-throw switches S1 and S2. The transmission waveform of the receiving tool is a sine wave, which is generated by the function generator chip MAX038. This design has a communication interface between the microcontroller AT89S52 and the host computer. It can be programmed by the host computer and the tool can be controlled using a graphical interface. Only software programming is required. This article uses the two modes of power-on automatic detection and manual detection, and does not use the host computer control mode.


Figure 1 Schematic diagram of the main control part of the transmitting and receiving tooling design circuit

Both the transmitting and receiving tools need to control the transmitting waveform or receiving waveform, and then connect it to the actual B-ultrasound board to be tested through the adapter cables JP3~JP7 and JP10 to test the B-ultrasound board (the sockets of the JP3~JP7 and JP10 connecting cables are not shown in Figures 1 to 3).

Launch tooling design

In Figure 1, U1 (7400) NAND gate circuit and 12MHz crystal oscillator form a crystal oscillator, which provides clock signal to the global clock terminal 43 pin of EPM7064. The 21 pin and 25 pin of EPM7064 output two pulse signals with opposite directions of 20ms period, 330ns pulse width and 660ns dead time. After being driven by the same-direction amplifier U21 (74F07), IPA and INB are obtained and added to the double-pole double-throw switch S1 (in Figure 2, S1 needs to be turned to the transmitting position at this time). IPA is added to the three high-voltage switches HV20220 of U3, U4 and U5 through S1. All the outputs of the three high-voltage switches are connected together, and these three high-voltage switches are connected in the form of daisy petals, that is, the data input terminal DIN of the next switch is connected to the data output terminal DOUT of the previous switch. Under the control of the microprocessor AT89S52, the serial control signals of the switching circuits SDATA1, SCLK1, SLD1, and RESET1 are given, so that the input ends of the three high-voltage switches are closed in turn with their own output ends, such as pins 7 and 8 of U3. At this time, the IPA signal is sent to IP001. However, it should be noted that at the same time, only one of the 24 channels of the three high-voltage switches can be closed, and the rest are disconnected. The process of INB is exactly the same as that of IPA. When IP001 gets the IPA signal, IN001 also gets the INB signal. IP001~IP024 get the IPA signal in turn, and IN001~IN024 get the INB signal in turn. IP001~IP024 and IN001~IN024 are sent to the AFE9624 board of B-ultrasound through the adapters JP3 and JP4. On the AFE9624 board, the MD1211 drives the built-in field effect tube chip C6320, and obtains two waveforms with dead time, opposite directions, and synthesized after amplification by MD1211. Then, the 12 high-voltage switches HV20220 on the AFE9624 board are switched, and the output of probe A or probe B is selected according to the relay switching. Under the control of the microprocessor AT89S52, the relay group is turned on or off by the signal SRELAY: when SRELAY=0, probe A is turned on; when SRELAY=1, probe B is turned on. At the same time, the SDATA2, SCLK2, SLD2, and RESET2 serial control signals are sent out to control the high-voltage analog switch HV20220 on the AFE9624 board through the JP10 adapter. The signal amplified and controlled by the AFE9624 board is sent to the 12 high-voltage switches U12~U20 on the tooling board through the adapter cables JP5, JP6, and JP7 (only U18~U20 are shown in Figure 3), and finally through the double-pole double-throw switch S2 (which should be turned to the transmitting position at this time), the oscilloscope connected to the J3 end can see the required synthetic waveform. Under the control of the microprocessor AT89S52, U12~U20 gives SDATA3, SCLK3, SLD3, RESET3 serial control signals to achieve the purpose of 96 to 1.


Figure 2 Schematic diagram of the transmitting part of the transmitting and receiving tooling design circuit [page]

Receiving tooling design

In Figure 3, U25 (MAX038) is a function generator chip. Its 3rd pin A0 and 4th pin A1 are output waveform selection terminals. The output waveform selection is determined by the combination of logic address pins A0 and A1: when A1A0=10 or 11, a sine wave is output; when A1A0=00, a square wave is output; when A1A0=01, a triangle wave is output. The waveform switching can be completed within 0.3μs, but the output waveform has a delay time of 0.5μs. Pin 19 of MAX038 is the waveform output terminal. This design outputs a sine wave with a frequency of 3.5MHz and an amplitude PP of about 1V. This sine wave passes through the double-pole double-throw switch S2 (which should be turned to the receiving position at this time), and under the control of the microprocessor AT89S52, it gives SDATA3, SCLK3, SLD3, RESET3 serial control signals, controls U12~U20, and switches this sine wave to the (96 choose 1) probe, that is, PA0~PA95 respectively obtains this sine wave, and sends it to the AFE9624 board through the adapter JP5, JP6, JP7. According to the adapter JP5, JP6, JP7, it is connected to the probe and the microprocessor uses a relay to control its operation. The sine wave passes through 12 high-voltage switches HV20220 (the same set of high-voltage switches as when transmitting), and passes through the transmitting and receiving isolation circuits to obtain the receiving signal (here is the sine wave given by our tooling), and then amplified by the preamplifier circuit on the AFE9624 board, and sent to the IP001~IP024 terminals of U3~U5 and the IN001~IN024 terminals of U6~U8 on the transmitting tooling in Figure 2 through the adapter wires JP3 and JP4 on the tooling. Also under the control of the microprocessor AT89S52, the high-voltage switches are turned on in turn. At this time, the other ends IP and IN of the high-voltage switches obtain sine waves, which pass through the double-pole double-throw switch S1 (S1 needs to be turned to the receiving position at this time). Connecting a dual-trace oscilloscope to J1 can see the differential 2 sine waves. The emitter of transistor Q5 outputs the TGC gain control signal, which is sent to the gain control end of the preamplifier circuit on the AFE9624 board through the adapter wire JP10 to control the amplitude of the received signal.


Figure 3 Schematic diagram of the receiving part of the transmitting and receiving tooling design circuit

Software Design

This tooling uses CPLD to generate the transmission waveform, uses the microprocessor AT89S52 to control the entire tooling board, and also provides switching instructions for relays and high-voltage switches to the B-ultrasound board (AFE9624) to be tested.

Transmit waveform generation

The two pulse signals with opposite directions and a period of 20ms, a pulse width of 330ns, and a dead time of 660ns are written in Verilog HDL language and output from pins 21 and 25 of EPM7064. The source code is as follows:

module pwm(clock,pwm_out,pwm_out1);

input clock;

output pwm_out;

output pwm_out1;

reg [20:0] count;

reg pwm_reg;

reg pwm_reg1;

always @ (posedge clock)

begin

count=count+1;

if (count<4) //330ns pulse width

begin

pwm_reg=1;

pwm_reg1=1;

end

else if (count<12) //660ns dead time

begin

pwm_reg=0;

pwm_reg1=1;

end

else if(count<21'd16) //330ns negative pulse

begin

pwm_reg=0;

pwm_reg1=0;

end

else if(count==21'd240000)//12M crystal, 12000000/240000=50Hz, i.e. 20 milliseconds

begin

ount=21'd000000;

pwm_reg=1;

pwm_reg1=1;

end

else

begin

pwm_reg=0;

pwm_reg1=1;

end

end

assign pwm_out = pwm_reg;

assign pwm_out1=pwm_reg1;

endmodule

Microprocessor AT89S52 control code

[page]

The microprocessor AT89S52 is connected to three external touch switches S3, S4, and S5. S3 is connected to external interrupt 0 for relay control. Probe 1 (PROBE A) is selected by default when powered on. Press S3 to select probe 2 (PROBE B). Pressing it again will have no effect (to prevent the probe from being replaced under power). Probe 1 can only be selected after powering on again. S4 is connected to external interrupt 1. The 24 channels and 96 array elements are automatically detected every 2 seconds by default when powered on. If manual detection is required, press S4. At this time, each press of S4 will detect the next channel and array element. S5 is the reset switch. According to the hardware connection, the settings are as follows:

uchar m=0; //For selection of 96 array elements

uchar n=0; //Default selection probe 1

uchar l=0; //For 24 channel selection

uchar k;

sbit SDATA1= P1^0; //Shift data 1

sbit SCLK1= P1^1; //Shift clock 1

sbit SLD1= P1^2; //Shift lock

sbit RESET1=P1^3; //Reset 1

sbit SDATA3= P1^4; //Shift data 3

sbit SCLK3= P1^5; //Shift clock 3

sbit SLD3= P1^6; //Shift lock

sbit RESET3=P1^7; //Reset 3

sbit SDATA2= P0^0; //Shift data 2

sbit SCLK2= P0^1; //Shift clock 2

sbit SLD2= P0^2; //Shift lock

sbit RESET2=P0^3; //Reset 2

sbit SRELAY=P0^4; //Probe relay selection

Timer automatic detection subroutine

void serves_timer2() interrupt 5 using 0

{

EA=0;

TF2=0;

k=k+1;

if(k==40) //2 seconds

{ k=0;

m=m+1;

l=l+1;

if( m>96) m=1;

if (l>24) l=1;

DELAY1s( );

for (j=0;j<8;j++)

{

HV20220_1(l);

HV20220_2( m ) ;

HV20220_3(m);

}

}

else{}

EA=1;

}

In this program, if( m>96) m=1;if (l>24) l=1; That is: 96 array elements correspond to 24 channels. In the actual B-ultrasound process, when one channel is working, there will be 4 array elements arranged in a certain pattern working at the same time. This tool not only independently detects each of the 24 channels, but also detects each of the 96 array elements. Therefore, the detection of 96 array elements and 24 channels is run 4 times.

Touch switch S4 external interrupt 1 subroutine

void serves_int1() interrupt 2 using 2 // external interrupt 1

{

EA=0;

TR2=0; //stop counting

m=m+1;

l=l+1;

if( m>96) m=1;

if (l>24) l=1;

DELAY1s( );

for (j=0;j<8;j++)

{

HV20220_1(l);

HV20220_2( m ) ;

HV20220_3(m);

}

EA=1;

}

Touch switch S3 external interrupt 0 subroutine

void serves_int0() interrupt 0 using 0 // external interrupt 0

{

EA=0;

n=1; //display 01

SRELAY=1; //Select probe 2

DELAY1s( );

EA=1;

}

The tooling first detects probe 1. After all 96 array elements of probe 1 have passed the test, the power is turned off and the probe adapter is placed in the position of probe 2. The power is turned on and the touch button S3 is pressed. At this time, the first two digits of the digital tube display 01, which is the sign of selecting probe 2. The microprocessor controls the relay to transfer all channels to the measurement of probe 2.

[page]

Driving function of high voltage switch HV20220

Function HV20220_1(uchar dd): Turn on the 1-to-24 high voltage switch of the CPLD waveform generator (tooling).

Function HV20220_2(uchar dd): Turn on the high voltage switch on the main system board (AFE9624).

Function HV20220_3 (uchar dd) function: turn on the 96-to-1 high voltage switch on the probe (tooling).

Take driver HV20220_1 as an example, the other two are similar.

void HV20220_1(uchar dd)

{

uchar i;

SLD1=1;

for (i=0;i<96;i++) {

SCLK1=0;

data10=0;

SDATA1 = data10;

SCLK1=1;

_Nop( );

_Nop( );

}

for (i=0;i
SCLK1=0;

if (i==0) data10=1;

else data10=0;

SDATA1 = data10;

SCLK1=1;

_Nop( );

_Nop( );

}

RESET1=0;

_Nop( );

_Nop( );

RESET1=1;

_Nop( );

_Nop( );

_Nop( );

_Nop( );

RESET1=0;

_Nop( );

_Nop( );

SLD1=0;

_Nop( );

_Nop( );

_Nop( );

_Nop( );

SLD1=1;

}

Use the transmitting and receiving tools to detect the B-ultrasound channel

B-ultrasound transmission channel detection

After connecting the tooling and B-ultrasound, and the detection device, check that the switches S1 and S2 are in the "transmit" position, and the oscilloscope is connected to J3.

1. The AFE9624 tooling board display screen lights up completely, and after 3 seconds, it displays 0000 again.

2. After 2 seconds, the machine automatically enters the detection state, the display shows 0001, and then the oscilloscope shows positive and negative pulse waveforms, as shown in Figure 4, indicating that the circuit of channel 1 is normal.

Figure 4 Oscilloscope displays positive and negative pulse waveforms

3. After 2 seconds, it automatically enters the detection state again, and the display shows 0002, followed by the oscilloscope showing positive and negative pulse waveforms, indicating that the circuit of channel 2 is normal.

4. Continue to wait for the detection device to automatically repeat the above process until the display shows 0096, and then the oscilloscope shows positive and negative pulse waveforms, indicating that the circuit of channel 96 is normal. So far, it is confirmed that the transmission of probe 1 interface is working normally.

5. Turn off the power and plug the "probe adapter board" into the probe 2 of the "main control system probe board". After the detection device is connected, power on, click the trigger switch S3 on the tooling board, the display screen shows 0100, and then repeat the above 2 to 4 processes to confirm that the probe 2 interface transmission is working normally. During this process, the display screen shows numbers 0101 to 0196.

B-ultrasound receiving channel detection

After the connection between the tooling and the B-ultrasound detection device is completed, the switches S1 and S2 are in the "receiving" position, and the oscilloscope is connected to J1. Follow steps 1 to 5 in the B-ultrasound transmission channel detection. At this time, the waveform displayed by the oscilloscope is a sine wave, as shown in Figure 5.


Figure 5 Oscilloscope display detection waveform

Conclusion

This article introduces the design of tooling for fully automatic testing of B-ultrasound board AFE9624. After testing, it has met the design requirements and can provide reference for B-ultrasound testing designed by other manufacturers. According to the ideas of this article, based on the actual B-ultrasound interface, you only need to design various adapter boards or adapter cables to conduct comprehensive testing of the B-ultrasound board.

Reference address:Design of B-ultrasound detection tooling based on single chip microcomputer and CPLD

Previous article:Design of ADF4106 Phase-locked Frequency Synthesizer Based on Single-Chip Microcomputer Control
Next article:A method of constructing a high-precision PWM 12-bit D/A based on a single-chip microcomputer

Recommended ReadingLatest update time:2024-11-16 22:55

Design of digital bus station system based on ARM7 and CPLD
In view of the shortcomings of existing printed bus stops, such as insufficient information, inability to provide vehicle arrival forecasts, and troublesome addition or modification of route information, this paper proposes a new digital bus stop system. The system is based on ARM7 and CPLD architecture, communicate
[Microcontroller]
Design of digital bus station system based on ARM7 and CPLD
Application of CPLD in the Design of Multifunctional Harmonic Analyzer
Application of CPLD in the Design of Multifunctional Harmonic Analyzer 1 Sampling method comparison When collecting data for three-phase voltage and current 6-channel analog quantities, there are generally two methods: ① Alternating sampling method of same-ph
[Analog Electronics]
Application of CPLD in the Design of Multifunctional Harmonic Analyzer
Arbitrary Waveform Generator Based on CPLD
       Arbitrary waveform generator ( AWG ) is widely used in communication systems, test systems, etc. This paper uses the self-developed 150 MSPS 12-bit DAC and 300 MSPS 12-bit DAC, based on CPLD technology, to design an AWG . The waveform to be generated is set by the host computer software, and then the waveform
[Microcontroller]
Arbitrary Waveform Generator Based on CPLD
Design of Vision System for Service Robot Based on CPLD
With the development of computer science and automatic control technology, more and more different types of intelligent robots are appearing in factories and life. As an important subsystem of intelligent robot system, robot vision system is also receiving more and more attention. It involves fields such as image pr
[Embedded]
Design of Vision System for Service Robot Based on CPLD
Design of system hardware watchdog based on CPLD
Introduction In digital systems with microcontrollers, DSP and other processors as the core, watchdogs are an indispensable part, especially in systems with extremely high reliability requirements, such as servo controllers on arrows. Due to the cross-use of strong and weak electricity in the arrow body, or the compl
[Microcontroller]
Design of system hardware watchdog based on CPLD
Reducing CPLD Power Consumption in Embedded Design
Engineers working on portable or handheld product designs understand that minimizing power consumption is an essential requirement for today's designs. However, only experienced engineers understand the subtle but important details of maximizing the battery life of their systems. In this article, we focus on how the
[Embedded]
Reducing CPLD Power Consumption in Embedded Design
Less than 2 years after acquisition, AMD abandons Xilinx CPLD chips
According to news on January 18, AMD recently issued a product discontinuation notice, stating that it will no longer provide all CoolRunner and CoolRunner II CPLD chips, as well as Spartan II and Spartan 3 FPGA chips. The discontinuation notice reads: Due to declining run rates and supplier sustainability reasons,
[Semiconductor design/manufacturing]
Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号