Usually use an op-amp circuit Often found as a pre-amplifier to ADC circuitry Simple circuit to computer natural logarithm

Similar documents
Controlling and reacting to the environment

Controlling and reacting to the environment

EE 40 Final Project Basic Circuit

4 20mA Interface-IC AM462 for industrial µ-processor applications

EXPERIMENT #4 AM MODULATOR AND POWER AMPLIFIER

Synchronization of single-channel stepper motor drivers reduces noise and interference

Lab 3 Acceleration. What You Need To Know: Physics 211 Lab

Designing the VCNL4200 Into an Application

Designing the VCNL4200 Into an Application

Diodes. Diodes, Page 1

4.5 Biasing in BJT Amplifier Circuits

EXPERIMENT #9 FIBER OPTIC COMMUNICATIONS LINK

ECMA st Edition / June Near Field Communication Wired Interface (NFC-WI)

FROM ANALOG TO DIGITAL

THE OSCILLOSCOPE AND NOISE. Objectives:

MEASUREMENTS OF VARYING VOLTAGES

LECTURE 1 CMOS PHASE LOCKED LOOPS

Designing the VCNL4040 Into an Application

Retro-reflective photoelectric sensors with polarization filter. Dimensioned drawing

Universal microprocessor-based ON/OFF and P programmable controller MS8122A MS8122B

The ramp is normally enabled but can be selectively disabled by suitable wiring to an external switch.

Programmable DC Electronic Loads 8600 Series

Table of Contents. 3.0 SMPS Topologies. For Further Research. 3.1 Basic Components. 3.2 Buck (Step Down) 3.3 Boost (Step Up) 3.4 Inverter (Buck/Boost)

Solid-state Multi-functional Timer

Programmable DC Electronic Load 8600 Series


Solution of ECE 342 Test 2 S12

Connection. Input II EEx ia IIC without SC red. Composition

10. The Series Resistor and Inductor Circuit

A-LEVEL Electronics. ELEC4 Programmable Control Systems Mark scheme June Version: 1.0 Final

Programmable DC Electronic Loads 8600 Series

Retro-reflective photoelectric sensors with polarization filter. Dimensioned drawing

Electrical connection

Application Note 5324

AN303 APPLICATION NOTE

Time Control Technique

Lecture 11. Digital Transmission Fundamentals

Time Control Technique

ECMA-373. Near Field Communication Wired Interface (NFC-WI) 2 nd Edition / June Reference number ECMA-123:2009

Dimensions. Model Number. Electrical connection emitter. Features. Electrical connection receiver. Product information. Indicators/operating means

Transmission Lines. Transmission Lines :: Topics. Introduction Wave Propagation Termination Reflections Summary. Introduction.

Dimensions. Transmitter Receiver ø2.6. Electrical connection. Transmitter +UB 0 V. Emitter selection. = Light on = Dark on

Industrial, High Repetition Rate Picosecond Laser

MODEL: M6SXF1. POWER INPUT DC Power R: 24 V DC

Dimensions. Transmitter Receiver ø2.6. Electrical connection. Transmitter +UB 0 V. Emitter selection. = Light on = Dark on

DISCONTINUED MODEL Replaced with Model JPS3

Control circuit for a Self-Oscillating Power Supply (SOPS) TDA8385

Communication Systems. Department of Electronics and Electrical Engineering

Installing remote sites using TCP/IP

EE 330 Lecture 24. Amplification with Transistor Circuits Small Signal Modelling

Chapter 2 Introduction: From Phase-Locked Loop to Costas Loop

Primary Side Control SMPS with Integrated MOSFET

Laser retro-reflective photoelectric sensor with polarisation filter. Dimensioned drawing

Obsolete Product(s) - Obsolete Product(s)

Automatic Power Factor Control Using Pic Microcontroller

MODEL: M6NXF1. POWER INPUT DC Power R: 24 V DC

Generating Polar Modulation with R&S SMU200A

EE201 Circuit Theory I Fall

Retro-reflective photoelectric sensors with polarization filter for bottles. Dimensioned drawing

Laser retro-reflective photoelectric sensor with polarization filter. Dimensioned drawing

