Ma - cs.uml.edu

144

Transcript of Ma - cs.uml.edu

Page 1: Ma - cs.uml.edu

6.270 Organizers's Manual

Matthew L. Domsch

May 18, 1994

Page 2: Ma - cs.uml.edu
Page 3: Ma - cs.uml.edu

Introduction

The \6.270 LEGO Robot Design Competition" is a student-run contest, oered atthe Massachusetts Institute of Technology during its January Independent ActivitiesPeriod (IAP). The contest, now in it's eighth year, has brought a fun and creativelearning environment to hundreds of students through the merger of software, hard-ware, and LEGO bricks.

The 6.270 contest has been under the creative supervision of several organizersover the past eight years, as well as the many teaching assistants who have broughtfresh ideas into the class. It is through the collaboration of these individuals thatthe contest has been a success. Specically, the former organizers include: MatthewDomsch '94; Fred Martin, PhD; Pankaj Oberoi, G; Michael Parker; Randy Sargent,G; Karsten Ulland '94; Sanjay Vakil '94; and Anne Wright '94;

This document, written to satisfy the \Advanced Undergraduate Project" report,serves multiple purposes. First, it includes revisions to the \6.270 Course Notes", adocument produced over the past four years by the organizers. These revisions re ectchanges that have been made in the hardware, the 6.270 Robot Controller Board Rev.2.21, as well as revisions to the course structure in general. Since the course notesare a collaborative eort, it is dicult to assign credit to the appropriate individualfor each specic chapter. Chapters 2, 3, and 4 are a derivative work of the \6.270Course Notes". These revisions may be placed in future course notes as the organizerssee t.

Chapter 5 includes debugging techniques for the Rev. 2.21 hardware. Commonfailure modes, as well as common mistakes, are outlined. Hopefully this will makedebugging of the hardware simpler for students, TAs and organizers alike. Thischapter contains some gures from the \6.270 Course Notes" as well.

The nal addition re ects some of the work I've been involved with as an organizerof the contest. Since the contest is student-run, it is vital that knowledge gatheredthrough teaching be passed on to future organizers. While this chapter cannot coverin detail every aspect of the contest I have been involved with, it should assist futureorganizers in some of the tasks. My goal was to make the organizational job easierfor future organizers. I sincerely hope I have succeeded.

Just as the 6.270 contest is constantly evolving, I expect others to evolve this doc-

i

Page 4: Ma - cs.uml.edu

ument as well. Please continue to provide insight and make changes as appropriate,so that the next breed of organizers will have a much simpler job.

Additional copies of the \6.270 Course Notes" and this document are available onthe anonymous FTP server aeneas.mit.edu in the pub/ACS/6.270 directory orthrough the Uniform Resource Locator (URL)http://www.mit.edu:8001/activities/6.270/home.html

The current 6.270 organizers can be reached through electronic mail [email protected] or through US Mail to:

6.270 OrganizersThe EECS DepartmentMassachusetts Institute of Technology50 Vassar St. Room 476Cambridge, MA 02139

The Philosophy of 6.270

As I see it, the philosophy of 6.270 is to learn by having fun. Fun comes to peoplein many dierent forms. Fun can be spending a day on the beach, washing your car,staring mindlessly at the television, or out for a night on the town with friends. Whilethese are all noble and worthwhile ways to spend time, and I highly recommend anyof them, you can't really teach a class in how to have fun.

For me, I'm not having fun unless I'm learning. This is why I've been so involvedwith the 6.270 contest. Where else do you get three weeks to play with LEGO? Whereelse do you get three weeks to write programs that YOU want to write? In 6.270, youcontrol the amount of learning you receive, the instructors don't. If you want to learnmore, there's more to learn. Even now, by writing this \Advanced UndergraduateProject", I'm learning a lot. More than I ever really wanted to know. But, it's stillfun. And, I learn more when I'm having fun.

I owe a great debt to the 6.270 organizers, sta, and students over the past fouryears. You have taught me so much more than books and lectures ever could. Hope-fully I have given something to you in return. Continue the tradition, and keep onlearning!

Matthew L. DomschMay 18, 1994

Page 5: Ma - cs.uml.edu

Contents

1 The 6.270 Organizers' Manual 11.1 Budget : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 11.2 Mailing lists : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 4

1.2.1 Editing a Mailing List : : : : : : : : : : : : : : : : : : : : : : 61.3 The 6.270 Locker and AFS : : : : : : : : : : : : : : : : : : : : : : : : 8

1.3.1 6.270 Directory Tree : : : : : : : : : : : : : : : : : : : : : : : 81.3.2 AFS permissions : : : : : : : : : : : : : : : : : : : : : : : : : 11

1.4 FTP Directory : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 131.5 Parts Ordering : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 141.6 Lecture and Recitations : : : : : : : : : : : : : : : : : : : : : : : : : 15

1.6.1 Lectures : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 151.6.2 Recitations : : : : : : : : : : : : : : : : : : : : : : : : : : : : 18

1.7 Team Structure : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 191.7.1 Team organization : : : : : : : : : : : : : : : : : : : : : : : : 201.7.2 Friends and Enemies : : : : : : : : : : : : : : : : : : : : : : : 20

1.8 Publicity : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 211.8.1 Press Releases : : : : : : : : : : : : : : : : : : : : : : : : : : : 211.8.2 Videotaping the contest : : : : : : : : : : : : : : : : : : : : : 22

1.9 Class Registration and Lottery : : : : : : : : : : : : : : : : : : : : : : 22

2 Assembly Manual 252.1 The Battery System : : : : : : : : : : : : : : : : : : : : : : : : : : : 26

2.1.1 Battery Pack Construction : : : : : : : : : : : : : : : : : : : : 262.1.2 The Battery Charger : : : : : : : : : : : : : : : : : : : : : : : 29

2.2 The Motor Switch Board : : : : : : : : : : : : : : : : : : : : : : : : : 322.2.1 Assembly Instructions : : : : : : : : : : : : : : : : : : : : : : 33

2.3 The Expansion Board : : : : : : : : : : : : : : : : : : : : : : : : : : : 342.3.1 Assembling the Expansion Board : : : : : : : : : : : : : : : : 352.3.2 Testing the Expansion Board : : : : : : : : : : : : : : : : : : 40

2.4 The LCD Display : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 412.5 The Microprocessor Board : : : : : : : : : : : : : : : : : : : : : : : : 42

iii

Page 6: Ma - cs.uml.edu

2.5.1 Assembling the Microprocessor Board : : : : : : : : : : : : : : 422.5.2 Testing the Microprocessor Board : : : : : : : : : : : : : : : : 522.5.3 Board Checko : : : : : : : : : : : : : : : : : : : : : : : : : : 532.5.4 After Board Checkout : : : : : : : : : : : : : : : : : : : : : : 56

2.6 The Infrared Transmitter : : : : : : : : : : : : : : : : : : : : : : : : : 562.6.1 Assembly Instructions : : : : : : : : : : : : : : : : : : : : : : 57

2.7 Cable and Connector Wiring : : : : : : : : : : : : : : : : : : : : : : : 602.8 Motor Wiring : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 64

2.8.1 The Polaroid Motor : : : : : : : : : : : : : : : : : : : : : : : : 642.8.2 Servo Motor : : : : : : : : : : : : : : : : : : : : : : : : : : : : 68

3 6.270 Hardware 713.1 The Microprocessor and Memory : : : : : : : : : : : : : : : : : : : : 71

3.1.1 Multiplexing Data and Address Signals : : : : : : : : : : : : : 733.2 Memory Mapping : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 74

3.2.1 Memory-Mapping the RAM : : : : : : : : : : : : : : : : : : : 763.2.2 Memory-Mapping with the 74HC138 Chip : : : : : : : : : : : 773.2.3 System Memory Map : : : : : : : : : : : : : : : : : : : : : : : 793.2.4 Digital Inputs : : : : : : : : : : : : : : : : : : : : : : : : : : : 793.2.5 Digital Outputs : : : : : : : : : : : : : : : : : : : : : : : : : : 823.2.6 6811 and Memory Schematic : : : : : : : : : : : : : : : : : : : 82

3.3 The Motor Drivers : : : : : : : : : : : : : : : : : : : : : : : : : : : : 823.3.1 The H-Bridge Circuit : : : : : : : : : : : : : : : : : : : : : : : 823.3.2 The H-Bridge with Enable Circuitry : : : : : : : : : : : : : : 843.3.3 The SGS-Thomson Motor Driver Chip : : : : : : : : : : : : : 853.3.4 Power Considerations : : : : : : : : : : : : : : : : : : : : : : : 883.3.5 Expansion Board Motor and LED Circuitry : : : : : : : : : : 88

3.4 Analog Inputs : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 913.4.1 Motor Current Monitoring Circuit : : : : : : : : : : : : : : : : 913.4.2 Analog Input Multiplexing on the Expansion Board : : : : : : 92

3.5 The Serial Line Circuit : : : : : : : : : : : : : : : : : : : : : : : : : : 933.5.1 Serial Output : : : : : : : : : : : : : : : : : : : : : : : : : : : 953.5.2 Serial Input : : : : : : : : : : : : : : : : : : : : : : : : : : : : 95

3.6 Battery-Backing the Static RAM : : : : : : : : : : : : : : : : : : : : 963.6.1 Powering the Memory Chip : : : : : : : : : : : : : : : : : : : 963.6.2 The Power-O Interrupt : : : : : : : : : : : : : : : : : : : : : 963.6.3 The Power-Up Delays : : : : : : : : : : : : : : : : : : : : : : 97

3.7 The Infrared Transmission Circuit : : : : : : : : : : : : : : : : : : : : 983.7.1 The IR Beacon : : : : : : : : : : : : : : : : : : : : : : : : : : 102

3.8 The LCD Display : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 1023.9 The Low-Battery Indicator : : : : : : : : : : : : : : : : : : : : : : : : 104

Page 7: Ma - cs.uml.edu

3.10 Fun Hacks : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 1053.10.1 Adding a Loudspeaker : : : : : : : : : : : : : : : : : : : : : : 105

4 Printed Circuit Layouts 1094.1 Microprocessor Board : : : : : : : : : : : : : : : : : : : : : : : : : : : 1104.2 Expansion Board : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 1114.3 Battery Charger Board : : : : : : : : : : : : : : : : : : : : : : : : : : 1124.4 Motor Switch Board : : : : : : : : : : : : : : : : : : : : : : : : : : : 1124.5 Infrared Beacon Board : : : : : : : : : : : : : : : : : : : : : : : : : : 113

5 Debugging the 6.270 Rev. 2.21 Hardware 1155.1 Useful Debugging Tools : : : : : : : : : : : : : : : : : : : : : : : : : : 1155.2 General Debugging Tips : : : : : : : : : : : : : : : : : : : : : : : : : 116

5.2.1 Component and Solder Sides : : : : : : : : : : : : : : : : : : : 1175.2.2 Power : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 1175.2.3 Power-Ground shorts : : : : : : : : : : : : : : : : : : : : : : : 1185.2.4 Solder Joints and Solder Bridges : : : : : : : : : : : : : : : : : 1205.2.5 Missing Parts : : : : : : : : : : : : : : : : : : : : : : : : : : : 1205.2.6 Backward Parts : : : : : : : : : : : : : : : : : : : : : : : : : : 120

5.3 Swapped parts : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 1255.4 Cooked Components : : : : : : : : : : : : : : : : : : : : : : : : : : : 1275.5 Annoying Stupid Mistakes : : : : : : : : : : : : : : : : : : : : : : : : 1275.6 Replacement Parts : : : : : : : : : : : : : : : : : : : : : : : : : : : : 1285.7 Non-board Problems : : : : : : : : : : : : : : : : : : : : : : : : : : : 129

5.7.1 Serial Cable : : : : : : : : : : : : : : : : : : : : : : : : : : : : 1295.7.2 UNIX devices : : : : : : : : : : : : : : : : : : : : : : : : : : : 1305.7.3 DOS/Windows devices : : : : : : : : : : : : : : : : : : : : : : 131

5.8 Quick checklist : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 1325.8.1 Hardware problems : : : : : : : : : : : : : : : : : : : : : : : : 1325.8.2 Software problems : : : : : : : : : : : : : : : : : : : : : : : : 132

Page 8: Ma - cs.uml.edu
Page 9: Ma - cs.uml.edu

List of Figures

1.1 Mailing list hierarchy : : : : : : : : : : : : : : : : : : : : : : : : : : : 4

2.1 Three Battery Pack Congurations : : : : : : : : : : : : : : : : : : : 272.2 Battery Plug and Cable Wiring Diagram : : : : : : : : : : : : : : : : 282.3 Battery Pack Wiring Diagram : : : : : : : : : : : : : : : : : : : : : : 292.4 Battery Charger Component Placement : : : : : : : : : : : : : : : : : 302.5 Motor Switch Board Component Placement : : : : : : : : : : : : : : 332.6 Expansion Board Component Placement : : : : : : : : : : : : : : : : 352.7 Mounting Method for Male Header Pins : : : : : : : : : : : : : : : : 382.8 Expansion Board Male Header Pin Placement : : : : : : : : : : : : : 382.9 Expansion Board Female Header Mounting : : : : : : : : : : : : : : : 392.10 Motor Chip Stacking Technique : : : : : : : : : : : : : : : : : : : : : 412.11 LCD Connector Mounting : : : : : : : : : : : : : : : : : : : : : : : : 422.12 6.270 Microprocessor Board Component Placement : : : : : : : : : : 432.13 6.270 Microprocessor Board Header Placement : : : : : : : : : : : : : 482.14 Motor Chip Stacking Technique : : : : : : : : : : : : : : : : : : : : : 512.15 Infrared Transmitter Component Placement : : : : : : : : : : : : : : 572.16 Standard Connector Plug Congurations : : : : : : : : : : : : : : : : 592.17 Step One of Connector Wiring : : : : : : : : : : : : : : : : : : : : : : 602.18 Step Two of Connector Wiring : : : : : : : : : : : : : : : : : : : : : : 612.19 Step Three of Connector Wiring : : : : : : : : : : : : : : : : : : : : : 622.20 Step Four of Connector Wiring : : : : : : : : : : : : : : : : : : : : : 632.21 Motor Housing with Tubing : : : : : : : : : : : : : : : : : : : : : : : 652.22 LEGO Jig for Mounting Polaroid Motor : : : : : : : : : : : : : : : : 662.23 LEGO Jig for Mounting Polaroid Motor : : : : : : : : : : : : : : : : 672.24 Servo Motor and Integral Connector Plug : : : : : : : : : : : : : : : : 68

3.1 Block Diagram of Microprocessor and Memory : : : : : : : : : : : : : 723.2 Block Diagram of Microprocessor and Memory with Latch : : : : : : 733.3 6.270 System Block Diagram : : : : : : : : : : : : : : : : : : : : : : : 753.4 Enabling the Memory : : : : : : : : : : : : : : : : : : : : : : : : : : : 763.5 Wiring the 'HC138 Address Decoder : : : : : : : : : : : : : : : : : : 77

vii

Page 10: Ma - cs.uml.edu

3.6 6811 System Memory Map : : : : : : : : : : : : : : : : : : : : : : : : 803.7 Digital Input Circuit : : : : : : : : : : : : : : : : : : : : : : : : : : : 813.8 6811, Memory, Address Decoding and Miscellaneous Circuitry : : : : 833.9 The H-Bridge Circuit : : : : : : : : : : : : : : : : : : : : : : : : : : : 843.10 The H-Bridge with Left-to-Right Current Flow : : : : : : : : : : : : : 853.11 The H-Bridge with Enable Circuitry : : : : : : : : : : : : : : : : : : 863.12 The SGS-Thomson L293 Motor Driver IC : : : : : : : : : : : : : : : 873.13 Motor Driver Circuit : : : : : : : : : : : : : : : : : : : : : : : : : : : 893.14 Power Filtering and Switching Circuit : : : : : : : : : : : : : : : : : : 903.15 Expansion Board Motor and LED Circuitry : : : : : : : : : : : : : : 903.16 Expansion Board Analog Input Circuitry : : : : : : : : : : : : : : : : 923.17 Host and Board Communications over 3-Wire Serial Link : : : : : : : 933.18 Serial Line Circuit : : : : : : : : : : : : : : : : : : : : : : : : : : : : 943.19 Reset Circuitry : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 983.20 Square Wave Consisting of Bursts of 40 Khz Signals : : : : : : : : : : 993.21 Sharp IR Sensor Decoding IR-Encoded Square Wave : : : : : : : : : 993.22 Block Diagram of Infrared Circuitry : : : : : : : : : : : : : : : : : : : 1003.23 Infrared Transmission Circuit : : : : : : : : : : : : : : : : : : : : : : 1013.24 Infrared Beacon Circuit : : : : : : : : : : : : : : : : : : : : : : : : : : 1023.25 Low Battery Indicator Circuit : : : : : : : : : : : : : : : : : : : : : : 1043.26 Speaker Hack, v1.0 : : : : : : : : : : : : : : : : : : : : : : : : : : : : 1063.27 Speaker Hack, v2.0 : : : : : : : : : : : : : : : : : : : : : : : : : : : : 107

4.1 Microprocessor Board, Component Side : : : : : : : : : : : : : : : : : 1104.2 Microprocessor Board, Solder Side : : : : : : : : : : : : : : : : : : : : 1104.3 Expansion Board, Component Side : : : : : : : : : : : : : : : : : : : 1114.4 Expansion Board, Solder Side : : : : : : : : : : : : : : : : : : : : : : 1114.5 Battery Charger Board, Component and Solder Sides : : : : : : : : : 1124.6 Motor Switch Board, Component and Solder Sides : : : : : : : : : : : 1124.7 Infrared Beacon Board, Component and Solder Sides : : : : : : : : : 113

5.1 Top View of 14-pin DIP : : : : : : : : : : : : : : : : : : : : : : : : : 1215.2 Top View of 52-pin PLCC : : : : : : : : : : : : : : : : : : : : : : : : 1225.3 Typical Diode Package : : : : : : : : : : : : : : : : : : : : : : : : : : 1225.4 Identifying LED Leads : : : : : : : : : : : : : : : : : : : : : : : : : : 1235.5 Resistor Pack Internal Wiring : : : : : : : : : : : : : : : : : : : : : : 1245.6 Serial cable schematic for a standard RS232 cable. : : : : : : : : : : : 129

Page 11: Ma - cs.uml.edu

List of Tables

1.1 Proposed 1994 budget. : : : : : : : : : : : : : : : : : : : : : : : : : : 21.2 Expenses and income for the 1994 contest. : : : : : : : : : : : : : : : 3

ix

Page 12: Ma - cs.uml.edu
Page 13: Ma - cs.uml.edu

Chapter 1

The 6.270 Organizers' Manual

This section is intended to serve as an informal guide to some of the organization of6.270, in the hopes that future organizers will have the job of organization a littlesimpler because I was involved. The information in here is as correct as I know howto make it, but is subject to change over time, as most things do. Future organizersare welcome to change this manual, and hopefully add their knowledge and insightto it. Carry on the tradition!

Many of the things discussed in this document are specic to the MIT 6.270contest, though their ideas may be extended beyond MIT to other institutions. Whilethe overall concepts, such as budget, sponsors, mailing lists, etc. will be similar, thespecic implementation at other institutions may be dierent. This document is notintended to give step-by-step instruction on setting up a similar course elsewhere, butis mostly an explanation of some of the administrative details covered at MIT. Thesedetails will necessarily be modied at other institutions.

1.1 Budget

The 6.270 contest has an annual budget of over $30,000. This money goes to pur-chasing electronics, building the playing tables, paying the student organizers, buyingT-shirts, and purchasing the LEGO. Table 1.1 shows our proposed budget for the1994 contest. Table 1.2 shows our actual expenses. It's always best to overestimateand come out in the black.

1

Page 14: Ma - cs.uml.edu

2 CHAPTER 1. THE 6.270 ORGANIZERS' MANUAL

PC BOARD FABRICATION COSTS $1,200.00MICROPROCESSOR BOARD COMPONENTS $5,732.04Including expansion board, andelectronic componentsSENSORS $2,745.40MISC COMPONENTS FOR KITS $1,272.86BATTERIES & POWER SUPPLY $736.30LEGO $8,730.00CARRYING BOXES $700.00

Total Parts for Kit $21,116.60Total Cost Per Kit (74 Kits) $285.36

RESEARCH AND DEVELOPMENT $300.00general purpose parts forexperimentation and evaluation

PLAYING TABLES $2,000.00PHOTOCOPYING COSTS $1,500.00ADVERTISEMENT & PUBLICITY $750.00TA SALARIES $4,000.00T-SHIRTS $2,000.00Lab Supplies $250.00Shipping Charges $750.00Total $32,666.60

Table 1.1: Proposed 1994 budget.

Page 15: Ma - cs.uml.edu

1.1. BUDGET 3

Expenses

Digikey - Thief River Falls - MN Electronic parts $2148.38FAI - Bolton - MA $1342.00CFC - Waltham - MA Circuit board fabrication $1120.00Sterling Electronics - Woburn - MA Motor driver chips $2766.50Mouser Electronics - Manseld - TX $591.00MCM Electronics - Centerville - OH $3045.45Tomberline - CA $700.00Nu Horizons $640.00Tee Shirts T-shirts $1730.00Digi-Key Electronic parts $413.00LEGO Dacta LEGO Technic $8730.00Pankaj Oberoi Misc. parts $3199.25Student organizers $5556.00Total Expenses $31981.58

Income

Motorola - Gift $2200.00Motorola - Gift $1600.00Student Entry Fees $2533.00Tool kits $1996.00Microsoft Gift $10000.00MIT EECS allowance $16000.00Total Income $34329.00

Income - Expenses = Prot (Loss) $2347.42

Table 1.2: Expenses and income for the 1994 contest.

Page 16: Ma - cs.uml.edu

4 CHAPTER 1. THE 6.270 ORGANIZERS' MANUAL

1.2 Mailing lists

As soon as more than one or two people are involved in any project, mailing listsbecome necessary. Electronic mail is by far the fastest and easiest way to distributeinformation to a large group of people.

This section is specic to the MIT Athena distributed computing environment. Itmust be modied accordingly for other institutions.

6.270−organizers

6.270−staff

6.270−participants

6.270−reg

6.270−fanclub

6.270

Figure 1.1: Mailing list hierarchy

The 6.270 contest has created a number of mailing lists, in a specic hierarchy, asshown in Figure 1.1. As is shown, the list 6.270-organizers is the main adminis-trative list. This list owns all the other lists, and can make changes to them. Emailsent to a list low in the chain is also sent to all lists higher in the chain.

The following is a list of mailing lists that 6.270 owns and uses. [email protected] the list name when sending email.

List: 6.270

Description: none

This list is a mailing list.

This list is a Group and its ID number is 19278

The Administrator of this list is the LIST: 6.270-organizers

This list is: active, private, and visible

The mailing list [email protected] was the original mailing list created by FredMartin and Randy Sargent many years ago. It has since been replaced by the moredescriptive lists below. This list is a mailing list which points only to the [email protected] mailing list. It exists so that older email references to thecontest will still reach the right people. This list is not necessary for non-MIT contests.

List: 6.270-organizers

Description: none

Page 17: Ma - cs.uml.edu

1.2. MAILING LISTS 5

This list is a mailing list.

This list is a Group and its ID number is 27596

The Administrator of this list is the LIST: 6.270-organizers

The mailing list [email protected] is the main administrative list forthe 6.270 project. This list holds administrative privileges over all of the other mailinglists, and over the 6.270 locker on Athena. For this reason, only real organizers shouldbe put on the list. All outside email references should probably be to this list, sooutsiders have a single place to get in touch with us.

List: 6.270-staff

Description: none

This list is a mailing list.

This list is a Group and its ID number is 28243

The Administrator of this list is the LIST: 6.270-organizers

This list is: active, private, and visible

The mailing list [email protected] is the main sta mailing list, which shouldcontain the names of all current 6.270 sta, as well as the LIST:6.270-organizers.It is primarily for internal discussions, and for the 6.270 participants to send questionsto during IAP. Dierent directories in the 6.270 locker may be readable or writableby the sta, though they are not readable or writable by other groups.

List: 6.270-reg

Description: List for people registering for 6.270

This list is a mailing list.

This list is NOT a Group.

The Administrator of this list is the LIST: 6.270-organizers

This list is: active, private, and visible

