Online Development Notebook > Index > ODN > Raw Device Programming > 02 - WriteBCmd

Command #02 - WriteBCmd


Description:

Write a byte value to port B. The possible values range from 0-255 (00h to FFh).

Command Format:

Byte Number Description
0 02h: WriteBCmd
1 Byte Data - This byte is written to port B, D8 - D15
The most significant bit of the byte value is written to D15
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 contains the data to write to port B. Byte 2 through byte 7 are unused.

Response Format:

Byte Number Description
0 02h: WriteBCmd
1 <not used>
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 through byte 7 are unused.

Example Usage:

Writing a 11h to port B with the command 02-11-00-00-00-00-00-00 will set lines B.4 and B.3 high and will set the remainder of the lines low, assuming that they are configured as outputs.


Hardware:  U401 USB Interface    U421 USB Interface
Programming:  USBm DLL Programming    Download Files
Application Notes:  U4x1 Application Notes    Misc Applications and Information    FAQ