Lecture 4. EITN Chapter 12, 13 Modulation and diversity. Antenna noise is usually given as a noise temperature!

49.8. Control Relays and Timers. Contents. Product Selection Guide. Timing Relays

M2 3 Introduction to Switching Regulators. 1. What is a switching power supply? 2. What types of switchers are available?

f t 2cos 2 Modulator Figure 21: DSB-SC modulation.

Lecture 5: DC-DC Conversion

MX629. DELTA MODULATION CODEC meets Mil-Std DATA BULLETIN. Military Communications Multiplexers, Switches, & Phones

Trigger high-speed, retro-reflective sensors for bottles. Dimensioned drawing

COMBITRON Program Schedule

Installation and Operating Instructions for ROBA -brake-checker Typ

ENDA ETM442 DIGITAL TIMER

SCiCoreDrive62 +DC T5 U V W -DC. SCiCore 62. IGBT/MOSFET drivers

Signal Characteristics

LD7516C 08/31/2016. Primary Side Quasi-Resonant Controller. Features. General Description. Applications. Typical Application REV.

A1 K. 12V rms. 230V rms. 2 Full Wave Rectifier. Fig. 2.1: FWR with Transformer. Fig. 2.2: Transformer. Aim: To Design and setup a full wave rectifier.

Proceedings of International Conference on Mechanical, Electrical and Medical Intelligent System 2017

Memorandum on Impulse Winding Tester

Wrap Up. Fourier Transform Sampling, Modulation, Filtering Noise and the Digital Abstraction Binary signaling model and Shannon Capacity

Electronic timer CT-MVS.12 Multifunctional with 1 c/o contact Data sheet

Active Filters - 1. Active Filters - 2

Sensing method Application Appearance Sensing distance Model Convergent-reflective Small type 30±3 mm

GG6005. General Description. Features. Applications DIP-8A Primary Side Control SMPS with Integrated MOSFET

Ultracompact 6-Channel Backlight and Flash/Torch White LED Driver

DS Bit, Programmable, 100kHz Pulse-Width Modulator

Solid-state Timer H3CT

16-CHANNEL CONSTANT CURRENT LED DRIVER WITH

Technology Trends & Issues in High-Speed Digital Systems

Laser retro-reflective photoelectric sensor with polarisation filter. Dimensioned drawing. Teach button Optical axis Indicator diode

ORDER INFORMATION TO pin 320 ~ 340mV AMC7150DLF

Application & Guidance Notes

ISSCC 2007 / SESSION 29 / ANALOG AND POWER MANAGEMENT TECHNIQUES / 29.8

Study on the Wide Gap Dielectric Barrier Discharge Device Gaofeng Wang

Optical fibres. Optical fibres made from high-density glass can carry light signals long distances without losing any light through their sides.

Investigation and Simulation Model Results of High Density Wireless Power Harvesting and Transfer Method

Chapter 14: Bandpass Digital Transmission. A. Bruce Carlson Paul B. Crilly 2010 The McGraw-Hill Companies

Laser retro-reflective photoelectric sensor with polarization filter. Dimensioned drawing

EECE 301 Signals & Systems Prof. Mark Fowler

A New Voltage Sag and Swell Compensator Switched by Hysteresis Voltage Control Method

Chapter 2 Summary: Continuous-Wave Modulation. Belkacem Derras

IR Receiver Modules for Remote Control Systems

Analog Multiplexer Demultiplexer High-Performance Silicon-Gate CMOS

Transcription:

