The DS30 bootloader.


The DS30 bootloader written by Mikael Gustafsson,  and can be downloaded from ....

Legend has it that it is based on the Tiny Bootloader, which in turn I think was based on the AN1310 application, because it uses the same settings panel. I think I first looked at this bootloader last December, before the 18F25K22 became available.   I did play with the 18F25K20 version of the DS30 and even wrote some loading procedures for it, which I have added below. I have subsequently tried it with the 18F25K22 chip.

I did run into 'issues' using the downloader with the 18F25K22 and they are listed at the bottom of this page. I have also posted them to the DS30 forum.



Finding the 18F25K20 and programming in the DS30 bootloader.


December 26th 2010.

"I would imagine that Ciseco will eventually sell the 16 Mhz xtal and two 15 pF caps as an optional add on. Likewise the right angled headers mentioned above. Why would you want them ?. Well the internal 16 Mhz oscillator block inside the PIC is only calibrated to 1%. If one PIC is working to another PIC, then the total error will be up to 2% and also temperature dependant. Since an Xtal and the two loading capacitors only cost pence, it will ward off the possibility of all kinds of horribly obscure problems, by buying them, for critical applications". 


28th December 2010.  

 I did manage to get a blank chip from Canada, just to prove that they exist. The next step would be to program the bootloader into it .... but that means you have to spend between £15 - £45 to buy a programmer.  I already have a Pickit2 programmer, which I regard as being the best value for money, at any price. What I didn't have was an adaptor to take 28 pin PIC's.  What I did do, was order some 28 pin ZIF sockets from China, with the intention of making one that matched my other adaptors, which plug straight into the Pickit2.

Today I decided I could wait no longer and made up a 'temporary' one on Veroboard.  

On the top left of the board is a six way right angled plug that plugs directly into the Pickit2. As you can see it is very simple and only six of the PIC pins are connected.  After uploading the latest data file which includes the 18F25K20, Pickit2 recognised the chip and programmed it. The automatic verify function proved that it had programmed the 18F25K20 16 MHz xtal and x4 PPL bootloader OK. If you need to find the bootloader file you can find it on the web site plus files for other configurations.



OK, so now I have an 18F25K20 chip with the bootloader programmed into it and am ready to go .... nowhere !.  You see I still have to get things like the download cable, the download cable driver and the compiler to all work together. Also how will I know when they are working ?. 


30th December 1010.


Fault finding.


1.     When I  fault find, everything is suspect; the PIC, the download cable, the cable driver, the board and the set up of the compiler. My first move is to prove the PIC and the board are working. I can do this by using the Pickit2 to program a simple flashing LED program into the PIC. The most likely pin failure when experimenting with download cables will be RC6 and RC7.


'Note. This program is for the Amicus compiler.

Xtal = 16


    High PORTC

    DelayMS 500

    Low PORTC

    DelayMS 500

GoTo Main



In my case, I removed the PIC from the target board and plugged it into the Pickit2, 28 way adaptor seen above. Then set the default programmer in Amicus to Pickit2 (or whatever programmer you have) and then program the above program into the 18F25K20. You then place the PIC back onto the target board, connect an LED with a series 270 ohm limiting resistor to  PortC.6 pin and ground. Power up the board and the LED should flash at 1 Hz. If that works ok transfer the led and 270 ohm resistor to Port C.7 and again it will flash at 1 Hz if that pin is OK. 

Please note that programming the above program into the PIC using a programmer, will over-write the bootloader, if it existed.  So when you have everything working, go back and reprogram the chip with the DS30 bootloader. Also remember to set the programmer back to DS30 in AMICUS before using the bootloader. 


2.    The next thing to do is to get a download cable working. A Picaxe download cable will not work with the target board, because the Picaxe cables invert both the TX and RX serial signals. We need a cable that does not invert the signals. If you are using the 18F25K20 PIC you also need a cable that has 3.3volt TX and RX signals as the more common 5 volt cables can damage the 3.3v PIC. One commonly found suggestion is to make one from a mobile phone download cable such as the Nokia CA-42. Unfortunately if you check the output voltages of this cable, using an oscilloscope, they will be found to be about 4.6 volts !. 



Testing a download cable. 

Just to recap we are using a USB to TTL download cable, which has a TX (Transmit) output and an RX (Receive) input. It is possible to functionally test this sort of download cable using the LOOP BACK test. It should of course be set up, using a known serviceable USB to serial download cable, connected to the PC's USB socket, so you know what to expect. This will be the socket used, when the cable was first installed on the PC. 

