What you will need

Microchip PICKit 3
A PICKit 3 or other approved Microchip programmer is necessary in order to flash the on board PIC with firmware. It is also highly recommended to purchase a pogo pin adapter as well.

POGO pin adapter or pin header
Connector for attaching to boards ICSP pads. Usually PICKit 3 comes with basic cable and pin header. Using a POGO pin adapter however ensures a solid connection is made between the unit ICSP pads and the PICKit 3.

Computer
You will need a computer, any OS will do.

MPLAB
MPLAB is an IDE for Microchip devices. It's a software package which can be downloaded from Microchip webpage here.

Compiled firmware HEX file
Actual firmware file. You can download latest compiled firmware from Github here.


Programming troubleshoot

MPLAB doesn't list my programmer under Tools
Programmer isn't connected to the computer, or drivers are not installed. Drivers are installed with MPLAB IDE automatically.

I'm getting "Target device was not found" message
Board is not powered up or connection between programmer and ICSP pads is bad. Without using POGO pins it's quite difficult to make a good connection. Try to apply pins to the ICSP pads at an angle.

I'm getting "Target device ID different" or something like that message
Make sure you have selected correct Device. If it's OK, you can simply ignore this message by pressing OK.

Programming unsucessfull message
IPE can stop programming in the middle of file. The common reason for this is loose connection between programmer pins and ICSP pads. No need to worry, you can program the board once again.

How to program

Klondike boards are using on-board microcontroller to manage work items, usb communication and other rutine tasks. Software that runs on boards microcontroller is called firmware. From time to time, new firmware version is released, adding new features or fixing bugs.

If you would like to update your boards firmware, you have two options. First is to use USB bootloader (if it is completed by the time you're reading this), or you can use ICSP (In Circuit Serial Programming).

Programming with ICSP

ICSP is a method of programming chips which are already assembled on a board. To do this, you will need Microchip PICKit, preferrably PICKit3 (it's an ICSP programmer for microcontrollers from company Microchip) and Microchip MPLAB IDE, which can be downloaded here. And you will need also a computer.

This method of programming is very safe and there is no way you can brick your board, so don't be afraid.

After you've downloaded MPLAB X, install it. You can leave all the options default. After installation, MPLAB will ask you, if you would like to download also Microchip XC. This is the compiler for MPLAB. If you're just updating firmware, you do not need this, so skip this option.
After software is installed, connect PICKit 3 USB connector to computer and wait untill drivers are installed. This process should be completed automatically without any user intervention. When done, continue with the steps below.

On your desktop you will see three MPLAB icons. Select MPLAB IPE. IPE stands for Integrated Programming Enviroment and is used to program devices from compiled firmware files.

After IPE is loaded, couple of things you need to change. First, select correct device, which you're going to program. In our case it's PIC16LF1459. Tool should be selected as PICKit3 S.No : BUR<SerialNumber>. If not, select it. If it isn't in the list, PICKit is disconnected from computer or drivers are not installed.

Picture 1 - MPLAB IPE

By pressing "Browse" button next to the "Source:" input, you can select hex file to upload to the device. Select "Klondike.X.production.hex". This file is located in a directory, you can download from Github here, in a folder Klondike.X/dist/K16/production/Klondike.X.production.hex.
File will be afterwards loaded to the IPE. Checksum field will be different between firmware releases, so no need to check that one.

Picture 2 - Selecting firmware file in MPLAB IPE

Next apply programmer pins to the board ICSP pads. The board has to be powered up. There is a small white on a board next to the ICSP pads marking Pin 1. On programmer, there is a small white triangle also marking Pin 1. Pin 1 on a programmer should go to Pin 1 on the board. Otherwise, programming will be unsucessfull.

Picture 3 - Attaching PICKit to onboard ICSP pads (note white markers and white cable)

When programmer pins are applied to the board ICSP pads, you have to click Connect in the IPE next to the selected Tool. This will initialize PICKit and prepares it for the programming. If you're doing this for the first time, IPE will try to update PICKit's firmware, so you will probably have to wait till thats done. It shouldn't take more than few minutes.

IPE will then display a warning, that you should check that device selected in IPE is the same as the one on the board. Make sure that device selected is PIC16LF1459. If it is, you can press OK here, otherwise click Cancel and select correct device.

Picture 4 - Warnings

After this, "Program" button will became active. You can press it to start programming the device.

Picture 5 - Ready to program

Programming takes only a couple of seconds. When it's done, blue text in the output window will say that it's completed sucessfully. After it's done, you have to remove and reapply power to the board. Without repowering the board, some chips may be stuck in undefined state, thus lowering boards hashrate.

Picture 6 - Programming complete

After firmware updating, make sure you are using latest CGMiner too. More about this in How to run section.

Am I running the latest firmware?

Only way (for now) to find out if you're running the latest firmware is to download it from Klondike itself and compare its checksum withchecksum of the firmware downloaded from Git (which should be the latest).

To download the firmware from the board, simply connect PICKit to it and in MPLAB IPE click Read. After read is complete, checksum of the downloaded firmware will be displayed in Checksum field in MPLAB IPE. Make a note of it.

Then download the latest firmware from Git and load it to the MPLAB IPE (using a Browse button and selecting Klondike.X.production.hex file). Its checksum will be displayed in Checksum field. Compare this checksum with the checksum you've noted above. If those two are different, you're not running the latest firmware.

Issues with programming? Look at the troubleshoot at the right.