lego mindstorms hitachi h8-based rcx brick b.a. juliano, r.s. renner, f. jauregui january 2004...

Post on 22-Dec-2015

216 Views

Category:

Documents

0 Downloads

Preview:

Click to see full reader

TRANSCRIPT

LEGO MindstormsHitachi H8-based RCX

brickB.A. Juliano, R.S. Renner, F. Jauregui

January 2004

California State University, ChicoIntelligent Systems Laboratory

Chico, CA 95929-0410http://isl.ecst.csuchico.edu

LEGO Mindstorms

• http://mindstorms.lego.com

Robotics Invention System 2.0

• RIS Kit

Contents of Kit

• RCX™ Microcomputer• CD-ROM Software• Contructopedia™• 3 Guided Challenges• 6 Pro Challenges• USB Infrared Transmitter• 718 pieces, including:• 2 Motors• 2 Touch Sensors• 1 Light Sensor

CompatibilityMinimum Requirements for your PC:

Operating System  Windows® 98*

CPU Pentium II 233 MHz 

RAM 32 MB

Available Hard Disk Space

115 MB

Mouse Windows® Compatible

SoundSound Blaster 16™ Windows® Compatible Sound

Device

CD-ROM Speed CD 8X

Video Display 800 X 600 SVGA with 4 MB RAM

Colors Colors 16 bit

Modem (optional) 28.8 KBPS

Internet Browser (optional)

Netscape® Navigator or Microsoft™ Internet Explorer

•Not compatible with Windows NT or Windows 2000 operating systems.

RIS 2.0 RCX BrickAn autonomous LEGO microcomputer that can be programmed using a PC. The RCX serves as the brain of LEGO MINDSTORMS inventions.

About the Brick

• LCD (Liquid Crystal Display)• Four buttons• One internal speaker• Three sensor inputs• Three actuator outputs• IR (Infrared) interface

About the Brick

• Hitachi H8 series microcontroller• 8 bit CPU at 16 MHz• 32 KByte RAM• 16 KByte ROM for the BIOS• serial I/O (input/output)• ADC (analog digital converter)• built-in timers

Features

• Instruction set with 57 basic instructions, including:– Multiply and divide instructions– Powerful bit-manipulation

instructions

• High-speed operation– All frequently-used instructions

are executed in two to four states

Software Architecture

• System ROM Layer• Low level control software • Interface to hardware• Second piece of software

– Firmware– Located in RCX ROM

Firmware

• Can bypass system ROM software– Allows complete control of RCX

• Erased when power removed• In RCX RAM• Can use standard Firmware OR

– Can be replaced with others– birickOS

Caution

• When changing batteries you may loose Firmware and all programs– Replace one at a time– Do within one minute

Multi-Tasking

• Threading– Multiple things at one time

• Can create new threads to accomplish Multi-Tasking

Put it All Together

Hitachi H8/3292Microcontroller

Hitachi H8/3292 diagram

Hitachi H8/3292 package

H8/300 CPU• 8-bit data

• 16-bit address space

• 8 X 16 bit registers (r0-r7)– R0 – function return– R7 – stack pointer

• 16 MHz clock

H8/3292 Block Diagram

RCX Memory Layout

Input Devices

• 3 Sensors• 4 Buttons• Battery level monitor• Timers

Light Sensor

•Two components•Light detector•Small light source

•Light turned on to find something close. Amplifies difference between light and dark.

•Great for line following

Light Sensor cont.

• Highly sensitive to ambient light– Sunlight is the worst

• How to solve problem– Take two light sensor readings and

subtract the background light• Sensitive to objects reflective

surface.– Thus, difficult to measure distance.

Light Sensor cont.

• Light measured as– 0% (total darkness) to– 100% (very bright).

Light Sensor cont.

voltagemeasurement

light energy

electrical flow

voltagemeasurement

light energy

photo-transistor

Uses for Light Sensor

• Navigation • Black on white• White on black

• Find light• Avoid light• Sort colors

• black Lego bricks• yellow Lego bricks.

• Input Device • colors or gray levels on paper.

Touch Sensor

force voltagemeasurement

electrical flow

Uses for Touch Sensor

• Detect contact • Wall detection• Internal contact

• Arm contact with internal parts

• Constant contact• Make sure bot does not fall off of a

table

• Input Device• Use as a push button

Others

• You can buy or make you own sensors– Example: Temperature sensor– Search online– Lots of resources

http://www.plazaearth.com/usr/gasperi/lego.htm

Temperature Sensor

Temperature Sensor cont.

Temperature Sensor cont.

Temperature Sensor cont.

Output Devices

• 3 Actuator Ports• 5-segment LCD• Speaker

Bidirectional Device

• Infrared port

LegoOS Network Protocol (LNP)

• Communication between brickOS and host computers

• If packets arrive– Free of corruption

• Collision problems

top related