琢磨 https://passport2.21ic.com/?24756 [收藏] [复制] [RSS]

日志

ZT:Free PIC16F87x / 16F87xA bootloader

已有 3380 次阅读2006-10-27 14:25 |个人分类:单片机开发

http://www.microchipc.com/PIC16bootload/


Free PIC16F87x / 16F87xA bootloader


Introduction - Features - Download - Hardware - Discussion Forum - Troubleshooting - Frequently Asked Questions (FAQ) - Photos


Overview

A bootloader is used to quickly download a new program into your PIC micro, in a few seconds.

Once you have it set up, you can quickly update the .hex file in your PIC micro with a single keystroke!

Bootloading is easily performed in-circuit, with the PIC micro still plugged into your PCB.

No modification to your circuit board is required for the basic implementation.


Supports Windows, Linux (native and under Java), and DOS.

A 18Fx52 bootloader
is also available.


Page Map



How to use the bootloader



  • You start with your application circuit, complete with a 16F87x or 16F87xA.
  • Program the PIC micro in your target circuit with the bootloader code. This is a once-off operation. A programmer is needed for this task; see the ICD2 from www.microchip.com or 3rd party programmers.
  • Plug in the RS232 serial adapter to your PC. 4 wires plug into the PIC micro.
  • Add an extra line in your program to reserve the top 255 bytes in memory for the bootloader. Full Instructions provided.
  • Click the Write button on the Windows software, then reset your target circuit.
  • The bootloader remains active for 0.2 seconds after reset, to give you the option of uploading new code, and after 0.2 seconds (or uploading complete) you can use the serial port as normal.
  • You can optionally set your IDE/editor to auto-load the compiled Hex file into the PIC16F87x, using the command line options for the Windows software.














Hello Shane,


Saw your bootloader page (WorkingTex) on Sunday, wired the max232 circuit Monday morning at 09:00 AM and had downloaded my first program into an 'F876 by 09:15!!! By the end of the day, I came to realize that this is by far one of the best time savers I've come across in the last 5 years!


Thanks for an extremely detailed description and once again, thank you for making Petr Kolomaznik's small and powerful bootloader available.


Fritz Braun Jr.
Melbourne, Fl USA

www.bellsouth.net


Features

PIC16F87x serial bootloader. Used successfully by thousands of users worldwide.



  • Compatible with the 16F870/1/3/4/6/7 and 16F876, 16F876A, 16F877, 16F877A.
  • 255 instructions long, fits into top of memory.
  • Only uses two wires - TX and RX. This is unlike some bootloaders that need up to 5 wires!
  • Example Hex files for 16F870/1/3/4/6/7 and the 'A' revisions. It is possible to run 16F73/4/6/7 .hex files on the appropriate 16F870/1/3/4/6/7 chip.
  • Example Hex files for 3.6864, 4,16 and 20Mhz.
  • Downloads at 19200bps. This takes a few seconds for a complete program.
  • Writes to EEPROM.
  • Supports any Hex file, including those from standard assemblers, Basic, C and Pascal compilers.
  • Circuit diagram supplied as a .gif or a Protel 99 .sch file.
  • Full source code supplied for bootloader, in assembly and C.
  • Compatible with any circuit - no trigger pins or jumpers needed to activate bootloader.
  • Fits into memory locations that the MPLab-ICD (an InCircuit Debugger) would normally use, if present.
  • Includes Petr Kolomaznik's excellent windows interface plus full Delphi source code.
  • Supports DOS or Linux under a DOS emulator. See instructions at the base of this page.
  • Source code in assembly provided. Many thanks to Petr Kolomaznik. See his bootloader page.


What the users think

More user testimonials ...

Hardware


To use the bootloader, you will need an adapter, which plugs between the COM port of your computer and the PIC microprocessor.


A serial adapter converts the RS232 to TTL levels, -13V to +5V and +13V to 0V. The PIC reads these TTL levels into its hardware serial port.


