Commands

Introduction
Commands can be sent to the target board via UDP messages, or the HTTP GET command. All commands follow the HTTP GET syntax of name=value.

For example, to set Port pin A2, we can:
Send the following HTTP GET command to the target board:
http://10.1.0.1/?a2=1
Or we can send the following UDP message to the UDP Command Port:
a2=1

In this example the name part is "a2" and the value part is '1'.

HTTP GET Command
Any of the commands listed below can be executed on the target by using the HTTP GET command. To issue a HTTP GET command, simply append the command to the web page address, after a '?' character.

For example, to set Port pin A2, we can send the following HTTP GET command to the target board:
http://10.1.0.1/?a2=1

Multiple commands can be send by seperating each command with a '&' character. For example, to set Port pin A2, and clear Port C0, we can send the following HTTP GET command to the target board:
http://10.1.0.1/?a2=1&c0=0

UDP Command
Any of the commands listed below can be executed on the target by sending them to UDP port 54123. This port is configurable, and can be changed.

For example, to set Port pin A2, we can send the following UDP message to the target board:
a2=1

Multiple commands can be send by seperating each command with a '&' character. For example, to set Port pin A2, and clear Port C0, we can send the following UDP message to the target board:
a2=1&c0=0

The following Port commands are implemented:
Command SyntaxDescription
p=XXSet Port - set the given PIC port to the given hex value. The given hex value (XX part or command) must be in uppercase! For example:
"a=8A" will set PIC port A to 0x8A.
p[0-7]=[1,0]Set Port Pin - set or clear the given PIC port pin. For example:
"a0=0" will clear PIC port A0 (Port A, pin 0)
"f7=1" will set PIC port F7 (Port F, pin 7)
px[0-7]=[1,0]Inverted Set Port Pin - Set or clear the given PIC port pin. The value is inverted! For example:
"ax0=0" will set PIC port A0 (Port A, pin 0)
"fx7=1" will clear PIC port F7 (Port F, pin 7)
p[0-7]r=[1,0]Set Port Pin, Remember - - Same as "Set Port Pin" command, except that the settings are saved to the application configuration, and are remembered after power up.
p[0-7]p=[0-9]Pulse Port Pin, Positive - The given PIC port pin is set high and then low again. The value gives the 'pulse width' specifying for how many micro seconds the pin should be kept high. If 0, the pin is kept high for a minimum time, which is usually between 200ns to 400ns. For example:
"a0p=0" will set PIC port A0 high and after 200ns to 400ns low again
"f7p=9" will set PIC port F7 high and after 9us low again
p[0-7]n=[0-9]Pulse Port Pin, Negative - The given PIC port pin is set low and then high again. The value gives the 'pulse width' specifying for how many micro seconds the pin should be kept low. If 0, the pin is kept low for a minimum time, which is usually about 200ns to 400ns. For example:
"a0n=0" will set PIC port A0 low and after 200ns to 400ns high again
"f7n=5" will set PIC port F7 low and after 5us high again
pc[0-7]=[1,0]Port Pin Configuration - Configure given PIC port pin as input or output. '0' will configure pin to be an output, and '1' an input. The port direction configured with this command will NOT be remembered after the next power up, use the "Port Pin Configuration, Remember" command to achieve this! Example to use this command:
"ac0=0" will configure PIC port A0 (Port A, pin 0) to be an output.
"fc7=1" will configure PIC port F7 (Port F, pin 7) to be an input
pc[0-7]r=[1,0]Port Pin Configuration, Remember - Same as "Port Pin Configuration" command, except that the settings are saved to the application configuration, and are remembered after power up.

The following Config commands are implemented:
Command Syntax Description
kxx=[0-255] Set Config Byte to given decimal value - set the given config byte to the given decimal value. The 'xx' part gives the offset (in uppercase hex) of the config byte in the "Application Configuration bytes" structure. The value has to be a decimal number from 0 - 255.
Examples to use this command:

"k00=100" Will set the the "Application Configuration byte" at 0x00 (MSB of IP address) to 100

"k2A=16" Will set the "Application Configuration byte" at 0x2A (Port F direction) to 16 (0x0f). Address 0x2A contains the TRIS register for PIC Port F. Setting a bit to 0 will configure the port as an output, and 1 as an input. In this example we set TRISF to 0x0f = binary 00001111. This will configure port F pins 0-3 as inputs, and pins 4-7 as outputs.

"k2F=16" Will set the "Application Configuration byte" at 0x2F (Port F default value) to 10 (0x0a). Address 0x2F contains the default value for PIC Port F at power up. In this example we set it to 0x0a = binary 00001010. This will set the default value of port F pins 1 and 3 to 1 (5V), and pins 0, 2, 4, 5, 6, 7 to 0 (0V) at power up.

kxx=Hyy Set Config Byte to given hex value - set the given config byte to the given hex value. The 'xx' part gives the offset (in uppercase hex) of the config byte in the "Application Configuration bytes" structure. The value ('yy' part of command) has to be an uppercase hex value from 00 - FF.
Examples to use this command:

"k00=H1F" Will set the "Application Configuration byte" at 0x00 (MSB of IP address) to 0x1F

kxxmzz=Hyy Set Config Byte to given hex value, using mask - set the given config byte to the given hex value, using the given mask. The 'xx' part gives the offset (in uppercase hex) of the config byte in the "Application Configuration bytes" structure. The 'zz' part gives the mask (in uppercase hex) of the bits in the config byte to change. If the mask is 00, no bits are changed. If the mask is FF, all bits are set to the given value. The value ('yy' part of command) has to be an uppercase hex value from 00 - FF.
Examples to use this command:

"k05m04=HFF" Will set the third bit (bit position 2) of the "Application Configuration byte" at 0x05.

"k1Am80=H00" Will clear the eighth bit (bit position 7) of the "Application Configuration byte" at 0x1A.

kxxby=[0,1] Set or Clear bit in Config Byte - set or clear a bit in the given config byte to the given value. The 'xx' part gives the offset (in uppercase hex) of the config byte in the "Application Configuration bytes" structure. The 'y' part gives the position (value from '0' to '7') of the bit in the config byte to change. The value has to be a '0' or '1' character, indicating if the given bit is to be cleared or set.
Examples to use this command:

"k05b6=1" Will set the seventh bit (bit position 6) of the "Application Configuration byte" at 0x05.

"kA5b0=0" Will clear the first bit (bit position 0) of the "Application Configuration byte" at 0xA5.

The following General commands are implemented:
Command Syntax Description
la=str New Username - assigns a new Username. The given "str" is the new username, and must be an alpha numeric string of 1 to 8 characters. For example:
"la=wombat" will set the new username to "wombat".
lb=str New Password - assigns a new Password. The given "str" is the new password, and must be an alpha numeric string of 1 to 8 characters. For example:
"lb=gumtree" will set the new username to "gumtree".
ln=str New NetBIOS name - assigns a new NetBIOS name. The given "str" is the new name, and must be an alpha numeric string of 1 to 15 characters. For example:
"lb=CROC1" will set the new username to "CROC1".

The following Short commands are implemented:
Command Syntax Logged
In
Description
m=r Reset Board - reset's the board. This command can be used to remotely reset the board. This can be used to update the firmware via the network bootloader for example.
m=o Log Out - log out the current user.

The following PWM commands are implemented:
Command Syntax Description
w[1-4]=[0-1023] Set PWM Value. This command will set the value (Duty Cycle) of the given PWM channel. The possible values must be in the range 0-255 for 8-bit mode, and 0-1023 for 10-bit mode. A value of 0 will give a duty cycle of 0% (output off), where a maximum value will give a duty cycle of 100% (permanently on).
Examples to use this command:
"w1=128" will set the duty cycle of PWM channel 1 to 50% when in 8-bit mode
"w3=256" will set the duty cycle of PWM channel 3 to 25% when in 10-bit mode
w[1-4]r=[0-1023] Set PWM Value, Remember. Same as the Set PWM Value command, except that the settings are saved to the application configuration, and are remembered after power up.
wf=[0-3] Set PWM Frequency. This command will set the PWM frequency. The available frequencies depends on the PWM mode (8-bit or 10-bit) used. The frequency is given by a constant value between 0 to 3.
For 8-bit mode, the following values are defined: 0 and 1=9.766kHz, 2=39.062kHz, 3=156.25kHz
For 10-bit mode, the following values are defined: 0=2.441kHz, 1=9.766kHz, 2 and 3=39.062kHz
wfr=[0-3] Set PWM Frequency, Remember. Same as the Set PWM Frequency command, except that the settings are saved to the application configuration, and are remembered after power up.
we=XX Enable PWM Channels. This command will enable/disable the given PWM channels. The command value (XX part) is a two character, uppercase hex value indicating which channels are to be enabled. Each bit in the byte represents a PWM channel. Bit 0 represents PWM channel 1, bit 1 PWM channel 2, ...., and bit 7 PWM channel 8. The SBC68EC has 2 PWM channels (C1, C2), so only the fist 2 bits are used.
Examples to use this command:
"we=00" will disable all channels
"we=1F" will enable PWM channels 1 to 5, and disable all the rest (if any)
"we=14" will enable PWM channel 3 and 5, and disable all the rest (if any)
wer=XX Enable PWM Channels,Remember. Same as the Enable PWM Channels command, except that the settings are saved to the application configuration, and are remembered after power up.
wm=[8,a] Set PWM Mode. This command will set the PWM mode. When the value is '8', the mode is set to 8-bit mode. When the value is 'a', the mode is set to 10-bit mode.
wmr=[8,a] Set PWM Mode, Remember. Same as the Set PWM Mode command, except that the settings are saved to the application configuration, and are remembered after power up.