First load the Hyper terminal program. Go to Start ... All Programs ... Accessories ... Communications ... Hyper Terminal and the following panel will be seen.

Next enter a name for this connection. As you can see I have simply called mine "Test". Ignore the Icons. Then click on 'OK' and another panel will appear.

We are not going to use a telephone line so ignore the first three entries. Click on 'Connect using' and a small drop down panel will appear showing you what COM ports are available. I do know that when I first installed the test cable, it appeared on COM5, so I next clicked on  COM5 and "COM5" will appear in the 'Connect using' box. Click on 'OK'. Another panel will appear.

We do not need to change anything on this panel, so click on 'OK' and a data terminal window will appear.

From the terminal end anything we now type into the PC keyboard will be transmitted down the USB cable to its serial end, however nothing will appear on the screen because it only shows what is received. If at the remote serial end of the cable we short the TX and RX connections together, anything that is transmitted will be received back by the terminal and will appear on the screen, as seen below. 

If this happens, it proves that the cable is working. All you have to do, is work out which wire is TX and which is RX, when you connect the cable to the board. This procedure can be used to test any USB to serial adaptor / download cable.


3.    Download cable drivers.  Many of the drivers available on the internet for the CA-42 and other Prolific chip set cables, simply do not work !.  One that has been reported to work is the USB010 USB-Serial Adapter cable driver, from Picaxe. This can be downloaded free from .....

Please note that there are different versions for different operating systems.


4.    The bootloader I am using is the DS30. If you are using the Amicus compiler, the DS30 needs to be set up as your default 'programmer'. At the end of this article are three procedures for using the DS30 bootloader and setting it up in Amicus. The programmer type is selectable in the 'View' menu of Amicus. Don't forget if you want to program the bootloader into a PIC then you will have to switch back to your usual programmer, in my case the PICKIT2 programmer.


5.    At some point you will have attended to the above points and are now ready to try out your download cable. Plug it into the lower serial input, on the board. To re-cap you have already programmed a simple flasher program into the PIC and that worked !. What I suggest that you do next is modify the program in Amicus to make the LED flash much slower. Don't forget to next select the DS30 as the programmer in Amicus. If everything is working, when you select 'compile and program' in Amicus, it should download the modified program down the download cable and into the PIC. The PIC will immediately run the new modified program and if everything is working you should see the change in flash rate of the LED. If it does not change then you know that the download did not work and that you need to systematically check out your system, until it does !. 




Downloading programs from the Amicus compiler to boards, other than Amicus.

(Screen shots of Amicus are by kind permission of Crownhill Associates).

I have cobbled together three procedures that may help newcomers get started with downloading programs using the DS30 bootloader, which is available free, to download at .




Using the DS bootloader to download from the DS30 Loader GUI.



The DS30 bootloader has two different ‘front ends’. The GUI version is intended be a ‘stand alone’ application. The Console version is intended to be integrated with a compiler, in this case the Amicus compiler.


Using the GUI front end.


Download the DS 30 bootloader files from




Run this zip package and it will unzip the  files …

Double click on the DS LOADER GUI file icon.

This will screen the DS30 Loader panel.





You will note that it has retained the details of the last download, this saves you having to re-enter device, Baud rate and port every time you use it. Also in the top Hex-file box it will retain the location of previous files downloaded.  The programs that these files represent were originally written in the Amicus BASIC language, which we humans can understand but the PIC microprocessor cannot.  Before the program can be downloaded to the PIC it has to be compiled, that is converted into a Hex file, before it can be downloaded to the PIC.


It is a good habit to open a folder especially for your Hex files so that you will be able to find them easily. Amicus keeps track of the BASIC programs that you write, but not the Hex files.  On this computer I have started a new folder for the Hex files called “My Xino”, so that I will always be able to find them.


Device settings.

The Xino PIC ds30 board uses the 18F25K20  PIC. So that is what we must select in the two device boxes.



The default Baud rate for the bootloader must be the same as set in the Amicus compiler. The default Baud rate is 115,200 and you can leave it set at that rate.



The COM's port setting, is dependant on what COM's port was assigned to your USB download cable, the first time you plugged it in. If you plug it into any other USB socket, the computer may not be able to find it. To find out which port has been assigned to it go to the control panel and look at the DEVICES list. One of the entries will be for your USB cable. If you unplug it one of the entries will disappear, plug it back in and it will reappear along with the Com port number. Go back to the DS30 loader panel and select that Com port. On this computer it was Com5, but on yours it may be different.




Downloading the Hex file to the PIC on the target board.


1.                   First select the Hex file that you want to download to the PIC, in the Hex file box.

