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

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

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

448

APPENDIX A - HARDWARE

 

 

 

 

 

 

 

74HC245

 

4046

 

PINS

74HC245

 

 

 

 

 

+5V PINS

 

 

 

 

 

 

 

ADC0804

ULN2803A

4093

 

 

 

74HC157

 

 

LM358

LM358

 

 

 

 

DAC0800

LM358

 

Figure A-14 LED Driver Circuit – component positions.

Figure A-15 LED Driver Circuit – components fitted.

APPENDIX A - HARDWARE 449

Digital to Analog Converter Circuitry

The DAC circuitry is shown in Figure A-16 and comprises the DAC itself and a DAC Buffer Circuit.

Assembly

Fit and solder all the components listed in Table A-5 into their position as marked on the pcb overlay and as shown in Figure A-17 and Figure A-18.

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

 

 

Lead Spacing

PCB

Quantity

Component Description

or Footprint

Designator

-8V Supply:

 

 

 

1

1N4004 diode

 

D3

1

2 way terminal block

5 mm pitch

J14

1

9V battery clip

 

 

DAC cct:

 

 

 

1

10 nF ceramic monolithic capacitor

0.2 inch

C16

2

0.1 ΠF ceramic monolithic capacitor

0.2 inch

C7, 8

11

10K resistor

¼ W

R39-41, 70-

 

 

 

77

1

20K resistor

¼ W

R22

1

DAC0800 CMOS IC

DIL16

U8

1

IC socket

16 pin

 

8

Pcb pin, 0.9 – 1.0 mm diameter

 

 

2

2 pin header

0.1 inch

LINK1,

 

 

 

LINK2

1

Jumper (fit to header LINK1 or LINK2)

0.1 inch

 

DAC Buffer cct:

 

 

2

0.1 ΠF ceramic monolithic capacitor

0.2 inch

C5, 6

2

10K resistor

¼ W

R26, 27

1

LM358 IC

DIL8

U10

1

IC socket

8 pin

 

1

Pcb pin, 0.9 - 1.0 mm diameter

 

 

450 APPENDIX A - HARDWARE

Testing the DAC Circuit

Figure A-16 DAC & DAC Buffer Circuit - schematic diagram.

Note: Ensure that a usable 9V battery is connected to the terminal block J14.

The voltage level at the DAC (U8) positive power supply pin V+ (13) should be at +5V, the DAC negative power supply pin V- (3) should be at approximately –8V. If not, check:

Incorrect IC orientation, faulty IC socket connections, flat 9V battery, short-circuits, open-circuits, faulty DAC IC, and the +5V internal supply.

When all DAC logic input pins (D0, D1, ..., D7) are unconnected, all logic inputs should be pulled up to +5V. If this is not so, check for:

Short-circuits, open-circuits, faulty resistors, and poor solder joints.

Fit the single Jumper to the Unipolar position, marked as LINK1. With all DAC logic inputs pulled to +5V (input pins unconnected), the output of the DAC (pin 4) should be at –5V. Conversely, when all DAC logic inputs are connected to GND (0V) the DAC should produce 0V. If this is not so, check for:

Poor lead connections, short-circuits, open-circuits, faulty soldering of components, components having incorrect value, and faulty components.

Fit the jumper to the bipolar position (LINK2). With all DAC logic inputs pulled to +5V (input pins unconnected), the DAC output should be at –5V. With all DAC logic inputs connected to GND (0V), the DAC output should produce +5V.

APPENDIX A - HARDWARE 451

Testing the Buffer Circuit

This circuitry buffers the output voltage generated by the DAC circuitry and inverts this voltage about zero volts to bring the DAC output voltage, VDAC, to a positive convention (increasing value of the DAC input byte produces an increasing voltage, VDAC).

The voltage level at the op-amp (U10) power supply pins should be +9V (pin 8) and approximately –8V (pin 4). If not, check:

