This is the Revision A verion of the IRDistance8 Module. The status of this project is finished.
This document is also available in PDF format.
The IRDistance8 Module is used to connect up to 5 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 IRDistance8 Module 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 IRDistance8 Module supports Module 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 Module 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 IRDistance8 Module is shown below:
The parts list kept in a separate file -- irdistance8.ptl.
The printed circuit board files are listed below:
The software for the IRDistance8 is listed below:
The following issues need to be addressed: