Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:

Interfacing with C plus plus-programing communication with microcontrolers (K. Bentley, 2006)

.pdf
Скачиваний:
192
Добавлен:
12.08.2013
Размер:
3.18 Mб
Скачать

458 APPENDIX A - HARDWARE

Figure A-22 VCO & Thermistor Circuit - schematic diagram.

Connect the VCO’s voltage input pin VIN (9) to GND and connect an interconnect lead from the VCO output (pin 4) to one of the 8 LED Driver input pins. This should produce a slowly changing signal, evident by a LED flashing on and off. Connecting the VCO voltage input pin to +5V should produce an output pulse-train having a much higher frequency. If this is not so, check:

Short-circuits, open-circuits, incorrect value of associated resistors and capacitors, faulty components, incorrect IC orientation, and faulty soldering.

Testing the Thermistor Circuit

This is a simple voltage divider circuit having a capacitor connected across its output to GND. The capacitor has been added to reduce the possible effects of any high-frequency noise coupled through from the +5V power supply.

Test for +5V at the end of resistor R31 (furthest from capacitor C9). If not present, check:

+5V power supply, short-circuits, and open-circuits.

The thermistor will have a particular resistance at room temperature, producing a corresponding output voltage (VTH) from the voltage divider circuit. Hold the body of the thermistor between two fingers to warm it (change its resistance) and the output voltage should change. If not so, check:

Inappropriate value of resistance for R31, faulty soldering of components, short-circuits, open-circuits, faulty resistor R31, faulty thermistor, or faulty capacitor.

APPENDIX A - HARDWARE 459

Thermistor Cct

 

 

 

 

 

 

74HC245

4046

 

 

74HC245

 

 

 

Voltage-Controlled

 

 

 

Oscillator Cct

ADC0804

 

 

 

ULN2803A

4093

 

 

74HC157

 

LM358

LM358

 

 

 

DAC0800

LM358

 

Figure A-23 VCO & Thermistor Circuit – component positions.

Figure A-24 VCO & Thermistor Circuit – components fitted.

460 APPENDIX A - HARDWARE

Analog-to-Digital Converter Circuitry

Assembly

Fit and solder all components listed in Table A-8 into their position as marked on the pcb overlay and as shown in Figure A-26 and Figure A-27.

Table A-8 Analog-to-Digital Converter - Bill of Materials.

 

 

Lead Spacing

 

Quantity

Component Description

or Footprint

Designator

1

150 pF ceramic capacitor

0.2 inch

C17

1

0.1 ΠF ceramic monolithic capacitor

0.2 inch

C11

1

100 : resistor

¼ W

R69

4

10K resistor

¼ W

R9, 15-17

1

ADC0804 CMOS IC

DIL20

U7

1

IC socket

20 pin

 

13

Pcb pin, 0.9 - 1.0 mm diameter

 

 

Testing

Figure A-25 shows the schematic for the Analog-to-Digital Converter (ADC) circuitry.

Figure A-25 ADC Circuit - schematic diagram.

APPENDIX A - HARDWARE 461

This circuit uses an ADC0804 IC to sample an analog voltage (0 to +5V) at its input pin (VIN) and produce a digital output byte (0 to 255) that represents this analog voltage.

The voltage at the ADC0804 power pin (20) should be +5V. If not, check:

+5V power supply, incorrect IC orientation, short-circuits, open-circuits, faulty IC socket connections, and a faulty ADC0804 IC.

If the IC has +5V present at its power pin as intended, but the IC is HOT, the device may be suffering from what is known as CMOS SCR Latch-up. This phenomena can occur with some CMOS devices, and has the effect of internally short-circuiting the power pin to GND. To overcome this problem, turn the power off to the interface board and allow the IC to cool, then re-apply power and check for normal cool temperature.

The three logic inputs to the ADC0804 (/READ, /START C., and /CS) should be pulled to +5V by the pull-up resistors R16, R9, and R17. If not, check:

Faulty soldering of components, short-circuits, open-circuits, faulty resistors, incorrect IC orientation, and a faulty ADC0804 IC.

To perform the final test for the ADC, connect the /CS and /READ input pins to GND. Connect an interconnecting lead to the /START C. input, at this stage leaving the other end of the lead free.

Connect the ADC digital output pins (D0-D7) to the LED Driver Circuit to visually display their logic state.

Connect the analog input voltage (VIN) to GND. Briefly connect the /START C. input to GND to initiate a conversion. The resulting ADC output byte should be close to decimal 0, or binary 0000 0000.

Repeat this test with VIN connected to +5V. The resulting ADC output byte should be close to decimal 255, or binary 1111 1111.

