Code:
*******************************
* FUSION BRAIN V4 BYTE STREAM *
* *
* Deterministic Difference: *
* PID Suffix: E *
* *
*******************************
**** ID CODE ****
Version 3a: VID_04D8&PID_000A
Version 3b: VID_04D8&PID_000B
Version 3c: VID_04D8&PID_000C
Version 3d: VID_04D8&PID_000D
Version 4: VID_04D8&PID_000E
**** STREAM ****
Bytes
[00-31] Digital Outputs 00 through 15
[32-57] Analogue Inputs 00 through 12
[57-59] Not Used Now, Maybe in future
[60] Number of Streams to Receive
[61] Initialize/Watchdog byte
[62] Hardware Version
[63] Firmware Version
Bits 0bMxxxxxxL | M = MSB and L = LSB
Digital Outputs
2 bytes per output
[PPPPPPPS][TTTTTTMM]
P = Value of PWM
([7bit Value + 1]/128)% duty cycle
Details of full period to be determined later
S = 1bit state
0 = Off
1 = on
T = 6bits of Timer to shutoff --> [Evaluated Units in Seconds]
If 6'bTTTTTT is 0, then shut off immediately on disconnect
If 6'bTTTTTT is between 1 and 10 inclusive, then wait [6'bTTTTTT] seconds after disconnect
If 6'bTTTTTT is 11, then wait 30 seconds after disconnect
If 6'bTTTTTT is 12, then wait 60 seconds after disconnect
If 6'bTTTTTT is 13, then wait 90 seconds after disconnect
If 6'bTTTTTT is greater than 14, then wait ([6'bTTTTTT] * 10) seconds after disconnect
M = 2bit Output Mode
2'b00: Normal Full-Off or Full-On Operation Mode
2'b01: Pulse Width Modulation Operation Mode
2'b10: Yet to be determined
2'b11: Yet to be determined
Analogue Inputs
2 bytes per input
[index][index + 1] = [000000Mx][xxxxxxxL] | M = MSB and L = LSB
Number of Streams to Receive
1 byte
[NNNNNNNN] | N = Number of streams to receive
If [8'bNNNNNNNN] is 0 (default) then receive 1 byte and send 1 byte
If [8'bNNNNNNNN] is greater than 0 then receive 1 byte and send 1 byte [8'bNNNNNNNN] times
Each of these "extra" byte streams received may not coorespond with the details of this byte stream outline
Each of the "extra" byte streams sent back to the PC may not coorespond with the details of this byte stream
Initialize/Watchdog Byte
1 byte
[000000IF] | F = Flipping Bit and I = Initialize Bit
F = Instead of flipping a bit in every digital output, flip 1 bit constantly
I = Needs I high to turn anything on, just like default behaviour of byte[61] now
Hardware Version
[MMMMLLLL]
M = Major Version. Currently Version 4, so MMMM = 0100
L = Minor Version. Currently Version 0, so LLLL = 0000
Firmware Version
1 byte
[????????]
Bookmarks