Feel free to make an adapter up yourself. Circuits for PIC >> RS232 comms are explained on PICLIST.

Note that you need serial conversion that is compatible with the hardware UART in a PIC, which requires some form of level inversion. A simple resistor circuit will not do, but a MAX232 based circuit will suffice. See PICLIST RS232 conversion circuits.


This hardware circuit diagram is supplied with the distribution download, as a .gif and a Protel 99 .sch file. For the Protel 99 .sch file, download the distribution download below.














-----Original Message-----
From: Michael

To: Shane Tolmie
Subject: Re: 16F87x bootloader

Shane - I just gotta tell you again how kickass this is... I remember when I switched from EPROM based PICs to a flash based 16F877, and I was utterly thrilled with how much faster I could reprogram the device after recompiling my code.


It's like that all over again now - takes me only 5 seconds to download the code to the PIC while it's on the breadboard - no more taking out the chip, putting it into the programmer, waiting _forever_ for MPLAB to burn it...


- Michael



Download Bootloader .hex files and Windows/Linux/DOS executables


Archive contains executables, .hex files, full source code and schematics.


Download Shane Tolmie PIC bootloader v9-50 with PICC-LITE compatibility. (2005-12-24). (1240Kb).
Download Shane Tolmie PIC bootloader v9-40 with added notes on potential data corruption due to BOR (2005-08-27). (1240Kb).
Download Shane Tolmie PIC bootloader v9-30 with 16F87xA quad alignment bug fixed (2004-09-24). (1240Kb).
Download Shane Tolmie PIC bootloader v9-21 (1240Kb).
Download Shane Tolmie PIC bootloader v9-10 (844Kb).

Previous versions
are available.

Any questions/enquiries about the bootloader? It worked beautifully or didn't work at all? Email me on webmaster[at]microchipc.com.


Troubleshooting and Online Forum

If you have any problems, see the
troubleshooting FAQ or the step-by-step quick start.

Compatibility List

Check if your compiler / assembler is compatible.


If you find that the bootloader works on a compiler/assembler not listed in the list, please email webmaster[at]microchipc.com so I can update the list. Thanks!

Photo Gallery




The picture below shows how to set up the bootloader on a breadboard.

The big white DIN plug on the top right plugs into the PAS12 serial adapter, which goes into the serial port of your PC.

The white button with the arrow on it is for resetting the PIC. The other components are a 5V regulator, and a 800mA polyswitch to switch off the current in case of a short. These last two components are entirely optional.




PICBoot Plus


An alternate bootloader interface which includes a terminal is available in the latest distribution download. The screenshot is shown to the right.


From readme:


PIC Bootloader + Terminal, September 2004


Most PIC applications that I develop include serial link to commuciate to some terminal-console program so I thought it would be handy to integrate a serial console into this Bootloader. The console was inspired on the very nice straightforward OC- console by www.castlesoft.de.

The original bootloader was made by Petr Kolomaznik (Czech Republic). http://www.ehl.cz/pic, email: kolomaznik@ehl.cz. PICbootPlus is based on the Delphi sources (1.0.8.0 25.7.2001) provided by (C)2000-2001 EHL elektronika.


All enthousiasts developing PIC applications are free to use this software. I have included the BCB source code for those who like to make something better out of it. Comments are welcome but I cannot guarantee quick response or even any response at all.


How to use: Same as bootloader provided by Petr Kolomaznik. The console works immediatly after startup and almost immediatly after bootloading. You may select baudrates for the console independantly from the bootloader.
The lines on the console will wrap after 40 characters. Non printable ASCII characters 0 and 9 show up as ASCII 254.


Herman Aartsen
TNO - The Netherlands
Eindhoven


License


The bootloader is free for hobbyist or home use. Use it and modify it, to your hearts content!


路过

鸡蛋

鲜花

握手

雷人

评论 (0 个评论)