nsprognsenum nsread nsconf nsloop nswait nsuart nshex NSZ Files Download Source Code SDK
nsprog - NSDS Command Line Programmer
nsprog is a command line programmer, which can be used to erase, program, verify, or read PIC device through NSDSP.
You can use the following parameters
|operation||Mandatory. Must be the first parameter. Operation to be
performed. One of the following:
|-s serial||Specifies the serial number of the NSDSP chip. This lets you select a particular NSDSP when several ones are connected. This parameter is optional. If not specified, NSDSP will be selected randomly. You can use nsenum to display the list of serial numbers of the NSDSPs connected to the computer.|
|-d device||Full name of the target defice, for example dsPIC30F1010.
Mandatory for most operations except the following cases:
|-i file||Specifies the input hex file. Manatory for p, w, and v operations.|
|-o file||Specifies the input hex file. Manatory for r operation.|
|-t voltage||Target voltage between 1.5 and 5.5V. Allows NSDSP to decide whether or not the bulk erase operation can be used. This setting may be omitted if the actual target voltage is above the bulk erase threshold. However, this setting is mandatory for programming at voltages below bulk erase threshold because such voltages require special programning algorithms. If the voltage is not specified, NSDSP assumes that the voltage is high enough for bulk erase operations. Thus it applies regular programming algorithms which rely on bulk erase and will fail if the actual target voltage is below the bulk erase threshold.|
|-r rate||The maximum allowed rate of communucations between NSDSP and target device in kHz. Must be between 50 and 6000. Default is 6000kHz. Lower values may result in more reliable communications.|
|-a||Use AMCLR pin instead of MCLR. For this option to work, the NSDSP must be configured to use PGM/RTS/AMCLR pin as AMCLR.|
|-h||High voltage programming. Requeres NSHVX or a external high voltage circuit.|
|-e||Ignore EEPROM memory. Depending on the operation:
|-u||Ignore User ID memory. Depending on the operation:
|-W (upper case)||Allow OTP. If not specified, all OTP operations are suppressed.|
|-z||Specifies NSZ file for serial programming.|
|-x sub||Substitute. Up to 5 substitutes may be specified. Intended to be
used by a calling script. The specified text is programmed directly into the
specified memory location regardless of the contents of the HEX file. Substitute
uses the following format:
|-c calibration||Can only be specified for baseline PIC devices. Specifies the calibration word to be programmed to the backup calibration location. May be used to restore lost calibration data. This can only be used when programming or erasing the target.|
|-p duration||After successful programming, produces a pulse on the PGM/RTS pin of the specified duration (between 10 and 10000 µs). The accuracy is within 20 µs at 6MHz programming speed and decreases when lower programming speeds are used. However the pulse duration is never less than the specified value. The presense of the pulse may be used in automated programming systems to detect whether the programming was succssful or not. Note that some of the old PIC devices require the PGM pin for LVP programming.|
|-q||Quiet. Do not print anything except errors.|
|-v||Verbose. Produces extensive messaging.|
If successful, nsprog returns with exit code 0. If an error occurs, nsprog prints an error message, which always starts from "ERROR:" and returns with exit code 1.
This example checks if the USB connection between the computer and NSDSP functions properly. This may be used for troubleshooting.
nsprog c -d PIC16F1454
This example checks the USB connection and verifies the device id.
nsprog p -d dsPIC30F1010 -i test.hex
This example programs the contents of the test.hex file into the selected target device and verifies the results.
nsprog p -i test.hex
This example programs the contents of the test.hex file into the target device and verifies the results. Since the device is not specified on the command line, the hex file must contain the device name at the end of the file:
nsprog v -v -d dsPIC30F1010 -i test.hex
This example verifies the contents of the chip against the the test.hex file. -v option is used to produce detailed report if differences are found.
nsprog r -d dsPIC30F1010 -o result.hex -u
This exmple reads the contents of the chip and saves it as the result.hex file. The content of the UID flash area is not read..
nsprog p -d dsPIC30F1010 -i test.hex -z test.nsz
This example reads the contents of the test.hex file, adds a record obtained from the test.nsz file, writes to the selected target device and verifies the results.
nsprog p -d dsPIC30F1010 -i test.hex -x 950:3:1:t123
This example programs the contents of the hex file, and also programs 3 instructions starting from 0x950. Each instruction stores 1 byte of useful information taken from the supplied text string:
0x000950 0x050310 retlw ’1’
0x000952 0x050320 retlw ’2’
0x000954 0x050330 retlw ’3’
nsprog p -i test.hex -x 950:5:2:b00112233445566778899
This example programs the contents of the hex file, and also programs 5 instructions starting from 0x950. Each instruction stores 2 bytes of useful information taken from the supplied hexadecimal string:
0x000950 0x001100 nop
0x000952 0x003322 nop
0x000954 0x005544 nop
0x000956 0x007766 nop
0x000958 0x009988 nop
nsprog p -i test.hex -x 950:5:2
This example programs the contents of the hex file, and also fills 5 instructions starting from 0x950 with random bits. Only 2 bytes of each instruction are filled:
0x000950 0x009952 nop
0x000952 0x00affd nop
0x000954 0x005303 nop
0x000956 0x00645a nop
0x000958 0x008b5d nop
© 2007-2021 Northern Software Inc. All Rights Reserved.