2.                 Connect the USB cable by plugging one end into the assigned USB socket and the 3.5mm plug into the download socket on the Xino  board.

3.                 Apply power to the target board and observe the red power indicator LED lights. Any old program in the PIC will automatically run, but you can      ignore it.

4.                 On the DS30 GUI panel. click on the tick box for ‘Write program’.



5.                 Click on the DOWNLOAD button on the tool bar and the Hex file will be copied to the PIC on the Xino board.


Note !.  During the download, a black panel will be seen on the screen.



When you see the bottom line of text appear, momentarily press the RESET  button on the target board and this will allow the bootloader to be found. If you then examine the lower window on the DS30 loader panel, it will give you the details of the successful download.  The new program will automatically run on the target board. It really is as easy as that!



Using the DS30 to download Hex files from the Amicus Compiler.


Open the AMICUS compiler.  The first thing we have to do is install the DS30 as a  NEW PROGRAMMER in the Amicus compiler.


  1. GOTO the VIEW menu in Amicus and select PROGRAMMER OPTIONS. The following panel will appear. 



  1. Select “Install New Programmer …” and another panel will appear …




  1. Select “Create a custom programmer” and another panel will appear.



  1.  As it says you can call your new programmer by any name, I decided to be creative and call mine DS loader !. Type in the name and then click on Next>. Another panel will appear.



Type in ‘ds30LoaderConsole.exe’.   Then click on Next and another panel will appear.



The simplest way is to click on Find Automatically and let Amicus search. When it finds it, this panel appears.



Click on Next and the last panel appears.



Into the parameters box you must type the following …


--file=$hex-filename$ --device=PIC$target-device$ --port=COM5 --baudrate=115200 --write-program --non-interactive


Then click on the Finished button.


NOTE.  My download cable was found to be assigned to COM5. If yours is different then change the 'COM5' to whatever yours is using. You will also Note that the statement also sets the Baud rate to 115200 exactly the same as the DS30 boot loader was set to.  Both must be the same !.


NOTE, if you want to make sure that the DS30 bootloader has now been included on the programmer list you can go back and check the Programmers Options box.



Yes it is and it is selected as the default programmer, until you decide to change it. You are now ready to go into the Amicus compiler, write a program, compile it and then download the compiled Hex into a PIC microprocessor!




 Downloading Hex files from within Amicus.



When using the GUI version, settings and control buttons used are those on the GUI panel. When downloading Hex files from within Amicus, the control buttons used are those on the Amicus GUI.


Compiling within Amicus.  

Amicus gives us two options for compiling the BASIC program into a Hex file.



The Compile button will cause the compiler to compile the program and nothing else.

The compile and download button will cause the compiler to compile the program and download it to the target PIC via the down load cable.


During the compile Amicus checks for programming mistakes and will not allow the download to happen, if there are any. When you have corrected all of the mistakes it will allow a download. It must be remembered that Everytime we make corrections we have actually changed the program and it needs to be re-compiled again. When all mistakes have been corrected, clicking on the Compile and Program button will  re-compile and then start the download to the PIC. The following panel will appear on top of the Amicus GUI …



When the bottom three lines of text appear you must click on the target board RESET switch, which will enable the boot loader to be found. If you do not press the RESET while the search is in progress, it will time out and the download will not happen.

After a successful download the target board will automatically run the downloaded program.


The Program button on the Amicus GUI.



Clicking on this button will not instigate a compile, but it will download the Hex file of the last compiled program.  This can be useful when you are testing download cables, board connections and also when you have more than one PIC that you wish to program.



1.    The first is that the above procedures* were written for the 18F25K20 chip, but also appear to apply to the 18F25K22 chip..

2.    Most of the issues found with the DS30 concerned the operation of the drop down DOS window.

3.    If the target board is not powered during a download, the bootloader search is bypassed and the DOS screen closes giving no time to read any warnings.

4.    If the download cable is not plugged in during a download, the bootloader search is bypassed and the DOS screen closes giving no time to read any warnings.

5.    During a normal download, it was found that very often the bootloader search was bypassed, or prematurely ended. This was of major concern because the DOS screen disappears so fast, it is impossible to read the warnings at the bottom of the window. The end result is that one thinks that there has been a download, when there hasn't. Again, the DOS screen closes down too fast to read any warnings.

6.    If,  in the settings box, the download cable is not plugged in, it obviously will not show. If it is then plugged in, one has to exit and then re-enter the box in order to detect the cable.

7.    It may very well be that the above conditions were caused by my own incompetence.




Copyright John Kent 16th November 2010.