gadget lab lecture 6: sensors and interfacing… microcontrollers… more project time

11
Gadget Lab Lecture 6: Sensors and Interfacing… Microcontrollers… More Project Time Dr. Cindy Harnett ECE Dept., U of Louisville Spring 2008

Upload: akiva

Post on 06-Jan-2016

39 views

Category:

Documents


0 download

DESCRIPTION

Gadget Lab Lecture 6: Sensors and Interfacing… Microcontrollers… More Project Time. Dr. Cindy Harnett ECE Dept., U of Louisville Spring 2008. Course Evals. Microcontrollers run the gadget universe. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Gadget Lab Lecture 6: Sensors and Interfacing… Microcontrollers… More  Project Time

Gadget Lab Lecture 6:Sensors and Interfacing…

Microcontrollers…More Project Time

Dr. Cindy Harnett

ECE Dept., U of Louisville

Spring 2008

Page 2: Gadget Lab Lecture 6: Sensors and Interfacing… Microcontrollers… More  Project Time

Course Evals

Page 3: Gadget Lab Lecture 6: Sensors and Interfacing… Microcontrollers… More  Project Time

Microcontrollers run the gadget universe

• A MSP430 microcontroller talks to the 1-wire chips in the sensor project, and to the radio chip. (Texas Inst.)

• ARM microcontrollers in cell phones are as powerful as desktop computers of a few years ago, and consume little power. (Made by many companies)

• Nowadays: programmable in high level languages like C.• Minimalist chips like some PIC microcontrollers (Microchip) are still

programmed in assembly language. • Most microcontrollers are not good at multitasking, but excel at

repetitive tasks requiring good timing.

•Remember all those “black dots” in our teardowns? Usually there’s a microcontroller underneath. Sometimes a custom made IC.

Microchip PICs

ARM

Furby board

MSP430

Page 4: Gadget Lab Lecture 6: Sensors and Interfacing… Microcontrollers… More  Project Time

Assembly LanguageStrict syntax, few commands

Commands differ for each controller

Can make up variable names

Can have subroutines

Should have comments!;--------; change LED pattern based on state of digit_index and dot_index;--------Display_now movlw 0x05

xorwf dot_index,w ;test for end of digitmovlw 0xFF ;pattern for blank columnbtfsc STATUS,Zgoto D_lookup_3 ;it needs a blankbcf STATUS,C ;clear carry before a rotaterlf digit_index,w ;double the index because eachaddwf PCL,f ;takes two instructions

Page 5: Gadget Lab Lecture 6: Sensors and Interfacing… Microcontrollers… More  Project Time

How do you program microcontrollers?

• Get or build a programmer that plugs into a PC. Can program in a ZIF socket or in a circuit.

• Get software that “cross-compiles” from your PC to the target chip. Usually sold by the chip maker, sometimes 3rd party

• Usually there’s a free development environment that lets you code, compile, and download your code onto the chip

• Fancy hardware (debuggers, emulators) is usually available to catch run-time errors.

Page 6: Gadget Lab Lecture 6: Sensors and Interfacing… Microcontrollers… More  Project Time

Learning to use microcontrollers• Take ECE course specifically on microcontrollers:

• Or pick a starter project like lighting a 7-segment display and learn from examples

• Microchip PICs are versatile and cheap--if you stick with assembly language--http://www.phanderson.com

• MSP430 tools are also inexpensive ($20-$40)• Or get a module like a Basic Stamp or Arduino, with a

large online community and plenty of code

ECE 412, Computer Interfacing (uses 68HC11 chips)

Page 7: Gadget Lab Lecture 6: Sensors and Interfacing… Microcontrollers… More  Project Time

From last time: Computer Interfacing

LabView PCI or PCMCIA cards and connector board very common in research labshttp://www.ni.com

Lower cost: “Phidgets” have analog inputs and USB to PChttp://www.phidgets.com

Even cheaper, dedicated circuits such as the 1-Wire DS2450 converterhttp://www.maxim-ic.com

And many more…

Page 8: Gadget Lab Lecture 6: Sensors and Interfacing… Microcontrollers… More  Project Time

Demos based on lab projects at U of L: 1-Wire and wireless sensor interfacing

“1-wire” chips allow multiple sensors to be connected to the same wire for weatherstations and similar devices.

(Thermometer Demo)

http://www.maxim-ic.com/products/1-wire/

QuickTime™ and aTIFF (Uncompressed) decompressor

are needed to see this picture.

Wireless sensor board can poll multiple sensors on the 1-wire bus.

(Flow sensor demo)

From last time:

Page 9: Gadget Lab Lecture 6: Sensors and Interfacing… Microcontrollers… More  Project Time

Antepenultimate* Slide of the Entire Semester

• Thanks for being the Gadget Lab “guinea pigs.” Comments? What should be changed next year?

• See IEEE student group for jumper wires/other gadget building tools.

• Slides and most websites I mentioned in the course are available on BlackBoard.

• Visit ECE labs in BRB/Lutz/Speed!

*2 more slides after this one. This word is “drittletzt” in German

Page 10: Gadget Lab Lecture 6: Sensors and Interfacing… Microcontrollers… More  Project Time

Soldering “Tips”

Heat the part, then solder will flow onto it. If solder is only going onto your wire but not your motor, you’ve probably noticed that thin wires heat more quickly than chunky motors. Try heating the motor first, then bring the wire in just before soldering.

Attach copper foil to your motor: copper solders easily

Is the tip blackened (oxidized) so much that the solder won’t melt? Dip the hot solderingiron in tip-tinner.

Avoid touching the soldering iron to the sponge for more than about 1 second. Long contact will oxidize the tip.

Work at the lowest temperature you can, to avoid oxidizing the tip.

Sandpaper can be used in tough cases (let your tip cool off first), but eventually it will remove the tin plating on the iron.

You will need a new tip someday.

Page 11: Gadget Lab Lecture 6: Sensors and Interfacing… Microcontrollers… More  Project Time

Feb. 16: Engineering Day at the

• 727 West Main Street

• 12:30-4:30 (drop in anytime)

• Show off your projects at the ECE table

Project Time!And A Special Announcement--