This is the Revision A verion of the AIROD2 RoboBrick. The status of this project is that it has been replaced by the AIROD4 RoboBrick.
This document is also available in PDF format.
The AIROD2 RoboBrick is used to connect up to 2 Sharp® GP2D12 IROD (InfraRed Optical Distance) measuring sensors. The GP2D12 module provides an analog voltage that is proportional to the distance (although not linearly.)
The AIROD2 RoboBrick is continuously reading the analog inputs from its two AIROD's. The controlling program can just read the results of the digital conversion, or it can have the result down converted into a single binary bit. Each pin has has a threshold high and threshold low register that is used for the down conversion. Whenever the digital conversion exceeds the high threshold register, the down coversion results in a 1. Whenever the digital conversion is lower than the low threshold register, the down conversion results in a 0. A hysterisis effect can be introduced by having some spread between the high and low threshold values.
After the down coversions to binary bits, the result is 2-bits of binary data. A complement mask can be used to selectively invert individual bits in the 2-bit data.
The AIROD2 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:
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 |
The hardware consists of a circuit schematic and a printed circuit board.
The schematic for the AIROD2 RoboBrick is shown below:
The parts list kept in a separate file -- airod2.ptl.
The printed circuit board files are listed below:
The software for the AIROD2 is listed below:
The following issues have come up: