47
More Hardware

09 Hardware Part 2 - Atomic Rhubarb Hardware Part 2.pdfNon-inverting compared Inverting. Comparator Vref Vin Vout V+ Vout goes to V+ when Vin>Vref (non-inverting) (non-inverting) Comparator

Embed Size (px)

Citation preview

More Hardware

Real Time Embedded Systems

www.atomicrhubarb.com/embeddedLecture 8 – January 31, 2012

More Hardware

Section Topic

• Where in the books– Catsoulis chapter 4– Simon chapter 2,3

Operational Amplifier (OPAMP)

Noninverting Input

Inverting Input

OpAmp

The output is a function of the difference of the inputs.

If ( noninverting(+) > inverting(-) )Vout swings to +V

If ( inverting(-) > noninverting(+) )Vout swings to -V

Small changes of Vinresult in large changes of Vout

OpAmp

VinVin

Vin

Vout

V+

V‐

Vout

V+

V‐

non-inverting

inverting

OpAmp

Vout = Vin * Rf/Rin Output voltage is fed

back to inverting input.

Amplification (gain) can be controlled by varying Rf

Useful for amplifying weak signals

OpAmp

Vin

Vout

Vout= Vin��Rf / Rin�

What an OpAmp is

Comparator

A comparator is a type of OPAMP that is used for comparing 2 voltages.

Vref = reference voltage

Vin = voltage to be comparedNon-inverting

Inverting

Comparator

Vref

Vin

Vout

V+

Vout goes to V+ when Vin>Vref(non-inverting)

(non-inverting)

Comparator Application

When Vin exceeds Vref of voltage divider, Vout of opamp will go high and turn on LED.

It's a 1-bit analog-digital converter!

Schematics

How to read them Parts, symbols, wires, labels How to make them Other stuff

connection no connection

componentdesignation& value

ground

power supply

component

pin #

signal nameor symbol

schematicsignal name

Important Things

Crossing wire (but not connected)

Connecting wires

Vdd

Vss

Symbols

What does the “/” mean?

This /

RST means the same as /RST

What does the “/” mean?

This /

RST means the same as /RST

/ Means “active low”

What does the “>” mean?

This >

What does the “>” mean?

That input is edge-triggered not level-triggered(positive edge-triggered in fact, rising edge)

This >

What does the “o” mean?

What does the “o” mean?

o = invert (active low) All others assumed active high

So what would “o>” mean?

Like this

So what would “o>” mean?

Like this

o = invert the edge trigger Edge-triggered on the FALLING edge.

Buses

A grouping of common signals. For examplem a Data Bus will contains

all 8 or 16 bit data lines (D0..D7 or D0..D15).

How to make schematics

Lots of free/low cost tools editors www.expresspcb.com www.pcb123.com

ExpressPCB

ASCII Art Schematic

+5 ---+---------------+---+| | |R +----------+|(see below) | 8 4 |

+---+------+-----|7 3|------/\/\/\---+------- Vout| | | LMC555 | |C to test +-----|6 | -----| | | -----

ground +-----|2 5|----+ || | 1 | | ground| +----------+ 0.1 uF| | |

Clock ----+ ground ground^

(Use a fixed-width font )

GPIO

General Purpose Input/Output Connections through which the

microcontroller can connect to external peripherals.

Over Simplified IO pin

V+1 0 1 0 1 0 1 0

External pin

Input Register

1 0 1 0 1 0 1 0

Output Register

InputOutput

Register

A small amount of very fast computer memory used to speed the execution of computer programs by providing quick access to commonly used values.

What really happens when we push a button?

Using IO

BouncePush

Release

Approximately 20-200 ms of noise as the mechanical contacts bounce

Software solution

Wait 200 ms from first event

Another

1 0 1 0 1 1 1 0 0 0 0 0

Sample until n values are the same

SW1 on LAB board

An actual button

Hardware Solution

Many solutions, this is a simple one

Hardware Debounce

Press button, discharge capacitor, release button to charge it.

Unfiltered button

Debounced button

Logic input Valid High

Hardware Solution

Debouce

Software? Hardware? Which is better?

LCD display

LCD (more)

Look at a Digital Compass

Look at a radio

LED Matrix

Remember basic schematic symbols,

labels, wires.