The mailing list [email protected] is the 6.270 registration mailing list. It wascreated to provide a level of indirection in the registration process (I didn't want allof the email coming to me necessarily). In this way, this list may receive individualregistration requests, questions, and the like, without specically pointing to oneorganizer or TA.

This list was also archived on life.ai.mit.edu during the 1993/94 registrationperiod. Archives on life are pretty simple, but you need to have an account on the AILab machines to do it. In general, archives are only necessary if you want a backupof the mail. Most things shouldn't be archived, but it's really bad to lose registrationmaterial.

Page 18: Ma - cs.uml.edu

6 CHAPTER 1. THE 6.270 ORGANIZERS' MANUAL

List: 6.270-participants

Description: none

This list is a mailing list.

This list is NOT a Group.

The Administrator of this list is the LIST: 6.270-organizers

This list is: active, private, and visible

The mailing list [email protected] was created to send email to thecurrent participants. The LIST:6.270-sta list should always be included on thatlist. Each year after the registration lottery, those people who are in the class shouldbe added to the participants list.

List: 6.270-fanclub

Description: none

This list is a mailing list.

This list is NOT a Group.

The Administrator of this list is the LIST: 6.270-organizers

This list is: active, public, and visible

The mailing list [email protected] is a public mailing list (meaning thatany MIT student can add their name to it easily). It should always contain thelists LIST:6.270-participants and LIST:6.270-sta. The fanclub mailing list wascreated to send out announcements to the general 6.270 community, though it hasbeen rarely used. At the end of each contest, the individuals on the participants listshould be added to the fanclub list.

1.2.1 Editing a Mailing List

Athena provides several dierent ways to edit lists. The listmaint program is amenu-driven list editor. I personally prefer the command-line editor blanche. Ithas fewer powers, but is simpler conceptually, and can handle the manipulation oflarge lists easily. On Athena, type: man blanche for more information beyond whatI teach here.

To add a single user to a mailing list, type:

athena% athena% blanche -v -a username listname

where \username" is the username of the person to add, and \listname" is thename of the list to add that person to.

To delete a single user from a mailing list, type:

Page 19: Ma - cs.uml.edu

1.2. MAILING LISTS 7

athena% blanche -v -d username listname

similar to the add function.

If you have a list of usernames you want to add to or delete from a list, thesefunctions will help.

Begin by placing the usernames into a le (perhaps edited with emacs), oneusername per line, like this:

USER:luigi

USER:katrin

USER:spedhead

LIST:6.270-organizers

STRING:[email protected]

The USER:, LIST:, and STRING: are optional, but useful to be sure the rightthing happens. For a further description of these ags, consult the manual pages.

In general, usernames without the ags will be assumed to be of type USER,then of type LIST, then lastly of type STRING. Usernames of type USER havemore individual control over a list, so it's best to use that type whenever possible,since typeUSER users can remove themselves from the mailing list with the athena%blanche -v -d command, where individuals of type STRING cannot edit the listat all, forcing the organizers to do so.

To add an entire list of people to a mailing list, type:

athena% blanche -v -al filename listname

where \lename" is either the preformatted le as shown, or - for stdin, wherethe standard input should be formatted as above.

To delete an entire list of people from a mailing list, type:

athena% blanche -v -dl filename listname

similar to the addlist function. The individual usernames listed in the le\lename" will be deleted from the list \listname".

To copy the contents of one list over to another list (ie to copy the 6.270-participants list into the 6.270-fanclub list) type:

athena% blanche -v 6.270-participants | blanche -v -al - 6.270-fanclub

Page 20: Ma - cs.uml.edu

8 CHAPTER 1. THE 6.270 ORGANIZERS' MANUAL

Here, the list LIST:6.270-participants is being sent to the standard out-put, which is sent as the standard input to the addlist function for the listLIST:6.270-fanclub. Each individual from the participants list is being addedto the fanclub list, one by one.

To completely replace a list with a list of names in a le, type:

athena% blanche -v -f filename listname

WARNING! This is a very dangerous thing to do. NEVER do this to the 6.270-organizers list, or you may lose control over all the lists. It may be useful toreplace the participants list with a le generated after the registration lottery,but that's about the only place I'd use this.

As a last resort, the kind people at [email protected] can x any problem youget yourself into, such as erasing the organizers list. Primarily they will create newlists for you as needed. If you have them create new lists, refer to the format of thecurrent lists and try to follow them as much as possible. Please follow the 6.270-????naming convention when making new lists. The organizers list should always haveadministrative rights over any 6.270-owned lists.

1.3 The 6.270 Locker and AFS

6.270 has a large amount of disk space on Athena, approximately 100MB. In thisspace we store the 6.270 Course Notes, the software, administrative information, anda whole lot of other stu all necessary for 6.270 to run smoothly.

In general, the 6.270-organizers should always have administrative privileges overall aspects of the locker. The 6.270-sta may be given read/write privileges overcertain portions of the locker. The binary directories should be world-readable, asshould the Course Notes. The software source directory and build tree should onlybe world-readable if the owner of the software (at the time of this writing, AnneWright and Randy Sargent hold the copyright to IC v2.8 and do not want the sourcereleased) want it released.

1.3.1 6.270 Directory Tree

Picture the 6.270 locker as a directory tree. That will make the most sense whenremembering where dierent programs are.

Page 21: Ma - cs.uml.edu

1.3. THE 6.270 LOCKER AND AFS 9

Accessing the 6.270 locker

To attach the 6.270 locker to an Athena workstation, type:

athena% add 6.270

This will mount the locker on the workstation, creating a link to the locker at/mit/6.270/, adding the appropriate binary directory to the user's search path.

Alternatively, typing:

athena% setup 6.270

will open another xterm window on a X workstation, adding the 6.270 locker asabove, and performing the other functions as listed in the le /mit/6.270/.attachrc.

Note: Since the locker is actually an AFS volume, it can be accessed by any work-station running AFS. On Athena, the attach, add, and setup commands simplifythis procedure. As of this writing, the locker is logically mounted on/afs/athena.mit.edu/course/6/6.270/, where any workstation running AFS maynd it.

Top Level Directory

The top level directory, /mit/6.270/ contains very little information, mostly subdi-rectories. Try to keep it that way, so that it doesn't become too cluttered, makingit dicult to nd anything when you need to. Proper things to keep in the top leveldirectory include:

Administrative directory. The directory admin contains administrativematerial for the 6.270 contest. It should not be world readable. In fact, only6.270 organizers should have any privileges to this directory at all. The ACLshould look like:

Access list for admin is

Normal rights:

system:6.270-organizers rlidwka

Underneath the admin directory there should be subdirectories, one for eachcontest year, as well as other subdirectories with information relevant to allyears, such as registration and payment forms, sponsor contact lists, etc.

Documentation. The directory new-doc contains the documentation for theclass, which includes the source for the course notes. Each year should have asubdirectory underneath the new-doc top level directory.

Page 22: Ma - cs.uml.edu

10 CHAPTER 1. THE 6.270 ORGANIZERS' MANUAL

The new-doc directory is actually a separate AFS volume, but that doesn'tmatter much. It has only 40MB, most of which is lled with PostScript picturesfor the course notes.

The doc91 and doc92 directories contain information from the 1991 and 1992Course Notes, respectively. We were running out of space on the new-docpartition, so they got moved into the top-level directory partition.

Software sources. The source code for IC, as well as the other associatedprograms such asmon, dl, init board, and term are kept in the src directory.The actual code lies in the src/dist/ subdirectories for each program. The buildtree for each workstation type is also there, each with links too the les in thesrc/dist/ subdirectories. The binary executable les should be copied into theappropriate subdirectory after they've been compiled. Consult Anne Wright forfurther information on compiling the source code.

As most of the source code for the 6.270 project is copyrighted by Anne Wrightand Randy Sargent, the src directory should not be readable by anyone otherthan the organizers.

Software distribution. The dist directory contains subdirectories which holdthe executables for the various workstations, including Kyle Peltonen's port ofIC v2.8 to Windows 3.1 (ie. WinIC) and Mike Wessler's port of IC v2.8 tothe Macintosh. As IC v2.8 is copyrighted by Anne Wright for use only in the6.270 project, the directory should not be world-readable, but readable only toAthena users.

Access list for dist is

Normal rights:

system:6.270-organizers rlidwka

system:authuser rl

Binary directories. The directories containing the executable code for eachtype of workstation should be here. The Athena binary naming convention is$fhosttypegbin, where $fhosttypeg is a csh variable referring to the typeof workstation the user is currently using. This directory should have sys-tem:authuser rl privileges.

There also needs to be the directory lib which contains library routines re-quired for IC and the other programs. Since the libraries change as the coursedevelops, organizers and sta may change the libraries to re ect those coursedevelopments. As with the binary directories, this directory should have sys-tem:authuser rl privileges.

Page 23: Ma - cs.uml.edu

1.3. THE 6.270 LOCKER AND AFS 11

Team code. The TEAMS directory (actually a link to new-doc/TEAMS)contains the software that each team wrote. We check this code at impoundingto be sure teams aren't doing anything seriously illegal. We use this code toreload a robot on contest night if it's memory system fails. It's available foranyone to read after the contest. We also archive the code from past years inthis directory.

Old stu. The archive directory contains information relating to the semi-nar 6.915, taught during the Fall 1991 school year by Fred Martin and RandySargent. While it's probably not critical, it's a piece of history and makes forinteresting reading as an organizer.

World Wide Web. The www directory contains the 6.270 World Wide WebHTML les. Organizers and sta may edit those pages as they wish, perhapseven making an on-line set of HTML course notes. This directory needs to beworld readable (system:anyuser rl) so that individuals outside of MIT mayreach those pages. The URL to the 6.270 Home Page ishttp://www.mit.edu:8001/activities/6.270/home.html.

1.3.2 AFS permissions

Since Athena uses AFS as the le system, one simple command (with lots of options)governs the le system. Type: fs help for information beyond what I present here.

Quota. Since 6.270 has a limited disk quota, you must be sure that it is notexceeded. To see the current disk quota, type:

athena% cd /mit/6.270

athena% fs lq . new-doc

This should return something like:

Volume Name Quota Used % Used Partition

course.6.270 65000 53859 83% 71%

course.6.270.doc 40000 34579 86% 82%

This shows that the 6.270 locker actually consists of two AFS volumes, locatedin the /mit/6.270 and /mit/6.270/new-doc directories. This disk spacegets pretty full, especially when the course notes are compiled. Our locker isthe largest course locker on Athena, so Faculty Liaisons don't really want togive us more space. But, if we have a genuine need, send email to f [email protected],the Faculty Liaisons group, and they can help out.

Page 24: Ma - cs.uml.edu

12 CHAPTER 1. THE 6.270 ORGANIZERS' MANUAL

Access Control List. In AFS, each directory has an individual \Access Con-trol List", or ACL. Dierent rights are available for the directory to dierentindividuals and lists. This is an example of ACL for the top-level directory:

athena% fs la /mit/6.270

Access list for /mit/6.270 is

Normal rights:

system:6.270-staff rl

system:6.270-organizers rlidwka

system:authuser rl

system:anyuser rl

Lists with the word \system:" prepended to them are moira groups, as editedearlier with blanche. As you can see, the 6.270-sta list has read and listprivileges. The 6.270-organizers list has all privileges, including administration.The system:authuser list, which consists of any MIT Athena user, has readand list privileges, as does the system:anyuser list (which is equivalent to beingworld-readable).

To change the access control list, you can either add or remove an individualor a list. Lists need to have the word system: prepended to the list name, asshown above. For example, to add the list 6.270 to the ACL for the 6.270 topdirectory, type:

athena% fs sa /mit/6.270 system:6.270 read

The list 6.270 will now be given read privileges to the top-level directory, andonly the top level directory.

To remove a user from the ACL for a directory, type:

athena% fs sa /mit/6.270 luigi none

This assigns the user luigi the privileges none.

The most useful privileges to grant are:

read - The individual or group can read and list the directory. This appears inthe ACL as rl.

write - The individual or group can read and write to the directory. Thisappears in the ACL as rlidwk.

Page 25: Ma - cs.uml.edu

1.4. FTP DIRECTORY 13

all - The individual or group can read, write, and administer the directory.Only people with administrative privileges can edit the ACL. This appears inthe ACL as rlidwka.

none - The individual or group gets no privileges at all. There is no line in theACL for this type, since it has no privileges.

li - Only list and insert privileges. Used for the registration directory whereindividuals write their own registration le , but you don't want others to haveaccess to that directory.

1.4 FTP Directory

Since so many people outside of MIT would like to get copies of our course notes andother les, we have a directory on the Athena FTP server, where we put PostScriptcopies of our documentation, and sometimes the code for IC.

The course notes should be split up into several parts, preferably one part perchapter, so that printing them may be split over several print jobs. Otherwise, oneperson trying to print out a 250 page manual takes quite a long time.

For people outside MIT, to get into our FTP directory, type:

athena% ftp aeneas.mit.edu

Name (aeneas:luigi): ftp

Password: (enter your email address as your password)

ftp> cd pub/ACS/6.270

Or, the directory is available through the URL ftp://aeneas.mit.edu/pub/ACS/6.270if using Mosaic or another FTP browser.

Just as our locker has several directories, the FTP server should have severaldirectories as well. Each year should get it's own directory where the course notescan be placed. Try to keep the directory organized so it's simple to nd what you'relooking for.

To install or remove things from the FTP directory, you must be on thesystem:6.270-organizers list. You must rst attach the directory, and then use itas any other locker.

To access the FTP directory, type:

athena% attach aeneas:ftp

athena% cd /aeneas/ftp/pub/ACS/6.270

Since aeneas.mit.edu is the same machine as the servers prep.ai.mit.edu (theGNU software FTP server) and athena-dist.mit.edu (the MIT Athena FTP server),the load on it may be quite high at times. The FTP server will not allow access ifthe load is too high. Try again later.

Page 26: Ma - cs.uml.edu

14 CHAPTER 1. THE 6.270 ORGANIZERS' MANUAL

1.5 Parts Ordering

Ordering parts takes a long time. Start early! As soon as you get your budgetapproved, start ordering parts. This should be as early as September, but not laterthan October.

While the physical act of ordering parts can take quite a while, it takes even longerto actually receive the parts. Some parts have quite long waiting periods (over a yearin some cases) while some parts are on suppliers' shelves.

In the past, 6.270 has ordered from a myriad of parts dealers, always trying tond the cheapest seller of each individual part. While this is noble, it takes animmense amount of time. This time can better be spent ironing out a deal with asingle company, like DigiKey 1, who carries most of the parts we need, and usuallyhas those parts in stock. It's far easier to make one large purchase order for a singlecompany than it is to make lots of single-item purchase orders for lots of companies.Not only is it easier, but once you purchase enough from a single company, the \bulkdiscounts" start applying. These bulk discounts usually match the prices you'd getfrom shopping many smaller retailers, making it cost eective as well.

Before you can get parts from a particular parts distributor, you must have thepart number for each item you are buying. Call the company, and, using the partslist provided in the course notes, verify that the part number you have is correct, andthat they have enough of that part in stock. Part numbers can change, or becomeoutdated, so be sure you're ordering the right thing. Also be sure to write down theprice of each item, and the extended price. MIT has tax-exempt status, so be sure toget the tax-exempt number from the EECS Department Headquarters before callingthe company.

At MIT, purchase orders are not too dicult. A company must accept the pur-chase order, however. Most electronics companies have no problem selling parts on apurchase order to MIT, but now and again you'll nd one. To buy parts on a MITpurchase order, simply go to the EECS Department Headquarters. If the budget hasbeen approved, they will gladly help you ll out a purchase order and get it sent tothe company.

If a company will not accept a purchase order from MIT, you may have to buythe parts on a personal credit card, and be reimbursed by MIT. The reimbursementprocess can take several, weeks for the check to arrive. It's much simpler for you ifyou can get the company to accept a purchase order. On occasion that may meansetting up an account with a company that MIT has not done business with before.

It is best to have the parts shipped to the 5th Floor Stock Room (38-501). Youshould notify the 5th Floor desk to expect the parts for the contest, and ask that

1DigiKey Corporation. 701 Brooks Ave. South, P.O. Box 677 Thief River Falls, MN 56701-0677(800)344-4539

Page 27: Ma - cs.uml.edu

1.6. LECTURE AND RECITATIONS 15

they be put somewhere safe until you have a chance to inspect them and use them.Once the parts arrive, you must verify that all the parts are there, in the right

quantity, and are the right type. If anything is wrong, call the company immediately.Most of these ideas apply to sponsors as well. On occasion, Motorola will have

delays in getting parts to us. Order the Motorola parts as early as possible, evenduring the summer, if you know what parts you'll need that early.

1.6 Lecture and Recitations

One of the biggest complaints we received during the 1994 contest was that the lec-tures and recitations seemed unprepared. Unfortunately, this was very true. Most ofthe time lectures were given o-the-cu, and very little time was given to preparation.The main cause for this was that the organizers (Karsten and myself in this case)were too busy xing problems as they came up in lab to prepare for lecture. Thiswill be discussed further in outlining the duties of the Teaching Assistants (TAs).

We've split the formal teaching up into ve lectures, and four recitations for eachteam. That's about all that students will actually go to during IAP anyhow. Theidea is that we give students as much of the information as we can up front, in therst ve lectures, and then hold recitations twice a week for the next two weeks todiscuss strategies and for students to ask questions.

1.6.1 Lectures

There are ve principal lectures oered. They will be outlined here.

Lecture 1 - Welcome to 6.270

In 1994, the rst lecture was held on the rst day of class, Monday, January 3, at10am. In the rst lecture, a lot of things happen.

Teams check in, so we know which teams are present. At least 1/2 of each teammust be present at the rst lecture, or they forfeit their kit to another team.

Videotapes of past contests are shown to excite the participants.

Course Notes are distributed to participants.

All ground rules for 6.270 are stated. This includes credit guidelines, lab hours,Athena use and rules. Mailing lists. All administrative details.

Individual entrants are grouped into teams.

Page 28: Ma - cs.uml.edu

16 CHAPTER 1. THE 6.270 ORGANIZERS' MANUAL

Break. Since this lecture tends to last about three hours, a break is very muchneeded. During the break, you may distribute the kits.

T-shirts are distributed along with the kits.

The rules are rst introduced to the students, and the oor is opened for ques-tions.

Lecture 2 - Team organization, brainstorming, and the board

In 1994, the second lecture was held on the second day of 6.270, in the afternoon.In general, MIT students may be awake and actually attend lectures held in theafternoon, whereas lectures in the morning are generally poorly attended, especiallyduring IAP. Students are up far into the night and simply don't want to get up andgo to class in the morning. For that matter, the organizers and TAs usually are upfar too late as well, and they don't want to get up either.

Topics covered in the second lecture include:

More questions. Students have had a day to think about the contest, and havebegun to solder their boards together. There are sure to be questions aboutthe contest, or 6.270 in general. Answer those rst, so they're in the back ofstudent's minds as they hear the rest of the lecture.

Team organization. Teams are typically composed of two or three people. Eachperson brings to the team a dierent background, a dierent set of skills, anda dierent way to approach the problem and arrive at a solution. I'll discussteam organization more in another section.

The board. Introduction to the hardware. Split the discussion into inputs andoutputs. Describe at a high level what's going on with the board. There's timefor more in-depth discussion for those who are interested later, and it'll onlyscare away those who aren't as knowledgeable coming into the contest.

Brainstorming. If the contest was properly created, there will be an unlimitednumber of strategies, as well as an unlimited number of things that can bebuilt out of the LEGO. Have a brainstorming session, picking members of theaudience for volunteers. Write down as many ideas as possible. Be creative!

Demos. Some simple demos, or perhaps some very complex demos, preparedahead of time by the TAs and organizers. These demos should not point straighttoward \THE WAY" to solve the contest, but should be more general, inspiringstudents to think of their own way to solve the problem.

Page 29: Ma - cs.uml.edu

1.6. LECTURE AND RECITATIONS 17

Lecture 3 - Sensors, Batteries, Motors, and LEGO

In 1994, the third lecture was held on the third day of 6.270, Wednesday.

Sensors. Sprawl out all the sensors on the table. Students should have theirkits with them, and examine the parts as you describe them. Separate sensorsinto analog/digital classes. Describe their uses and their peculiarities.

Batteries. Burn a battery. Show students that they shouldn't do this at home.Remind them to always keep their motor batteries plugged in. Talk aboutcharging batteries. Tell them to go buy extra AAs.

Motors. Pull out the Polaroid motors. Discuss the power/speed tradeo. Dis-cuss gearing to achieve that tradeo. Show dierent types of motor mounts.

LEGO. By now students should be playing with their LEGO. Pull out someof the more random parts and describe them. Magic LEGO spacing. Verticalbracing. Black pegs.

LEGO Labs

In the past we've oered LEGO labs to anyone who wanted to show up, in twosessions. In this lab we go over more of the strange LEGO parts, give examples ofwhat can be built, and give challenge problems to the students. While attendanceisn't mandatory, it should be fun. Don't structure this too much like a lecture, butmore like a design problem.

The 6.270 Crash Course in C

Never programmed in C before? It's time to learn. Optional lecture is designedfor students who've never used C before. Since this lecture is really designed forindividuals with nearly no programming experience, good clear examples are essential.

Topics covered include:

Syntax.

Statements. 10+10;

Variables. int i=10;

Functions. void main(void);

Optional discussion on pointers, structures, and more advanced topics for studentswho want to know.

Page 30: Ma - cs.uml.edu

18 CHAPTER 1. THE 6.270 ORGANIZERS' MANUAL

Lecture 4 - IC

This lecture, taught on the fourth day of 6.270, Thursday, describes the IC program-ming language and the libraries. Assume for the discussion that students know someprogramming (though not necessarily C). Don't go in depth into how the operatingsystem works. Save that for recitation.

Mandatory topics:

init bd.

ic

Libraries

Multitasking.

Dierences between C and IC.

Give sample code (since we've got code from past years in the TEAMS directory)that clearly demonstrates all the topics.

Lecture 5 - Control systems

The last lecture is taught on the following Monday. Control and feedback systems isthe major topic. Open-loop vs. closed-loop control. Visual demonstrations (perhapswith a remote-control car and blindfolded driver, with students acting as \sensors")make the point much clearer.

1.6.2 Recitations

While we've got a denite plan for each of the ve lectures, we don't have suchspecic plans for the recitations. This is one area of the course that could use somereal improvement.

Recitations are usually taught as a team eort between one organizer and one TA.The TA should bring new and dierent experiences into the classroom and provideanother point of view. Remember, the organizers are not always right!

The purpose of recitations is to create more personal contact between the orga-nizers, TAs, and the individual members of the teams. Each recitation has about veteams. We want teams to discuss their strategies, develop new ideas, and learn fromeach other's successes and failures. The class should be interactive. Sit on the oor.Show and tell. If this degenerates into a lecture, the students won't learn much fromit.

The general outline for recitations is as follows:

Page 31: Ma - cs.uml.edu

1.7. TEAM STRUCTURE 19

Recitation #1. Answer any questions that students may have about the con-test. Check on the status of teams (ie. which teams may have already droppedout, ensure that all teams have completed construction of their controller board,etc.) Discuss strategies teams have devised. Be supportive of all ideas. Discusssensors and their uses. Discuss LEGO structures. Assignment for next time:simple wall-follower, line follower or light-snier robot.

Recitation #2. Similar to Recitation #1. Discuss the inner workings ofthe hardware. Assignment for next time: build an actual routine required forthat team's strategy, such as a robust wall-follower, line follower, or orientationroutine. Install start/stop code.

Recitation #3. This being the last week of the contest, be sure teams are stillon track and pushing toward the goal. Discuss how designs have changed overthe past week, and why changes were made. Test that teams have installed thestart/stop code, and know how to use it. Demonstrate their working subrou-tines. Assignment for next time: Mock contest. Everything should be ready togo.

Recitation #4. Mock contest. When things go wrong, as a class perform adetailed analysis of the problem areas, and nd ways to x them. All teamsshould distribute copies of their code to the recitation, so that everyone canunderstand what's happening.

1.7 Team Structure

One of principal strengths of 6.270 as an educational forum has been its center onteam learning. In the \Real World", people do not sit in corners and do everythingby themselves. People work in teams to accomplish a common goal. We've appliedthis concept to 6.270 as well, knowing that students will learn more when they'relearning from each other.

Over the past several years, we've noticed that the number of people on a teamaects a team's performance. Teams with a single individual (not much of a team,really) may work very hard to complete a robot within the time allowed, but rarelywill it be of good quality.

Similarly, teams with four people seem to fall into a dierent trap. In a team withfour people, it is much easier to sit back and let someone else do the work. Apply thisrule to all four members, and the project doesn't get completed. There are simplytoo many people for the amount of work that needs to be done. Communicationbetween all four members is dicult. Schedules won't t together. Teams of four,if allowed, typically degenerate into working teams of two or three members. It has

Page 32: Ma - cs.uml.edu

20 CHAPTER 1. THE 6.270 ORGANIZERS' MANUAL

been our experience that teams of four rarely nish their robots at all, or at best,make a robot that doesn't work well. For this reason, we have disallowed teams offour, except under special circumstances appealed to the organizers.

Teams of two or three members tend to fare the best, which is our goal. Theseteams are more likely to complete their robot and create a design that will work.

1.7.1 Team organization

Since each person on a team brings a dierent set of values, experiences, and knowl-edge to the group, it only seems right that teams will split the workload across theappropriate individuals.

One obvious way to split the team up is into three sections: LEGO, hardware, andsoftware. This approach seems to work very well, especially if team members comeinto the class with talents in each of those areas. However, it also tends to oer asingle point of view and a single learning experience, rather than a blended approach.The abstraction layers between mechanics, hardware, and software are pretty basic.

Another typical division of labor is to have everyone share in all the work. Ev-eryone solders part of the board together. Everyone helps build the LEGO structure.Everyone helps write the code, or at least performs code walk-throughs to eliminatethe bugs. This approach gives all teammates a thorough understanding of all partsof the project. But, in order for this division to succeed, much more communicationis required between team members. Abstraction, between components and betweenduties of each teammate, disappears entirely. This situation can make team manage-ment dicult.

1.7.2 Friends and Enemies

Many times, friends form a team and enter 6.270, but leave as enemies. This canbe even more disruptive when individuals are thrown together into teams. Overall,students at MIT are very set in their ways, headstrong, perhaps even stubborn. Oftentimes, students are unwilling to compromise. The fast pace of 6.270 seems to intensifythis feeling, sometimes causing con icts between teammates.

The guiding principle of 6.270 is to have fun. Con icts between students runcounter to this principle. Generally it is best to let teammates solve their own prob-lems, but on occasion TAs and organizers must step in and help resolve the con icts.Usually people just need a break from the stress. Suggest they take some time to donon-6.270 related activities, like ice skating, a snowball ght, or whatever. There'senough other stu during IAP to take your mind o of 6.270, and often that's exactlywhat is needed. As much fun as this contest may be, there is life outside the lab aswell, and students should be encouraged to explore it.

Page 33: Ma - cs.uml.edu

1.8. PUBLICITY 21

1.8 Publicity

As with any successful project, it's nice to get some publicity for the project. Infact, sponsors count on publicity, or else they would not donate their money. Tosponsors, it's a form of advertising. Publicizing the contest should be seem more likeadvertising as well. When a project goes well, good publicity ensures that the projectwill continue.

Publicity comes in many forms. Television, newspapers, and magazines are thetypical media, but T-shirts, posters, World Wide Web pages, and email lists cantarget specic and broad audiences as well.

1.8.1 Press Releases

The media likes a well-written press release. You must write something that catchesthe eye of the reporter, and makes them want to do a story. The press release shouldinclude information such as the overall theme of the contest (ie. pirate theme, soccertheme, etc.), as well as key information such as where and when the contest will beheld, and who to contact for further information. Be prepared to FAX the pressrelease to anyone who asks.

The press release should be sent out to several local newspapers and TV stations,as well as several magazines, about two months in advance. This will give the pressadvanced notice, so that if a larger story is desired, they can have time to prepare forit.

The week prior to the contest, a second notice should be sent to the same news-papers, TV stations, and magazines, as a reminder.

Publicity coordination should be the responsibility of a single organizer. Often,reporters will show up unannounced after seeing the press release and expect to lmor report on the contest. On contest night, the auditorium is a zoo of people, andunannounced cameras can pose serious problems. In the past, we've held one roundof the contest early on the last day so that TV cameras can get all the footage theylike without interfering with the rest of the contest that night.

It may be useful to have the local news oce, such as the MIT News Oce, helpyou prepare the press release, and choose whom to send it to. Corporate sponsors mayalso be willing to have their public relations departments help write and distributepress releases. These departments exist for just this purpose, and typically havecontacts inside the important media oces. Use them. It's good publicity for thesponsor, and for the contest.

Other suggested groups to send the press-release to include:

Netnews groups:

comp.robotics

Page 34: Ma - cs.uml.edu

22 CHAPTER 1. THE 6.270 ORGANIZERS' MANUAL

rec.toys.lego

comp.ai.edu

Email lists

[email protected]

[email protected]

1.8.2 Videotaping the contest

It's nice to videotape the contest. Contestants, as well as organizers, like to see theirperformance afterward. Sponsors like to watch what they're donating money toward,especially if they could not actually attend the contest. Since the auditorium at MITalways over ows, videotaping allows us to send the TV signal to other lecture hallsso that more people can watch. Writing that signal to a tape is simple once the TVcameras are already set up.

Ideally, station a video camera directly over each contest table. This aords thebest view, free from obstruction. In addition, at least one video camera per contesttable, slightly above the level of the table, set to see the whole table, gives the\audience" view, and can show more detail to a robot's movements.

Video cameras require brighter lights than normal ambient lighting may provide.More than likely, these extra lights will ood the contest table with unwanted light(from a robot's point of view) and cause it to react dierently than it did in the lab.Lighting conditions on contest night should be as close as possible to the lightingconditions in the lab. For the same reason, ash photography is not allowed beforeor during a contest, as it can aect the light sensors on a robot.

Video cameras and other auto-focus cameras may also emit 40kHz infra-red light.Since 6.270 robots depend on 40kHz IR for location information, these cameras mayinterfere with the performance of some robots. This is to be avoided as well. For thisreason, no auto-focus cameras are allowed near the stage while a competition is inprogress.

Raw video footage takes quite a while to edit, and for best results should be leftin the hands of professionals if you wish to have a professional-looking product in theend.

1.9 Class Registration and Lottery

For the past three years, the 6.270 contest has been oversubscribed. Unfortunately,resources do not currently permit us to have more than 50 teams enter the contest.Given that we also limit team size to three people unless under exceptional circum-stances, that means only 150 students can participate each year. When 300 or more

Page 35: Ma - cs.uml.edu

1.9. CLASS REGISTRATION AND LOTTERY 23

students apply for those spots, we need some way to decide who may enter, andwho may not. As much as we would like to let everyone participate that wants, itnancially and organizationally isn't possible.

As a rule, we have not given immediate entry into the contest to anyone, regardlessof his/her major or their year. We have given additional weight in the lottery tostudents who have been lotteried out in previous years, but still no guarantee ofadmission.

Students register for the class by rst reading the course information, and thensubmitting either a paper form or through a newly-created on-line registration pro-gram. A deadline of early October is required for the registration. This will allowstudents plenty of time to make travel arrangements for the winter holidays.

Page 36: Ma - cs.uml.edu

24 CHAPTER 1. THE 6.270 ORGANIZERS' MANUAL

Page 37: Ma - cs.uml.edu

Chapter 2

Assembly Manual

This chapter presents an introduction to electronic assembly followed by step-by-stepinstructions for assembling the 6.270 hardware. The instructions assume no priorbackground in electronics. The order of the assembly should help you get into thesoldering mode, and will give you practice at soldering some of the bulky items beforesoldering the delicate devices.

This chapter was revised by Matt Domsch '94 in his \Advanced UndergraduateProject" to correct inaccuracies and simplify some assembly steps.

Instructions are provided for the following boards and devices:

Battery Packs

Battery Charger Board

Motor Switching Board

Expansion Board

Microprocessor Board

Infrared Transmitter Board

Sensor Assemblies

Motor Assemblies

If your team has more than one soldering iron, you can assemble some of theboards in parallel.

The reasons for having the teams build the boards are two fold. First it gives youan opportunity to learn about the components and how to solder. The second reasonis to get you familiar with the boards and how they operate. As you read throughthe assembly sections, a brief description of the functionality will be given so thatyou become familiar with the system.

25

Page 38: Ma - cs.uml.edu

26 CHAPTER 2. ASSEMBLY MANUAL

2.1 The Battery System

The 6.270 Robot Controller system has two battery power supplies. The rst is thefour AA alkaline cells that snap into the holder that is attached to the MicroprocessorBoard. These are used to run the microprocessor and some sensors. They are alsoused to keep the program and data in the RAM when the board is switched o.

These batteries should power the microprocessor board for about thirty hours ofoperation before needing to be replaced. The board should not be left on inadvertentlybecause the batteries will be drained. When the board is o, you should not removethe AA batteries, or else the RAM will be erased. These batteries will last longer ifthe motor batteries are also plugged into the board.

The second set of batteries plug into the motor power jack. The reason for havinga separate battery for the motors is to provide isolation between the two supplies.When a motor turns on or reverses direction, it draws a huge surge of current. Thiscauses uctuations in the battery voltage. For motors, this is not a problem, but itcould cause a microprocessor circuit to fail. For this reason, separate batteries areused for the motors and the microprocessor.

The motor battery is a bank of three Gates 2 volt lead-acid cells wired in series,yielding a 6 volt supply. Each cell is rated for 2.5 ampere-hours of operation.

These lead-acid cells are extremely powerful devices. Car batteries are constructedof similar lead-acid technology. These batteries can be used to start a motorcycle,or maybe even a car. When handling the batteries, be extremely careful not to shortthe (+) an () terminals of the battery together. A huge surge of current will ow,melting the wire and causing burns. In extreme cases, batteries can explode and causeserious injury. These batteries however, have been reinforced very well and shouldnot explode, but will burn you if they are shorted.

The Gates cells were donated to 6.270 by Gates Energy Products, Inc.

The following instructions explain how to build the battery recharger and howto wire the Gates cells into power-packs. Note that contest rules prohibit usingthe Gates cells in any conguration other than what is presented here. This meansthat you cannot alter the electrical conguration, but you can modify the physicalconguration. You can also use the battery casings that were donated by GatesBatteries to hold your batteries. It is important that you take care in assemblingthe battery packs because the batteries are charged in their initial state. You shouldassemble the batteries rst so that there are no inadvertent shorts that can cause thebatteries to overheat.

2.1.1 Battery Pack Construction

Before beginning assembly, make sure to have a well-lighted, well-ventilatedworkspace.Make sure that all of the electronic assembly tools are available.

Page 39: Ma - cs.uml.edu

2.1. THE BATTERY SYSTEM 27

The 6.270 kit includes 6 Gates cells, enough to make two battery packs. It isrecommended that contest robots be designed in a fashion that facilitates batterypack swapping. One battery pack can be used to operate the robot while the other isbeing charged (charging takes about 10 hours). There are reasons for which you maywant your design to have batteries in dierent locations.

Rectangular Configuration Triangular Configuration

LEGO Configuration

Figure 2.1: Three Battery Pack Congurations

Two obvious alternatives for battery pack construction are depicted in Figure 2.1:a rectangular conguration and a triangular one. Another possibility is a LEGOconguration shown in Figure 2.1 which can be mounted on a 6x8 LEGO plate.Other congurations may be explored.

Wiring the Battery Cable

Figure 2.2 illustrates how to wire the battery plug and cable assembly.

Cut a 12" to 16" length of the black/red twisted pair cable for use in makingthe battery cable. Strip and tin the wire ends.

1

16

00

Heat shrink tubing is used on the shorter terminal of the DC power plug.The tubing acts as an insulator to minimize the likelihood of an electrical short

Page 40: Ma - cs.uml.edu

28 CHAPTER 2. ASSEMBLY MANUAL

Barrel is positive (+)

Tip is negative (-)

Heat-shrink tubing

RED WIRE

BLACK WIRE

DC Power Plug Plug Cover

‘‘Use 12 to 16 inches of wire’’

Figure 2.2: Battery Plug and Cable Wiring Diagram

at the plug terminals. It is essential that this wiring be performed carefullybecause a short in the power plug will short out the battery terminals and createa serious hazard.

Proper polarity is important. The use of red wire to signify the (+) terminaland black wire to signify the () terminal is an international standard. Mountthe black wire to the short terminal and the red wire to the long terminal.

After soldering, slide the heat shrink tubing down over the short terminal andshrink it. Also, crimp the prongs of long terminal onto the red wire as a stressrelief.

Screw the plug cover onto the plug.

Before installing the cable onto a battery pack, use an ohmmeter to make abso-lutely sure that the cable is not shorted. The cable should measure open circuitor innite resistance. If a short is placed across the terminals of lead-acid bat-teries (like the Gates cells), a huge surge of current will ow, melting the wirecausing the short and possibly causing the battery to explode.

Constructing the Battery Pack

Wire the 3-cell pack to the battery cable as indicated in Figure 2.3. Use the red andblack wire to make the two jumpers between the cells (color of these jumpers doesnot matter). Make sure to get polarities correct. Incorrect wiring will cause the wireto get hot and catch on re.

After the battery pack is wired, an overall conguration (as suggested in Figure 2.1can be selected. The battery pack may be held in the desired conguration using avariety of materials, including rubber bands, cable ties, hot glue, and/or electrical

Page 41: Ma - cs.uml.edu

2.1. THE BATTERY SYSTEM 29

+ -+ -+ -

Gates

‘‘Cy

clon’

’ D ce

ll

Gates

‘‘Cy

clon’

’ D ce

ll

Gates

‘‘Cy

clon’

’ D ce

llRE

D W

IRE BLACK WIRE

Figure 2.3: Battery Pack Wiring Diagram

tape. The terminal of the batteries can be bent and hot glued so they do not inad-vertently get shorted. Do not put too much hot glue, or else the battery will not beable to breathe. There must be a pathway for the gases in the battery to escape orelse too much pressure builds up in the casing and may cause an explosion.

2.1.2 The Battery Charger

The battery charger can charge two 6 volt battery packs simultaneously. Each packcan be charged at either of two rates:

Normal charge. Marked Slow on the charger board, this is the normal chargeposition. A battery pack will recharge completely in about ten to fourteenhours. When the batteries become slightly warm they are fully charged. In thisconguration, the power is supplied to the battery through the larger valuedresistor (15). The batteries are charged with a constant current of about 400milliamps.

When operating in normal mode, a green LED will be lit to indicate propercharging. In this mode, it is safe to leave batteries on charge for periods of upto 24 hours without causing damage.

Page 42: Ma - cs.uml.edu

30 CHAPTER 2. ASSEMBLY MANUAL

Fast charge. Marked Fast on the charger board, this position will rechargea battery pack in ve to seven hours. The batteries are being charged at aconstant current of about 800 milliamps.

Batteries being charged in fast mode should be monitored closely; as soon asthe pack becomes warm to the touch, the batteries are completely charged andshould be removed from the charger.

Is is better to charge the batteries at the slower rate if possible. When highcurrents are being passed through the batteries, they tend to heat up. Thebatteries do not accept charge very well at higher temperatures.

Permanent damage to the battery pack can occur if left on fast charge for morethan ten hours. Needless to say, this mode should be used with care.

Assembly Instructions

All of the 6.270 boards have component placements silkscreened directly onto theboard. In addition, diagrams in these instructions will provide copies of the diagramsprinted on the boards, often at better resolution. Refer to the printed diagrams asoften as necessary to be sure that components are being placed correctly.

The instruction checklist may be marked o as each step is completed.

Figure 2.4: Battery Charger Component Placement

Figure 2.4 shows component placement on the battery charger board.

Page 43: Ma - cs.uml.edu

2.1. THE BATTERY SYSTEM 31

12 Get the battery charger board and determinewhich is the componentside. The component side is marked with the placement guidelines in white.You should always solder on the solder side of the board, which does not havewhite writing.

Please make sure that the components are mounted on the proper side of theboard! It would be a terrible mistake to mount everything upside down.

22 Resistor Pack.

Install RP7, 1.2k4, 8 pins, Blue single in-line pin. The board is labelledfor 1k; this marking is incorrect. This resistor pack consists of four isolatedresistors so orientation is not signicant.

32 LEDs.

These LEDs are the LEDs which are in bin with a yellow LED. There is anothercompartment with just red LEDs do not mix these two up. The red LEDs inthe upper right hand compartment are not low power LEDs. You need to usethe low powered LEDs in this section.Mount LEDs so that the short lead isinserted in the shaded half of the placement marking. Make sure to push theLEDs all the way through and mount them as close to the board as possible.

LED19red

LED20red

LED21green

LED22green

42 DC Power Jacks.

Install J3 and J4, DC power jacks. When soldering, use ample amounts ofsolder to ll the mounting holes completely.

52 Power Resistors.

R187.5, 5 watts. This resistor is marked by a big white square outlineon the component side.

R197.5, 5 watts. This resistor is marked by a big white square outlineon the component side.

R2015, 2 watts, brown, green, black

R2115, 2 watts, brown, green, black

62 Slide Switches.

Page 44: Ma - cs.uml.edu

32 CHAPTER 2. ASSEMBLY MANUAL

SW6miniature SPDT slide switch

SW7miniature SPDT slide switch

72 Bridge Rectier.

Install BR1, rectangular bridge rectier. Observe polarity: make sure (+)symbol on bridge rectier is inserted into hole marked (+) on circuit board.

82 Power Cord.

Get large DC power adapter. Clip o any connectors on the DC side of theadapter. Measure the voltage across the wires and make sure that the voltage isabove 12VDC when the adapter is plugged into the wall. Strip 1

4" of insulation

from power wires. Insert stripped wires into holes marked power input fromcomponent side of board; solder from solder side.

The polarity of the power connection is not signicant.

92 Check Out

You can test the battery charger in the lab using a voltmeter. Plug the chargerinto the wall socket and measure the voltage between positive and negative ofthe bridge rectier. Make sure that the polarity is correct. Plug the batterypack into each of the jacks, and make sure the red LED is on when the switchis on FAST and the green LED is on when the switch is on SLOW. You shouldcheck it out with a TA if you are unsure.

102 After Checkout.

After the battery charger is checked in lab, add a glob of hot glue as a strainrelief at the base of the power input connection.

2.2 The Motor Switch Board

The Motor Switch Board allows manual control of up to four motors. This is usefulwhen testing and debugging mechanisms because the motors can be switched onforward, backward, and o easily.

It is important to realize that the amount of power delivered to the motors bythe Motor Switch Board will be dierent than the amount delivered when the motorsare driven by the electronics on the Microprocessor Board. The Motor Switch Boardhas diode circuitry to simulate the power loss of the Microprocessor Board's controlelectronics, but there will still be a dierence.

Motors driven from the Expansion Board will operate at even less power thanthose driven by the Microprocessor Board. The motors are driven through a diode

Page 45: Ma - cs.uml.edu

2.2. THE MOTOR SWITCH BOARD 33

which provides a .6 volt drop, but the motor drivers may drop up to 1.2 volts andreduce your motor output.

The careful designer will test mechanisms both from the Switch Board and fromthe Microprocessor Board before committing to them.

The simplicity of the Motor Switch Board will give the inexperienced solderer anopportunity to get some practice before committing to the bigger boards. A secondmember in the group should begin to assemble a motor to test the Motor SwitchBoard.

2.2.1 Assembly Instructions

Figure 2.5: Motor Switch Board Component Placement

Figure 2.5 provides a reference to parts mounting on the Motor Switch Board.

12 Get Motor Switch Board, and determinewhich side is the componentside. The component side is marked with the parts placement layout.

22 Diodes.

These diodes have black epoxy bodies. Polarity matters: Install the diodes withthe banded end as marked on the circuit board. These diodes can be mountedin the horizontal position.

D71N4001

D81N4001

D91N4001

D101N4001

32 DC Power Jack

Install J5, a DC power jack. Fill mounting holes completely with solder whensoldering.

Page 46: Ma - cs.uml.edu

34 CHAPTER 2. ASSEMBLY MANUAL

42 Switches.

SW82 pole, 3 position slide switch

SW92 pole, 3 position slide switch

SW102 pole, 3 position slide switch

SW112 pole, 3 position slide switch

52 Female Socket Headers.

To cut socket headers to length, repeatedly score between two pins using anexacto knife. Score on both sides of one division and then snap or cut the stripcarefully with the diagonal cutters in two. Do not try to snap header piecesbefore they have been suciently scored, or they will break, destroying one orboth of the end pieces in question. These are often dicult to cut without somepast experience, so don't hesitate to ask a TA if you have any trouble. You onlyhave a limited number of the female header so do not waste them because theyare very expensive and we do not have too many extra.

Cut four 3-long pieces of female socket header. Mount in remaining holes onboard where marked.

2.3 The Expansion Board

The 6.270 Expansion Board plugs on top of the 6.270 Microprocessor Board, usingthe Expansion Bus connector. The Expansion Board adds the following capabilities:

analog multiplexers to provide up to eight times more analog inputs;

four DIP conguration switches;

a user-adjustable \frob knob" for analog input;

drivers for two additional motors;

drivers for two LED/lamp circuits;

a general purpose prototyping construction area.

Figure 2.6 is a component placement guide for the Expansion Board.Assembling the expansion board is the next step before taking on the task of

soldering the microprocessor board. It is important that good soldering technique bedeveloped before moving on to the microprocessor board.

Page 47: Ma - cs.uml.edu

2.3. THE EXPANSION BOARD 35

Figure 2.6: Expansion Board Component Placement

2.3.1 Assembling the Expansion Board

12 Get the 6.270 expansion board, and determine which is the compo-nent side.

The side that has white component markings is the component side. The reverseis the solder side.

22 Check for Power-Ground shorts. Before placing any components, take amultimeter and test for a short between power and ground. Power and groundcan be found on the prototype area as marked on the white silkscreen. Theresistance between power and ground should be innite. If a resistance of 0ohms is found, replace the board.

32 Resistor Pack.

These resistor pack are all polarized resistor packs where the common terminalend is marked with a band. On the 6.270 board, nd a square metal pad at oneend of the area that each resistor pack will mount. Insert the resistor pack suchthat the marked end mounts in the shaded hole.

The \caddy-cornering" technique of soldering the two end terminals rst ishelpful here. Solder one end of the terminals before soldering the remaining

Page 48: Ma - cs.uml.edu

36 CHAPTER 2. ASSEMBLY MANUAL

pins. Adjust the component such that it is straight and the pins are orientedproperly, and then solder the other end of the resistor pack. After the resistorpack is straight and aligned, solder the middle pins. This will allow you to alignthe resistor pack and make it straight before all the pins are fastened.

RP5, 47k9, 10 pins, polarized, marked \E47K." The marked end ofthe resistor pack goes through the shaded square hole.

RP6, 47k7, 8 pins, polarized, marked \E47K." Mount on the com-ponent side so that the marked end of the resistor pack goes through theshaded square hole.

RP5 and RP6 are pull up resistors for the analog inputs. These are usedso that the inputs to the analog ports don't oat. They are also used aspart of a resistor divider in some of the sensors used.

RP7, 1k7, 8 pins, polarized, marked \E1K." Mount so that markedend of resistor pack goes in square hole on board.

42 IC Sockets.

Mount the DIP sockets such that the notch in the socket lines up with the notchmarking in the rectangular outline printed on the PC board. \DIP4" meansthe DIP socked for integrated circuit U4.

The caddy-cornering technique should help here too. After inserting a DIP intothe board, solder its two opposite-corner pins rst. This will hold the chip inplace. Make sure it is pressed down as far as it can go; then solder the otherpins. You may need to apply heat to the corner pins to press the socket downif it is not ush with the board.

DIP2116 pins. The socket used for this DIP is dierent from the othersockets. The pins are more rounded, and the sockets are circular holes.The other sockets have more rectangular socket holes. These are goldplated sockets and are used for a better conduction pathway to the motoroutputs.

DIP1720 pins

DIP1816 pins

DIP1916 pins

DIP2016 pins

52 LEDs.

These LEDs are low powered LEDs. Install LEDs so that the short lead mountsin the shaded half of the placement marking. Be careful to get polarity correct.

Page 49: Ma - cs.uml.edu

2.3. THE EXPANSION BOARD 37

LED13red, indicates motor 4 in reverse direction.

LED14green, indicates motor 4 in forward direction.

LED15red, indicates motor 5 in reverse direction.

LED16green, indicates motor 5 in forward direction.

LED17red, indicates LED out 1 is on.

LED18red, indicates LED out 0 is on.

62 Trimpot.

Install VR2, 50k, this is the FROB KNOB. The three pins of the potentiome-ter are polarized. They should look like they form a triangle. The triangleshould correspond to the triangle of pins on the board.

72 Resistors.

These resistors must be mounted in the upright position due to the tight spacing.

R16, 2.2k, red, red, red.

R17, 2.2k, red, red, red.

82 Capacitors.

C160.1F, non-polarized

C170.1F, non-polarized

C180.1F, non-polarized

C190.1F, non-polarized

92 Male Header Pins.

The following steps deal with the interface pins which protrude from the Ex-pansion Board to the Microprocessor Board.

When mounting these pins, insert upward from the underside of the board sothat the maximal pin lengths protrude downward (see Figure 2.7). These pinsare then soldered from the top, component side of the board.

Be careful to make sure the pins are mounted perfectly normal to the surface ofthe Expansion Board, as there are quite a few pins that must all mate properlywith the Microprocessor Board.

For the following instructions, refer to Figure 2.8 for pin placement.

Motor Battery Pinsa 2-long strip.

Page 50: Ma - cs.uml.edu

38 CHAPTER 2. ASSEMBLY MANUAL

TOP OF BOARD (Component Side)

Insert male header pinsfrom underside of board;SOLDER from top of board.

Figure 2.7: Mounting Method for Male Header Pins

Figure 2.8: Expansion Board Male Header Pin Placement

Page 51: Ma - cs.uml.edu

2.3. THE EXPANSION BOARD 39

Port D Connectora 5-long strip

Analog Port Connectora 4-long strip

Expansion Bus Connectorone 14-long and one 8-long strip

102 Transistors.

Install transistors Q2 and Q3 (type MPS2222A) where indicated on the Ex-pansion Board. The transistors mount so that their at edge is above the atedge of the placement marking.

These transistors look identical to the DS1233 Econo Reset chip. Be sure youhave the MPS2222A transistors and not the DS1233, or your board will notwork.

112 C15220F, polarized. Be sure to mount with correct polarity.

Leave some spacing between the board and the capacitor so the capacitor canbe bent over. Before soldering the capacitor bend it sideways so it points to theleft side of the board, and then solder.

122 Female socket headers.

Figure 2.9: Expansion Board Female Header Mounting

Refer to Figure 2.9 to be sure of placement of these parts.

Page 52: Ma - cs.uml.edu

40 CHAPTER 2. ASSEMBLY MANUAL

When mounting the sockets, pay attention to how well they are lining up verti-cally. Sometimes reversing the way a strip is mounted will help its connectionsto line up better with the others. It may be helpful to insert a strip of maleheader (so that the male header connects all three strips, perpendicular to thelength of the female strips) into the socket to hold them at proper horizontaland vertical placement before soldering.

Cut three 16-long strips. Before installing the Female header, make surethat the resistor packs RP5 and RP6 are correctly installed. Once thefemale header is in place, it is nearly impossible to replace the resistorpacks. Install the Analog Input Port. A male header strip can be usedat each end to align the vertical and horizontal placement of the femaleheader. Solder.

Cut one 14-long strip. Install the LCD Connector. Note: The correctposition for this header is not the location marked LCD CONNECTOR

on the board. The correct position is indicated properly in Figure 2.9, atthe top edge of the board.

Cut six 2-long strips. InstallMotor Connectors and LED Driver Con-nectors.

132 DIP Switches.

Install SW5, 4-position DIP switch. Install so that numbers are on the outsideedge of the board.

2.3.2 Testing the Expansion Board

As with the Microprocessor Board, run through the following checklist before mount-ing the chips into the Expansion Board.

12 Check the solder side of the board for proper solder connections. Specically:look for solder bridges and cold solder joints.

22 Check continuity (resistance) between power and ground of the board. Powerand ground can be located in the prototyping area.

Resistance should increase as the board capacitor charges. There should be areading of between one and ten kilo-ohms. If there is a reading of zero ohms,or near zero ohms, the board has a power short. Do not proceed with testinguntil this is corrected.

32 Install ICs in the board, observing correct polarity:

Page 53: Ma - cs.uml.edu

2.4. THE LCD DISPLAY 41

U1774HC374. This is the output latch used for controlling motor 4 and5, and the two LED outputs. There are two additional outputs that canbe jumpered to.

U1874HC4051. This is the analog muliplexer that controls analog out-puts 20-27. It feeds the signal to analog 9.

U1974HC4051. This is the analog multiplexer that controls analog out-puts 12-19. It feed the signal to analog 8.

U2074HC4051. This is the analog muliplexer that contols the Frob Knob,the DIP switches, and analog 33-35. It feeds the signal to analog 10.

U21L293D. Slide gold heat sink onto chip before installing in socket. Thediagram for the mounting is shown in gure 2.10. The gold heat sink slidesright onto the chip.

Slide-on Heatsink

L293D

Figure 2.10: Motor Chip Stacking Technique

2.4 The LCD Display

The LCD display provided in this year's 6.270 kit can display two rows of 16 char-acters. The system software makes it easy to write code that prints messages to thisdisplay, for status, debugging, or entertainment purposes.

The display needs to have a 14-pin male header soldered to its interface. Fig-ure 2.11 shows how these pins should be installed, in a similar fashion to the pinsprotruding from the Expansion Board.

Cut a 14-long male header strip and mount and solder to the LCD as indicatedin the gure.

Page 54: Ma - cs.uml.edu

42 CHAPTER 2. ASSEMBLY MANUAL

TOP OF LCD (Display Side)

Insert male header pins fromunderside of LCD board;SOLDER from top of LCD.

Figure 2.11: LCD Connector Mounting

2.5 The Microprocessor Board

The 6.270 Microprocessor Board is the brains and brawn of the 6.270 Robot Controllersystem. It uses a Motorola 6811 microprocessor equipped with 32K of non-volatilememory. It has outputs to drive four motors, inputs for a variety of sensors, a serialcommunications port for downloading programs and user interaction, and a host ofother features.

2.5.1 Assembling the Microprocessor Board

Figure 2.12 illustrates the component placement on the microprocessor board.In addition to checking o the boxes and circles after completion of a component,

it may be helpful to ll in the component location in Figure 2.12.The component numbering for parts on the microprocessor board increments in

a counter-clockwise fashion around the board for resistors, capacitors, and resistorpacks.

12 Get the 6.270 Microprocessor Board, and determine which is the\component side." The Microprocessor Board is the largest of the 6.270boards.

The side of the board that has been printed with component markings is the\component side." This means that components are mounted by inserting themdown from the printed side; then they are soldered on the obverse, the unprintedside.

Please make sure that the components are mounted on the proper side of theboard! It would be a terrible mistake to mount everything upside down.

22 Check for Power-Ground shorts. Before placing any components, take amultimeter and test for a short between power and ground. Power and groundcan be found on the LCD connector ports at the top of the board as marked

Page 55: Ma - cs.uml.edu

2.5. THE MICROPROCESSOR BOARD 43

Figure 2.12: 6.270 Microprocessor Board Component Placement

on the white silkscreen. The resistance between power and ground should beinnite. If a resistance of 0 ohms is found, replace the board.

32 Flat Resistors

Begin by installing the resistors that lie at along the board. Try to get thebody of the resistor very close to the board.

42 R147k, yellow, violet, orange, at mounting, lower right corner.

52 R112.2M, red, red, green, at mounting, next to oscillator.

62 R1247k, yellow, violet, orange, at mounting, top left corner under SW3.

72 R1347k, yellow, violet, orange, at mounting, top left corner under SW4.

82 Non-polarized Capacitors.

Next install the non-polarized capacitors. These are the smallest componentson the board. After installing, solder and clip leads close to the board.

C34700 pF, marked \472.", above U8.

C40.1 F, marked \104.", right edge next to U7.

Page 56: Ma - cs.uml.edu

44 CHAPTER 2. ASSEMBLY MANUAL

C60.1 F, marked \104.", above SW2.

C70.1 F, marked \104.", top right corner above U9.

C80.1 F, marked \104.", between U9 and U2.

C100.1 F, marked \104.", just above 6811.

C120.1 F, marked \104.", left of U2.

92 Resistor Packs.

Most of the resistor packs are polarized: the common terminal end is markedwith a dot or band. On the 6.270 board, nd a square metal pad at one endof the area that each resistor pack will mount. Insert the resistor pack suchthat the marked end mounts in the square hole. (The square hole is more easilydiscernible on the unprinted solder side of the board.)

The \caddy-cornering" technique of soldering the two end terminals rst ishelpful here. Solder the two ends of the terminals before soldering the middlepins. This will allow you to align the resistor pack and make it straight beforeall the pins are fastened.

RP147k9, 10 pins, polarized, marked \E47K.", located at the bot-tom of the board.

RP247k5, 6 pins, polarized,marked \E47K.", located at the bottomof the board. You must cut o one pin which is the farthest from themarked end before mounting the component.

RP1 and RP2 are pull-up resistors for the digital inputs and the analoginputs. Only the analog 10 and 11 pull-up resistors are connected. Sinceanalog 8 and 9 are multiplexed inputs, a pull-up resistor is connectedto each of the multiplexed inputs. If you use the analogs without theexpansion board, you must jumper the pull-ups to analog 8 and 9.

RP31k3, 6 pins, non-polarized, marked \V1K," top right corner.

RP41k5, 6 pins, polarized, marked \E1K," bottom left corner.

102 IC Sockets.

Mount the DIP sockets such that the notch in the socket lines up with the notchmarking in the rectangular outline printed on the PC board. \DIP4" meansthe DIP socket for integrated circuit U4.

The caddy-cornering technique should help here too. After inserting a DIP intothe board, solder its two opposite-corner pins rst. This will hold the chip inplace. Make sure it is pressed down as far as it can go; then solder the otherpins.

Page 57: Ma - cs.uml.edu

2.5. THE MICROPROCESSOR BOARD 45

The socket used for the rst two DIPs are dierent from the other sockets. Thepins are more rounded, and the sockets are circular holes. The other socketshave more rectangular socket holes. These are gold plated sockets and are usedfor a better conduction pathway to the motor outputs.

DIP13/1416 pins. There is only one socket for these two ICs. (Use thegold plated sockets)

DIP15/1616 pins. There is only one socket for these two ICs. (Use thegold plated sockets)

DIP416 pins

DIP520 pins

DIP620 pins

DIP714 pins

DIP816 pins

DIP914 pins

DIP1016 pins

DIP1214 pins

112 Direct Mount Chip.

One chip is soldered directly to the board. Be careful not to apply too muchheat to its pins when soldering. The soldering iron should not be in contactwith any given pin for more than about eight seconds. It's okay to wait forthings to cool down and try again if problems arise.

Mount this chip such that its notch is aligned with the rectangular notch printedon the PC board.

U374HC373.

122 Ceramic Resonator.

Install XTAL1, 8 Mhz. ceramic resonator. This is a heat sensitive device andthe soldering iron should not be in contact with any given pin for more thanabout eight seconds.

132 Inductor.

Install L1, 1 uH, located below the OFF and ON markings on the board. Theinductor looks like a miniature coil of wire wound about a thin plastic core. Itis about the size of a resistor.

Page 58: Ma - cs.uml.edu

46 CHAPTER 2. ASSEMBLY MANUAL

142 28-pin Socket.

You must rst cut out the bar across the middle of the socket. Do this carefullyby scoring the bar and then cutting it with wire cutters. Install on top of U3,with the notch marking as indicated. Solder.

152 LEDs.

These LEDs draw less current than other LEDs in you kit. If you put the wrongLEDs in, your batteries will die out much faster than you expect.

LEDs must be mounted so that the short lead (the cathode) is inserted into theshaded half of the LED placement marking.

Be sure to mount LEDs properly as it is very dicult to desolder them if theyare mounted backward.

LED1red, indicates motor 0 in reverse direction.

LED2red, indicates motor 1 in reverse direction.

LED3red, indicates motor 2 in reverse direction.

LED4red, indicates motor 3 in reverse direction.

LED5red, indicates IR emitters are on.

LED6red, indicates Low Battery.

LED7green, Indicates motor 0 in forward direction.

LED8green, Indicates motor 1 in forward direction.

LED9green, Indicates motor 2 in forward direction.

LED10green, Indicates motor 3 in forward direction.

LED11green, Indicates serial receive.

LED12yellow, Indicates serial transmit, and is o when the board is indownload mode.

162 Resistors.

These resistors mount vertically: try to mount them perfectly upright, with oneend very close to the board, and the wire lead bent around tightly.

If you have trouble discerning colors, you may wish to have your teammateshandle this task. It is fairly dicult to read the color bands from 1

8watt

resistors, even to the trained eye.

R247k, yellow, violet, orange, upright mounting, above U8.

R3100k, brown, black, yellow, upright mounting, right side above U7.

Page 59: Ma - cs.uml.edu

2.5. THE MICROPROCESSOR BOARD 47

R410k, brown, black, orange, upright mounting, right side above U7.

R53.3k, orange, orange, red, upright mounting, right side of U9.

R62.2k, red, red, red, upright mounting, top right corner.

R947k, yellow, violet, orange, upright mounting, above 6811.

R1047k, yellow, violet, orange, upright mounting, above 6811.

R144.7k, yellow, violet, red, upright mounting, center underneath IRout. Mislabeled \5k" on silkscreen.

R151k, brown, black, red, upright mounting, under R14.

172 Polarized Capacitors.

All of these capacitors are polarized. Make sure that the lead marked (+) onthe capacitor goes into the hole that is marked (+). Some of the tantalumcapacitors are not marked. If the capacitor leads are not marked (+) or (),the lead marked with a dot or bar is the (+) lead. Be careful. The electrolyticcapacitors have a bar with a minus sign in them, and these are the negativeterminals.

C110 F Tantalum, right side of U8.

C210 F Tantalum, above U8.

C547 F Electrolytic, above U7. Fold capacitor at to the board beforesoldering.

C94.7 F Tantalum, above 6811.

C13470 F Electrolytic. Fold capacitor at to the board before soldering.You will need to extend the capacitor into the space next to the oscillator.This is a tight squeeze between the oscillator and the IC sockets.

182 Diodes.

Diodes are polarized. Mount them such that the lead nearer the banded endgoes into the square hole on the circuit board.

D11N4001, right of SW1. This diode has a black epoxy body and fairlythick leads.

D21N4148, left of SW2. This is a glass-body diode.

D31N4148, under U2.

D41N4148, next to U9.

D51N4148, next to U9.

Page 60: Ma - cs.uml.edu

48 CHAPTER 2. ASSEMBLY MANUAL

Figure 2.13: 6.270 Microprocessor Board Header Placement

Page 61: Ma - cs.uml.edu

2.5. THE MICROPROCESSOR BOARD 49

D61N4148, next to U9.

192 Female Socket Headers.

To cut socket headers to length, repeatedly score between two pins using theutility knife. Score on both sides of one division and then snap the strip in two.Do not try to snap header pieces before they have been suciently scored, orthey will break, destroying one or both of the end pieces in question.

When mounting the sockets, pay attention to how well they are lining up verti-cally. Sometimes reversing the way a strip is mounted will help its connectionsto line up better with the others. It may be helpful to insert a strip of maleheader into the socket to hold them at proper horizontal and vertical placementbefore soldering.

Refer to Figure 2.13 for placement of these parts.

Cut three 8-long strips, Install the Digital Input connector block. Beforeplacing these header, make sure that RP1 is properly aligned. Once thefemale header is in place, removal of RP1 is nearly impossible, You maywish to solder all three strips simultaneously. The male pins can be putacross the three strips at each end to make sure the female strips arealigned properly. Solder.

Cut three 5-long strips. Install the Port D I/O connector block. Youmay wish to solder all three strips simultaneously. The male pins can beput across the three strips at each end to make sure the female strips arealigned properly. Solder.

Use three 4-long strips. Install the Analog Input connector block. Beforeplacing these header, make sure that RP2 is properly aligned. Once thefemale header is in place, removal of RP2 is nearly impossible, You maywish to solder all three strips simultaneously. The male pins can be putacross the three strips at each end to make sure the female strips arealigned properly. Solder.

Cut one 12-long strip. Install the Motor Output connectors. Solder.

Cut one 8-long and one 14-long strip. Install the Expansion Bus con-nector. Solder.

Cut three 7-long strips. Install the Motor Power connector. Solder.

Cut one 2-long strip. Install the Expansion power connectors. Solder.

202 PLCC Socket

Install PLCC1, 52-pin square socket for the 6811. The Pin 1 marking is in-dicated by the numeral \1" and an arrow in the socket; this marking mounts

Page 62: Ma - cs.uml.edu

50 CHAPTER 2. ASSEMBLY MANUAL

nearest to U2, the 32K RAM chip. There should be a beveled notch in theupper-left corner of the chip and the outline printed on the board, with respectto the pin 1 marking. Be absolutely sure to mount this socket correctly; thesocket is polarized and will only let you mount the chip into it one way. Solder.

212 Switches.

SW1DPDT slide switch

SW2large red pushbutton switch

SW3miniature pushbutton switch. The switch is polarized and will tsnugly in one direction and not the other. Do not bend the leads too much,or force the switch in.

SW4miniature pushbutton switch. The switch is polarized and will tsnugly in one direction and not the other. Do not bend the leads too much,or force the switch in.

222 Trimpot.

Install VR1, 50k.

232 U11. Reset Power Regulator DS1233

This component looks like a transitor and is located with the expansion boardIC's in your parts bin. DS1233 goes here with the rounded part towards thePLCC socket, as shown on the silk screen on the board.

This part looks a lot like the MPS2222A transistors. Be sure you install theDS1233 here, or your board will not work.

242 Transistor

Install TIP120 such that the metal backing is facing the expansion port powerconnector and the plastic is facing the DC power jack. This is a tight squeeze.Fold the transistor to the left so it lies at above the inductor (L1). It isimportant that the heat sink on the transistor does not touch the edge of theExpansion Board.

252 Piggy-Backing the L293 Chips.

Motor driver chips U13/14 (L293D plus L293B) and U15/16 (L293D plusL293B) will be piggy-backed and soldered together before installing in theirsocket.

The instructions will be given for one pair and can be repeated for the secondpair. Make sure that each pair consists of one L293D and one L293B chip!

Page 63: Ma - cs.uml.edu

2.5. THE MICROPROCESSOR BOARD 51

Slide-on Heatsink

L293B

L293D

Solder is applied toeach pin of the two chips.

Figure 2.14: Motor Chip Stacking Technique

Begin by sliding the gold-colored heat sink over an L293B chip. Then, pressthis assembly onto an L293D chip, as indicated in Figure 2.14. Make sure thatthe two chips have their notches lined up. Also, be sure to remember wherewhich way the notches face, as they may be obscured.

Finish by soldering the two chips together, pin by pin. Try to have them pressedtogether as close as is possible, so that both press rmly against the heat sink.Be careful not to apply too much heat to the IC. Soldering the opposite cornerswill help secure the ICs in place and will make soldering the remaining pinseasier.

Repeat for the other pair of motor driver chips.

By piggy-backing the two chips, there is a parallel circuit for the motor currentto ow through, so the amount of current that can be delivered to the motor isalmost doubled to about 1.2 Amps.

262 Power Jack.

Install J1, DC power jack. When soldering, use ample amounts of solder sothat solder completely lls mounting pads.

272 Phone Jack.

Install J2, modular phone jack. The phone jack is polarized, and should paceoutward.

282 Piezo Beeper.

Page 64: Ma - cs.uml.edu

52 CHAPTER 2. ASSEMBLY MANUAL

Mount the piezo beeper so that it is centered on circular outline. Polarity doesnot matter.

292 Battery pack.

Clip connector on the battery pack and about 1/2" of length o batterypack leads.

From bottom of board, insert leads for battery pack. Note polarization:black lead goes in hole marked (), red lead in hole marked (+). Solderfrom top of board and clip leads.

2.5.2 Testing the Microprocessor Board

This section explains a few simple tests to be performed before installing the ICs inthe sockets.

Full board testing and debugging will be handled in the laboratory.

12 Check the solder side of the board for proper solder connections. Specically:look for solder bridges and cold solder joints.

Solder bridging is when a piece of solder \bridges" across to adjacent terminalsthat should not be connected.

Cold solder joints are recognized by their dull luster. A cold solder joint typicallymakes a aky electrical connection. Make sure that all of the solder joints areshiny with a silver color.

Make sure that joints do not have too much solder.

22 Check continuity (resistance) between power and ground of your board. Powermay be obtained from the cathode of D1 and ground from the black lead of thebattery pack.

Resistance should increase as the board capacitor charges. The board resistanceshould measure greater than 0. If a reading of zero ohms is observed, the boardprobably has a power to ground short. Do not proceed with testing until this iscorrected.

32 Insert 4 AA batteries into battery holder.

42 Turn on board power switch.

52 Examine the yellow LED: it should be glowing slightly. If not, turn o boardpower immediately. Check for power short.

Page 65: Ma - cs.uml.edu

2.5. THE MICROPROCESSOR BOARD 53

62 Measure board voltage (as above with continuity check). You should haveapproximately 5.5 volts.

72 Install ICs in the board. Be careful not to damage the component leads wheninstalling the chips into their sockets! Make sure to get the orientation correct|refer to Figure 2.12 if necessary. Remove the 4AA batteries before installingthe ICs.

U168HC11A0 microprocessor. The brains of the board. A 68HC11A1microprocessor may be substituted.

U262256LP 32K static RAM where the memory is stored.

U374HC373 (already soldered to board). This is the latch that is usedto access the memory locations.

U474HC138. This is the address decoder for memory mapping input andoutput latches

U574HC273. This is the output latch to the motors 1-4. Upon powerup, the latch is cleared so all the motors are turned o when the board isturned on.

U674HC244. This is the tristate input latch which drives the bus forreading the digital inputs.

U774HC132. Schmitt trigger used for the serial communications with thedownloading machine.

U874HC4053. Used to switch the RS232 TxD.

U974HC10. 3-input NAND used in the low-battery indicator.

U1074HC390. Dual decade counter that divides the 2MHz clock to a40kHz signal used in the IR emitters.

U1274HC04. An inverter through which the motor outputs to the L293are inverted. Because the L293s draws less processor current when all theinputs are high than when all the inputs are low the outputs are invertedso that when all the motors are o, all the inputs to the 293 are high.Another inverter is used to invert the signals in the IR circuitry.

U13,14L293D + L293B motor driver assembly with heatsink

U15,16L293D + L293B motor driver assembly with heatsink

2.5.3 Board Checko

You now have the components in place to check your board. Follow the instructionsto check o your board. If there are any problems along the way, check the debugchapter or nd someone to help you.

Page 66: Ma - cs.uml.edu

54 CHAPTER 2. ASSEMBLY MANUAL

12 Turn the board o, and plug in the AA batteries. You should also plug themotor batteries into the board. When the motor batteries are not plugged in,the motor chips draw power from the processor batteries, and therefore reducethe lifetime of your AA cells. To extend the lifetime of your AA cells, alwayshave your motor batteries plugged in.

22 Attach the expansion board on top of the microprocessor board. Be carefulnot to bend any pins, and make sure that all the pins go in the correct sockets.Then put the LCD on the expansion board.

32 When you turn on the board, the yellow light should be on. To get the boardinto download mode, you must turn the board o, and while holding down theescape button, turn the board on. The yellow light should icker, and then beo. If this does not happen, check the debug section under startup. When theyellow light is o, the board is in download mode.

42 When you hit the big red reset button, the yellow light should come on per-manently. If the yellow light does not come on, then check the debug sectionunder startup.

52 In order for your board to work, the pcode must be loaded into the board. Youneed to do this only when there are new revisions of the pcode and when theRAM memory has been corrupted.

There are two types of downloading. The rst download mode is the mode wherethe microprocessor load the pcode. This is done using the init bd command.When the yellow LED is o, the processor is ready to accept new assemblycode.

To download the pcode to the board you must:

Plug the serial cable into the board. The green LED should be on wheneverthe board is connected to the host computer. If the green LED is not on,check the debug section on serial problems.

Turn on the board. (SW1)

Hold down the \CHOOSE" button (SW3) while pressing the red resetbutton (SW2). Release the reset button. Watch for the yellow serialtransmit light to extinguish. Release the \CHOOSE" button. Your boardis now in pcode download mode.

You need to download the pcode to the board. The command to downloadwill be dierent, depending on the machine you are using. On the Athenaworkstations you must add 6.270 and then type init bd at the prompt.The yellow LED must be o for downloading to occur.

Page 67: Ma - cs.uml.edu

2.5. THE MICROPROCESSOR BOARD 55

You should get the following response, or something similar, when down-loading the pcode:

6811 .s19 file downloader. Version 6.1 16-Nov-91

Downloading 256 byte bootstrap (229 data)

and a bunch of dots should appear on the monitor and the yellow and greenLEDs should begin to icker. This ickering lets you know that there iscommunication between the board and the host computer. If the responseis a dierent, check the debug section, on downloading or serial problems.

Once the pcode is loaded into the board, press the reset button, and theboard should beep and on the LCD should be the message:

Interactive C

V 2.71 1/4/93

or something similar. You may need to adjust your LCD contrast to seethe messages on the LCD. Do this by turning the variable resistor VR1.

The second download mode is through IC when you download your code or theIC libraries. The yellow light must be on for this download to occur. When youpress reset, the yellow light should come on.

62 When the pcode is loaded into the board, you can use the IC program. Thiscan be done by simply typing ic at the prompt when the board is connectedto the host computer. The IC program will download several libraries to theboard.

72 The next step is to use the test program to make sure that all the outputs andinputs are working. Before you do this, you must build a simple digital sensorfor testing the input ports.

82 After you are in the IC program, you will need to load the test code into theboard. To do this, at the C> prompt type load testboard.c to load in the testcode. This program is designed to help you become familiar with the board,and where things are located.

92 The following tests will be performed:

Check Motor Outputs.

Check Digital Inputs.

Check Analog Inputs.

Check Dip Switches.

Page 68: Ma - cs.uml.edu

56 CHAPTER 2. ASSEMBLY MANUAL

Check Frob Knob.

Check LED outputs.

You can advance through the menu by using the ESC button and the CHOOSEBUTTON. To advance to the next test push the ESC button. When checkingthe analog and digital ports push the CHOOSE button to advance the portnumber.

102 You should test each of the digital and analog ports using a digital switch.The analog readings for an open switch should be around 255 since the inputsare connected to a pull up resistor. When the switch is closed, the analogreading should yield a low number below 50. The digital ports should show a 1when the switch is closed and a zero when it is opened.

2.5.4 After Board Checkout

The following nal assembly step should be done only after the board has been shownto work properly. It is dicult to debug a board once the battery pack has been boltedon.

12 Use 2 strips of double sticky tape to attach the AA battery pack to board.Make sure that the wire in the AA holder does not come in contact with any ofthe protruding leads on the underside of the board. Many problems can occuris the wire in the battery pack shorts adjacent leads on the board.

After the Microprocessor Board, the Expansion Board, and the LCD have beentested and are working, the two boards may be bolted together at three pointswith the 6-32 1

2" nylon standos and screws.

You should then bring your boards to one of the organizers or a TA to get itchecked o. The checko procedure will require that you have some knowledge of thelocation of the ports and we expect you to try out the test code before checko.

2.6 The Infrared Transmitter

The infrared (IR) transmitter board emits modulated infrared light that can be de-tected by the Sharp IR sensors (of type GP1U52). The board has infrared transmit-ting LEDs that are driven by a divide by 50 counter (the 74HC390 chip) and a powertransistor (TIP120) on the Microprocessor Board.

Each infrared LED is wired in series with a visible LED, so that if current is owingthrough the infrared LED, it must also ow through the corresponding visible LED.It should therefore be easy to determine if the IR LEDs are emitting light.

Page 69: Ma - cs.uml.edu

2.6. THE INFRARED TRANSMITTER 57

2.6.1 Assembly Instructions

Figure 2.15: Infrared Transmitter Component Placement

Figure 2.15 illustrates component placement on the infrared transmitter board. Notethat the LED numbering that was printed on the actual boards is incorrect. Thenumbering shown in the gure is correct.

12 Resistor Packs.

Both of the resistor packs are polarized. Mount so that the marked end of theresistor pack is placed into the square pad on circuit board. These resistor packsare blue, and have 6 pins, but you will need to cut o one of the pins. Do thiscarfully. Do not cut the resistor pack, just the last pin labeled with a 6.

RP8334

RP9334

22 Visible LEDs.

The visible LEDs used on the infrared transmitter board have red lenses. Theyshould look similar to the low powered LEDs. These will be in the parts bin inthe upper right hand bin. Be sure to use this variety of LED here. These LEDscan handle more current than the LEDs that have been used in other circuitry.The LEDs will glow red when powered.

Mount LEDs so that the short lead is inserted in the shaded half of the place-ment marking.

LED23red lens, red element

LED24red lens, red element

LED25red lens, red element

LED26red lens, red element

LED27red lens, red element

Page 70: Ma - cs.uml.edu

58 CHAPTER 2. ASSEMBLY MANUAL

LED28red lens, red element

LED29red lens, red element

LED30red lens, red element

32 Infrared LEDs.

The infrared LEDs come in a small rectangular package.

When mounting, make sure that the face with a small bubble aims outward fromthe ring of LEDs. The bubble is the lens in front of the actual emitter element.

The face with the colored stripes must be on the inside of the ring.

LED31MLED71 IR LED

LED32MLED71 IR LED

LED33MLED71 IR LED

LED34MLED71 IR LED

LED35MLED71 IR LED

LED36MLED71 IR LED

LED37MLED71 IR LED

LED38MLED71 IR LED

42 Cable and Connector.

Cut a 12" length of the twisted-pair red/black cable. Strip 1

4" of insulation

from the wire on both ends.

From underside of IR board, insert red wire into hole marked (+) andblack wire into hole marked (). Solder from top of board.

Mount other end of red wire to the middle pins of a three-pin male con-nector and the black wire to one of the outside pins. Use guideline shownin Section 2.7.

The infrared transmitter plugs into the connector labelled ir out on the Micro-processor Board (see Figure 2.13), with the red lead inserted into middle (power) stripand the black lead plugged into the right hand (signal) strip. The transistor acts asa switch between the signal lead of the IR emitter and ground so no current may ow when the signal to the base of the transitor is o. If the connector is plugged inbackwards, the IR LED will always be on, and the transmitter will get very hot.

Page 71: Ma - cs.uml.edu

2.7. CABLE AND CONNECTOR WIRING 59

Bi-Directional Motor

Uni-Directional Motor,LED, Incandescent Lamp

Sensor, Polarized

Sensor, Non-polarized

Infrared Beacon

Servo, Polarized

Figure 2.16: Standard Connector Plug Congurations

Page 72: Ma - cs.uml.edu

60 CHAPTER 2. ASSEMBLY MANUAL

2.7 Cable and Connector Wiring

This section explains how to build reliable cables and connectors for the motors andsensors that will plug into the robot's controller boards.

Sturdy and reliable connectors are critical to the success of a robot. If a robot'sconnectors are built sloppily, hardware problems will occur. Well-built connectorswill help make the robot more reliable overall and will ease development diculties.

Remove or clip one center pin

Cut away nubson the sidesof the connector

Solder

Soldering IronTin the wires

Strip a small amount of insulation o the wire ends. Tin the wire ends by applyinga thin coat of solder to them.

Figure 2.17: Step One of Connector Wiring

Sensors and motors are built with integral wiring; that is, a sensor or motor willhave a xed length of wire terminating in a connector. It is possible to build extensioncables, but it is more time-ecient to build cables that are the proper length already.

The average robot has its control electronics near the physical center of the robot;hence, motors and sensor cables need to reach from the center of the robot to theirmounting position. Given this geometry, most robots will need sensor and motorcables between 6 and 12 inches long.

Several dierent connector styles are used depending on the device which is beingconnected to. Figure 2.16 shows the connector congurations used for bidirectionalmotors, unidirectional motors, sensors, and the infrared beacon.

Page 73: Ma - cs.uml.edu

2.7. CABLE AND CONNECTOR WIRING 61

Soldering Iron

Clipped Pin

Clipped Pin

Power

Ground

Signal

Heat-shrink Tubing

Heat-shrink Tubing

Cut the male connector to size.This example shows a plug that can be used to wirea motor and the bottom a polarized sensor. Cut 1

2inch length pieces of 1/4" heat-

shrink tubing. Solder the wires to the connector, being careful not to let the heatfrom the soldering iron shrink the tubing.

Figure 2.18: Step Two of Connector Wiring

Page 74: Ma - cs.uml.edu

62 CHAPTER 2. ASSEMBLY MANUAL

Clipped Pin

Heat-shrink Tubing

Hot Glue Gun

Hot Glue

Use hot glue to strengthen and insulate the connection. Be careful not to use toomuch glue, or else the connector will be too fat. While the glue is cooling o, youshould slide the heat shrink tubing over the glue and atten the glue while it is tillsoft.

Figure 2.19: Step Three of Connector Wiring

Page 75: Ma - cs.uml.edu

2.7. CABLE AND CONNECTOR WIRING 63

Clipped Pin

Heat-shrink Tubing

Heat

Slide a piece of heat-shrink tubing over connections. Shrink using heat gun, amefrom a match or lighter, or the side of a soldering iron. A heat gun provides by farthe best results, and you may want to come to lab to use one.

Figure 2.20: Step Four of Connector Wiring

Page 76: Ma - cs.uml.edu

64 CHAPTER 2. ASSEMBLY MANUAL

The ribbon cable provided in the 6.270 kit is best for making sensor and motorcables.

Figures 2.17 through 2.20 illustrate the recommended method for wiring to aconnector plug. When assembled properly, this method will provide for a sturdy,well-insulated connector that will be reliable over a long period of use. Too muchglue or heat shrink tubing will make the connector fat, and later you will not be ableto connect several connectors side by side. You will want to keep the connectors smalland sturdy.

The example shows wiring to opposite ends of a three-pin plug, as would commonlybe used when wiring to a motor. The method, however, is suitable for all kinds ofconnectors.

2.8 Motor Wiring

This section explains how to wire the Polaroid motors and the servo motor, and howto prepare the Polaroid motor for mounting on a LEGO device.

2.8.1 The Polaroid Motor

The Polaroid motors are used to eject lm in their instant cameras and are particu-larly powerful DC motors. They are manufactured by Mabuchi, a leading Japanesemotor manufacturer. The Polaroid motors have been donated to the 6.270 course byPolaroid.

The process of preparing the motor can be broken into three separate parts. Therst part is to place a LEGO axle on the shaft of the motor. The second part is tomount the motor onto a platform. The third part is wiring a cable and plug to themotor assembly.

These instructions will specify that a lego axle be installed on the motor shaft.In general, this is the most useful motor conguration. You will probably mount aneight-tooth LEGO gear on the shaft. Other possibilities include mounting a LEGOpulley wheel or a larger diameter gear on the axle.

Attaching a Shaft to the Polaroid Motor

The motors come with a metal gear that is press-t onto the shaft of the motor.The rst step is to remove this gear.

The gear is removed using a pair of of wire strippers. Place the jaws of thestrippers between the motor and the gear. When the strippers are closed, thebevel in the cutters should pry o the gear.

Page 77: Ma - cs.uml.edu

2.8. MOTOR WIRING 65

The cutters should provide a uniform force around the gear so that it does notget stuck on the shaft when being pried o.

You should give one of the organizers a small piece of LEGO axle so that wecan drill a hole in it. The hole in the axle will be the size of the motor shaft.The axle should t snugly over the motor shaft.

Place a drop of super glue around the outer area of the motor shaft, farthestaway from the motor housing as shown in Figure 2.21. Make sure that too muchglue is not used. If there is too much super glue, it may leak into the motorhousing and jam up the motor. Using a paper napkin, pat o any of the excesssuper glue.

Side View

Motor power contactsMotor shaft

LEGO axle

Place glue here,on outside of shaft

Figure 2.21: Motor Housing with Tubing

This is the most crucial step. Slide the axle over the motor shaft and wipe oany excess glue with a paper napkin. Make sure that the glue does not get intothe motor housing assembly.

Attaching the Polaroid Motor to a LEGO Base

The purpose of this step is to ax the motor to LEGO parts so that it will meshproperly with gear mechanisms built from other LEGO pieces.

To make sure that the motor is mounted properly, it will be placed on a platformin the correct orientation to mesh with other LEGO gears.

This platform or jig is shown in Figure 2.22. It is constructed from two 28beams, one 68 at plate, one 24 plate, two 24-tooth gears, and two axles.

The motor is placed on a 24 at plate and mounted so that its 8-tooth gear isnestled between the two 24-tooth gears at the proper horizontal and vertical LEGOspacing.

Page 78: Ma - cs.uml.edu

66 CHAPTER 2. ASSEMBLY MANUAL

8-tooth gearattached to motor shaft

Polaroid motor 2x4 LEGO plate taped to motor

Gea

r ce

nter

per

fect

lyal

igne

d w

ith L

EG

O h

ole

24 24

Polaroid motor

LEGO Jig, side view

LEGO Jig, rear view

Figure 2.22: LEGO Jig for Mounting Polaroid Motor

Page 79: Ma - cs.uml.edu

2.8. MOTOR WIRING 67

Polaroid motor

2 X 4 Plate Without Nubs.

2 X 4 Plate WithoutSide Bottom Ridges

Figure 2.23: LEGO Jig for Mounting Polaroid Motor

Assemble the jig as shown in Figure 2.22. A second 24 plate will mounted tothe motor.

Cut o the LEGO nubs from the second 24 plate that will be connected tothe motor. Place a piece of double-sided sticky tape on the plate.

Position the motor on its plate so that the 8-tooth gear is meshed between thetwo 24-tooth gears, and the center line of the motor shaft is parallel with theaxles of the 24-tooth gears. Remove the paper from the tape and secure themotor onto the tape.

With a second 24 plate, cut o the bottom ridges so that it is a at piece withjust the nubs, or use a 24 piece of grey plate. Attach a piece of double-sidedsticky tape to the bottom of the piece.

Make a second jig as shown in gure 2.23 out of four 24 bricks, two 24 plates,and two 68 plates that sandwich the motor in place.

Attach the piece to the motor such that the motor can be locked into place whenanother piece is attached across the top of the motor. It is probably a goodidea to lock in your motors in a similar fashion when building your machine.

Page 80: Ma - cs.uml.edu

68 CHAPTER 2. ASSEMBLY MANUAL

Wiring a Cable and Plug to the Polaroid Motor

Motor cables may be constructed with either two strands of ribbon cable wire orthe twisted pair red/black cable. Cut an 8 inch to 12 inch length of whicheverwire is preferable.

Strip and tin both ends of the wire.

On the side of the motor there should be two metal lead/pads. Solder one wirelead to each pad. After proper soldering, hot glue may be used to hold the wireto the side of the motor for a stress relief.

Motor plugs may be wired for bidirectional or unidirectional use, as shown inFigure 2.16. (For most purposes, motors will need to be operated bidirection-ally.)

Cut a two- or three-long strip of male socket headers as will be needed.

Using the connector plug wiring technique shown in Figure 2.17 through Fig-ure 2.20, wire the motor plug. Polarity does not matter since the plug may beinserted into a motor power jack in either orientation.

2.8.2 Servo Motor

Control (white or orange)

Power (red)

Ground (black or brown)

Figure 2.24: Servo Motor and Integral Connector Plug

Page 81: Ma - cs.uml.edu

2.8. MOTOR WIRING 69

Figure 2.24 illustrates a typical servo motor similar to the one provided in the 6.270kit. The servo motor has a short cable that terminates in a three-lead connector, asillustrated. The functions of these lead are power, ground, and the control signal.

Page 82: Ma - cs.uml.edu

70 CHAPTER 2. ASSEMBLY MANUAL

Page 83: Ma - cs.uml.edu

Chapter 3

6.270 Hardware

This chapter is partly tutorial and partly technical reference: in additional to doc-umenting the 6.270 hardware, it explains the design in a way that would be under-standable to the beginner. The discussion does however assume familiarity with someideas of digital electronics.

The information presented here should be considered optional, as it is not strictlynecessary to know it to build a robot. Hopefully though, this chapter will satisfymost readers' curiosity about how the 6.270 hardware works.

This chapter was revised by Matt Domsch '94 in his \Advanced UndergraduateProject" to re ect changes in the Rev. 2.21 hardware and to provide better schemat-ics.

3.1 The Microprocessor and Memory

At the most primitive level, a computer consists of a microprocessor, which executesinstructions, and a memory, in which those instructions (and other data) is stored.

Figure 3.1 shows a block diagram of these two components. The diagram showsfour types of wires that connect the microprocessor and the memory:

Address Bus. These wires are controlled by the microprocessor to select a particularlocation in memory for reading or writing.

The 6.270 board uses a memory chip that has 15 address wires. Since eachwire has two states (it can be a digital one or a zero), 2 to the 15th powerlocations are possible. 215 is precisely 32,768 locations; thus, the system has32K of memory.

Data Bus. These wires are used to pass data between the microprocessor and thememory. When data is written to the memory, the microprocessor drives thesewires; when data is read from the memory, the memory drives the wires.

71

Page 84: Ma - cs.uml.edu

72 CHAPTER 3. 6.270 HARDWARE

Microprocessor Memory

Address Bus (15 bits)

Data bus (8 bits)

(Motorola 6811) (32K static RAM)

Read/Write control line

A0:14 A0:14

D0:7 D0:7

R/~W

R/~W

Enable

Enable

E

Figure 3.1: Block Diagram of Microprocessor and Memory

Page 85: Ma - cs.uml.edu

3.1. THE MICROPROCESSOR AND MEMORY 73

In our example (and in the 6.270 board), there are eight data wires (or bits).These wires can transfer 28 or 256 dierent values per transaction. This dataword of 8 bits is commonly referred to as a byte.

Read/Write Control Line. This single wire is driven by the microprocessor tocontrol the function of the memory. If the wire is logic true, then the memoryperforms a \read" operation. If the wire is logic zero, then the memory performsa \write operation."

Memory Enable Control Line. This wire, also called the E clock, connects to theenable circuitry of the memory. When the memory is enabled, it performs eithera read or write operation as determined by the read/write line.

3.1.1 Multiplexing Data and Address Signals

MicroprocessorMemory

Address Bus (upper 7 bits)

MultiplexedAddress/Data bus (8 bits)

(Motorola 6811)(32K static RAM)

Read/Write control line

Latch

(’HC373)

Addres Bus (lower 8 bits)

‘‘Address Strobe’’ signal

A8:14 A8:14

A0:7

R/~W

R/~W

AS

AS

AD0:7D0:7

E

Enable

Enable

Figure 3.2: Block Diagram of Microprocessor and Memory with Latch

Page 86: Ma - cs.uml.edu

74 CHAPTER 3. 6.270 HARDWARE

Things are a little more complex with the particular microprocessor that is used inthe 6.270 board, the Motorola 6811. On the 6811, The eight data bus wires taketurns functioning as address wires as well.

When a memory location is needed (for reading or writing), rst the data wiresfunction as address wires, transmitting the eight lower-order bits of the address.Then they function as data wires, either transmitting a data byte (for a write cycle)or receiving a data byte (for a read cycle). All this happens very fast; 2 million timesper second to be exact.

The memory needs to help to deal with the split-personality data/address bus.This help comes in the form of an 8-bit latch. This chip (the 74HC373) performs thefunction of latching, or storing, the 8 address values so that the memory will havethe full 15-bit address available for reading or writing data.

Figure 3.2 shows how the latch is wired. The upper 7 address bits are normal,and run directly from the microprocessor to the memory. The lower 8 bits are thesplit-personality, or, more technically, multiplexed address and data bus. These wiresconnect to the inputs of the latch and also to the data inputs of the memory.

An additional signal, the Address Strobe output of the microprocessor, tells thelatch when to grab hold of the address values from the address/data bus.

When the full 15-bit address is available to the memory (7 bits direct from themicroprocessor and 8 bits from the latch), the read or write transaction can occur.Because the address/data bus is also wired directly to the memory, data can ow ineither direction between the memory and the microprocessor.

This whole process|the transmitting of the lower address bits, the latching ofthese bits, and then a read or write transaction with the memory|is orchestrated bythe microprocessor. The E clock, the Read/Write line, and the Address Strobe lineperform in tight synchronization to make sure these operations happen in the correctsequence and within the timing capacities of the actual chip hardware.

3.2 Memory Mapping

So far we have seen how a memory can be connected to the address space of amicroprocessor. In a circuit like the one of the 6.270 board, the microprocessor mustinteract with other devices than the memory|for example, motors and sensors.

A typical solution uses 8-bit latches for input and output. These latches areconnected to the data bus of the microprocessor so that they appear like a locationin memory. Then, the act of reading or writing from one of these memory locationscauses data to be read from or written to a latch|to which the external devices areconnected.

Figure 3.3 is a block diagram of the 6.270 Robot Controller Board system. Fol-lowing the present discussion that concerns how the motors and sensors are addressed

Page 87: Ma - cs.uml.edu

3.2. MEMORY MAPPING 75

Digital Inputs

M

M

M

M

Four Motor Outputs

LCD display

6811 32kRAM

244273

L

og

ic p

ow

er

4 x

AA

alk

alin

e

Prototyping Area

Motor Battery

6 volts

6811

Dat

a B

us (

8 bi

ts)

6.270 Robot Controller Board

Serial Interface ckt.

RS

-232

Ser

ial

Por

tIR

Bea

con

PiezoBeeper

User Buttons

Port D I/O 4 Analog Inputs

Microprocessor

inputbuffer

output latch

6.270 Expansion Board

374

output latch

M

ML293motordriver

‘‘Frob’’ Knob

4 DIPswitches

analog mux

analog mux16

Ana

log

Inpu

ts

LED drivers

IR Transmission ckt

L293motordriver

L293motordriver

Low Batt.Circuit

analog mux

connector connector

Figure 3.3: 6.270 System Block Diagram

Page 88: Ma - cs.uml.edu

76 CHAPTER 3. 6.270 HARDWARE

by the microprocessor, notice that a chip labelled \273" is connected to the data bus.The '273 has outputs that control the motors (through chips labelled \L293," whichwill be discussed later). The digital sensors are driven into the data bus by a chiplabelled \244." On the expansion board, a 374 chip, another output latch, is used foreight bits of digital output.

These interface latch chips are used in a technique called memory mapping. Thechips are \mapped" to a particular address in the microprocessor's memory.

The following discussion will show how both the 32k RAMmemory and the digitalinput and output latch chips share the address space of the microprocessor.

3.2.1 Memory-Mapping the RAM

32K Memory Chip

R/~W read/write line

~CE chip enable line

Microprocessor R/~W

A15

E Clock

AND gate NOT gate

Figure 3.4: Enabling the Memory

The 6811 has a total of 16 address bits, yielding 64K bytes of addressable locations(65536, to be exact). Half of this space will be taken up by the 32K memory chip(also known as a RAM chip, for \random access memory").

The 6811 has a bank of interrupt vectors, which are hardware-dened locations inthe address space that the microprocessor expects to nd pointers to driver routines.When the microprocessor is reset, it nds the reset vector to determine where itshould begin running a program.

These vectors are located in the upper 32K of the address space. Thus, it is logicalto map the RAM into this upper block, so that the RAM may be used to store thesevectors.

The technique used to map the memory to the upper 32K block is fairly simple.Whenever the 6811's A15 (the highest-order address bit) is logic one, an address inthe upper 32K is being selected. The other fteen address bits (A0 through A14)determine that address.

Page 89: Ma - cs.uml.edu

3.2. MEMORY MAPPING 77

A logic gate is used to enable the memory when A15 is logic one and when theE clock is high (since the E clock must control the timing of the enable). Figure 3.4shows a block diagram of this circuit. (The actual circuit to enable the RAM, shownin Figure 3.8, is slightly more complex due to considerations of battery-protecting thememory, as explained later.)

Memory chips are part of a class of chips that have negative true enable inputs.This means that they are enabled when the enable input is logic zero, not logic one.

There are two methods for denoting an input that is negative true. As shown inFigure 3.4, the chip enable input is shown with connecting to a circle. This circleindicates a negative true input. Also, the name for the signal, CE is prexed with a~ symbol.

The function of the NOT gate shown in the diagram is to convert the positive-trueenable produced by the AND gate into the negative-true signal required by the ~CEinput. (Often these two gates are collapsed into a single NAND gate.)

3.2.2 Memory-Mapping with the 74HC138 Chip

SelectInputs

EnableInputs

ControlOutputs

A

B

C

G1

G2-A

G2-B

’HC138

Y0

Y1

Y2

Y3

Y4

Y5

Y6

Y7

R/W line

A12

A13

E clock

~A14

A15

Motor ’273 chip

Digital inputs ’244 chip

Expansion board ’374 chip

Exp

ansi

on B

us

Figure 3.5: Wiring the 'HC138 Address Decoder

Figure 3.5 shows the 74HC138 chip, which is commonly used in circuits that mapdevices onto an address space. This chip is a 3-to-8 decoder: a binary number ofthree digits (the select inputs) causes one of eight possible outputs to be selected (thecontrol outputs). The chip also has three enable inputs, all of which must be enabledto make the chip become active.

Page 90: Ma - cs.uml.edu

78 CHAPTER 3. 6.270 HARDWARE

The outputs of the '138 chip control the input and output latches shown in thesystem block diagram. The '138 determines when these latches are activated, eitherto read data from the data bus (in the case of the '273 output latch), or to write dataonto the data bus (in the case of the '244 input latch).

Enable Inputs

The enable inputs of the '138 determine when the chip will become active, and therebyturn on one of the input or output latches. These enables inputs are critical becausethe '138 must not become active at the same time as the RAM chip. In it did, thentwo devices (the RAM and perhaps a '244) would attempt to drive the data bussimultaneously, causing a problematic situation called bus contention.

As shown in Figure 3.5, A15, the highest order address bit, is connected to anegative enable of the '138. Thus A15 must be zero to enable the chip. Since theRAM is enabled only when A15 is one (as was explained earlier), there is no chancethat the '138 and the RAM could be active at the same time.

~A14, which is the logical inverse of A14, is connected to a second negative enableof the '138. Thus when A14 is one, ~A14 is zero, and the G2-A enable is true. SoA14 must be one in order to active the '138.

The nal enable input is positive true, and is connected to the 6811 E clock. WhenA15 is zero and A14 is one, the E clock will turn on the '138 at the appropriate timefor standard 6811 read/write cycles.

Select Inputs

Given that the '138 is enabled, the A, B, and C inputs determine which deviceconnected to its outputs will be activated. A, B, and C form a binary number (C isthe most signicant bit) to determine the selected output.

The A13 and A12 address bits and the 6811 read/write line make the selection.Suppose A13 and A12 are one. The read/write line makes the nal choice. This lineis one for a read and zero for a write. If a read operation is in progress, then the ABCinputs will form the number 7, and the Y7 output will be activated. As shown inFigure 3.5, this output connects to the digital input '244 chip. So, the '244 chip willturn on and will drive a byte onto the data bus. The read operation will completewith this byte having been read from the location in 6811 address space that wasselected.

Notice that address bits A0 through A11 have no eect on the operation justdescribed. As long as A15 is zero, A14, A13, and A12 are one, a read operation willcause the '138 to turn on the digital input '244 chip to write a byte onto the databus. Thus, the digital input chip is selected by a read from any address from $7000

Page 91: Ma - cs.uml.edu

3.2. MEMORY MAPPING 79

to $7FFF1. This is fairly wasteful of the address space of the 6811, but keep in mindthat the only circuitry required to arrange this solution was the '138 chip.

Suppose a write operation were to occur in that same range of memory. Therelevant upper four address bits would have the same values, but the read/write linewould be zero (indicating the write operation). Thus the '138 ABC inputs wouldform the number 6, and output Y6 would be activated. Y6 is connected to the '273chip that controls the motors; thus, the '273 would latch the value present on thedata bus during the write operation.

As shown in Figure 3.5, most of the '138 outputs are still available for future ex-pansion. The 6.270 Expansion Board includes a circuit with one '374 chip, connectedto the Y0 output. Outputs Y1 through Y5 are left free for further expansion use.

3.2.3 System Memory Map

Figure 3.6 summarizes the memory map solution that has been implemented for the6.270 Board.

The 32K RAM takes up half of the total address space of the microprocessor. Asindicated in the map, it is located in the upper 32K of the microprocessor's memory,from addresses $8000 to $FFFF.

The four digital input and output ports are mapped at locations starting at $4000,$5000, $6000, and $7000.

There is small area of memory that is internal to the 6811 chip itself. This memoryconsists of 256 bytes located at the start of the address space, from locations $00 to$FF.

The 6811 also has a bank of 64 internal special function registers, located ataddresses $1000 to $103F. These registers control various hardware features of the6811 (the analog inputs and serial communications are two examples).

The remainder of this section presents details on the digital input and outputcircuit wiring.

3.2.4 Digital Inputs

Figure 3.7 shows the digital input circuitry. U6, a 74HC244 chip, is used to latch aneight-bit word of sensor inputs and drive the 6811 data bus with that value when thechip is selected.

The '244 chip has two halves which may be separately enabled. The Y7 select isconnected to both enable inputs, so that both halves of the chip are always selectedsimultaneously.

1These numbers are expressed in the hexadecimal numbering system, in which each digit repre-sents a four-bit value from zero (0) to fteen (F)

Page 92: Ma - cs.uml.edu

80 CHAPTER 3. 6.270 HARDWARE

Ext

erna

l RA

M (

32K

byt

es)

6811 Internal RAM$0000

$00FF 6811 Internal Registers$1000

$103F

Digital I/O Port 3

Digital I/O Port 2

Digital I/O Port 1

Digital I/O Port 0$4000

$4FFF

$5000

$5FFF

$6000

$6FFF

$7000

$7FFF

$8000

$FFFF

Memory Map of the6.270 Board and 6811 Microprocessor

Total Address Space = 65536 bytes (64K)

Figure 3.6: 6811 System Memory Map

Page 93: Ma - cs.uml.edu

3.2. MEMORY MAPPING 81

6811D

ata Bus

1 0

Digital

Input Port

"CHOO

SE"

"ESCAPE"

2A2

2A3

2A4

2A1

1A4

1A3

1A2

1A1

24

41G 2G

1Y4

1Y3

1Y2

1Y1

2Y4

2Y3

2Y2

2Y1

1 19

2468

18

16

14

12

11

13

15

17

9753

'138 Y7 Select

3

4

5RP1 E47k x 9

6

7

8

9

1 1 0

6811 Port A0

6811 Port A1

SW4

SW3

R12 47k

R13 47k

+5V

+5V

+5V

D1

D3

D5

D7

D6

D4

D2

D0

245 367 2

Figure 3.7: Digital Input Circuit

Page 94: Ma - cs.uml.edu

82 CHAPTER 3. 6.270 HARDWARE

The lower two bits of the '244 are connected to the two user buttons (which havebeen dubbed Choose and Escape). The upper six bits are connected to the digitalinput header.

The lower two bits of the input header are connected to two timer inputs inputs ofthe 6811. These inputs can be used to precisely measure waveforms, or can simply beused for digital input. If shaft encoding is used, it is the input capture functions onthese two input ports which are used for the encoding. The library functions writtento perform digital inputs insulate the user from the fact that the eight pins on theinput header are not mapped contiguously to one location in memory.

RP1, a 47K resistor pack, acts as pull-up resistors to the inputs of the '244 chip,making the default values of the inputs one.

3.2.5 Digital Outputs

Figure 3.13 shows the complete schematic for the '273 output latch controlling themotors. For the purpose of the discussion to this point, notice that the data inputs'273 are connected to the 6811 data bus. The Y6 select signal connects to the clockinput of the '273; when Y6 is activated, the '273 latches the value present on the databus.

The outputs of the '273 connect to the motor driver chips. This circuitry isexplained in the following section.

Figure 3.15 is the schematic of the motor circuit present on the 6.270 ExpansionBoard.

3.2.6 6811 and Memory Schematic

Figure 3.8 presents the schematic of the 6811, memory, address decoding, and sup-porting main circuitry on the 6.270 Processor Board. By the end of this chapter,most of the circuitry depicted here will be explained.

3.3 The Motor Drivers

Motors are high-powered devices in the world of digital electronics. A typical digitaloutput can supply about 10 to 20 milliamperes (mA) of current; a small permanent-magnet motor requires anywhere from 500 to 4000 mA of current. It should not comeas a surprise that special circuitry is required to drive motors.

3.3.1 The H-Bridge Circuit

Page 95: Ma - cs.uml.edu

3.3. THE MOTOR DRIVERS 83

High S

peedS

erial Header

Analog Input H

eader

Expansion B

us/LCD

Connector

"Reset"

RJ11 S

erial Line

Dow

nload Mode

Select

Safe

Reset

Circuit

Serial

Line R

estart

"Choose"

XTA

LE

XTA

L

/RE

SE

T/IR

Q/X

IRQ

MO

DA

/LIRM

OD

B/V

STB

Y

AS

VRH

VRL

PA

0P

A1

PA

2P

A3

PA

4P

A5

PA

6P

A7

PB

0P

B1

PB

2P

B3

PB

4P

B5

PB

6P

B7

PC

0P

C1

PC

2P

C3

PC

4P

C5

PC

6P

C7

E

R//W

PD

0P

D1

PD

2P

D3

PD

4P

D5

PE

0P

E1

PE

2P

E3

PE

4P

E5

PE

6P

E7

87

17

19

18324

52

51

34

33

32

31

30

29

28

27

42

41

40

39

38

37

36

359

10

11

12

13

14

15

16

5620

21

22

23

24

25

43

45

47

49

44

46

48

50

U1

U1

68HC

11A1F

N

9 10

11

8

U9c

74HC

10

+5

VR9 47K

R10 47K

D3

123

U1

1/D

S1

23

3

+5

V

C6 0.1uF

~RESET

109

8

U7

/74

HC

13

2

6811 Port D

0

6811 Port D

1

Motor F

orce 1M

otor Force 2

Motor F

orce 3

Motor F

orce 0

2RP2/47k x 4

1 3

+5

V

4

5

Piezo

6811 Port A

16811 P

ort A0

Servo S

ignal

IR X

MIT S

ignal

Pow

er Off Int

+5

V

/W

A0

A1

A2

A3

A4

A5

A6

A7

A8

A9

A1

0A

11

A1

2A

13

A1

4

DQ

0D

Q1

DQ

2D

Q3

DQ

4D

Q5

DQ

6D

Q7

/CE

/OE

20

27

22

109 8765 43

25

24

21

232

261

11

12

13

15

16

17

18

19

62

25

6

XT

AL

1/8

MH

z

R1

1/2

.2M

+5

V

Analog P

ort 8A

nalog Port 9

Analog P

ort 10A

nalog Port 11

SW

2

G1G2AG2B

CBA

Y7Y6Y5Y4

Y1Y0

Y3Y2

1 3 8

645

3211 5

1 41 31 21 11 0

97

U4

74HC138

SW

3

4 56

U7

/74

HC

13

2

to '244

to '273

ASA10S5S4S3S2S1S0

4D 7D6Q3Q

37

32Q1Q 4Q

OC C

7Q5Q 8Q

6D3D2D1D 5D 8D

3 4 7 81

31

41

71

8

11

1

2 5 6 9 12

15

16

19

74HC

373

U3

D7D6D5D4D3D2D1D0Ti4A 8A 9VR+ 5GND

+5

V

VR

1/1

00

k

Ti3

PD

2P

D3

PD

4P

D5

Figure 3.8: 6811, Memory, Address Decoding and Miscellaneous Circuitry

Page 96: Ma - cs.uml.edu

84 CHAPTER 3. 6.270 HARDWARE

Motor

TRANSISTOR ONE

TRANSISTOR TWO

TRANSISTOR THREE

TRANSISTOR FOUR

POWER + POWER +

POWER - POWER -

Figure 3.9: The H-Bridge Circuit

A circuit known as the H-bridge (named for its topological similarity to the letter\H") is commonly used to drive motors. In this circuit (depicted in Figure 3.9), twoof four transistors are selectively enabled to control current ow through a motor.

As shown in Figure 3.10, an opposite pair of transistors (Transistor One andTransistor Three) is enabled, allowing current to ow through the motor. The otherpair is disabled, and can be thought of as out of the circuit.

By determining which pair of transistors is enabled, current can be made to owin either of the two directions through the motor. Because permanent-magnet motorsreverse their direction of turn when the current ow is reversed, this circuit allowsbidirectional control of the motor.

3.3.2 The H-Bridge with Enable Circuitry

It should be clear that one would never want to enable Transistors One and Two orTransistors Three and Four simultaneously. This would cause current to ow fromPower+ to Power through the transistors, and not the motors, at the maximumcurrent-handling capacity of either the power supply or the transistors.

To facilitate control of the H-bridge circuit, enable circuitry as depicted in Fig-ure 3.11 is typically used.

Page 97: Ma - cs.uml.edu

3.3. THE MOTOR DRIVERS 85

Motor

TRANSISTOR ONE

TRANSISTOR THREE

POWER + POWER +

POWER - POWER -

cu

rre

nt flo

w

cu

rre

nt flo

w

current flow

Figure 3.10: The H-Bridge with Left-to-Right Current Flow

In this circuit, the inverters ensure that the vertical pairs of transistors are neverenabled simultaneously. The Enable input determines whether or not the wholecircuit is operational. If this input is false, then none of the transistors are enabled,and the motor is free to coast to a stop.

By turning on the Enable input and controlling the two Direction inputs, themotor can be made to turn in either direction.

Note that if both direction inputs are the same state (either true or false) andthe circuit is enabled, both terminals will be brought to the same voltage (Power+or Power, respectively). This operation will actively brake the motor, due to aproperty of motors known as back emf, in which a motor that is turning generates avoltage counter to its rotation. When both terminals of the motor are brought to thesame electrical potential, the back emf causes resistance to the motor's rotation.

3.3.3 The SGS-Thomson Motor Driver Chip

A company named SGS-Thomson makes a series of chip called the L293 that in-corporates two H-bridge motor-driving circuits into a single 16-pin DIP package.Figure 3.12 shows a block diagram of this incredibly useful integrated circuit.

The schematic of the motor circuit (Figure 3.13) shows how the L293 chips are

Page 98: Ma - cs.uml.edu

86 CHAPTER 3. 6.270 HARDWARE

Motor

TRANSISTOR TWO

TRANSISTOR THREE

TRANSISTOR FOUR

POWER + POWER +

POWER - POWER -

TRANSISTOR ONE

ENABLE

DIRECTION

ANDgate

ANDgate

Inverter

ANDgate

Inverter

ANDgate

DIRECTION

Figure 3.11: The H-Bridge with Enable Circuitry

Page 99: Ma - cs.uml.edu

3.3. THE MOTOR DRIVERS 87

Enable Motor 1

Direction A

Direction B

Motor Power

M1

Enable Motor 2

Direction A

Direction B

M2

Motor Ground

Block Diagram of theL293 Motor Driver Chip

Pin 1

Pin 2

Pin 7

Pin 3

Pin 6

Pin 8

Pin 9

Pin 10

Pin 15

Pin 11

Pin 14

Pins 4,5, 12,13

Pin 16

Logic Reference Voltage

H-BridgeMotor Driver Circuit

H-BridgeMotor Driver Circuit

Figure 3.12: The SGS-Thomson L293 Motor Driver IC

Page 100: Ma - cs.uml.edu

88 CHAPTER 3. 6.270 HARDWARE

used in the 6.270 board design. Eight bits are used to control four motors. Four ofthe bits determine the direction of the motors (with the assistance of inverters) andfour bits determine the when the motors are on or o.

Notice that braking a motor is not possible with this circuit conguration, becausethe inverters do not allow both direction inputs of a given motor to be the same state.

The speed of a motor may be controlled by pulsing its enable bit on and o. Thistechnique, called pulse width modulation, is explained in the chapter on motors.

3.3.4 Power Considerations

Current Handling and Spike Protection

In the 6.270 circuit design, two L293 chips are used in parallel to control each motor.This is an unconventional circuit hack add to the current-handling capacity of themotor drivers.

Two dierent L293 chips are used in this circuit. One chip, the L293D, has internalspike-protecting diodes on the motor outputs. These diodes protect the motor chipand the rest of the circuit from electrical noise generated by the motors. The otherchip, the L293B, does not have these diodes, but has a greater current handling abilitythan the 'D chip.

The L293D can supply 600 mA of current per channel; the L293B, 1000 mA. Usedin parallel, the circuit can supply 1600 mA per channel. Because of the spike-killingdiodes contained in the 'D chip, the overall circuit is safe to use.

Power Supply Isolation

The electrical noise generated by motor can be hazardous to a microprocessor circuiteven with the use of the diodes. For this reason, separate power supplies are used forthe motors and the rest of the microprocessor electronics.

Figure 3.14 shows the power-supply circuitry. Notice that Logic Power, for themicroprocessor circuitry, is a conguration of four AA cells, while + Motor, powerfor the motors, is supplied through the J1 connector.

The motor ground and the logic ground must be kept at the same potential sothat the control signals from the '273 chip shown in Figure 3.13 can communicatewith the L293 chips. These grounds are kept at the same potential by the inductorL1.

The inductor is used to provide reactance (frequency-dependent resistance) totrap spikes that might travel from the motors, through the L293 chips, and into themicroprocessor circuit.

3.3.5 Expansion Board Motor and LED Circuitry

Page 101: Ma - cs.uml.edu

3.3. THE MOTOR DRIVERS 89

6811D

ata Bus

MO

TOR 1

MO

TOR 0

MO

TOR 3

MO

TOR 2

IN1

IN2

IN3

IN4

CS1

CS2

OUT1

OUT2

OUT3

OUT4

Vss

Vs

gnd

gnd

gnd

gnd

L2

93

2 7 10 15 1 9

3 6 11 14

8

16

4

5

12

13

U13, U

14

IN1

IN2

IN3

IN4

CS1

CS2

OUT1

OUT2

OUT3

OUT4

Vss

Vs

gnd

gnd

gnd

gnd

L2

93

2 7 10 15 1 9

3 6 11 14

8

16

4

5

12

13

U15, U

16

12

1110

U11 13

12

34

U11

51

RP4

61

1K

LED2

LED8

LED1

LED7

LED9

LED3LED10

LED4

14

RP4

13

1K

+Motor

+Motor

1 2 31 2 31 2 31 2 3 +Motor

'138 Y6 Select

+Motor

6811 Port E0

6811 Port E1

6811 Port E2

6811 Port E3

/RESET

4D 7D6Q3Q

27

32Q1Q 4Q

CLR CLK

7Q5Q 8Q

6D3D2D1D 5D 8D

2 5 6 9 12 15 16 19

3 4 7 8 13 14 17 18 1 11

U5

74273

D6

D4

D2

D0

D1

D3

D5

D7

Figure 3.13: Motor Driver Circuit

Page 102: Ma - cs.uml.edu

90 CHAPTER 3. 6.270 HARDWARE

Power-Off Interrupt

6v (4xAA cell)Logic Power

6v MotorBatteryPower

Swi tchSW1a

D1/1N4001

D2/1N4148C5/47 µF

C8/0,1 µF

C13/470 µF

C9/4,7 µF

C4/0,1 µF

C12/0,1 µF

C10/0,1 µF

+5V

+RAM

C7/0,1 µF

L1/1 µH

+Motor

SW1b

+

-

J 1

D3 1N4148

R1/47K

6811 Port A2

RAM Power U2,U9

Logic Power

Motor GroundLogic Ground

Figure 3.14: Power Filtering and Switching Circuit

Motor 4

Expansion Bus &LCD Connector

Motor 5

LEDOUT 1

LEDOUT 0

IN1IN2IN3IN4

CS1CS2

OUT1

OUT2

OUT3

OUT4

Vss

Vs

gnd

gnd

gnd

gnd

L 2 9 3

27

1015

19

3

6

11

14

816

4512

13

U21

Gnd+5vVRA9A8Ti4D0D1D2D3D4D5D6D7

ASA10S5S4S3S2S1S0

D0D1D2D3D4D5D6D7

OENCLK

Q0Q1Q2Q3Q4Q5Q6Q7

374

43

188

171413

7

111

521991615126

U17

+-

MOTOR PWR HDR

7 6 5 4 3 2

RP7/1K x 7

8

Q1

Q2

R16/2.2K

R17/2.2K +-

+-

LED13-18

1

Figure 3.15: Expansion Board Motor and LED Circuitry

Page 103: Ma - cs.uml.edu

3.4. ANALOG INPUTS 91

The 6.270 Expansion Board plugs into the Expansion Bus header depicted in Fig-ure 3.8. This header connects to the 6811 data bus and to the six '138 select signalsthat are not used on the main board.

Figure 3.15 illustrates how a single L293D chip is used on the Expansion Boardto provide outputs for two additional motors. Because six outputs of the '374 chipare wired to control all four direction inputs and the two enable inputs of the L293D,the motors can be braked if desired. Or, four unidirectional devices may be powered.

The remaining two bits of the '374 are connected to transistor drivers. Thesetransistor circuits are well-suited for powering light-load devices, such as LEDs.

3.4 Analog Inputs

The 6811 has on-chip circuitry to perform an analog-to-digital signal conversion. Inthis operation, a voltage from 0 to 5 volts is linearly converted into an 8-bit number(a range of 0 to 255). This feature is one of the many that make the 6811 very wellsuited for control applications.

The 6811 has eight of these analog inputs. In the 6.270 board design, four of thesepins are wired to a motor current monitoring circuit, and four of them are wired toinput connectors.

3.4.1 Motor Current Monitoring Circuit

When the L293 chips drive a motor, there is a voltage drop across the transistors thatform the H-bridge. The transistor connected to motor ground (0 volt potential) mightdrive the motor at some voltage between .2 and .8 volts; the transistor connected tothe positive terminal of the battery (say it's at 6 volts) might drive the motor between5.2 and 5.8 volts.

The amount of this voltage drop is proportional to the amount of current beingsupplied by the motor-driving transistor. When more current is being supplied, thetransistor drops more voltage.

This undesirable property of the L293 transistors is exploited to give a crude mea-surement of the amount of current being driven through the motor. A fundamentalproperty of motors is that as the amount of work they are performing increases, theamount of current they drawn also increases. So the current measurement yields dataon how hard the motor is working|if it is turning freely, if it is stalled, or if it isworking somewhere in between.

As indicated in Figure 3.13, the voltage feedback point is tapped from the indicatorLEDs that are connected to the motor outputs. The voltage across the LEDs willdecrease as a result of increased current draw of the motor (and the corresponding

Page 104: Ma - cs.uml.edu

92 CHAPTER 3. 6.270 HARDWARE

EXPANSION BOARD ANALOG INPUT HEADER

MAIN BOARDANALOG INPUT HEADER

MAIN BOARDPORT D HEADER

SW5

FrobKnob

Ti3

D5

D4

D3

D2

11

10

98

Y0

Y1

Y2

Y3

Y4

Y5

Y6

Y7

A B C Ou

t/In

INH

Vee 4

05

1

13

14

15

12

1 5 2 4

11

10 9 3 6 7

U20Y

0Y

1Y

2Y

3Y

4Y

5Y

6Y

7

A B C Ou

t/In

INH

Vee 4

05

1

13

14

15

12

1 5 2 4

11

10 9 3 6 7

U19

Y0

Y1

Y2

Y3

Y4

Y5

Y6

Y7

A B C Ou

t/In

INH

Vee 4

05

1

13

14

15

12

1 5 2 4

11

10 9 3 6 7

U18

27

26

25

24

23

22

21

20

19

18

17

16

15

14

13

12

3 3

3 4

3 5

DIP SWITCHES +5V

VR2 100K

12

RP6 47k x 7

345678

4

RP5 47k x 9 678910

+5V +5V

5

31 2

Figure 3.16: Expansion Board Analog Input Circuitry

decreased performance of the L293's). This voltage is fed to a 6811 analog input andcan be measured by the 6811 analog-to-digital conversion hardware.

Each of the four motor circuits is wired in this way to a 6811 analog input.

3.4.2 Analog Input Multiplexing on the Expansion Board

The Expansion Board has three eight-to-one analog multiplexer ICs. These chips (the74HC4051) have eight inputs and one output; depending on the state of three selectorinputs, one of the eight input lines is connected to the output.2

The outputs of the '4051 chips are wired into the 6811 analog inputs when the6.270 Expansion Board plugs into the main board. Three signals from the 6811 areused to control the multiplexers and select which analog input is mapped to the 6811analog input3.

Figure 3.16 is a schematic of the analog input circuitry on the 6.270 ExpansionBoard. It is easy to see how the use of the analog multiplexer chips greatly expands

2Actually, the chip's signals are bidirectional, but for the purpose of this discussion, it is conve-nient to think of the chip as having eight inputs and one output.

3These signals are taken from the 6811's High Speed Serial Port, a special sub-system of the6811 that allows it to communicate at high speeds with other 6811's. In the 6.270 application, thisfunctionality is not needed; instead, the signals are used as simple digital outputs.

Page 105: Ma - cs.uml.edu

3.5. THE SERIAL LINE CIRCUIT 93

the analog input capability of the 6.270 hardware:

Two of the '4051 chips have their inputs wired to a bank of sixteen open sensorinputs.

The other chip is wired from the Frob Knob, a general-purpose analog inputknob, and four DIP switches (for user conguration input).

Three of the inputs to this third chip are open, as is one of the 6811's analoginputs.

3.5 The Serial Line Circuit

Host ComputerRobot Board

signal ground

Robot receive data

Robot transmit data

Figure 3.17: Host and Board Communications over 3-Wire Serial Link

The 6.270 Board communicates with a host computer over an RS-232 serial line.\RS-232" refers to a standard protocol for communications over a three-wire system,as depicted in Figure 3.17. Nearly all of today's computers have serial ports thatconform to the RS-232 standard.4

In the RS-232 system, a \logic zero" is indicated by a +15 volt signal with respectto ground, and a \logic one" is indicated by a 15 volt signal. Note that this isdierent from standard digital logic levels in several ways. Negative voltages areused, higher voltages are used, and negative voltages connote a logic one value.

The 6811 chip includes circuitry to generate waveforms compatible with the RS-232 systems, but requires external circuitry to convert its own signals, which obeythe digital logic norms, to RS-232 signals as described.

There exist o-the-shelf single-chip solutions to this problem (most notably, theMAX232 and MAX233 chips made by Maxim, Inc.), but these chips are typically

4The actual RS-232 standard involves quite a few more wires for conveying various status infor-mation, but the data itself is transmitted on two uni-directional wires.

Page 106: Ma - cs.uml.edu

94 CHAPTER 3. 6.270 HARDWARE

Green

Yellow

RJ-11 Serial Jack (front view)

Receive Data

Transmit Data

+5V

40531 21 3

21537

1 11 41 01 5946

U8

43

RP

3/1

k

21

RP

3/1

k

R4

/10

kR

3/1

00

k

R6/2.2k

R2/47k

LED

12

LED11

+5V

+

C1 10uF

+

C2 10uF

C3 4700pF

12 3

U7/74HC132

1 31 21 1

U7/74HC132

6811 Port D1

6811 Port D0RS232 TxD

RS232 RxD

Figure 3.18: Serial Line Circuit

Page 107: Ma - cs.uml.edu

3.5. THE SERIAL LINE CIRCUIT 95

expensive and consume a fair bit of power. The solution implemented on the 6.270board requires a few more components, but is signicantly cheaper and less power-hungry.

3.5.1 Serial Output

One of the diculties in generating RS-232 signals is obtaining the negative voltagerequired to transmit a logic one. However, it turns out that the specied 15 voltsis not required: 5 volts will do for most applications.

A circuit called a charge pump is used to generate this negative voltage. A chargepump consists of two capacitors and a switch. One of the capacitors is charged toa positive voltage by the main power supply. Then the terminals of this capacitorare switched to the terminals of the second capacitor. The rst capacitor dischargesrapidly into the second, charging it negatively with respect to system ground. Thisprocess is switched rapidly, and a steady negative voltage supply is produced in thesecond capacitor.

The schematic for this circuit and the rest of the serial line circuitry is shown inFigure 3.18. The heart of the circuit is a 74HC4053 chip, which is a triple analogSPDT switch that can be controlled digitally.

The charge pump is built from switches A and B of the '4053 chip. Capacitor C1 ischarged from system voltage when the switches are in the X position (as is illustratedin the diagram). When the switches are ipped to the Y position, C1 discharges intocapacitor C2, creating a negative voltage on C2 with respect to system ground.

The C switch is used to switch either the 5 volts from C2 or +5 volts fromsystem power out over the serial line. This is done by wiring the 6811's logic-level\Transmit Data" signal to the control input of switch C.

Switches A and B are repeatedly alternated between the X and Y positions by anoscillator built from a schmitt-trigger NAND gate wired as an inverter (U7) and anRC delay (R2 and C3). This oscillator is tuned to about 10,000 Hertz, a frequencythat has been experimentally determined to yield good results.

The commercially-available single-chip solutions mentioned earlier implement asimilar circuit. In fact, they use two charge pumps. The rst is used to double thesystem voltage of +5 volts to obtain a +10 volt supply that more closely matches theRS-232 standard. The second charge pump inverts this +10 volts to obtain a 10volt supply.

3.5.2 Serial Input

A schmitt-trigger NAND gate is wired as an inverter to convert the negative-true RS-232 standard to the positive-true logic level serial standard. Resistor R3 limits the

Page 108: Ma - cs.uml.edu

96 CHAPTER 3. 6.270 HARDWARE

current that can ow into the gate when the serial line voltage is negative, preventingthe possibility of damage from a high negative voltage.

The RS-232 standard dictates that a serial line should be in the logic true (negativevoltage) state when it is not transmitting data. LED11, the serial receive indicator, iswired such that it will light in this state, being powered directly by the serial voltagegenerated by the host computer. This LED serves as an indicator that the 6.270board is properly hooked up to the host.

3.6 Battery-Backing the Static RAM

The static RAM used in the 6.270 board is a special low power device, a relativelyrecent innovation in widely-available memory technology. This memory chip requiresonly an innitesmal amount of current to store its contents when it is not being used.

The actual amount of current|less than one microampere|is so small that astandard alkaline battery does not notice it. That is, the battery will last as longas its shelf life, whether or not it is supplying one microamp to a circuit. (Alkalinebatteries have a shelf life of several years.)

Having a battery-backed static memory greatly increases the usability of the 6.270board. A robot can simply be turned on and operated immediately, without havingto be connected to a computer rst.

Unfortunately, implementing a battery-backed RAM can be complicated. Thediculty arises from unpredictabilities in microprocessor behavior when system poweris either switched on or o. During these transition periods, the microprocessor ispowered by illegal voltages, and its behavior is not dened. In order to make sure thatthe microprocessor does not corrupt the contents of the memory, orderly transitionsfrom the powered-o to power-on states, and vice-versa, must be implemented.

3.6.1 Powering the Memory Chip

Figure 3.14 illustrates how power is alway provided to the memory (through diodeD2) even when microprocessor and motor power is turned o. Capacitors C5 andC8 help to smooth the power supply of the memory, and also can provide power tothe memory while batteries are being changed. Because the current draw is so small,capacitor C5 will actually keep the memory \alive" for periods of up to thirty minuteswhen the system is powered o and batteries are removed.

3.6.2 The Power-O Interrupt

Diodes D1, D2, and D3 provide isolation amongst the three parts of the circuit:

the memory's power supply

Page 109: Ma - cs.uml.edu

3.6. BATTERY-BACKING THE STATIC RAM 97

the microprocessor's power supply

the power-o interrupt circuit

This isolation is necessary to ensure clean transition of the power-o interruptcircuit when power is shut o. The power-smoothing capacitors (both for the memoryand for the microprocessor circuit) retain charge for a brief period after power isswitched o. The diodes prevent this charge from \ owing backward," and allowingone part of the circuit to power another.

When power is switched o, the power-o interrupt signal immediately goes low.However, system capacitors (mostly, C13) will keep the microprocessor powered upfor a short while (about about one-tenth of a second).

The interrupt signal generates a hardware-level interrupt to the 6811. A special-purpose software driver is activated, which has the job of shutting down the 6811 inan orderly fashion before the capacitor power supply runs down.

Sometimes, a brief physical jolt to the microprocessor board will dislodge a batterymomentarily, causing the interrupt to be triggered. It would be incorrect for thesoftware to shut down the system in this case. So, the interrupt software waits for ashort while to see if the interrupt line goes high (indicating that power has returned).If power does return, the interrupt exits without taking action.

If power does not return after about one-hundredth of a second, the softwareroutine executes a machine-language HALT instruction, which shuts o the micro-processor. This sequence of actions implements an orderly shutdown sequence.

3.6.3 The Power-Up Delays

The Dallas Reset Chip (U11) holds the reset line low for 350 ms after the logic powerreaches a level of at least 4.25 Volts. This prevents the 6811 from trying to operatewith indeterminate voltages at its inputs, and it safeguards the SRAM while powerlevels settle.

Once power has normalized, the Dallas chip allows the reset line to rise. TheMODA pin has reached a valid logic 1, and the microprocessor comes up in the \run"state. This circuit is shown in Figure 3.19.

A second mode is used to download the operating system software to the micro-processor when initializing the board. To bring the processor up in this mode, theMODA must be a logic zero when the processor comes out of the reset state. Thishappens when the choose button is depressed while the reset occurs. This will put the6811 into a bootstrap download mode in which a program is executed from internalROM rather than external RAM.

Diode D3 allows the choose button to pull MODA low without forcing MODA tofollow the state of the choose button at all times. Resistor R10 pulls MODA to highwhen nothing else is going on, so normal run mode is the default after a reset.

Page 110: Ma - cs.uml.edu

98 CHAPTER 3. 6.270 HARDWARE

Mode Select+5V +5V

+5V

Reset

U11SW2

C6

R10R9

D3

SW3

Figure 3.19: Reset Circuitry

If the user presses reset without the choose button, the Dallas chip will pull thereset line low and MODA will remain high. The 6811 will go into the normal runmode, executing a program in external memory.

In order to ensure that the 6811 does not access external memory until the resetconditon is clear, the reset line is also an input to the RAM enable logic.

3.7 The Infrared Transmission Circuit

The Sharp GP1U52 sensor, and others like it commonly used in TVs, VCRs, and otherdevices controlled by infrared, is sensitive to modulated infrared light. It detects thepresence of infrared light that is blinking on and o at a particular rate. The GP1U52sensor is tuned to 40,000 Hertz (40 KHz).

In TV remote applications, a data stream is then generated around the 40 KHzcarrier frequency. The signal consists of bursts and gaps of the 40 KHz transmissions.

For the 6.270 application, the 40 KHz carrier is used to tranmit a square wave ofrelatively low frequency (100 or 125 Hz), as shown in Figure 3.20. When the SharpIR sensor decodes this signal, it removes the 40 KHz carrier, yielding a copy of thesquave wave that was originally transmitted (Figure 3.21).

Page 111: Ma - cs.uml.edu

3.7. THE INFRARED TRANSMISSION CIRCUIT 99

0.01 seconds (100 Hz.)

Bursts of 40 KHz light(each lasting .005 sec)

Figure 3.20: Square Wave Consisting of Bursts of 40 Khz Signals

Infrared Light Modulation...

Sharp GP1U52 sensor

Electrical Signal Demodulation

Figure 3.21: Sharp IR Sensor Decoding IR-Encoded Square Wave

Page 112: Ma - cs.uml.edu

100 CHAPTER 3. 6.270 HARDWARE

Software can continuously check the Sharp sensors for square waves of the speciedfrequency. It can lock on to the square wave when it is present and count the numberof consecutive cycles that have been detected.

6811 E Clock 2MHz

Modulated 40KHz

ModulationControl

Transistor -- controls currentflow through LEDs

IR Light Emitting Diodes --LEDs

Motor Power

Ground

Divide-by-50 Counter

’390

Enable

Figure 3.22: Block Diagram of Infrared Circuitry

A special circuit is used to generate infrared emissions modulated at the 40 KHzfrequency. A block diagram of this circuit is shown in Figure 3.22.

The diagram shows that the '390 chip, wired in a divide-by-fty conguration, isused to generate a 40 Khz signal from the 6811 E clock, a 2 Mhz signal. In actuality,the '390 chip contains two decade counters. Each these consists of a separate divide-by-ve counter and a ip- op (a divide-by-two device). The '390 is wired in thedivide-by-fty function by ganging two of the divide-by-ve counters and one of the ip- ops.

The IR control signal is wired to the clear input of the '390 chip; when this signalis low, the counters will reset and will be prevented from counting. By modulatingthis signal, the 6811 can generate the low-frequency square wave that ends up beingtransmitted to the Sharp sensor.

Figure 3.23 shows the full circuit schematic for the IR subsystem.The TIP120, a power transistor, is used to drive the infrared LED's. The output

Page 113: Ma - cs.uml.edu

3.7. THE INFRARED TRANSMISSION CIRCUIT 101

Clr

ClkA

ClkB

Clr

ClkA

ClkB

2

+5

Qa

Qb

Qc

Qd

Qa

Qb

Qc

Qd

+

IR Beacon Connector

S

+5V

1K

4.7K

Indicator LED

E Clock

A6

’390

1

4

14

15

12

3

5

6

7

13

11

10

9 TIP120

pin 2

pin 1

pin 3

Figure 3.23: Infrared Transmission Circuit

Page 114: Ma - cs.uml.edu

102 CHAPTER 3. 6.270 HARDWARE

of the '390 chip is driven into the base of the TIP120. When this signal is high thereis a positive dierential between the base and the emitter of the TIP120 and currentis allowed to ow from the collector to the emitter, thus driving current through theIR emitter. When this signal is low, the base and emitter are at the same dierentialand no current ows. This causes no current to be allowed to ow from the collectorto the emitter and the IR LEDs have no current owing through them so they turno.

3.7.1 The IR Beacon

High Current Red LEDs

MLED71 IR LED'sLED31-38

LED23-30

RP8/47 Ωx4 RP9/47 Ωx4

-+

Figure 3.24: Infrared Beacon Circuit

Figure 3.24 shows the schematic for the IR beacon. Each infrared LED has a visibleLED in series with it so it should be easy to ascertain that the device is transmittinginfrared light properly. The resistors act as current-limiters, limiting the amount ofcurrent that can travel through any branch of the circuit to between 10 to 20 mA.

3.8 The LCD Display

The rst fourteen pins of the 6.270 Board's Expansion Bus are designed to be com-patible with a 14-pin standard LCD bus. A variety of character-based LCD deviceswith dierent screen sizes use this standard bus.

The LCD bus standard is fairly simple, consisting of the following signals:

an 8-bit data bidirectional bus

two mode select input signals

a clock line

a voltage reference for contrast adjustment

Page 115: Ma - cs.uml.edu

3.8. THE LCD DISPLAY 103

+5 volt logic power

signal ground

In fact, reading and writing data to an LCD is much like reading and writing datato latches or to memory. There is one problem, however: LCDs only work at datatransfer rates up to 1 MHz. The 6811 in the 6.270 board operates at 2 MHz|toofast for most LCDs.

One straight-forward solution to the speed problem would be to use a '374-typelatch between the 6811 and the LCD. The '374 could be written to at the full busrate of the 6811; its outputs would drive the data bus of the LCD. A separate signalcould be used to toggle the LCD's clock line, causing it to latch the data that hadbeen written to the '3745.

An unconventional, zero-additional-hardware solution has been implemented inthe 6.270 system, which takes advantage of an obscure feature of the 6811 micropro-cessor.

The 6811 has two main operating modes, known as single chip mode and expandedmultiplexed mode. The discussion of memory read and write cycles that has beenpresented in this chapter has been based on the expanded multiplexed mode, whichis the 6811 mode that is used when external memory is part of the 6811 circuit.

When the 6811 is operated in single-chip mode, the upper-eight-bit address busand multiplexed address/data bus become general purpose inputs and outputs of the6811, controllable by system software. Thus, in single-chip mode, the 6811 couldcommunicate with the LCD with a software driver, rather than the too-fast hardwarecommunication.

There is a problem with this, however: when the 6811 is placed into single-chipmode, it can no longer execute a program from its external RAM. In fact, as far asthe 6811 is concerned, there is no external memory anymore.

Fortunately, the 6811 has 256 bytes of internal RAM, from which it can exe-cute a program when in single-chip mode. Thus, a software driver could executeout of internal RAM, perform a transaction with the LCD, and then switch backto expanded-multiplexed mode and return control to the main program in externalmemory.

The obscure feature mentioned is not the fact that the 6811 has both of thesemodes, but the idea of dynamically switching between them. Here is the solutionthat has been implemented:

1. Start by copying a software driver from external system memory into the 256bytes of internal 6811 memory.

2. Begin execution of the driver program located in internal memory:

5This solution assumes that one does not need to read status data back from the LCD.

Page 116: Ma - cs.uml.edu

104 CHAPTER 3. 6.270 HARDWARE

Place the 6811 into single-chip mode; external memory disappears.

Execute a low-speed transaction with the LCD by directly controlling thedata bus via software.

Place the 6811 into expanded-multiplexed mode.

Return to the main program in external memory.

3. Continue normal program execution.

The actual LCD driver routine buers characters to be printed to the LCD; onethousand times per second, an interrupt routine calls the internal memory driveras described, writing a single character to the LCD. The whole process operatestransparently to the 6.270 system user.

3.9 The Low-Battery Indicator

345

6U9b

D6 1N4148

D5 1N4148

D4 1N4148

R5 3.3K

+5V

RP3/1K

LED6 (red)

+5V

+RAM

Figure 3.25: Low Battery Indicator Circuit

A spare gate on U9 has been used to implement a low-battery indicator. Theschematic is shown in Figure 3.25.

The transition point for determining if a digital input is logic one or logic zero isnormally one-half of the supply voltage. Assuming a 5 volt supply, signals greaterthan 2.5 volts will be interpreted as logic ones, and signals less than 2.5 volts will beinterpreted as logic zeros.

Diodes have the interesting property that they drop exactly 0.6 volts when currenttravels through them. Thus the input voltage to the gate U9? will be about 1.8 volts,over a wide range of system supply voltages.

Page 117: Ma - cs.uml.edu

3.10. FUN HACKS 105

Assuming a 5 volt supply, this input would to be interpreted as logic zero. U9?is wired as an inverter, so it will output a logic one. Since the LED is wired fromsupply voltage, it will be o in this state.

Suppose supply voltage falls to 3.5 volts. Now the transition point is around 1.75volts. The input to the gate is 1.8 volts, so it becomes a logic one. U9? inverts thisto obtain a logic zero, and drives zero volts on its output, lighting the LED.

The actual transition point in the circuit is closer to 4 volts, because the diodestend to drop a bit more than 0.6 volts that are usually specied. Surprisingly, nearlyall of the 6.270 electronics, including the 6811 microprocessor, work ne at voltages aslow as 4 volts. One notably exception is the Sharp GP1U52 sensor: its performancedecreases sharply at supply voltages less than 4.5 volts.

3.10 Fun Hacks

Many people have created clever hardware hacks to the 6.270 board. Hopefully thissection will grow as more and more features are found to further develop the board.

3.10.1 Adding a Loudspeaker

There are two rather simple ways to add an external loudspeaker to the 6.270 board.Teams have done this to play music loudly. However, it requires some minor hardwaremodications, in particular, the loss of at least one unidirectional motor port on theExpansion Board. The rst version of this hack uses both sides of Motor 5. Thesecond version uses only the right unidirectional side of Motor 5.

Speaker Hack, v1.0

Steps for Speaker Hack v1.0:

Find Component Side of Expansion Board.

Find trace under the 74HC374 socket, from pin 19 of the '374 to pin 15 of theL293D. This trace extends underneath the '374 socket left toward the VR2 pot,then up through the false LCD Connector. There is an unused hole, immediatelyleft and slightly above pin 20 of the '374 socket that this trace runs through.

Cut the trace between the unused hole and the '374 socket with a sharp knife.

Place a single Female Header pin into the unused hole. This pin should nowconnect with pin 15 of the L293D.

Page 118: Ma - cs.uml.edu

106 CHAPTER 3. 6.270 HARDWARE

Motor 5

Motor 4

Expansion Bus &LCD Connector LED

OUT 1

LEDOUT 0

IN1IN2IN3IN4

CS1CS2

OUT1

OUT2

OUT3

OUT4

Vss

Vs

gnd

gnd

gnd

gnd

L 2 9 3

27

1015

19

3

6

11

14

816

4512

13

U21

Gnd+5vVRA9A8Ti4D0D1D2D3D4D5D6D7

ASA10S5S4S3S2S1S0

D0D1D2D3D4D5D6D7

OENCLK

Q0Q1Q2Q3Q4Q5Q6Q7

374

43

188

171413

7

111

521991615126

U17

+-

MOTOR PWR HDR

7 6 5 4 31

2

RP7/1K x 7

8

Q1

Q2

R16/2.2K

R17/2.2K +-

+-

LED13-18

External speaker

Pie

zo +

Figure 3.26: Speaker Hack, v1.0

Run a wire from the + signal of the Piezo on the Controller Board into theFemale Header you placed on the expansion board. There are several unusedholes on the Conroller Board for the piezo that you can solder to. Use MaleHeader on this signal wire so you can disconnect the Expansion Board from theController Board.

Plug your 8 external speaker into the bidirectional Motor 5 port. You maywish to put a 100-200 pot in series with the 8 speaker as a volume control.

In IC, use the command:

fd(5);

to turn on the speaker. Use the command:

off(5);

to turn o the speaker.

Page 119: Ma - cs.uml.edu

3.10. FUN HACKS 107

Motor 4

Expansion Bus &LCD Connector

Motor 5

LEDOUT 1

LEDOUT 0

IN1IN2IN3IN4

CS1CS2

OUT1

OUT2

OUT3

OUT4

Vss

Vs

gnd

gnd

gnd

gnd

L 2 9 3

27

1015

19

3

6

11

14

816

4512

13

U21

Gnd+5vVRA9A8Ti4D0D1D2D3D4D5D6D7

ASA10S5S4S3S2S1S0

D0D1D2D3D4D5D6D7

OENCLK

Q0Q1Q2Q3Q4Q5Q6Q7

374

43

188

171413

7

111

521991615126

U17

+-

MOTOR PWR HDR

7 6 5 4 31

2

RP7/1K x 7

8

Q1

Q2

R16/2.2K

R17/2.2K +-

+-

LED13-18

External Speaker

Motor GroundP

iezo

+

Figure 3.27: Speaker Hack, v2.0

Speaker Hack, v2.0

Steps for Speaker Hack v2.0

Find Component Side of Expansion Board.

Cut the trace from pin 16 of the '374 to pin 10 of the L293D. This trace shouldbe cut immediately above the '374 socket at pin 16.

Find the column of holes on the bottom right corner of the prototyping area,immediately to the left of the U19 label. Look one column left of that, directlyabove pin 10 of the L293D. Solder a single Female Header pin there.

Make a solder bridge between the Female Header pin you just placed and pin10 of the L293D immediately below it.

Run a wire from the + signal of the Piezo on the Controller Board into theFemale Header you placed on the expansion board. There are several unusedholes on the Conroller Board for the piezo that you can solder to. Use MaleHeader on this signal wire so you can disconnect the Expansion Board from theController Board.

Plug your 8 external speaker into the bidirectional Motor 5 port. You maywish to put a 100-200 pot in series with the 8 speaker as a volume control.

The right unidirectional motor port of Motor 5 is now wired to drive the speaker.The left unidirectional motor port of Motor 5 may still be used as normal.

Page 120: Ma - cs.uml.edu

108 CHAPTER 3. 6.270 HARDWARE

In IC, use the command:

motor5_right(1);

to turn on the speaker. Use the command:

motor_right(0);

to turn o the speaker.

Page 121: Ma - cs.uml.edu

Chapter 4

Printed Circuit Layouts

This section has the printed circuit board artwork patterns for the 6.270 Rev. 2.21boards:

the Microprocessor Board

the Expansion Board

the Battery Charger Board

the Motor Switch Board

the Infrared Beacon Board

The board artworks are provided to facilitate debugging; they are not intended toserve as master artworks for fabricating new printed circuit boards. The layouts arereproduced at actual size given the limits of Laserwriter reproduction technology.

109

Page 122: Ma - cs.uml.edu

110 CHAPTER 4. PRINTED CIRCUIT LAYOUTS

4.1 Microprocessor Board

Figure 4.1: Microprocessor Board, Component Side

Figure 4.2: Microprocessor Board, Solder Side

Page 123: Ma - cs.uml.edu

4.2. EXPANSION BOARD 111

4.2 Expansion Board

Figure 4.3: Expansion Board, Component Side

Figure 4.4: Expansion Board, Solder Side

Page 124: Ma - cs.uml.edu

112 CHAPTER 4. PRINTED CIRCUIT LAYOUTS

4.3 Battery Charger Board

Figure 4.5: Battery Charger Board, Component and Solder Sides

4.4 Motor Switch Board

Figure 4.6: Motor Switch Board, Component and Solder Sides

Page 125: Ma - cs.uml.edu

4.5. INFRARED BEACON BOARD 113

4.5 Infrared Beacon Board

Figure 4.7: Infrared Beacon Board, Component and Solder Sides

Page 126: Ma - cs.uml.edu

114 CHAPTER 4. PRINTED CIRCUIT LAYOUTS

Page 127: Ma - cs.uml.edu

Chapter 5

Debugging the 6.270 Rev. 2.21

Hardware

There are two reasons for reading this chapter. Either you have a 6.270 board thatdoes not seem to work properly, or you just want to learn more about how the 6.270hardware works. Hopefully this chapter will present the ways to detect problems withyour board, and how to x them.

5.1 Useful Debugging Tools

This is a list of commonly used tools necessary for debugging hardware. Most of theseparts are available in the 6.270 Tool Kit, which may be purchased along with yourkit.

The following is a list that I deem REQUIRED to adequately debug a board.

Jewlers screwdriver set. This is a set of 6-8 small screwdrivers, of varioussizes, both at head and Phillips head.

Needlenose pliers. A small pair of pliers that can be used in lieu of manytools you may not have.

Diagonal cutters. A sharp pair of diagonal cutters can be used to shortenlong part leads.

Wire strippers. Required if you ever need to replace a blown trace.

115

Page 128: Ma - cs.uml.edu

116 CHAPTER 5. DEBUGGING THE 6.270 REV. 2.21 HARDWARE

Multimeter. A good quality multimeter, complete with voltmeter, ohmmeter,ammeter, and continuity tester. Optional items include capacitor, inductor,transistor, and diode testers. Multiple probe tips can help free up your handsfor other uses.

Soldering Iron, sponge, and stand. Necessary to replace traces, touch upcold solder joints, etc. Keep extra tips handy so you always have a sharp tip onyour iron.

Helping Hands. Something else to hold the circuit board so your hands arefree to poke around and x parts.

These items are not required, but make life a lot easier for you.

Fan. A small fan can help keep solder fumes out of your eyes.

IC Extractor. While the pliers may be used to pull chips, it's better to usean IC extractor, so that the IC pins do not get bent.

PLCC Extractor. The best way to extract the 6811, should it be necessaryto remove it, is to use a PLCC extractor.

Magnifying glass. Not required, but helpful when you've got small traces orsolder joints to work with.

Digital Scope. These are really nice, and useful to analyze signals. Granted,these are also expensive, but if you happen to have one, there isn't a problemthat can't be xed.

Logic Analyzer. Again, if you think you've got a logic problem, this is youranswer.

5.2 General Debugging Tips

In debugging ANY piece of hardware, there are several key places to start lookingwhen problems arise. These are pretty general, and will be developed further later inthe chapter.

In this chapter, there will be many references to \The Board". For this, I usuallymean the Controller Board and the Expansion Board together as one item. These

Page 129: Ma - cs.uml.edu

5.2. GENERAL DEBUGGING TIPS 117

are the two most likely places where problems occur. Most of these techniques willequally apply to the IR Transmitter board, the Battery Charger board, or the MotorSwitchboard. However, those boards are rather small, and there aren't nearly asmany chances for error with them as there are with the Controller and Expansionboards.

Before beginning any debug, be sure there is no power connected to any compo-nent. Removing the AA batteries and the Gates cells should ensure that no power isconnected. Failure to do so may result in blown parts, shocks, and more componentfailures.

5.2.1 Component and Solder Sides

Throughout this chapter, we will refer to the two sides of the board as the componentside and the solder side. The component side has the white silkscreen componentmarkings. All components, including ICs, resistors, LEDs, and everything else, shouldbe placed on this side, with their pins sticking through the holes to the solder side.The solder side does not have a white silkscreen. All component leads should besoldered from the solder side, then clipped.

If components are placed onto the board from the wrong side, it is more than likelythat the board will not work. Be sure that the parts are placed on the componentside, and soldered to the solder side.

5.2.2 Power

Low, or nonexistent AA batteries. Things don't work unless they've gotpower going to them. The AA batteries should have a voltage of at least 5.1V,or else the DS1233-15 Econo-Reset chip may prevent the board from working.

Logic Power and Reset. The DS1233 will hold the board in reset if the AApower supply drops near 4.5V. To detect this, test the voltage between pin 2and pin 3 of the DS1233. When this signal is low, the board is being held inthe reset state. Check the voltage between pin 1 and pin 3. If that is not above4.5V, replace the AA batteries and see if that solves the problem.

Motor Batteries and AA Battery Life. Whenever your board is turnedon, both the Motor Batteries and the AA batteries should be plugged in. Themotor batteries supply power to the L293 chips. If the motor batteries are not

Page 130: Ma - cs.uml.edu

118 CHAPTER 5. DEBUGGING THE 6.270 REV. 2.21 HARDWARE

plugged in, the AA batteries are forced to drive the L293 chips, which draws alot of current. This kills a set of AAs pretty fast. Therefore, always keep themotor batteries plugged in.

Broken power wires. If the AA battery holder has a broken lead, it needs tobe replaced. A bad job of soldering the pack to the Controller Board can alsofail easily. Once the battery pack is properly soldered to the Controller Board,use a drop of hot glue to hold the wire to the board, and to act as a stress relief.

Pierced AA Battery wire. If the wires going to the AA battery pack getpierced by the sharp component leads, erratic behavior can result. Also, mostAA battery packs have one odd external wire that most people forget exists. Besure to keep that wire, and any other wire, away from the board with a pieceof two-sided foam tape.

3x5 Index Card. It is a very good idea to tape a 3x5 index card to thebottom of the Controller Board. Many times, the board is accidently set downon something metallic, which can cause a power short. The index card willinsulate the board from anything which might cause a short. Tape the indexcard directly to the bottom of the Controller Board, then tape the AA BatteryPack to the index card.

5.2.3 Power-Ground shorts

Before beginning assembly of the boards, always check for shorts between power andground. It is much simpler to test for shorts before assembly than after assembly. Onthe Controller board and the expansion board, there are actually two separate powersystems which need to be tested. If any of these tests shows a power-ground short,replace the board. 1

Controller Board - Motor Power

Motor power positive and negative rails can be found between the L293 motor chips,the 74HC390 decade counter, and the 74HC273 latch in the motor power header

1Tracking power-ground shorts down (even on a blank board) can be very dicult, and probablynot worth the time. In the past, the mounting holes in the corners of the boards have been plated,connecting power to ground where we never would have expected it.

Page 131: Ma - cs.uml.edu

5.2. GENERAL DEBUGGING TIPS 119

strip. On the component side, look for the three bars running between vertically.The left-most bar is motor ground. The center bar is motor power. There should beno continuity between them.

Controller Board - Logic Power

Logic power positive and negative rails can be easily found along the top of the boardat the LCD display header. White markings for GND and +5 indicate logic groundand logic power. There should be no conductivity between them.

Expansion Board - Motor Power

Motor power to the Expansion Board only comes onto the board through the MotorBattery Pins at the far left, next to the Frob Knob. Be sure these two pins are notsolder-bridged together, or you will be shorting out the motor batteries. Be sure thereis no continuity between these two pins.

Expansion Board - Logic Power

Just as on the Controller Board, the LCD display header provides an excellent andwell-marked place to test logic power. Again, GND and +5 marking can be foundthere.

TIP120 casing

Often, if the TIP120 on the Controller Board is not carefully installed, the metal casewill make contact with the edge of the Expansion Board, shorting out the power andground planes which are exposed along the edge of the Expansion Board.

Heat Sinks and Motor Power

The heat sinks placed on the L293 motor driver chips are designed to conduct heataway from the chips, allowing them to drive more current through them withoutmelting. Metal is used because it makes an excellent conductor for heat. However,it also is an excellent conductor for electricity. Be sure the heat sink is not touchingany of the pins on any of the L293 chips, or it may cause a short circuit.

Page 132: Ma - cs.uml.edu

120 CHAPTER 5. DEBUGGING THE 6.270 REV. 2.21 HARDWARE

5.2.4 Solder Joints and Solder Bridges

Since most of the 6.270 boards are soldered together by novices, you can bet thatthere will be some bad solder joints. The soldering technique chapter of the 6.270Course Notes discusses the dierences between good and bad solder joints. Bad solderjoints may make intermitant contact, which will result in aky board behavior. Usethe magnifying glass to look closely for cold solder joints.

Solder bridges join two pins that should not be joined. Pieces of component leadoften get soldered between two pins. Again, look closely for solder bridges, and xthem with the soldering iron.

5.2.5 Missing Parts

The \Ahh, I forgot about that!" phenomenon has stuck many times. People forget toinstall a chip or some other component. Carefully review the assembly instructionsto be sure that no components are missing. A quick examination of the bottom of theController Board can easily show that some parts may be missing. If a large sectionof the board has unused holes, chances are some part is missing.

5.2.6 Backward Parts

This can be the most annoying type of bug to nd. The parts have been placed on theboard, but they were installed backward. Any polarized part can have this problem.LEDs, diodes, capacitors, resistor packs, and chips are often placed incorrectly on theboard. This is especially true when parts are not clearly labeled.

ICs

The rst clue that a chip is in backward is when it gets very hot very fast. Whenthis happens, immediately turn o the board and remove the batteries. Let the partscool before continuing to work.

ICs have only one direction they can be inserted. Figure 5.1 shows the notchin each IC next to Pin 1. On the component side of the board, the white silkscreenshows the proper conguration for that notch. Also, Pin 1 of the IC should connectto a square pad on the solder side of the board.

Page 133: Ma - cs.uml.edu

5.2. GENERAL DEBUGGING TIPS 121

Pin 1 Pin 7

Pin 8Pin 14

Notch marking

Figure 5.1: Top View of 14-pin DIP

There are two ICs which will cause serious problems if they are installed backward.The rst is the 74HC373 latch, U3, the only IC which is soldered directly to the board,which resides underneath the SRAM.

The second is the PLCC socket for the 6811 processor. There is only one correctway to place the socket. It is nearly impossible to remove this socket if it is solderedincorrectly. The top left corner of the socket should be angled, as shown in Figure5.2

In many cases, these errors can be fatal to the board. Since the other ICs aresocketed, it's simple to turn them around to x the problem. If either of these issoldered onto the board backward, nd a very experienced person who can desolderit carefully.

LEDs and Diodes

\Short = Shaded" is the key to remember. The short pin on LEDs goes into theshaded hole on the board. This hole will also have a square pad, rather than a roundpad, when viewed from the solder side of the board. Square holes will also have asquare marking on the white silkscreen on the component side of the board. Thesquare, shaded terminal is the negative, or cathode terminal. The round terminal isthe positive, or anode terminal.

Figures 5.3 and Figure 5.4 show pictures of both a diode and an LED.

To test if an LED is in backward, use the diode test of the multimeter, with thepositive terminal on the round hole, and the negative terminal on the square hole. Ifthe LED is in properly, the diode test should show a value of about 1.6V, and theLED will light up dimly. If not, it should read as innite, or 1 on most meters, and

Page 134: Ma - cs.uml.edu

122 CHAPTER 5. DEBUGGING THE 6.270 REV. 2.21 HARDWARE

M

Motorola 68HC11A0

Pin 1 Marking

Figure 5.2: Top View of 52-pin PLCC

Cathode Anode

Figure 5.3: Typical Diode Package

Page 135: Ma - cs.uml.edu

5.2. GENERAL DEBUGGING TIPS 123

Short lead indicates cathode.

Cathode Anode

Side View

(-) (+)

Flatted rim indicates cathode.

Cathode Anode

Bottom View

(-) (+)

Figure 5.4: Identifying LED Leads

the LED will not light up.On normal 1N4148 glass signal diodes and 1N4001 power diodes, the diode test

will show a value of about 0.6V when it is good, or innite when it's bad, or incorrectlysoldered in place. Another good way to test that a diode are good is to check thevoltage drop across it's terminals while the board is turned on. With the negativeterminal of the voltmeter on the square solder pad (cathode) and the positive terminalon the round pad (anode), test to see that the voltage between these two points isbetween 0.6V and 0.8V. This means that the diode is dropping 0.6V as it is expectedto do.

Capacitors

Most capacitors are not polarized. A few of them are though. As with the diodes,the negative terminal of the capacitor will have a square pad on the board.

The electrolytic capacitors are tall round cylinders. The negative terminal isclearly marked with a large minus sign \-" on the side of the capacitor. This pinshould go to the square hole on the board.

Tantalum capacitors are small, and more round. They will have a white barpointing to a plus sign \+" which is the positive terminal. This pin should go to theround hole on the board.

Page 136: Ma - cs.uml.edu

124 CHAPTER 5. DEBUGGING THE 6.270 REV. 2.21 HARDWARE

Resistor Packs

CommonTerminal 7-Pack

IsolatedElement 4-pack

Figure 5.5: Resistor Pack Internal Wiring

There are two types of resistor packs, the E and V varieties. The V type is notpolarized, though the E type is polarized. Figure 5.5 shows a V type resistor packon the left, and an E type resistor pack on the right.

The E type has one common pin, and then a set of resistors in parallel. Thecommon pin will have a bar on the resistor pack to designate pin 1. On the board,the white silkscreen will have a square marking for pin 1, and from the solder sidethe pad should be square also. RP2 on the Controller Board, and RP5 and RP6 onthe Expansion Board do not have this square pad, though they do have the squaremarking in the silkscreen.

Transistors and the DS1233

The two MPS2222A transistors, and the DS1233 Econo-reset chip, all have a at side,and a rounded side. Positioned so that the at side is facing you, and the roundedside is facing away from you, pin 1 is to the left, pin 2 is in the middle, and pin 3is to the right. The white silkscreens show the proper positions for these parts. Thebeveled edge on the silk represents the rounded edge of the transistor or the resetchip.

The TIP120 power transistor is square, with no particular markings on the boardto indicate direction. The transistor should face to the left, toward the DC powerjack, so that the tall metal back is toward the Expansion Board. If this part in placedincorrectly, the IR Transmitter will not work.

Page 137: Ma - cs.uml.edu

5.3. SWAPPED PARTS 125

SW3 and SW4

SW3, \Choose", and SW4, \Escape", are nearly square, so it's simple to get themplaced 90 degrees wrong. When this happens, it will seem that the button is alwayspushed. To test for this, check the voltage on the right side of R12 and R13, the47k pull-up resistors for those switches. If the voltage is always 0V, whether or notthe button is pressed, that means that the switch is in sideways. Rotate the switch90 degrees.

5.3 Swapped parts

Many of the components on the 6.270 board look alike. Not surprisingly, some partsare then mistakenly swapped when soldered to the board.

A partial list of parts that are commonly swapped:

DS1233 and MPS2222A transistors. These parts are labeled, but the writingis very small. The Controller Board will not reset unless the DS1233 chip is inplace.

20-pin ICs: 74HC273 and 74HC244. The '244 is a octal line driver and the '273is an 8-bit-latch with clear. If you switch these two, Motors 0-3 will not workproperly, and the digital input ports will not work properly either.

20-pin ICs: 74HC373 and 74HC374. Since the '373 is a D-type latch, and the'374 is a D-type ip- op, the two are probably interchangeable. However, it'sbetter to stick with a proven design when possible.

16-pin ICs: L293D and L293B Motor Drivers. Rule of thumb: one and only oneL293D per motor chip socket. The L293B then stacked on top of the L293Dis optional, and allows the motors to be driven with more current. Since theL293D provides the spike-limiting diodes, one is needed per motor chip socket.

16-pin ICs: 74HC138, 74HC390, 74HC4051, 74HC4053. The '138 is the addressmultiplexor that drives the six motor ports, and the digital input port, as wellas SW3 and SW4. The '390 is a frequency divider used to transmit the 40kHzIR signal. The '4051 is an analog multiplexor used for the Expansion Boardanalog inputs. The '4053 is an analog switch driving the serial port. If any ofthese subsystems appears broken, check that the right chip is in place.

Page 138: Ma - cs.uml.edu

126 CHAPTER 5. DEBUGGING THE 6.270 REV. 2.21 HARDWARE

14-pin ICs: 74HC04, 74HC10, 74HC132. The '04 is a hex-inverter package usedto drive pins on motors 0-3, and to invert signal A6 from the processor to the'390 counter. There is one extra inverter (pins 7 and 8) available for future useon the '04. The '10 is a triple three-input NAND gate, which is used to enablethe SRAM CS chip select line and drive the low battery indicator. There isone extra NAND gate (pins 1,2,13, and 12) available for future use, thoughthe inputs are tied high now. The '132 is a quad two-input NAND gate withSchmitt Trigger inputs. It's used to drive the serial line input and output andas an A14 address line inverter going to the '138 multiplexor.

High-Power LEDs and High-Brightness Low-Power LEDs. The high-powerLEDs belong on the IR Transmitter board because they can handle a largercurrent. Using the diode test on the multimeter, the high-power LEDs dropabout 1.8V, while the high-brightness LEDs drop about 1.6V. Also, the high-power LEDs have shorter leads than the high-brightness LEDs, and they havea small lip at the base of the plastic package that the high-brightness LEDs donot have.

Capacitors of various sizes. Most of the time it really won't matter, as mostof the capacitors are used to lter the 5V power supply from the AA batteries,and they're all in parallel with each other. The capacitors around the '4053may make a dierence though.

Resistors of various sizes. Again, most of these won't make that much dierence,as they're either used to drive LEDs or act as pull-up resistors. However, ifthey're wrong, your AA batteries may die faster, or the LEDs may be brighterthan they should be.

6-pin RPs: RP4 E1k x 5, RP3 V1k x 3. RP4 has ve resistors in parallel,while RP3 has three individual resistors. RP4 drives the LEDs for motors 0-3,and there is an extra resistor available (pin 2). RP3 drives the LEDs for theserial transmit, serial receive, and low battery indicators. If the LEDs on theController Board appear not to work, check these resistor packs.

8-pin RPs: RP6 E47k x 7, RP7 E1k x 7. RP6 acts as pull-up resistors for analogports 21-27. RP7 drives the LEDs on the Expansion Board. There is one extraresistor in RP7 which is not being used (pin 8). If the LEDs do not work, and

Page 139: Ma - cs.uml.edu

5.4. COOKED COMPONENTS 127

analog ports 21-27 act dierently from analog ports 12-20, check these resistorpacks.

10-pin RPs: RP1, RP5. Since these are both E47k x 9 resistor packs, they areinterchangeable with no problem.

5.4 Cooked Components

As with all of these problems, rst nd the cause of the problem, then replace theparts. It does no good to x the symptoms without rst xing the cause.

Fuse trace. This thin trace runs from the inductor to logic ground on the solderside Controller Board, underneath SW1. When the board gets shorted againstnearly anything, this trace will burn or vaporize entirely. When this happens,logic ground and motor ground are no longer tied together in any way, whichcan cause severe problems. Most notably, the servo will stop working properly.Replace this trace with a small wire if it gets vaporized, and be very carefulfrom from that point forward.

Inductor L1. After the fuse trace has blown and has been replaced, the nextlikely part to blow is the inductor. A cooked inductor looks brown, black, orsmokes perhaps. When this happens, you've shorted the board again. Find thecause of the short, and x that, then replace the inductor.

Tantalum capacitors. If a tantalum capacitor is placed in backward, it mayburn, or even blow up, or there may be no visible change at all. Replace thecapacitor, because it won't work any longer.

5.5 Annoying Stupid Mistakes

This section is devoted to those annoying stupid mistakes that people often miss, butare very simple to x.

Bent IC pins. If you are not careful when you install the ICs, it is very simpleto bend a pin on the IC such that it does not make a connection with thesocket, but is bent outside the socket. If a chip gets hot, check that it's in placecorrectly, then check the pins to be sure they're all making good connections.

Page 140: Ma - cs.uml.edu

128 CHAPTER 5. DEBUGGING THE 6.270 REV. 2.21 HARDWARE

Forgotten Sockets. If you forget to install the sockets while you're assemblingthe board, it's not fatal. It just means that if there are any serious problemswith the chips, it's more dicult to x. You do not have to de-soldier the ICsyou soldered to the board.

Bad sockets. While this is rarely a problem, it can happen. Cheap, inferiorquality sockets may not bond well with the solder. We've only seen this problemwhen wave soldering the boards. The x is to hand-solder the sockets whichdidn't bond well.

No Motor Batteries. Forgetting to keep the motor batteries plugged in isstupid. The AA batteries will get ruined much faster. Besides, the motors can'tturn (even though the LEDs may light dimly) without the motor batteries beingplugged in.

Missing Header pins. Be sure you've got the right number of header pinsfor each of the header ports. Being one pin short is easily xed, but sometimeshard to detect.

Broken Female Header. If you're not careful when you cut the female headerstrips, you may break a pin. These are sometimes dicult to spot, but simpleenough to x.

Sensors plugged in backward. How many times has this happened to you?for some sensors, it doesn't matter at all (e.g. pushbuttons and photoresistors),but for others (like the Sharp IR Receivers) it does.

IR Transmitter plugged in backward. When you plug in the IR Transmit-ter, if you've programmed the board to transmit, the lights should light dimly.If the transmitter is not turned on in software, but the lights are still on, thenthe transmitter is plugged in backward. When this happens, the transmitterwill get very hot, and may even melt the hot-glue used to secure it to LEGO.

5.6 Replacement Parts

A lot of times people ask, \Can I replace part X with part Y"? In general, the answeris no. But, there are some parts which can substitute for others, and some thatcannot.

Page 141: Ma - cs.uml.edu

5.7. NON-BOARD PROBLEMS 129

NiCad AA batteries. NiCad AA batteries typically are 1.2V per cell ratherthan the 1.5V like alkalines are. Four 1.2V cells total 4.8V. After the 0.6V dropacross the diode on the logic power system, that only leaves 4.2V to drive thesystem on. The chips don't work well at that voltage. The Dallas 1233 ICwill not let the board reset if the board voltage is that low. Therefore, NiCadscannot be used in the 6.270 board.

TI SN754410 chip. The TI SN754410 chip is made to be a pin-for-pin re-placement for the L293D chip. It works just ne, and can drive more currentthan the L293D chip. Go right ahead and swap them if you like. You can evenput the L293B chip on top of the TI chip to get even more current. The onlydrawback is that it draws .1ma more quiescent current, but that's not a lot.

5.7 Non-board Problems

This section is devoted to those problems which occur with the computers or externaldevices which are needed to program or use the 6.270 hardware.

5.7.1 Serial Cable

Yellow

Black

TxD

RxD

Phone Plugtop view

DB25To pin 2

To pin 3

To pin 7Controller BoardSolder Side IBM, DECStation, or

Macintosh "Modem" cableRed and Green

RxD

TxD

Figure 5.6: Serial cable schematic for a standard RS232 cable.

There's only one way to make a cable that will work, and that one way is dependanton the type of computer you've got to program the 6.270 board with. If that cableis made incorrectly, or is broken, or whatever, that will need to be xed before anyprogramming can be done.

When a serial cable is plugged into both the host computer and the 6.270 board,the green SER RCV light on the right side of the board should illuminate. If thegreen light does not come on, there is a problem somewhere, either in the computerserial port, in the cable, or in the 6.270 serial receive circuit.

Page 142: Ma - cs.uml.edu

130 CHAPTER 5. DEBUGGING THE 6.270 REV. 2.21 HARDWARE

Note: On a Apple Macintosh Powerbook, the green light may not illuminate whenthe cable is plugged in until IC starts up and activates the serial port. The computersaves power by not turning on port unless it is actually in use.

Assuming that the cable is ok, and the board is OK, you still may not be able todownload to the board. Typically, this is caused by an incorrect conguration of thehost computer.

5.7.2 UNIX devices

Dierent UNIX workstations name their serial ports dierently. Typically, the serialdevice will be addressed as /dev/tty00 or /dev/tty01, though some may be labeled/dev/ttya or similar. Find out from your system administrator what the name ofthe serial port is. You may specify the option -port portname option to ic and dl

if necessary.

Page 143: Ma - cs.uml.edu

5.7. NON-BOARD PROBLEMS 131

The user must have read/write privilages for the serial port as well. To test forthis, type:

athena% ls -l /dev/ttya | awk 'print $1'

crw-rw-rw-

^^^ (these are the important bits)

The furthermost right rw- shows that the user has read and write access to the device.If these bits are not set, the user cannot read or write on the serial port.

To allow read/write access to the serial port, type:

athena% su root

password: (get root password from the system administrator)

# chmod a+rw /dev/ttya

# exit

5.7.3 DOS/Windows devices

Since WinIC is not ocially supported by the 6.270 Organizers, any comments madehere are strictly my own experience, and not ocial in any way. Perhaps the interfacewill be cleaned up in the future, so problems with serial ports go away.

DOS and Windows devices can be tricky, especially if other devices, such as mice,trackballs, or modems are installed. If your computer has only one external serialport, and a mouse is installed there, you may not be able to run IC. At least one freeexternal serial port is required to connect the PC to the board.

Properly setting up serial ports in Windows is dicult, if not impossible. I leavethis particular hassle to the user to gure out. In general, COM1 and COM3 areinstalled on the same interrupt, and COM2 and COM4 are installed on the sameinterrupt. At most one from each pair can be active at the same time. It's usuallybest to put the serial cable on COM2 when the mouse is installed on COM1.

Once you know which serial port the cable to the board is installed on, IC hasa Congure option in the menus which allows the user to select the COM port theboard is connected to.

If there are problems, consult the Windows Users Guide.

Page 144: Ma - cs.uml.edu

132 CHAPTER 5. DEBUGGING THE 6.270 REV. 2.21 HARDWARE

5.8 Quick checklist

5.8.1 Hardware problems

Symptom Cause Solution

LCD dim or unreadable LCD Contrast too low. Adjust LCD Contrast.Low AA batteries. Replace AA batteries.

Motors don't work Motor batteries unplugged. Plug in motor batteries.Missing motor driver chips. Plug in motor driver chips.

Missing '273 chip. Plug in '273 chip.Fuse trace is blown. Replace fuse trace.

Board keeps resetting. Low AA batteries. Replace AA batteries.Intermittant power-ground short Fix short.Broken AA battery wire. Replace AA battery wire.

Resets when a sensor is pushed. Low AA batteries. Replace AA batteries.Pullup resistor too small. Pullup should be 47k for most sensors.

Servo jitters. Fuse trace is blown. Replace fuse trace.Command driving servo beyond it's limits. Reset servo limits.Command not waiting for servo to reach it's position. Wait between servo commands.

5.8.2 Software problems

Most of the software problems are explained pretty well in the IC chapter of the 6.270Course Notes. However, some common software errors can be mistaken for hardwareerrors.

Symptom Cause Solution

Servo jitters. Command driving servo beyond it's limits. Reset servo limits.Command not waiting for servo to reach it's position. Wait between servo commands.