Connecing he compuaion capabiliies of a microconroller o exernal signals Transforming variable values ino volages and vice-versa Digial and analog Issues How many signals can be conrolled? How can digial and/or analog inpus be used o measure differen physical phenomena? How can digial and/or analog inpus be used o conrol differen physical phenomena? To conrol or reac o he environmen we need o inerface he microconroller o peripheral devices Microconroller may conain specialized inerfaces o sensors and acuaors Things we wan o measure or conrol ligh, emperaure, sound, pressure, velociy, posiion Sensors e.g., swiches, phooresisors, acceleromeers, compass, sonar Acuaors e.g., moors, relays, LEDs, sonar, displays, buzzers Map analog inpus o a range of binary values 8-bi A/D has oupus in range 0-255 Wha if we need more informaion? linear vs. logarihmic mappings larger range of oupus (16-bi a/d).1 1 10 100 1000 analog 0 64 128 192 255 digial.1 1 10 100 1000 analog! Usually use an op-amp circui Ofen found as a pre-amplifier o ADC circuiry Simple circui o compuer naural logarihm Map binary values o analog oupus (volages) Mos devices have a digial inerface use ime o encode value Time-varying digial signals almos arbirary resoluion pulse-code modulaion (daa = number or widh of pulses) pulse-widh modulaion (daa = duy-cycle of pulses) frequency modulaion (daa = rae a which pulses occur) V IN V OUT = log e ( V IN ) V V V 1

#$%& $ ( $%& $ &) Pulse a digial signal o ge an average analog value The longer he pulse widh, he higher he volage period Pulse-widh raio = on on period average value Mos mechanical sysems are low-pass filers Consider frequency componens of pulse-widh modulaed signal Low frequency componens affec componens They pass hrough High frequency componens are oo fas o figh ineria They are filered ou Elecrical RC-neworks are low-pass filers Time consan (τ = RC) ses cuoff frequency ha separaes low and high frequencies " ' %)+) -&. %)+) Rear wheel conroller/ani-lock brake sysem Normal operaion Regulae velociy of rear wheel Brake pressed Gradually increase amoun of breaking If skidding (fron wheel is moving much faser han rear wheel) hen emporarily reduce amoun of breaking Inpus Brake pedal Fron wheel speed Rear wheel speed Oupus Pulse-widh modulaion rear wheel velociy Pulse-widh modulaion brake on/off brake pedal pressed fron wheel velociy rear wheel velociy micro conroller brake on/off move rear wheel *, /.0 1+)2 #3 $ Check if brake pedal pressed or inerrup brakepressed = read (brakepedalpor) Turn brake on/off wrie (brakepor, onoff) Move rear wheel wrie (rearwheel, onoff) brake pedal pressed fron wheel velociy rear wheel velociy GPIO por micro conroller GPIO por brake on/off move rear wheel Sofware mus repeaedly check Brake pedal por How ofen? Need o make sure no o forge o do so (use imer) Use auomaic deecion capabiliy of processor Connec brake pedal o inpu capure or exernal inerrup pin Inerrup on level change Inerrup handler for brake pedal brake pedal pressed GPIO por micro conroller 2

#$%& $ +) /)$ $ To pump he brakes gradually increase he duy-cycle ( on ) unil car sops Use imer o urn brake on and off Apply brake Se imer o inerrup afer on ime Disengage brake Se ime o inerrup afer off ime Repea How do we ell which inerrup is which? se imer o go off a each edge sar imer running /)$ $1 42 Change value of on ime o change analog average average oupu = ( on + off ) / ( period ) How do we decide on he period of he pulses? Using wo imers One o se period (auo-reload) One o urn i off a he righ duy cycle Need o deermine he rear wheel velociy Use sensor o deec wheel moving Deermine speed of a bicycle Aach baseball card so i pokes hrough spokes Number of spokes is known Coun clicks per uni ime o ge velociy Baseball card sensor is a shaf encoder click! bike wheel se imer o go off a each edge baseball card sar imer running - Insead of spokes we ll use black and whie segmens Black segmens absorb infrared ligh, whie reflecs Coun pulses insead of clicks How many segmens should be used? More segmens give finer resoluion Fewer segmens require less processing Tradeoff resoluion and processing wheel infrared ligh emier deecor pulse " ' 3