Incorrect IC orientation, faulty IC socket connections, +9V internal power supply, flat 9V battery, short-circuits, open-circuits, and a faulty LM358 IC.

With the DAC output at –5V (all DAC logic inputs pulled to +5V), the noninverting input of the ‘Buffer’ op-amp (U10, pin 3) should also be –5V. Likewise the inverting input and the output of the ‘Buffer’ op-amp (U10, pin 2 and pin 1 respectively) should be –5V. If not, check:

Short-circuits, open-circuits, faulty IC socket connections, and a faulty LM358 IC.

The ‘inverter’ op-amp’s non-inverting input pin (U10, pin 5) and the inverting input pin (U10, pin 6) should both be at 0V. The ‘inverter’ op-amp output pin (U10, pin 7) should be at +5V. If not, check:

Short-circuits, open-circuits, faulty IC socket connections, incorrect value or faulty resistors R26, R27, and a faulty LM358 IC.

452

APPENDIX A - HARDWARE

 

 

 

 

74HC245

4046

 

PINS

74HC245

 

 

 

+5V PINS

 

 

 

 

 

ADC0804

ULN2803A

4093

 

 

74HC157

 

LM358

LM358

 

 

 

DAC Cct

DAC Buffer Cct

 

 

 

 

 

DAC0800

LM358

 

Figure A-17 DAC & DAC Buffer Circuit – component positions.

Figure A-18 DAC & DAC Buffer Circuit – components fitted.

APPENDIX A - HARDWARE 453

Motor Control Circuitry

Assembly

Fit and solder all the components listed in Table A-6 into their position as marked on the pcb overlay and as shown in Figure A-20 and Figure A-21.

Table A-6 Motor Control Circuitry - Bill of Materials.

 

 

 

Lead Spacing

 

Quantity

Component Description

 

or Footprint

Designator

4

4K7 resistor

 

¼ W

R34, 35, 51, 53

12

10K resistor

 

¼ W

R18-21, 24, 25,

 

 

 

 

45-50

8

1N4004 diode

 

 

D5-8, 11-14

4

24V zener diode

 

1W

ZD1, 2, 4, 5

4

BC547 npn transistor

 

TO-92

Q1, 2, 13, 14

4

BD649 npn darlington

transistor

TO-220

Q5, 6, 15, 16

 

(or equivalent)

 

 

 

4

BD650 pnp darlington

transistor

TO-220

Q8, 10, 17, 18

 

(or equivalent)

 

 

 

4

2 way terminal block

 

5mm pitch

J7, 8, 12, 13

2

4 way terminal block

 

5 mm pitch

J6, 11

8

Heatsink 20θC/W

 

 

HS5-12

8

Pcb pin, 0.9 – 1.0 mm diameter

 

 

8M3 screw 6-10 mm long (or equivalent)

8

M3 nut

8

M3 locking washer

Testing

Figure A-19 shows the schematic diagram for the motor control circuitry, comprising two H-bridge circuits used for driving DC and stepper motors. Ensure wire links are fitted across each two-way terminal block before testing the circuitry. Connect an external DC power supply (less than 30V) capable of powering the motor(s) (or the +12V DC 1A power pack if suitable) to the four-way terminal block connections: Power Supply +ve connects to Vm1 and Vm2, Power Supply –ve connects to Vm1 GND and Vm2 GND.

454 APPENDIX A - HARDWARE

Figure A-19 Motor Control Circuit - schematic diagram.

APPENDIX A - HARDWARE 455

The appropriate voltage from the motor power supply should be present at each of the respective two-way terminal blocks. If not, check:

Powerpack or external power supply wiring/operation, and wire links are fitted across two-way terminal blocks.

The four ‘transistor switches’ used in each H-bridge operate independently - each ‘closes’ when its logic input is taken to a high level. Each H-bridge circuit uses two types of transistor:

1.Two identical lower transistor switch circuits, each using a npn darlington transistor (e.g. Q5).

