Online Development Notebook > Index > ODN > Raw Device Programming > 06 - ReadBCmd

Command #06 - ReadBCmd


Description:

Read a byte value from port B. 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 06h: ReadBCmd
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 06h: ReadBCmd
1 Data read from port B
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 B. Byte 2 through byte 7 are unused.

Example Usage:

If the port lines were hi⁄hi⁄hi⁄hi⁄lo⁄lo⁄lo⁄lo (msb high), the command 06-00-00-00-00-00-00-00 would return 06-F0-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