Usage for Tiny PIC bootloader
After you browse or enter the name of the hex file, select the COM port and baud rate:
- You can keep the TinyBootloader interface opened, then click WriteFlash, or double-click the tray icon, and after that reset (or power-up) the PIC. If your program is continuously sending serial data to PC, (that will be interpreted as a bootloader response) use the second method:
- first press PIC reset, click WriteFlash, then release PIC reset;
- Use a hardware (RTS) or software reset (codes to send first).
Write Flash
![]() |
|
Commands
![]() | Command line parameter: hex filename to be written. When using a command line parameter writing flash will start automatically.
|
? | help |
ontop | keep the window on top of the others |
logdetails | lists detailed stuff happening inside (used only for debugging) |
clearallflash | clears all flash except the bootloader (actually it fills all flash with FFh) |
writeeeprom <addr> <dat> | writes the byte <dat> at the address <addr> (numbers can be either dec or hex) eg: writeeeprom 0 b6h - writes B6h in the first eeprom location |
writeconfig <adrLow> <dat> | only for 18F; writes the configuration byte <dat> at the address 300000h+<addrLow> eg: writeconfig 3 FFh - activates WDT |
Options
![]() |
|
![]() |
|
Terminal
![]() | A rudimentary Terminal, with the following possibilities:
|
What do you need
Hardware
- An external programmer is needed (only) the first time in order to write the bootloader into the PIC
- On your board, you must have the PIC (pins TX,RX) connected to the serial port of the PC (pins Rx,Tx), usually using a MAX232 level converter:
Software
- You can use one of the provided .hex files or
- Modify tinybld.asm and assemble it using MPASM IDE (or Mpasmwin.exe)
- Modify "xtal", "baud", "_??_OSC" to what you need; assemble it (for example with .\MPLAB\MCHIP_Tools\Mpasmwin.exe); write the HEX it with a PIC programmer; put the PIC on you board and connect it to the PC serial port.
- Requirements for your program:
- The program must meet this requirement: it must have in the first 4 words of memory a GOTO to the start of the main program. (this is what the majority of the bootloaders require). So in assembler it should look something like this:
PIC16F PIC16F PIC18F org 0
;clrf STATUS
clrf PCLATH
goto Mainorg 0
;clrf STATUS
pagesel Main
goto Mainorg 0
goto Main
- If you use a compiler, search the help for a directive that allows coexistence with a bootloader;
- The program must meet this requirement: it must have in the first 4 words of memory a GOTO to the start of the main program. (this is what the majority of the bootloaders require). So in assembler it should look something like this:
Critics and suggestions at: