n3c Protocol Description

General Overview

The n3c programmer (server) communicates with one client at a time using a set of instructions. Each instructions consist of a 4 byte command, optional parameter(s) and optional data. The command and parameters are delimetered by a space (' ') and are followed with a newline ('\n'). There should be no more than one instruction per packet (might change in future).

Command Description

command layout: command' '[param1' 'param2' '...paramX]'\n'[data]

Command
hide
Parameter
hide
Direction
hide
Implemented?
hide
Hexcode
hide
Description
hide
dnld label size\ndata -> YY 0x646e6c64 Dowload a file, file parameter is binary begins right after command. If server does not want file it'll send an error command and close connection.
dele label\n -> YY 0x64656c65 Delete a file
lsfl \n -> YY 0x6c73666c list downloaded files
label label ...label\n <- list of all files
xply label action\n -> YY 0x78706c79 play downloaded file using XSVF player
sply label action\n -> YY 0x73706c79 play downloaded file using Jam/STAPL player, action should be specified in the second argument
jply label action\n -> YY 0x6a706c79 play downloaded file using Jam Byte Code player
exit \n -> NN 0x65786974 Exit to dBUG monitor. Programmer goes offline and responds only to dBUG commands over serial connection. To get back online enter 'go' dBUG command.
abrt \n -> NN 0x61627274 abort last command
erro type\n <- YY 0x6572726f report an error/fault. Refer to erro table
scss type\n <- YY 0x73637373 report successfull execution of last command. Refer to scss table
lsdv \n-> NY 0x6c736476 Print number devices on JTAG chain
p\n <- Print IDCODE an contents of JTAG USERx.x registers
prnt string\n <- YY 0x70726e74 print a string, (string must fit in one packet)
ping \n <->YY 0x70696e67 Replies with pong when received, used to make sure other end is alive
pong \n <->YY 0x706f6e67 Send when receive ping.
dsht host port\n -> NN 0x64736874 Sets the datasink host and port. host is the _IP_ address in HEX, and port is, well the port
dsst \n -> NN 0x64737374 Start the datasink transmittion. Data is sent over UDP, it does not check if anyone is listening.
dssp \n -> NN 0x64737370 Stop the datasink transmittion.
test id\n -> -- 0x74657374 This is used for development only. Functions vary.
jusr id\n -> -- 0x6a757372 JTAG user commands. jusr t n: simulate 10^n triggers; jusr p: dump fifo; jusr e: process event; jusr u/d: datataking up/down; jusr v: view BSCAN registers; jusr i: init; jusr 0/1/2 value: load value to a BSCAN register.
jsvx l id\n -> -- 0x6a737678 Load configuration stream from file lable l to SVX chain.
jgev id\n -> -- 6a676576 Print current event number.
owac master device channel debth\n -> YY Configures a channel of an ADC device to specific digitization debth and voltage range. Bit debth can be 0-16 for 2.55V and 16-32 for 5.1V
owad master device\n -> YY 0x6f776164 Digitizes(converts) all channels of an ADC device and prepares them to be read back.
owar master device\n -> YY 0x6f776172 Reads back data from ADC.
owpc master device\n -> YY 0x6f777063 Configures/Initiates Potentiometer.
owps master device wiper\n -> YY 0x6f777073 Sets value of wiper on POT, must be 0-254
owpr master device\n -> YY 0x6f777072 Reads back value of wiper on POT.
owpi master device\n -> YY 0x6f777069 Increments POT wiper and returns new value
owpd master device\n -> YY 0x6f777064 Decrements POT and returns new value
owpp master device\n -> YY 0x6f777070 Purges list of POTs for climb.
owpa master device startValue stopValue rate\n -> YY 0x6f777061 Sets start-state and end-state of POT climb. It does rate climbs per ~.5s. NOTE: adding same device multiple times leads to undefined behavior.
owpe master device\n -> YY 0x6f777065 (re)Initializes climb of all POTs, Sets wiper to start state and perpares for start of climb.
owp1 master device\n -> YY 0x6f777031 Starts climb on all configured POTs.
owp0 master device\n -> YY 0x6f777030 Stops/Pauses climb of all configured POTs, can be resumed with owp1.
owtc master device debth\n -> YY 0x6f777063 Configures Temperature sensor for digitization debth. Debth 0-4 stands for 9-12 bits respectively.
owtd master device\n -> YY 0x6f777464 Digitizes(converts) Temperature sensor and prepares values to be read back.
owtr master device\n -> YY 0x6f777472 Reads back data from Temperature sensor. Data is in 1000ths of a Kelvin.
owss master device pioa piob\n -> YY Sets state of PIO pins on switch.
owsg master device\n -> YY Reads back state of PIO pins on switch
---- \n -> -- ----------
show all columns

SCSS Type Description

Value
hide
Acronym
hide
Description
hide
0 ---- Uneventfull
1 FSTR File stored
2 FREP File replaced
3 FDEL File deleted
4 JSTRT JTAG play started
5 JFIN JTAG play finished
6 DSHT datasinking host is set
7 DSST datasinking is started
8 DSSP datasinking is stopped
- ----
show all columns

ERRO Type Description

Value
hide
Acronym
hide
Close Connection?
hide
Description
hide
0 ---- N Ueneventfull
1 PROT Y Protocol Error
2 STOR Y Not enough storage, could be fragmented
3 2MNY Y Too many files in memory
4 FSZM Y File size missmatch
5 ABRT Y Aborted (sent when receive abrt command and request is honored)
6 UIMPL N Unimplemented command
7 NLBL N No such label
8 NCHP N No such chip in chain
9 PLAY N Failed in playing file to chip
10 UNKNW N Unknown error
11 JCMD N JTAG command error
12 JINI N JTAG init error
13 JRUN N JTAG run error
14 JFRMT N JTAG Format not supported
15 JWID N JTAG Wrong id code
16 DSHT N DataSinking could not be set (wrong ip/port?)
17 DSST N DataSinking cannot be StarTed (already running/host not set?)
18 DSSP N DataSinking cannot be StoPped (not running?)
19 DSNI N DataSinking is Not Initialized
20 DSPE N DataSinking Port Error (invalid port number)
21 DSHE N DataSinking Host Error (invalid hostname))
- ---- -
show all columns