nswaitnsuart nshex NSZ Files Download Source Code
nswait - NSDS Trigger Utility
nswait is a command line utility designed to monitor hardware trigger events. It is used within scripts. It holds the execution of the script until the specified trigger condition is detected.
You can use the following parameters
|-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.|
|-c||Monitor CTX pin. Either -c or -x must be specified, but not both.|
|-x||Monitor RX pin. Either -c or -x must be specified, but not both.|
|-r||Wait for rising edge. The signal must transition from low to high. At least 200ms of low state followed by 200ms of high state is required. Either -r or -f must be specified, but not both.|
|-f||Wait for falling edge. The signal must transition from high to low. At least 200ms of high state followed by 200ms of low state is required. Either -r or -f must be specified, but not both..|
If the specified NSDSP is not connected to the computer or there is a problem connecting to the NSDSP, nswait does not exit, but tries to re-establish connection indefinitely. While waiting, nswait does debouncing. Therefore a push button can be used as a trigger.
If successful, nsconf returns with exit code 0. If there is an error in parameters, the exit code is 1.
nswait -c -r
nsprog p -i test.hex -d dsPIC30F1010
This example waits for the rising edge on the CTS pin. When it is detected, it launches nsprog to program the chip.
Typical use would be to connect a button to the CTS pin. An operator inserts the target chip into the programming socket and then presses the button to trigger the programming.
© 2007-2018 Northern Software Inc. All Rights Reserved.