5 Use inerrup on GPIO pin Every inerrup, incremen couner Use imer o se period for couning When imer inerrups, read GPIO pin couner velociy = couner known disance per click / judiciously chosen period Rese couner Pulse accumulaor funcion Common funcion Some microconrollers have his in a single peripheral device Basically a couner conrolled by an ouside signal Signal migh enable couner o coun a rae of inernal clock o measure ime Signal migh be he couner s clock o measure pulses ATmega16 has exernal clock source for imer/couner Microconrollers come wih buil-in I/O devices Timers/couners GPIO ADC Ec. Someimes we need more... Opions Ge a microconroller wih a differen mix of I/O Ge a microconroller wih expansion capabiliy Parallel memory bus (address and daa) exposed o he ouside world Serial communicaion o he ouside world *,.0 # The are never enough I/O pors Techniques for creaing more pors por sharing wih simple glue logic decoders/muliplexors memory-mapped I/O por expansion unis Direcion of pors is imporan single direcion por easier o implemen iming imporan for bidirecional pors If signals all in same direcion and have a separae guard signal, hen able o share wihou glue logic Example: connec 5 LCD displays o microconroller can share connecions o RS, RW, and DB bu no E changes on E affec display mus guaranee only one is acive 6!$ 7 Conflic on device signals (e.g., one signal affecs boh) soluion is o inser inervening regisers ha keep signals sable regisers require enable signals which now need pors as well Encode n single-bi device pors using log n bis of a conroller por enabled decoder: one-ho, inpu-only device pors regisered decoder: inpu-only (bu no one-ho) device pors muliplexor: oupu-only device pors µ C device A device B µ C D EN D EN Q Q device A device B µc log(n) bis enable enabled decoder n one-ho signals µc daa µc log(n) bis n signals enable n signals log(n) muliplexor selec bis D EN n regiser selec lines regisered decoder Q 4

8%.0 8%.0 Address bus selecs device Daa bus conains daa Pariion he address space Assign memory-mapped locaions Sofware loads read from he device sores wrie o he device Can exploi unused bis for device inpu-only pors # 7$ $ & Problem of por shorage so common por expansion chips exis Easily connec o he microprocessor Timing on pors may be slighly differen May no suppor inerrups Exploi specialized funcions (e.g., UART, imers) Aemp o connec direcly o a device por wihou adding inerface hardware (e.g., regisers), ry o share regisers if possible bu beware of unwaned ineracions if a signal goes o more han one device If ou of pors, mus force sharing by adding hardware o make a dedicaed por sharable (e.g., adding regisers and enable signals for he regisers) If sill run ou of pors, hen mos encode signals o increase bandwidh (e.g., use decoders) If all else fails, hen backup posiion is memory-mapped I/O, i.e., wha we would have done if we had a bare microprocessor " ' %+ 5%$.0 %+.0 & Suppose we waned a 64-bi I/O por If EN is rue, hen we have an oupu pin If EN is false, hen we have an inpu pin We need 8 8-bi regisers o sore/wrie he 64 bis Selec he EN addresses o be $...000 o $...007 Selec OUT addresses o be $...010 o $...017 Read 15h bi load value a address $...011 (2nd se of OUT regs) logical AND wih 0x80 bi posiion 7 of resul is 15h bi Wrie he 47h bi read OUT regiser a $...015 se bi posiion 7 o desired value ( or wih 0x80) sore in $...015 load EN regiser a $...005 se bi o oupu sore value back o $...005 *, 5

7 #(89 7 #( 868 Design a sysem o conrol a digial Soluion: design a PWM uni! "#$ '&! "#$! "#( %! "#$ %&! "#$ %& '&! "#( % 7 #( 8 & 7.0 // in iniializaion code Wrie off o onoff regiser // do some suff // se up PWM Repea for each moor Wrie hightime and period regisers Sonar range finder Compass IR proximiy deecor Acceleromeer Brigh LED // urn moors on Repea for each moor Wrie on o he onoff regiser // more suff #,, Uses ulra-sound (no audible) o measure disance Time echo reurn Sound ravels a approximaely 343m/sec need a leas a 34.3kHz imer for cm resoluion One simple echo no enough many possible reflecions wan o ake muliple readings for high accuracy Commonly found on old Polaroid cameras, now a frequenly used par in mobile robos Transducer (gold disc) charged up o high volage and snapped disc says senisized so i can deec echo (acs as microphone) Conroller board high-volage circuiry o prepare disc for ransmiing and hen receiving 6