Note that the most significant bit of the ADC0804 is DB7 (pin 11). This bit should remain high until the input voltage drops below half the input voltage range (2.5V).

If any of the above tests fail, check:

Incorrect IC orientation, faulty soldering of components, short-circuits, open-circuits, faulty IC socket connections, and faulty components.

462 APPENDIX A - HARDWARE

 

 

 

74HC245

4046

 

 

74HC245

 

 

 

 

ADC0804

ULN2803A

4093

 

 

74HC157

 

LM358

LM358

 

 

 

DAC0800

LM358

 

Figure A-26 ADC Circuit – component positions.

Figure A-27 ADC Circuit – components fitted.

463

APPENDIX A - HARDWARE

Miscellaneous Circuitry

 

 

 

 

 

74HC245

 

4046

 

 

74HC245

 

 

 

 

 

 

Charge/Discharge Cct

 

 

Photonic Cct

Switch Cct

 

 

ADC0804

Multiplexer Cct

 

 

 

 

ULN2803A

 

 

 

 

Transistor Cct

 

4093

 

 

 

 

 

 

 

74HC157

 

 

POT

 

 

 

 

 

Const.

LM358

LM358

 

 

 

Curr.

 

 

 

 

 

 

 

 

Sce.

 

 

 

 

 

 

 

Voltage Buffer Cct

 

 

 

 

Diode

DAC0800

LM358

 

 

 

Test

 

 

 

 

 

 

 

 

Cct

 

 

 

 

Figure A-28 Miscellaneous Circuits – component positions.

Figure A-29 Miscellaneous Circuits – components fitted.

464 APPENDIX A - HARDWARE

Multiplexer Circuit

Assembly

Fit and solder all the components listed in Table A-9 into their position as marked on the pcb overlay and as shown in Figure A-28 and Figure A-29.

Table A-9 Multiplexer - Bill of Materials.

 

 

Lead Spacing

 

Quantity

Component Description

or Footprint

Designator

1

0.1 ΠF ceramic monolithic capacitor

0.2 inch

C19

9

10K resistor

¼ W

R58-66

1

74HC157 CMOS IC

DIL16

U12

1

IC socket

16 pin

 

13

Pcb pin, 0.9 - 1.0 mm diameter

 

 

Testing

Figure A-30 Multiplexer Circuit - schematic diagram.

Figure A-30 shows the schematic for the multiplexer circuitry. This circuit splits eight bits (or digital signals) into two groups of four bits and allows one group at a time to be switched through to its four output pins. In this manner, a stream of eight-bit data can be transmitted as a series of two four-bit groups to another device, using only four signal transmission signal lines. The disadvantage is the doubling of time required to transmit when compared to the use of eight direct connections and no multiplexer.

APPENDIX A - HARDWARE 465

The Select input (pin 1) to the multiplexer controls the connection of inputs 1A-4A or inputs 1B-4B to the outputs 1Y-4Y respectively. When Select is at a low logic level, A’s inputs are switched to the output pins. Conversely when Select is at a high logic level, B’s inputs are switched to the output pins.

The voltage at the power supply pin of the Multiplexer (74HC157, pin 16) should be equal to approximately +5V, the same as that output by the +5V voltage regulator. If not, check:

Incorrect IC orientation, short-circuits, open-circuits, faulty IC socket connections, and a faulty 74HC157 IC.

Switch Test I

Ensure all input pins (and output pins) are disconnected. This places all inputs (including Select) in a high state due to their pull-up resistors. This will switch the second set of four high-level inputs 1B-4B (inputs D4-D7) to their corresponding output pins 1Y-4Y (outputs D4-D7) that should all be in a high state.

Connect the Select input to GND using an interconnect lead (input data pins disconnected) as before. This will switch the first set of four high-level inputs 1A-4A (inputs D0-D3) to their corresponding output pins 1Y-4Y (outputs D4-D7) that should all be in a high state.

If either of these tests show bits that are not as stated, then measure the voltages at each input data pin (disconnected as before). If voltages are not at +5V, check:

Continuity (turn off power) across each resistor to its respective data bit (pcb pin). If this value is greater than the 10K resistance specified, then check the resistor(s) for open-circuits and faulty solder joints.

Incorrect IC orientation, short-circuits, open-circuits, faulty IC socket connections, and a faulty 74HC157 IC.

Switch Test II

Connect all four inputs 1A-4A (inputs D0-D3) to GND using interconnect leads. Ensure remaining four inputs 1B-4B (inputs D4-D7) are disconnected (pulled to a high state). Connect the Select input to GND using an interconnect lead. This will switch the four input bits 1A-4A to their corresponding output pins 1Y-4Y (outputs D4-D7). The output bits should all be in a low state. If not, check:

