Following my previous post on How to Setup a PIC Microcontroller Development Environment in Ubuntu 11.10 Oneiric Ocelot With Piklab + SDCC, now I’ll show you how to use the Tiny PIC Bootloader with Piklab.
Piklab already has programming interfaces for various programmers, including the Tiny Bootloader. To configure it you must go to “Settings > Configure Programmers… > Tiny Bootloader” and then set your serial port and it’s specific settings. In my case, since I use a USB Serial TTL Cable (see my previous post on how to make a Low Cost (1,85€) USB to RS232 LVTTL Serial Cable), I configure it with the following data:
- Port Selection: /dev/ttyUSB0
- Specific > Port Speed: 19200
- Specific > Timeout: 300
- Specific > No of Retries: 5
Response code is 400
After inserting all the correct configurations for your serial connection, Click “Apply” and you’re ready to go. To program you just have to go to “Programmer > Program”. Do not forget to click the Reset button of your development board to reset the PIC and initiate bootloader when you want to program it.
Easy, right? Yes, but it doesn’t always work. 🙁 I had it working when I used Ubuntu 11.04 Natty Narwhal and some version of Piklab that I can’t remember now but since I upgraded to Oneiric Ocelot and a new version of Piklab, the Tiny Bootloader programming interface stopped working. However, there is another easy way to use Tiny Bootloader with Piklab.
This alternative involves installing the linux interface for the Tiny PIC bootloader, Tinybldlin.
To install it you can download the .deb package here: tinybldlin-0.6.6_all.deb. Then, open a console, enter the folder where you have the .deb file and run the following command:
sudo dpkg -i tinybldlin-0.6.6_all.deb
You can use Tinybldlin as a standalone application to program your PIC microcontroller or as a serial port terminal for any project. However, changing between the Piklab and Tinybldlin windows is boring and inefficient so let’s use the Tinybldlin’s command line interface to set it up as a Custom Programmer in Piklab. Again, go to “Settings > Configure Programmers…” but now choose “Custom Programmer” and in the “Program” line insert
tinybldlin -port /dev/ttyUSB0 -baud 19200 -file %O
NOTE: Do not forget to change the serial port to suit your own serial connection.
And that’s it. Now you can use Piklab with Tiny Bootloader again. Personally, even if the default Tiny Bootloader was working in my computer, I would still use this second option because it has the advantage of opening up a window which tells you to click the reset button at the right time.
Oh and don’t you ever forget of choosing the appropriate programmer in your piklab projects!
I hope it helped! Good luck with your PIC projects! 🙂
Did you find this post helpful? Do you wish to contribute to other projects regarding computer science, electronics, robotics or mechatronics that will be posted in this blog? If you wish to do so, you can donate via paypal using the button below. Thanks! 🙂