2.Two identical upper transistor switch circuits, each using a npn transistor (e.g. Q2) driving a pnp darlington transistor (e.g. Q8). Without the npn transistor, the logic input signal could not drive the pnp darlington transistor, since this darlington configuration needs to be controlled by an input voltage capable of rising close to the motor supply voltage (Vm1) to turn off the transistor. The npn transistor ‘inverts’ the logic input signal and can switch off at voltages up to Vm1. The ‘inverted’ signal then drives the pnp darlington transistor.

Test each of the transistor switches in the two H-bridge circuits in-turn. Fit a resistor, say 1K: (1000 :) as a light load in place of an actual motor across the four way terminal block contacts marked M1 and M2.

One lower npn darlington transistor and its diagonally opposing upper pnp darlington transistor circuitry will be tested at a time, all other logic inputs must not be connected. For example, logic input C and logic input B will be switched as follows:

When logic input C is wired to +5V (Q5 ON) and logic input B is wired to +5V (Q10 ON), the voltage at the four way terminal block contact, M1 should be equal to approximately 1V and M2 should be equal to approximately Vm1 minus 1V.

Repeat this test for the opposite transistor circuits in the H-bridge controlled by logic inputs A and D. This circuit test will give opposite voltages at terminal block contacts M1 (Vm1 minus approximately 1V) and M2 (approximately 1V). Should any of these tests fail, check:

Power supply operation, poor lead connections, missing wire links, shortcircuits, open-circuits, faulty soldering of components, components having incorrect value or incorrect orientation, and faulty components.

Note that the BD649 and BD650 darlington transistors used in the H-bridge (shown on the schematic with two arrows) are capable of switching currents up to 8A. Other darlington transistors with similar current capacity and matching pin configuration can be used. A 24V zener diode in series with a regular diode is connected across the BD650 darlington transistors to absorb spikes of back-emf generated during switching. The diodes across the BD649 darlington transistors limit negative voltages across the transistor to one forward-biased diode drop approximately (0.7V).

456 APPENDIX A - HARDWARE

 

 

 

74HC245

4046

 

 

74HC245

 

 

 

 

ADC0804

ULN2803A

4093

 

 

74HC157

 

LM358

LM358

 

 

 

DAC0800

LM358

 

Figure A-20 Motor Driver Circuit – component positions.

Figure A-21 Motor Driver Circuit – components fitted.

APPENDIX A - HARDWARE 457

Voltage-Controlled Oscillator Circuitry

The VCO circuit uses the Thermistor circuit for several projects within the main text. Therefore, assembling and testing the Thermistor circuit has been included with the VCO material.

Assembly

Fit and solder all the components listed in Table A-7 into their position as marked on the pcb overlay and as shown in Figure A-23 and Figure A-24.

Table A-7 Voltage-Controlled Oscillator - Bill of Materials.

 

 

Lead Spacing

 

Quantity

Component Description

or Footprint

Designator

VCO cct:

 

 

 

1

1ΠF ceramic monolithic capacitor

0.2 inch

C18

1

100K resistor

¼ W

R11

1

1M resistor

¼ W

R13

1

4046 CMOS IC

DIL16

U4

1

IC socket

16 pin

U4

2

Pcb pin, 0.9 - 1.0 mm diameter

 

U4

Thermistor cct:

 

 

 

1

0.1ΠF ceramic monolithic capacitor

0.2 inch

C9

1

100K - 470K resistor (suit thermistor

 

R31

 

- see main text Chapter 10)

 

 

1

Thermistor

 

RT1

Testing the VCO Circuit

Figure A-22 shows the circuit diagram for the voltage-controlled oscillator (part of the phase lock-loop IC) and the thermistor circuitry. The VCO circuit outputs a digital signal having a square waveform at a frequency proportional to the voltage applied to its input pin.

The voltage at the power supply pin of the Phase-Lock Loop IC (U4, 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, faulty 4046 IC, and the +5V power supply.