ICSP Programming
The RS-UV3A includes a 6-pin In-Circuit Serial Programming (ICSP) header for programming the PIC microcontroller. This header serves two purposes:
- Bootloader forcing — Jumper pins to force bootloader mode on startup (for firmware updates when the board is unresponsive)
- Direct ICSP programming — Connect a PICkit or similar programmer to flash firmware directly
For routine firmware updates using the bootloader, see the Firmware Upgrade guide.
ICSP Header Location
Section titled “ICSP Header Location”The ICSP header is a 6-pin (3×2) header located near the PIC microcontroller (U2) on the left side of the board. The pins are staggered — offset from the standard 0.1” grid — to allow a programming clip or individual test probes to make contact without soldering a header.
ICSP Header Pinout
Section titled “ICSP Header Pinout”Viewed from the top of the board:
1 2 ● ● 3 4 ● ● 5 6 ● ●| Pin | Signal | Description |
|---|---|---|
| 1 | Boot Select A | Jumper to pin 2 forces USB/JP1 bootloader on startup |
| 2 | VDD (+3.3V) | PIC supply voltage |
| 3 | PGD | Programming data (PIC RB7, pin 17) |
| 4 | PGC | Programming clock (PIC RB6, pin 16) |
| 5 | GND | Ground |
| 6 | Boot Select B | Jumper to pin 5 forces DE-9 bootloader on startup |
Method 1: Bootloader Forcing (Jumper)
Section titled “Method 1: Bootloader Forcing (Jumper)”If your RS-UV3A is unresponsive (bad firmware upload, corrupted flash), you can force it into bootloader mode on power-up:
USB / JP1 Serial Upload
Section titled “USB / JP1 Serial Upload”- Power off the RS-UV3A
- Place a jumper across pins 1–2
- Power on — the board enters bootloader mode on USB/JP1
- Upload firmware using mikroBootloader at 115200 baud
- Power off and remove the jumper
- Power on — normal operation resumes
DE-9 Serial Upload
Section titled “DE-9 Serial Upload”- Power off the RS-UV3A
- Place a jumper across pins 5–6 (or 4–5, verify against your board revision)
- Power on — the board enters bootloader mode on DE-9
- Upload firmware using mikroBootloader at 115200 baud
- Power off and remove the jumper
- Power on — normal operation resumes
For the full bootloader upload process, see Firmware Upgrade.
Method 2: Direct ICSP Programming (PICkit)
Section titled “Method 2: Direct ICSP Programming (PICkit)”For advanced users who need to flash the PIC microcontroller directly — for example, to restore a corrupted bootloader or flash custom firmware.
What You Need
Section titled “What You Need”| Item | Notes |
|---|---|
| PICkit 3, 4, or 5 | Microchip in-circuit programmer/debugger |
| MPLAB X IDE | Free download from microchip.com |
| Firmware .HEX file | From HobbyPCB or compiled from source |
| 2×3 pin header (optional) | Press-fit into staggered ICSP holes |
PICkit Connection
Section titled “PICkit Connection”The PICkit programmer needs five signals. Connect to the ICSP header as follows:
| PICkit Pin | Signal | ICSP Header |
|---|---|---|
| 1 | MCLR/VPP | See note below |
| 2 | VDD | Pin 2 |
| 3 | VSS (GND) | Pin 5 |
| 4 | PGD (ICSPDAT) | Pin 3 |
| 5 | PGC (ICSPCLK) | Pin 4 |
MCLR Connection
The ICSP header may not break out the ~MCLR signal (PIC pin 18) directly. Check your board revision’s schematic on the Schematics page. If MCLR is not on the header, you may need to connect the PICkit’s MCLR line directly to PIC pin 18 or the ~MCLR trace on the board.
MPLAB X Configuration
Section titled “MPLAB X Configuration”- Open MPLAB X IDE
- Create a standalone project or open the firmware project
- Select the target device: PIC18F46J11
- Select the programmer tool: PICkit 3 (or 4/5)
- Under Project Properties → PICkit:
- Set Power to not supply voltage from PICkit (the RS-UV3A has its own 3.3V regulator)
- Set Voltage Level to 3.3V if powering from PICkit
Programming Steps
Section titled “Programming Steps”- Connect the PICkit to the ICSP header
- Power the RS-UV3A (or enable PICkit power at 3.3V)
- In MPLAB X, click Make and Program Device (or use
ipecmdfor command-line) - Verify the programming completed successfully
- Disconnect the PICkit
- Power cycle the RS-UV3A
Command-Line Programming (IPECMD)
Section titled “Command-Line Programming (IPECMD)”For automated or headless programming using Microchip’s IPECMD:
ipecmd -P18F46J11 -TPPK4 -M -F"RS_UV3_FIRMWARE.HEX" -OL| Flag | Meaning |
|---|---|
-P18F46J11 | Target PIC device |
-TPPK4 | Tool: PICkit 4 (use -TPPK3 for PICkit 3) |
-M | Program device |
-F"..." | Firmware .HEX file path |
-OL | Release from reset after programming |
Microcontroller Details
Section titled “Microcontroller Details”From the schematics, the RS-UV3A uses:
| Parameter | Value |
|---|---|
| MCU | PIC18F46J11-I/PT (U2) |
| Package | TQFP-44 |
| Flash | 64 KB |
| VDD | 3.3V |
| PGD | RB7 (pin 17) |
| PGC | RB6 (pin 16) |
| MCLR | Pin 18 |
When to Use Each Method
Section titled “When to Use Each Method”| Scenario | Method |
|---|---|
| Routine firmware update | Bootloader (BL command) |
| Board won’t respond to commands | Bootloader forcing (ICSP jumper) |
| Corrupted bootloader | Direct ICSP (PICkit) |
| Custom firmware development | Direct ICSP (PICkit) |
| Factory programming | Direct ICSP (PICkit) |
Troubleshooting
Section titled “Troubleshooting”PICkit Can’t Connect
Section titled “PICkit Can’t Connect”- Verify PGD, PGC, VDD, GND connections
- Check that MCLR is accessible to the PICkit
- Ensure the RS-UV3A is powered at 3.3V
- Try reducing PICkit programming speed in MPLAB X
Programming Succeeds but Board Won’t Boot
Section titled “Programming Succeeds but Board Won’t Boot”- Verify the correct .HEX file was used
- Check that the bootloader region was preserved (if applicable)
- Try the bootloader jumper method as a fallback
- Ensure configuration bits are correct for the PIC18F46J11
Staggered Pins Won’t Hold Contact
Section titled “Staggered Pins Won’t Hold Contact”- Use a press-fit 2×3 header and apply light finger pressure
- Solder a header if you program frequently
- Use a spring-loaded pogo pin adapter (e.g., Tag-Connect TC2030)