Nyquie Plus Host Protocols ========================================== Started 2016 Feb Alan Stummer, UofToronto Last revision: n/a COMMUNICATIONS BETWEEN HOST AND UNIT ==================================== The host computer sends commands to the unit which acts on the commands. All commands are ASCII and can send one per IP packet or concatenated into one or more packet, up to 1450 bytes per packet. Commands are sent over ethernet, UDP/IP, port 37829. Unit is DHCP. After a cold boot and until it aquires a host, it broadcasts info in an "I" command as shown below. The first host to connect to the unit is the only host it sees until a cold boot. COMMAND OVERVIEW ============================= Commands fall into two categories, immediate and sequence. There are only four immediate commands: Run, Stop, Clear Sequence and Version. All other commands are added to the sequence and executed in order. For example, to output a fixed frequency: - "C " to clear the sequence - "P1 1227133 4095 0 " to set 1MHz at full amplitude into profile #1 - "R " to run the sequence At the end of this above sequence there are no more commands so execution of the sequence stops and the unit continues to put out 1MHz. Note that at the start of a sequence, profile #1 is used. If more than one profile is needed, the next must be profile #2, and so on up to #8. Note that if more than 8 profiles are desired, they can be set or reset as part of a sequence. Profiles must be contigious (if #1 and #3 are loaded but #2 is not, then only #1 can be used) COMMANDS SENT BY HOST TO UNIT ============================= Note that improperly formatted commands or command values outside of the acceptable range will silently commit seppuku and kill all subsequent commands in that packet. Cmd Size Description --- ---- ---------------------------------------------------------------------------------- The following commands are executed immediately. C 2 Clear sequence and all profiles (does not affect current output) R 2 Run sequence, must be "R " V 2 Request versions, must be "V " X 2 Stop, must be "X " The following commands are added to the sequence. D 3-7 Delay between (burst) Trigger and start of processing 1: "D" 2...: time to wait ("1" to "65535", as 4 cycles per count, ~20nS) last: [space] Example: "D5000" will wait ~100uS F 2-21 Friendly name of unit for it to show, must be in its own packet 1: "F" 2...: the name, e.g. (without quotes) "Doohickey #1" H 2 Heartbeat, about once a second, unit will echo it to confirm connection, loss of connection is harmless, unit continues as it was. Must be "H ". Better to use "V ". L 2 Loop back to start of sequence and repeat, must be "L " M 19-27 Ramp parameters (from current freq to end freq) 1: "M" 2...: End Frequency (as defined for FTW below) next: [space] next: Step size (as defined for FTW below, but lower limit = 1) next: [space] next: Step Cycles (AKA time, "1" to "65535", as 1/24th sys clock) last: [space] Example: "M12271335 123 146" is ramp to 10MHz with 100Hz steps every 1uS (if 3.5GHz) N 2 Go to Next loaded profile (go back to #1 if on last valid profile), must be "N " P 13-21 Load the next available profile, up to 8 1: "P" 2...: Frequency (as defined for FTW below) next: [space] next: Amplitude ("0" to "4095", unitless) next: [space] next: Phase ("0" to "359", in °) last: [space] Example: "P12271335 2047 0 " is 10MHz, 50% amp, 0° phase into next profile (if 3.5GHz) S 2 Start ramping the frequency, must be "S " T 2 Wait for the next Trigger rising edge, must be "T " W 3-10 Wait a number of Sync cycles (1/24 of sample clock, ~6.857nS) 1: "W" 2...: number of cycles to wait ("1" to "16000000", up to ~110mS if 3.5GHz clock) last: [space] Example: "W145833" will wait ~1mS, assuming a 3.5GHz sample clock FTW (Frequency Tuning Word) Description: FTW = 2^32(freq/SysClk) where SysClk = 3.5GHz, range 1MHz to 1.75GHz. e.g. 1MHz => FTW = 1227133 DATA SENT BY UNIT BACK TO HOST ============================== Cmd Size Description --- ---- ----------------------------------------- H 2 Heartbeat, echoed when received from the host. 1: "H" 2: [space] I 37 IP address and name of a unit without a host 1: "I" (capital "i") 2: Type ID (must be "H" for this project) 3: IP address in ASCII, MSB (of 15 bytes) ... " " " " 17: IP address in ASCII, LSB (trailing unused are spaces) 18: Unit name, first char (of 20 bytes) ... " " 37: Unit name, last char (trailing unused are spaces) Example: "IH192.168.1.2 Something Unit #1 " V >4 Version strings 1: "V" 2-n: Text, multi-line (CR/LF EOL), as described below last: [space] Text may include: Rev: HDL: ERROR - Example: Rev: 1.2.3 HDL: 4.5.6