#,,1 42 Only need o connec wo pins o microconroller INIT - sar ransmiing ECHO - reurn signal Some imporan informaion from daa shee INIT requires large curren (greaer han microconroller can provide add exernal buffer/amplifier) ECHO requires a pull-up resisor (deermine curren ha needs o flow ino microconroller pin - size resisor so proper volage is on pin " Four compass direcions (each has hree pins) One-ho/wo-ho encoding one-ho for N, E, S, W wo-ho for NE, SE, SW, NW #!"Ω $ Ω ' # 1 42-7 Deecing a change in compass direcion 4 bis change from 0001 o 0011 o 0010 o 0110 o 0100 Always alernaing beween one bi on and wo bis on Pariy ree can deec difference beween one and wo bis being assered XOR ree of four bis (one TTL SSI package) Oupu mus change a leas once for every change in orienaion Use inerrups o deec changes N E S W e.g., NE E SE 1100 0100 0110 0 1 0 * Oscillaor mus be se o mach deecor, -:$$ #7 urn on emier sleep for 600us val_on = read deecor urn off emier sleep for 600us val_off = read deecor reurn ( val_on & ~val_off ) imer goes off wake imer goes off wake Mosly in main urn on emier se imer sleep imer goes off val_on = read deecor urn off emier rese imer sleep reurn ( val_on & ~val_off ) wake Using inerrup handlers imer goes off (again) val_off = read deecor 7

8 7 Always sending ou IR Deecor drives LED (guaraneed o mach frequency) Micro-elecro-mechanical sysem ha measures force F = ma (I. Newon) Measured as change in capaciance beween moving plaes Designed for a maximum g-force (e.g., 2-10g) 2-axis and 3-axis versions Used in airbags, lapop disk drives, ec. 8

( +$.< = /$ % Average over ime smoohing Sofware filer like swich debouncing Take several readings use average for Tb and Tc or heir raio Running average so ha a reading is available a all imes e.g., updae running average of 4 readings curren average = ¾ * curren average + ¼ * new reading Take readings of boh Tb and Tc o be exra careful Tc changes wih emperaure Usually can do Tc jus once Filer capaciors limied noise frequency bandwidh limiing *,!;,0$ $!;,0 Acceleromeer duy cycle varies wih force 12.5% for each g R SET deermines duraion of period A 1g duy-cycle will be 62.5% (37.5%) Sensiiviy (maximum duy cycle change per degree) is highes when acceleromeer is perpendicular o graviy #( 8$ /! How big a couner do you need? Assume 7.37MHz clock 1ms period yields a coun of 7370 This fis in a 16-bi imer/couner Should you use a prescaler for he couner? Bi precision issues unsigned in posiive; unsigned in period; unsigned in pos_duy_cycle; BAD: pos_duy_cycle = posiive/period; BAD: pos_duy_cycle = ( posiive * 1000 ) / period; OKAY: pos_duy_cycle = ( (long) posiive * 1000 ) / period; Easy o conrol inensiy of ligh hrough pulse-widh modulaion Duy-cycle is averaged by human eye Ligh is really urning on and off each period Too quickly for human reina (or mos video cameras) Period mus be shor enough (< 1ms is a sure be) LED oupu is low o urn on ligh, high o urn i off Acive low oupu 9

! 6 #(8 Varying PWM oupu volaile uin8_ widh; /* posiive pusle widh */ volaile uin8_ delay; /* used o slow he pulse widh changing */ SIGNAL (SIG_OVERFLOW2) { if(delay++ == 20) { OCR2 = widh++; delay = 0; } } in main (void) { /* mus make OC2 pin an oupu for he PWM o visible */ DDRD = _BV(DDD7); /* use Timer 2 FasPWM and he overflow inerrup o updae duy-cycle */ TCCR2 = _BV (WGM21) _BV (WGM20) _BV (COM21) _BV(COM20) _BV(CS21) _BV(CS20); TIMSK = _BV (TOIE2); /* seup iniial condiions */ delay = 0; /* enable inerrups */ sei (); for (;;) { ; /* LOOP FOREVER as he inerrup will make necessary adjusmen */ } reurn (0); } 10