Pond Electronics - Home of the µFlash876 & µFlash876B embedded controllers, µStack & µConnect Bus.

PICulator User Manual


The PICulator is a bootstrap loader for Flash PIC devices such as the popular PIC16F876. Unlike most bootstrap loaders, the PICulator does not use the PICs on chip serial port, this leaves the PICs UART completely free for use by the application - no cable swapping, jumpers or worries about interactions with the application. Another notable aspect of the PICulator is its low pin count, a single I/O pin is dedicated to use by the loader - with care even this can be reused by the application.

The initial version (3.00) of the PICulator is restricted to the PIC16F876 & PIC16F877 @ 20MHz. If you have urgent requirements for a different configuration, please contact us and we may be able to accommodate you.


What is a bootstrap loader?

A bootstrap loader is a small piece of code which allows a chip with self programming capability to load and execute a user program, without recourse to an external programmer. In fig 1 you can seen the development cycle for Flash PICs using the traditional PIC programmer method.

You can see that excluding compiling or assembling, there are seven discreet steps involved in the cycle. This compares with only two steps in the PICulator development cycle shown in fig 2.

Instead of using a programmer, you download your code directly to the target PIC, where it runs as soon as download is complete. No more removing the chip to program it with the associated risks of bent pins, worn sockets, ESD damage and wasted time. A further advantage of a bootstrap loader is that software updates following release become much easier. You can now reprogram a target controller in-situ, without removal from the application environment.


Sounds perfect, so what's the catch?

The loader will use some of the resources of the chip including program memory, RAM and I/O. However the PICulator is among the best loaders in this respect. It uses only one I/O pin, only 272 Words of program space (256 protected & 16 unprotected), zero permanent RAM requirement and best of all it does not use the on chip serial port making it perfect for applications with serial communications (particularly those with RS422 or RS485 buffers on the serial port). You should also note that a bootstrap loader cannot program the PICs configuration fuses, instead the PICulator loader is supplied in a number of configurations covering common requirements.

There is of course one other catch shared by all bootstrap loaders, how do you get the loader into the chip in the first place? You have two options, you can burn the loader onto a PIC using a PIC programmer (if you have or can borrow one), or you can buy a PIC preprogrammed with the loader directly from Pond.


What does the PICulator package consist of?

The PICulator consists of two pieces of software, the loader and the driver. The loader is a short piece of code which resides on the target PIC, it is responsible for accepting serial commands & data from the driver as well as burning the data into FLASH or EEPROM memory. The driver runs on the PC (under Windows) and is responsible for placing the target PIC into boot mode, sending the application program over the serial port and verifying that the PIC has been programmed correctly.


Target hardware requirements

One of the design objectives for the PICulator was to keep the target hardware requirements as simple and low cost as possible. Rather than specifying an RS232 buffer on every target, we have separated the target hardware from the RS232 driver. This means that each target only needs a couple of resistors and a four pin header. A single RS232 buffered cable can now be used to program all your target boards. The diagram in fig 3 shows the PICulator target hardware requirements. The header provides access to the PICulator signals as well as power to the RS232 buffer required by the driver cable.




Driver hardware requirements

The driver program requires a PC (Win95/98/Me) with an RS232 serial port available (Default is COM1). It also requires a buffer between the RS232 signals and the TTL level signals required by the PIC. The details of the interface are shown in fig 4. Note that the interface is powered from the target +5V. If you do not feel like going to the trouble of building this interface, a ready made and tested interface (the µPod) is available from Pond.


Installing the PICulator Driver

As of version 3.11 the PICulator and µFlash876/876A share the same driver. Please see the µFlash/PICulator Driver Manual for details of installation.


Burning the Loader onto a PIC

To produce a PIC with PICulator capability, you must burn the bootloader code onto a PIC. The code is supplied in standard Hex format, compatible with most programmers. The Hex file also contains a record for setting up the configuration fuses on the PIC. As these settings are fundamental to the operation of the PICulator, you should not attempt to modify them before loading onto a target PIC.

As it is not possible to modify the fuse settings of a PIC16F876/877 using a bootstrap loader, two versions of the bootloader are available :

  • PIC20WDD.hex - 20MHz 16F876/877 watchdog disabled
  • PIC20WDE.hex - 20MHz 16F876/877 watchdog enabled


Compiler/Assembler Compatibility

The PICulator has been tested with MPASM (Microchips free PIC assembler) and PCW/PCM compilers from CCS, preliminary examination of code produced by other compilers has shown no problems with compatibility.


Code Requirements

Your target program should not generate code for locations used by the bootstrap loader, ie locations 1EF0 to 1FFF. If your program does contain code in this segment, the loader will report the error and abort download. However since these locations are at the end of memory it is unlikely that the compiler will place code here until the program is too large to fit in memory. If you are programming in CCS PIC-C you can force the compiler to reserve this segment with the instruction:

#RESERVE 0x1ef0:0x1fff

Other compilers may have similar ability to reserve program space.

If you wish to determine if code is compatible with the PICulator, the specific restriction is:

Locations 0 to 3 should not be the TARGET of any jumps or calls (including direct writes to the program counter).

As far as we can determine all other code is compatible.


Using the PICulator with MPASM

When programming in assembly we recommend the following format for code locations zero to three.


Home | Products | Technical Info | How to Order | Contact Us | Links