Programming
Debugging USB-to-UART Configuration Speed Tests ICSP Cable Software for NSDSP Interface Library Source Code SDK Supported DevicesNSDSP Programming
To program PIC device, NSDSP uses programming protocols outlined in Microchip Flash Programming Specifications. It uses 6-pin Microchip ICSP® connector.
LVP Programming
NSDSP uses low voltage programming - LVP. This method involves only logic level voltages on MCLR pin.
Most PIC microcontrollers support LVP.
LVP is generally safer because it doesn't apply high voltage to the target PIC device, but unfortunately, it requires the MCLR pin (and also PGM pin on older PIC devices) to be dedicated to programming. When LVP is enabled, MCLR pin cannot be used as a regular input. This may be a problem if you cannot afford losing a pin. In such cases, an HVP programming must be used.
HVP Programming
High voltage programming (HVP) requires elevated voltages on MCLR (between 8 and 13 V).
NSDSP-2 and NSDSP-3 can generate such voltages internally. Therefore, they can do high voltage programming natively.
NSDSP-1 cannot generate high voltages internally. However, an HVP extension - NSHVX - may be used to transform NSDSP-1 into an HVP programmer. It is also possible to build custom HVP circuit to do HVP programming through NSDSP-1, however such circuit will require a source of high voltage.
HVP programming is optional for most PIC microcontrollers, however some of the PIC devices can only be programming through HVP. For such devices either NSDSP-2 or NSDSP-3 is necessary. NSDSP-1 can also be used, but only with NSHVX (or an external HVP circuit).
NSDSP can program nearly any PIC device, but there are exceptions. To see if your PIC microcontroller is supported, and whether it requires NSHVX, refer to the list of supported devices.
Programming operations
NSDSP can perform the following programming operations.
| Operation | Description |
|---|---|
| Bulk Erase | Erases the entire content of the target device. This may not be available for some PIC devices running at lower voltages. |
| Programming | Erases the entire content of the target device and then programs the specified data. This can be applied to protected devices. |
| Verification | Verifies that the contents of the chip memory matches the specified data. NSDSP does not use checksums because they may be unreliable. It reads the entire contents back and verifies every byte. On most PIC devices, programming and verification can be executed simultaneously, which may lead to shorter programming times. |
| Read | Reads the entire contents of the target PIC memory and saves it as a hex file. Read operation may fail if the device is code protected, programmed for debugging and for other similar reasons. In such cases, reading may be possible with nsread |
| Other | Since NSDSP supports hundreds of diverse PIC devices, it is difficult to provide common interface to all devices. Therefore, operations provided by the standard NSDSP software are limited. If you want to perform programming operations not covered by the standard software, please contact us and we will build custom software to meet your needs. |
Code Protection
Many PIC devices support code protection. When a device is code protected it cannot be read. If you try to read it, the operation may fail or it may read all zeros or all ones.
If PIC device is code protected, the only way to remove the protection is bulk erase. This operation erases everything. Therefore, all memory areas will be erased, even if software settings may have requested preservation of some areas such as EEPROM.
On many PIC devices, bulk erase is only possible at VDD voltages above certain level. If the voltage is below this level, it is impossible to remove protection from code protected device. Please refer to the device support list to see if this applies to your particular device.
Bulk Erase Threshold
To program chips, NSDSP uses bulk erase. Bulk erase is a fast and efficient way to fully erase chip memory and the only way to remove code protection. However, bulk erase requires a minimum voltage level, which depends on the PIC device, and is usually around 2.7V.
NSDSP assumes that the target voltage is above the bulk erase threshold and attempts to use bulk erase. This ensures the fast and most efficient programming. However, if the actual target voltage is below the bulk erase threshold, the programming will fail. Therefore, if you want to program PIC devices below their bulk erase threshold voltage you must specify the actual voltage.
When programming at voltages below bulk erase threshold, NSDSP uses special programming algorithms. However, some of the PIC devices cannot be fully programmed in such conditions. For example, most PIC16 devices do not allow erasing their configuration bits. Other PIC devices can be fully programmed, but since the bulk erase cannot be used, the programming may take longer.
Please refer to the device support list to find out if programming of your PIC device is affected by the voltage level.
Voltage
NSDSP-1 cannot automatically detect the target voltage. Usually, it is not the problem. However, if you want to program your device at voltages below bulk erase threshold, you must specify the target voltage, so that NSDSP-1 could use special algorithms which avoid bulk erase.
If NSDSP-1 chip always works at the same voltage, as is the case with pre-built programmers such as NSDSP-1-3V3 or NSDSP-1-5V, the voltage setting may be stored inside the chip.
NSDSP-2 can detect the target voltage. It selects the programming algorithm based on the voltage detected. However, you can specify the target voltage in software, in which case the voltage detection is skipped.
NSDSP-3 works the same as NSDSP-2, but also can provide power on-demand with voltages from 1.8 to 5.3 V. If the power is provided on-demand, the voltage you specify in the programming software will determine the actual voltage supplied to the target once the programming starts.
Variable speed
During programming, NSDSP software selects the highest rate suitable for the device being programmed. In most cases, this works, but if the cable is long, or there's parasitic capacitance, the high speed may not work. In this case, you can reduce the speed. This will allow programming, but will increase programming times.
NSDSP-3 can use multiple data rates. For ICSP programming, the effective data rate is produced by dividing the 120 MHz base clock and can vary from 50 kHz to 60 MHz, although currently there is no PIC devices which would allow rates above 24 MHz.
NSDSP-1 and NSDSP-2 use pre-defined data rates. The table below shows the list of available speeds for NSDSP-1 and NSDSP-2:
| Frequency | KBytes/sec |
|---|---|
| 50 kHz | 6 |
| 100 kHz | 12 |
| 250 kHz | 30 |
| 500 kHz | 59 |
| 1 MHz | 113 |
| 1.5 MHz | 163 |
| 2 MHz | 209 |
| 2.4 MHz | 244 |
| 3 MHz | 293 |
| 4 MHz | 366 |
| 6 MHz | 488 |
The speed limit may be set by the programming software
Firmware
NSDSP-1 and NSDSP-2 does not require firmware updates to program different PIC devices. The same firmware is installed in all NSDSP and it works for all supported devices.
NSDSP-3 uses FPGA and must program FPGA before use. Programming takes from 100 to 200 ms and must be done every time you switch to a different mode (for example when using UART after ICSP or vice versa). If you use the same mode multiple times, the programming must be done only once. The software automatically reporograms FPGA as needed.
© 2007-2026 Northern Software Inc. All Rights Reserved.