| Online Development Notebook > Index > ODN > Raw Device Programming > 05 - ReadACmd |
Command #05 - ReadACmd
Description:
Read a byte value from port A. The returned value is the state of the port lines that an external device has set, if the line is an input. The lines that might be configured as outputs return the output state.
Command Format:
| Byte Number | Description |
| 0 | 05h: ReadACmd |
| 1 | <not used> |
| 2 | <not used> |
| 3 | <not used> |
| 4 | <not used> |
| 5 | <not used> |
| 6 | <not used> |
| 7 | <not used> |
Command Format Details:
Byte 0 contains the command. Byte 1 through byte 7 are unused.
Response Format:
| Byte Number | Description |
| 0 | 05h: ReadACmd |
| 1 | Data read from port A |
| 2 | <not used> |
| 3 | <not used> |
| 4 | <not used> |
| 5 | <not used> |
| 6 | <not used> |
| 7 | <not used> |
Response Format Details:
Byte 0 contains the command. Byte 1 contains the current value of port A. Byte 2 through byte 7 are unused.
Example Usage:
If the port lines were hi⁄lo⁄hi⁄lo⁄hi⁄lo⁄hi⁄lo (msb high), the command 05-00-00-00-00-00-00-00 would return 05-AA-00-00-00-00-00-00 (assuming that the port is set as all inputs).
| Hardware: U401 USB Interface U421 USB Interface |
| Programming: USBm DLL Programming Download Files |
| Application Notes: U4x1 Application Notes Misc Applications and Information FAQ |