Файл: Interfacing with C plus plus-programing communication with microcontrolers (K. Bentley, 2006).pdf

ВУЗ: Не указан

Категория: Не указан

Дисциплина: Не указана

Добавлен: 14.06.2025

Просмотров: 3583

Скачиваний: 1

ВНИМАНИЕ! Если данный файл нарушает Ваши авторские права, то обязательно сообщите нам.

446 APPENDIX A - HARDWARE

LED Driver Circuitry

Assembly

Fit and solder all the components listed in Table A-4 into their position as marked on the pcb overlay and as shown in Figure A-14 and Figure A-15.

Table A-4 LED Driver Circuitry - Bill of Materials.

Lead Spacing

Quantity

Component Description

or Footprint

Designator

8

330: resistor

¼ W

R1, ..., R10

(not inclusive)

8

Red LED 3mm diameter body

LED1-8

1

ULN2803A transistor array

DIL18

U3

1

IC socket

18 pin

8

Pcb pin, 0.9 - 1.0 mm diameter

Testing

Figure A-13 LED Driver Circuit - schematic diagram.

Figure A-13 shows the schematic diagram of the LED Driver circuitry. This circuit block is ideal for testing logic levels of particular signals read or controlled by software – especially when writing and debugging a program. The circuit comprises one ULN2803A Driver IC along with eight associated resistors and LEDs. The IC contains eight separate darlington transistors, each one used to switch current through an output pin. Connecting logic level signals to the Driver will turn on and off the respective LEDs to indicate their logic state.

Note: assemble and test one series connected LED and resistor first – to check the correct polarity of the LED. Establishing LED polarity is discussed in the earlier section of this appendix titled “The Assembly Process”.


APPENDIX A - HARDWARE 447

The voltage level at the ULN2803A power pin (10) should be +5V. The LED terminals furthest from the resistors should also be at +5V. If this is not so, check:

Incorrect IC orientation, faulty IC socket connections, short-circuits, open-circuits, a faulty IC or LED, and faulty +5V internal power supply.

The ULN2803A Driver operates as follows:

3.When a Driver input pin (D0, D1, …, D7) is taken to a high logic level (use +5V), the corresponding output pin (Q0, Q1, …, Q7) will be switched internally to ground voltage (0V). This will light the corresponding LED as current flows from VCC (+5V), through the LED, resistor and the Driver output pin to its internal ground.

4.When a Driver input is driven to a low logic level (use GND), the corresponding output pin connection to GND will be broken, interrupting current flow through the LED and resistor, extinguishing the LED.

Should any LED fail to light, check:

Incorrect LED polarity, short-circuits, open-circuits and faulty LEDs or resistors.


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.