PDA

View Full Version : Bootloader



yasser hassani
- 18th December 2007, 10:36
Hi anyone. I don't know anything about Bootloader! I want to know about that so I need some helpful references.
1- What is Bootloader and how does it work?
2- Which types of PICs can support that?
3- Is there any PBP written routins for using it?
Thanks alot

J. Mark Wolf
- 18th December 2007, 12:26
The bootloader is a small piece of code that you burn into your virgin PIC part once, with a typical device programmer, which then allows it to be programmed thereafter via the standard serial port pins (RX & TX). My favored method.

Alternate methods of programming PIC devices include the use of the standard Microchip ICSP (In-Circuit Serial Programming). Which uses a specific set of pins (PGC & PGD & sometimes PGM) to program the device.

The bootloader method makes use of the standard PC serial port, and thus requires level translation hardware such as a MAX232 chip.

The ICSP method requires that a device programmer be in-line between the PIC and the PC, and that some special circuit accomodations be made on your circuit board to isolate the PGC & PGD & MCLR pins from the rest of your circuit.

Both methods are fairly transparent to the user and allow very rapid download of code during development.

One down side to relying on bootloaders, is that sometimes they are un-available for a specific device and new devices. In which case the ICSP method has to be used.

The ICSP method will always work because it is built-in to every PIC device.

The ideal solution, in my opinion, is to provide pads for both on your PCB, populate the parts as required, and you have the best of both worlds.

yasser hassani
- 18th December 2007, 14:51
Thanks Dear Wolf
You answered to my question briefly :-)
I foundout something about bootloader usage. However I need more help. How can I use bootloader in PBP? Can you give me a schematic of way of connection micro and PC?
As you said bootloader is your favorite way for programming. Is it possible to learm me the way of using?
Thanks gain
Regards

mister_e
- 18th December 2007, 15:06
There's a few different bootloaders here and there (such as TinyBootloader), the one i use is made by Mecanique and come with the full version of MicroCode Studio, the schematic you need to use is like bellow...
http://www.mecanique.co.uk/code-studio/loader/reset-circuit.gif

In your PBP code, you just need to add

DEFINE LOADER_USED 1

in Microcode studio, you choose MicroCode Loader as programmer.

Further explanation... http://www.mecanique.co.uk/products/pic-prog/bootloader.html

HTH

yasser hassani
- 18th December 2007, 15:48
Hi Dear Mister_e
Thanks for your reply. Unfortunately I haven't MicroCode studio plus and MicroCode loader :-(
I found Tiny Bootloader- As you mentioned- and downloaded it from here:
http://www.etc.ugal.ro/cchiculita/software/picbootloader.htm
Have you worked with tiny bootloader? I think that I should write my program with microCode studio ( with--> DEFINE LOADER_USED 1 ) after commpiling send .HEX via Tiny Bootloader. Is it true? Does it work?
Thaks again.

mister_e
- 18th December 2007, 15:52
Yup make sense to me. now if TinyBootloader utility have it's command line, that would be great 'cause you could launch it directly from Microcode studio as a third party programmer.

Out of curiosity, which PIC are you going to use? Which OSC speed?

yasser hassani
- 18th December 2007, 16:02
Dear Mister_e
Thanks for your reply. I want to use PIC16F877 and 10 MHz Osc. (Is it possible to use PIC16F628?)
--------
Regards

mister_e
- 18th December 2007, 16:09
not suppose to work with a 16F628 as it don't have the capability to write/modify it's own codespace. 16F88 will work.

handgio
- 3rd January 2008, 05:51
hi
mister_e, maybe you remember my problem in the next topic
http://www.picbasic.co.uk/forum/showthread.php?t=7627

i am fix my problem usign tinybootloader also, but i have only a waring message,
when i am load my program usign the tiny, the software say :

WARNING: PCLATH not initialised before GOTO! ... sucessfully repaired

and the load continue, and work fine, i am put only DEFINE LOADER_USED 1

that place i need put this GOTO command for skip this warning??????

thanks for all

Regards

mister_e
- 3rd January 2008, 07:22
I already heard it, but seems it's more a PC utility problem and it's just an annoying warning without any effect to your PIC code.

Yup the only thing you have to do is place a DEFINE LOADER_USED 1 and you're in business.

Don't worry about the warning, just ignore it.