Incorrect IC orientation, poor connections, short-circuits, open-circuits, faulty IC socket connections, and a faulty 74HC157 IC.

Connect the Select input to a high state (disconnect the interconnect lead). This will switch the other four high-level input bits 1B-4B (inputs D4-D7) to their corresponding output pins 1Y-4Y (outputs D4-D7). At this stage the output bits should be in a high state. Connect all four inputs 1B-4B (inputs D4-D7) to GND using interconnect leads. The output bits should now all be in a low state. If either of these two tests do not comply as stated, check:

Incorrect IC orientation, poor connections, short-circuits, open-circuits, faulty IC socket connections, and a faulty 74HC157 IC.

466 APPENDIX A - HARDWARE

Adjustable Current Source Circuit

Assembly

Fit and solder all the components listed in Table A-10 into their position as marked on the pcb overlay and as shown in Figure A-28 and Figure A-29.

Table A-10 Adjustable Current Source - Bill of Materials.

 

 

Lead Spacing

 

Quantity

Component Description

or Footprint

Designator

3

0.1 ΠF ceramic monolithic capacitor

0.2 inch

C4, 10, 23

1

3K resistor

¼ W

R67

4

10K resistor

¼ W

R28, 55-57

1

12K resistor

¼ W

R68

1

BD650 pnp darlington transistor (or

TO-220

Q9

 

equivalent)

 

 

2

LM358 IC

DIL8

U9, 11

2

IC socket

8 pin

 

2

2 way terminal block

5 mm pitch

J4, 16

1

Heatsink 12θC/W

 

HS4

2

Pcb pin, 0.9 - 1.0 mm diameter

 

 

1M3 screw 6-10 mm long (or equiv.)

1

M3 nut

1

M3 locking washer

Testing

Figure A-31 shows the schematic for the adjustable current source circuitry. Adjustable current sources have many uses such as charging NiCad batteries and for electronic test and measurement purposes. This circuitry generates a current that is proportional to an input voltage (0 to +5V) such as that produced by VDAC. The resistor Rcurr (of appropriate value) is fitted across the terminal block J16 to set the range of current level that can be supplied.

The adjustable current source is implemented using three op-amp stages, each stage performing a different operation. The first op-amp circuit (U11B) scales the input voltage VDAC by 4/5ths, using a voltage divider circuit formed by resistors R67 and R68. This means that for a maximum input voltage of +5V, the resistive divider will give +4V at its output. Op-amp U11B buffers this voltage for use by the second stage of the circuitry (U11A).

The second stage uses op-amp U11A configured as a non-inverting amplifier, amplifying the voltage signal at its +ve (non-inverting) input terminal using a gain of two. Note: for a non-inverting amplifier configuration, the gain is equal to 1 + Rf /R, where Rf is the feedback resistor and R is the grounded resistor. A second

APPENDIX A - HARDWARE 467

voltage divider circuit (that uses resistors R28 and R57) generates the input voltage at the non-inverting terminal. When the output from the first stage (U11B, pin 7) is +4V, the input voltage at the non-inverting terminal of U11A will be +4.5V. This voltage is amplified by two to produce +9V at the output of U11A (pin 1).

Figure A-31 Adjustable Current Source Circuit - schematic diagram.

The final stage in the current source circuitry uses op-amp U9A operating as an adjustable current source. It takes the output voltage from U11A and drives a pnp darlington transistor (Q9) such that the voltage at the emitter of this transistor (marked by an arrow and connected to the –ve input terminal) is equal to the voltage at the +ve input terminal. Therefore, when the previous stage outputs +9V, the voltage at the emitter side of the terminal block J16 will also be at +9V. This produces a net voltage of zero across the resistor Rcurr, meaning that no current flows through Rcurr, the transistor, and the component fitted across the terminal block J4.

When the input voltage (VDAC) to the first stage is 0V, the output of U11B will be 0V, the output of the second stage will be +5V and the voltage at the emitter side of terminal block J16 will also be +5V, producing a maximum voltage across Rcurr equal to 4V. The level of current generated by the four volts across Rcurr will depend on its resistance value. Select the value of Rcurr to set the maximum current range needed.

This adjustable current source can be used for many purposes, including the three following examples:

i)Virtual Ohmmeter - fit a resistor of correct value (Rcurr) across terminal block J16 to generate a corresponding range of current. The resistor to be measured is fitted across terminal block J4. A controlled voltage VDAC applied to input pin ‘Vin Curr’ will generate a current through the resistor being evaluated, to produce a voltage across it. This voltage can be