Programming and Testing

There are two steps to the programming process. Programming the PIC processor, and programming the USB chip configuration information. These two steps are completely independent of each other and may be done in either order. However the unit will not run until both steps have been completed. Click on any image to make it larger.

1. Programming the PIC processor.

The PIC processor is wired to a header that allows the PIC programmer to be connected to the board for in circuit programming. The hex file to be downloaded into the PIC is named LB2024USB_B4_24.hex.

2. Programming the USB processor.

The USB processor is shipped with internal code sufficient for it to connect to the USB bus. The RR-CirKits specific information is downloaded to the USB processor and a serial number is automatically assigned by the FTDI program called MProg.exe. The RR-CirKits specific information is stored in the file LocoBuffer-USB-24.ept

When the USB chip is first loaded it uses the FTDI D2XX driver to run. This is the basic USB bus driver and it gives program level access to the chip.

Programming the PIC processor

Once the boards are clean and dry we may proceed with the PIC programming process. The PIC is programmed through the device header by using a jumper cable from the 18 pin DIP adapter on your programmer. The following image shows the adapter cable plugged into our programmer's 18 pin socket. Pin 1 is at the end away from the cable.

Programming adapter cable.

The programming adapter connects to the LocoBuffer-USB with the cable facing the modular jack end and the brown wire (header pin 1) close to the edge of the board.

Open your programmer software and load in the file named LB2040USB_B4_24.hex for downloading to the PIC.

Choose file LB2040USB_B4_24.hex.

Configuation information.

Program and verify the PIC on each board according to the instructions for your programming device.

Programming the USB processor

Installing the USB programming software.

The USB chip is programmed by using the FTDI provided program named MProg. It may be downloaded from here. Once the program is installed it will create a folder named "MProg2.9c" Add the file LocoBuffer-USB-24.ept into the Templates folder. The programming process also requires that the FTDI drivers be available. Use an XP machine and download the driver files found at and unpack it onto a CD or into a folder on your machine to be used during the USB programming process.

Changing the system options.

Each board's USB chip is programmed through the USB port. Unfortunately this means that Windows will detect each individual board and require a repeat installation of the drivers. We can short cut this process somewhat by doing the programming steps in a non intuitive way.

First open up the security settings and make the following change.

Find the entry for "Devices: Unsigned driver installation behavior" and set it to "Silently succeed". This will prevent the incessent warnings about installing unsigned drivers.

Running the USB software.

First run the MProg program and load the data file for the LocoBuffer-USB. This program may remain open during an entire programming session. It will automatically connect to each device as soon as the driver file is installed.

Loading the program.

Open and read in the data file.

After the data file has been loaded the program should appear like this.

Once the MProg program is loaded and running you can proceed to the programming of the USB chips.

Programming the USB chip.

Connect the LocoBuffer-USB unit to your computer with a standard A-B USB cable. The operating system should locate the device and ask you to load the software for it. Use the drivers you found and downloaded at

There are also instructions at but you will not need to complete all the steps mentioned there. Also it will not know that the unit is a LocoBuffer-USB at this time, so the messages will be different. Proceed only until the first time that the "Finish" button appears. Do NOT click finish at this time.

After "Finish" appears, switch windows to the MProg that you have previously opened. If you click on the hourglass icon it should show 1 unit available to program.

Click on the lightning bolt icon, and the information window should now show the serial number of the programmed device.

Once the device has been programmed, unplug it from the machine. NOW, after the device has been removed go back to the Windows hardware install window and click on "Finish". The hardware install window should close. Once it is closed you may then connect the next device and repeat the process again.

Unfortunately the Windows install step needs to be done for every unit, but the MProg program does not need to be reloaded each time. I knows when each device is installed and ready to be programmed. If you don't wait a few seconds between when the "Finish" window appears and when you click on the identify icon in MProg it may give an error. Simply retry the "identify" operation a couple of more times and it will find the device.