Command:
Byte
0
Checksum8
1
0xF8
2
0x02
3
0x0A
4
Checksum16 (LSB)
5
Checksum16 (MSB)
6
Reserved
7
Reserved
8
TimerClockConfig
Bit 7: Configure the clock
Bits 2-0: TimerClockBase
b000: 4 MHz
b001: 12 MHz
b010: 48 MHz (Default)
b011: 1 MHz/Divisor
b100: 4 MHz/Divisor
b101: 12 MHz/Divisor
b110: 48 MHz/Divisor
9
TimerClockDivisor (0 = ÷256)
Response:
Byte
0
Checksum8
1
0xF8
2
0x02
3
0x0A
4
Checksum16 (LSB)
5
Checksum16 (MSB)
6
Errorcode
7
Reserved
8
TimerClockConfig
9
TimerClockDivisor (0 = ÷256)
TimerClockConfig
: Bit 7 determines whether the new TimerClockBase and TimerClockDivisor are written, or if just a read
is performed. Bits 0-2 specify the TimerClockBase. If TimerClockBase is 3-6, then Counter0 is not available.
TimerClockDivisor
: The base timer clock is divided by this value, or divided by 256 if this value is 0. Only applies if
TimerClockBase is 3-6.
5.2.5 - Feedback
A flexible function that handles all command/response functionality. One or more IOTypes are used to perform a single write/read
or multiple writes/reads.
Note that the general protocol described in Section 5.1 defines byte 2 of an extended command as the number of data words,
which is the number of words in a packet beyond the first 3 (a word is 2 bytes). Also note that the overall size of a packet must be
an even number of bytes, so in this case an extra 0x00 is added to the end of the command and/or response if needed to
accomplish this.
Since this command has a flexible size, byte 2 will vary. For instance, if a single IOType of PortStateRead (d26) is passed, byte 2
would be equal to 1 for the command and 3 for the response. If a single IOType of LED (d9) is passed, an extra 0 must be added
to the command to make the packet have an even number of bytes, and byte 2 would be equal to 2. The response would also need
an extra 0 to be even, and byte 2 would be equal to 2.
Command:
Byte
0
Checksum8
1
0xF8
2
0.5 + Number of Data Words (IOTypes and Data)
3
0x00
4
Checksum16 (LSB)
5
Checksum16 (MSB)
6
Echo
7-63
IOTypes and Data
Response:
Byte
0
Checksum8
1
0xF8
2
1.5 + Number of Data Words (If Errorcode = 0)
3
0x00
4
Checksum16 (LSB)
5
Checksum16 (MSB)
6
Errorcode
7
ErrorFrame
8
Echo
9-63
Data
IOTypes & Data
: One or more IOTypes can be passed in a single command, up to the maximum packet size. More info
about the available IOTypes is below. In the outgoing command each IOType is passed and accompanied by 0 or more data
bytes. In the incoming response, only data bytes are returned without the IOTypes.
Echo
: This byte is simply echoed back in the response. A host application might pass sequential numbers to ensure the
responses are in order and associated with the proper command.
ErrorFrame
: If Errorcode is not zero, this parameter indicates which IOType caused the error. For instance, if the 3rd
passed IOType caused the error, the ErrorFrame would be equal to 3. Also note that data is only returned for IOTypes before
the one that caused the error, so if any IOType causes an error the overall function response will have less bytes than
expected.
46