beautypg.com

PNI CommBoard User Manual

Page 22

background image

PNI Sensor Corporation

DOC#1018122 r02

PNI CommBoard User Manual

Page 20

] or W or w

– Finish Write Packet

An end square bracket, a „W‟, or a „w‟ character finishes the construction of an I

2

C

packet to write data to the slave device. The syntax of the packet is:

[SLA REG data data data….data]

Where:

All numbers must be in 2-digit hexadecimal format. For example, the value

zero must be represented as “00” and the value one as “01”. As a result, no

delimiter is necessary.

SLA is the 7-bit slave address in the 7 MSBits, plus the r/w bit in the LSB.

However, the value of the r/w bit does not matter, as the CommBoard ensures

the r/w bit is properly set. For example, the SpacePoint Scout‟s 7-bit slave

address is 0x0C, and shifting it into the 7 MSBits makes SLA = 0x18. Even if
the LSB, or r/w bit, is set to “1” indicating a read operating, the CommBoard
will transmit SLA = 0x18, effectively changing the LSB to reflect a write

operation.

REG either can be the first register number to write to or a command number,

depending on the client hardware protocol.

Data are the data bytes to write. Up to 62 bytes can be written in one packet.

Example:

For the SpacePoint Scout, [ 18b4] sends the command 0xB4, which establishes
the cursor‟s reference frame (ResetRef). Recall the SpacePoint Scout has a left-
shifted SLA address of 0x18, and the CommBoard recognizes that the closing “]”

bracket indicates this is a write command.

~

– DRDY Hold

This command causes an indefinite delay of processing subsequent characters
received from the host until a „Q‟ character is received or the conditions of DRDY
port pin are met. The syntax is:

~#

such that # is either “1” or “0”, where “1” indicates DRDY must be HIGH to release
the hold and “0” indicates DRDY must be LOW.

Characters received from the host will continue to be stored in a 100-character

receive buffer. The exceptions are the „Q‟ and „F‟ commands, as they are processed

as soon as they are received. Once the hold condition on the DRDY line is met the

system will begin processing characters in the receive buffer in the order received.