This is the Revision A verion of the IRDistance1 RoboBrick. The status of this project is work in progress.

IRDistance1 Robobrick (Revision A)

Table of Contents

This document is also available in PDF format.

1. Introduction

The IRDistance1 RoboBrick is used to connect operate one Sharp® GP2D12 IROD (InfraRed Optical Distance) measuring sensor. The GP2D12 module provides an analog voltage that is proportional to the distance (although not linearly.) The analog voltage is converted into a number between 0 and 255 to report back the distance.

2. Programming

The IRDistance1 RoboBrick can enable zero, one or more of the AIROD's. For the ones that are enabled, it continuously reads the distance values. To conserve power, only one AIROD is powered up at a time.

The IRDistance1 RoboBrick supports RoboBrick Interrupt Protocol for those lines that are being used as inputs. The interrupt pending bit is set whenever the the formula:

L&(~I) | H&I | R&(~P)&I | F&P&(~I)
is non-zero, where: and Once the interrupt pending bit is set, it must be explicitly cleared by the user.

In addition to the common shared commands and the shared interrupt commands, the AnalogIn4 RoboBrick supports following commands:
Command Send/
Receive
Byte Value Discussion
7 6 5 4 3 2 1 0
Read Distance Send 0 0 0 0 0 0 0 b Read IROD b and respond with 8-bit value dddddddd
Send d d d d d d d d
Read Binary Values Send 0 0 0 0 0 0 1 0 Return the binary values ab (after XOR'ing with complement mask)
Receive 0 0 0 0 0 0 a b
Read Raw Binary Send 0 0 0 0 0 0 1 1 Return the raw binary values ab (no XOR with complement mask)
Receive 0 0 0 0 0 0 a b
Reset Send 0 0 0 0 0 1 0 0 Reset everything to zero
Read Enable Bit Send 0 0 0 0 0 1 0 1 Read and return the enable bit e
Receive 0 0 0 0 0 0 0 e
Set Enable Bit Send 0 0 0 0 0 1 1 e Set enable bit to e
Read Complement Mask Send 0 0 0 0 1 0 0 0 Return and return the complement mask cccc
Receive 0 0 0 0 0 0 c c
Read High Mask Send 0 0 0 0 1 0 0 1 Return and return the high mask hh
Receive 0 0 0 0 0 0 h h
Read Low Mask Send 0 0 0 0 1 0 1 0 Return and return the low mask ll
Receive 0 0 0 0 0 0 l l
Read Raising Mask Send 0 0 0 0 1 0 1 1 Return and return the raising mask rr
Receive 0 0 0 0 0 0 r r
Read Falling Mask Send 0 0 0 0 1 1 0 0 Return and return the falling mask ff
Receive 0 0 0 0 0 0 f f
Read High Threshold Send 0 0 0 1 0 0 0 b Read and return high threshold for pin b of hhhhhhhh
Receive h h h h h h h h
Read Low Threshold Send 0 0 0 1 0 0 1 b Read and return low threshold for pin bb of llllllll
Receive l l l l l l l l
Set High Threshold Send 0 0 0 1 0 1 0 b Set high threshold for pin b to hhhhhhhh
Send h h h h h h h h
Set Low Threshold Send 0 0 0 1 0 1 1 b Set low threshold for pin b to llllllll
Send l l l l l l l l
Set Complement Mask Send 0 0 1 0 0 0 c c Set complement mask to cc
Set High Mask Send 0 0 1 0 0 1 h h Set high mask to hh
Set Low Mask Send 0 0 1 0 1 0 l l Set low mask to ll
Set Raising Mask Send 0 0 1 0 1 1 r r Set raising mask to rr
Set Falling Mask Send 0 0 1 1 0 0 f f Set falling mask to ff
Read Interrupt Bits Send 1 1 1 0 1 1 1 1 Return the interrupt pending bit p and the interrupt enable bit e.
Receive 0 0 0 0 0 0 e p
Set Interrupt Commands Send 1 1 1 1 0 c c c Set Interrupt Command ccc.
Shared Commands Send 1 1 1 1 1 c c c Execute common shared command ccc

3. Hardware

The hardware consists of a circuit schematic and a printed circuit board.

3.1 Circuit Schematic

The schematic for the IRDistance1 RoboBrick is shown below:

IRDistance1 Schematic

The parts list kept in a separate file -- irdistance1.ptl.

3.2 Printed Circuit Board

The printed circuit board files are listed below:

irdistance1_back.png
The solder side layer.
irdistance1_front.png
The component side layer.
irdistance1_artwork.png
The artwork layer.
irdistance1.gbl
The RS-272X "Gerber" back (solder side) layer.
irdistance1.gtl
The RS-272X "Gerber" top (component side) layer.
irdistance1.gal
The RS-272X "Gerber" artwork layer.
irdistance1.drl
The "Excellon" NC drill file.
irdistance1.tol
The "Excellon" tool rack file.

4. Software

The software for the IRDistance1 is listed below:

irdistance1.ucl
The µCL file for IRDistance1.
irdistance1.asm
The assembly file for IRDistance1.
irdistance1.hex
The Intel® Hex file.
irdistance1.lst
The listing file for IRDistance1.

5. Issues

Any fabrication issues will be listed here.


Copyright (c) 2001-2003 by Wayne C. Gramlich. All rights reserved.