Baud: 12000000
Data bits: 8
Stop bits: 1
Byte order: Little endian
Terminator: Line Feed (not used)
Flow control: none
Parity: none
DTR (Data terminal ready): off
RTS (Request to send): on (AKA CTS / clear to send)
Output Buffer Size: Preferably >100kB
Pulse Pal uses a one-byte op-code to specify each operation. Some operations may expect more data to follow. When this is true, the following convention is used for datatypes:
RED: 8-bit unsigned integer (1 byte)
GREEN: 16-bit unsigned integer (2 bytes)
BLUE: 32-bit unsigned integer (4 bytes)
Pulse train parameters are explained in depth in the parameter guide.
All transmissions must begin with the Op menu byte: 213.
Next, an op code byte must follow.
The op code bytes are:
72 (character 'H'): Handshake
Pulse Pal returns byte 75 (character 'K')
Pulse Pal then returns a 32-bit integer specifying the firmware build number.
73: Program Pulse Pal (ALL parameters, ALL channels)
Pulse Pal expects the following bytes next:
Output channel 1, Phase1Duration (Bytes 3-6, units = cycles*)
Output channel 1, InterPhaseInterval (Bytes 7-10, units = cycles*)
Output channel 1, Phase2Duration (Bytes 11-14, units = cycles*)
Output channel 1, InterPulseInterval (Bytes 15-18, units = cycles*)
Output channel 1, BurstDuration (Bytes 19-22, units = cycles*)
Output channel 1, InterBurstInterval (Bytes 23-26, units = cycles*)
Output channel 1, PulseTrainDuration (Bytes 27-30, units = cycles*)
Output channel 1, PulseTrainDelay (Bytes 31-34, units = cycles*)
Output channel 2, Phase1Duration ... PulseTrainDelay (Bytes 35-66, units = cycles*)
Output channel 3, Phase1Duration ... PulseTrainDelay (Bytes 67-98, units = cycles*)
Output channel 4, Phase1Duration ... PulseTrainDelay (Bytes 99-130, units = cycles*)
Output channel 1, Phase1Voltage (bytes 131-132, units: [0-65535 = -10V: +10V])
Output channel 1, Phase2Voltage (bytes 133-134, units: [0-65535 = -10V: +10V])
Output channel 1, RestingVoltage (bytes 135-136, units: [0-65535 = -10V: +10V])
Output channel 2-4: Phase1Voltage ... Resting Voltage (Bytes 137-154, units: [0-65535 = -10V: +10V])
Output channel 1, isBiphasic (Byte 155)
Output channel 1, CustomTrainID (Byte 156)
Output channel 1, CustomTrainTarget (Byte 157)
Output channel 1, CustomTrainLoop (Byte 158)
Output channel 2-4, isBiphasic ... CustomTrainLoop (Bytes 159-170)
Trigger channel 1, Trigger Link Bytes 1-4 (bytes 171-174, bytes specify output channels linked to input ch1 i.e. 1 0 1 0 = link to output channels 1 and 3)
Trigger channel 2, Trigger Link Bytes 1-4 (bytes 175-178)
Trigger channel 1, TriggerMode (byte 179)
Trigger channel 2, TriggerMode (byte 180)
Pulse Pal returns 1 if transmission was successful.
74: Program Pulse Pal (ONE parameter on ONE channel)
Pulse Pal expects the following bytes next:
Parameter code (byte 3, see parameter code table in the MATLAB client documentation)
Output channel (byte 4, valid values = 1-4)
If the parameter contains time data (codes 4-11)
Parameter (bytes 5-8)
If the parameter contains voltage data (codes 2-3, 17)
Parameter (bytes 5-6)
Otherwise
Parameter (byte 5)
Pulse Pal returns 1 if transmission was successful.
75: Program custom pulse train 1
Pulse Pal expects the following bytes next:
nPulses (Bytes 4-7, specifying the number of pulses in the custom pulse train)
PulseTimes (Bytes 8 to [7+(nPulses*4)], units = cycles*)
Voltages (Bytes [7+(nPulses*4)] to [7+(nPulses*4)] + (nPulses*2)-1, units: [0:65535 = -10V:+10V])
Pulse Pal returns 1 if transmission was successful.
76: Program custom pulse train 2 (Same byte sequence as custom pulse train 1)
77: Soft-trigger Pulse Pal output channels
Pulse Pal expects the following bytes next:
Trigger Link Byte (byte 3, bits specify output channels targeted i.e. 5 = 0101 = output channels 1 and 3)
78: Write text to Pulse Pal oLED display
Pulse Pal expects the following bytes next:
ASCII bytes for text on row 1 of the display (up to 16 characters)
Optional: Line break byte (254)
Optional: ASCII bytes for text on row 2 of the display (up to 16 characters)
79: Set a fixed voltage on an output channel
Pulse Pal expects the following bytes next:
Target channel (byte 3, values = 1-4)
Voltage (Byte 4, units: [0:255 = -10V:+10V])
80: Abort all ongoing pulse trains (no subsequent bytes required)
81: Disconnect from software client and store all current parameters to EEPROM memory (no subsequent bytes required)
82: Set a channel to loop the current pulse train indefinitely without being triggered
Pulse Pal expects the following bytes next:
Target channel (byte 3, values = 1-4)
Loop status (0 = normal operation, 1 = indefinite loop)
89: Send 6 character client ID string (displayed on top line of oLED display while connected to software client, i.e. "MATLAB" or "PYTHON")
Pulse Pal expects the following bytes next:
Characters 1-6
90: Load, Save or Delete a settings file on the microSD card.
Pulse Pal expects the following bytes next:
Op byte (1 = save, 2 = load, 3 = delete)
File name length byte - indicating n, the number of characters in the file name
Characters 1-n
If Op byte = 2 (load), Pulse Pal returns the entire 180 byte program loaded. The byte order is the same as for op 73 above.
The following commands require an in-depth knowledge of Pulse Pal's circuitry and firmware to avoid causing malfunctions.
These functions should not be included in a typical software client, and are provided for development and hardware debugging purposes only.
86: Set logic level of a digital i/o line on the Arduino microcontroller
87: Read logic level of a digital i/o line on the Arduino microcontroller
Pulse Pal expects the following bytes next:
If the pin mode is set for output, pulse pal will reconfigure it for input before reading the line.
Pulse Pal will return the state of the line (0 = low/0V, 1 = high/3.3V)
*cycles = time expressed as a number of consecutive 50μs cycles (e.g. 1ms = 20 cycles)