What's A Bootloader?So we've got our platform in a state where we can load new firmware onto it with our programmer. That's great but what if we need to update the platform after we've built some units and sent them off to end users? I guess we could give them all a Pickit and instructions on how to use it.
We need a better way than that. We need a bootloader. What's a bootloader? Simple, a bootloader allows our microcontroller to be reprogrammed WITHOUT our Pickit.Basic OperationWhen we use the Pickit, or any other programmer for that matter, ones and zeroes are sent on the programming pins after the microcontroller is put into a special programming mode. The microcontroller writes that data into program memory. Most of the PIC microcontrollers nowadays have a “self-write” capability which means that they are capable of writing to their own program memory space during normal operation without going into a special programming mode. We have to be careful though because if we put new programming instructions in the wrong addresses the microcontroller will exhibit unpredictable behavior or stop working altogether until we reprogram it with our Pickit.When the unit is powered up we can have a small piece of code that checks some type of flag(button pressed, entry in EEPROM memory) to determine whether to run the application code or run the bootloader code.
The bootloader code has some mechanism for getting the new firmware instructions into the application code program memory, overwriting the old application code in the process.Bootloader SpecI've thought a lot about the best way to implement a bootloader for the EmbeddedFun Sensor Platform. Taking into consideration ease of use and functionality I think the best option is to use an SD card. We can put new firmware on the SD card and the next time they reset the device it can check for new firmware and load it into program memory as well. How we get the firmware onto the SD card is also up to us. The platform could implement the Mass Storage USB class so we could copy firmware to it like any other external drive or maybe we could get it there wirelessly. The SD card provides other benefits as well. It gives us a ton of storage that the platform can use for things like storing sensor data, settings and other things.
Pickit 3 Pgm Pin
Pickit 3 Download
Episodes 3 and 4 will cover implementing the bootloader for our sensor platform. Topics covered will include:. Reading/Writing to flash program memory on the PIC. Communicating with an SD/uSD card.
By serial do you mean USB or UART (or what)?There are a number that you can get from the Microchip web site and also from other sources via a Google search.What program do you want to drive it with from the PC side.Are you expecting to be able to debug through the bootloader (typically very hard but not impossible) or is this just for field upgrades of the firmware?How much spare space have you got left over from your app?Especially for a USB bootloader, do you want to share the USB code with your app?All of these will affect the choices you have.Susan. What are you trying to achieve as I'm not entirely clear on what you are actually asking for.A bootloader is code that resides in the microcontroller and can be used to re-program the microcontroller itself. Normally it resides in protected memory (or at least memory that is not supposed to be used by anything else) and does not normally execute except to reload the main application firmware out in the field. (If you are in the lab or factory, then you would typically use a programmer directly connected to the board to take complete control of the device, provide debugging facilities if necessary, and higher speed programming.)Therefore it typically talks to the outside world via a serial connection via a UART or USB interface.I have not heard of a parallel bootloader but I suppose there is nothing to stop such a beast being written.
However I would think it unusual to require 10 or more pins (assuming 8 bits and control lines) that you would need to a parallel bootloader where 2 is all you need for a UART or USB connection.Susan. It is firmware for the FSUSB demo board with the 18F4550 chip.It has a USB bootloader.MCHPFSUSB Firmware User's GuideMCHPFSUSB v1.3 USB FrameworkMCHPFSUSB v2.2 USB FrameworkRelease Notes for MCHPFSUSB v1.3Release Notes for MCHPFSUSB v1.3 – Microchip Full-Speed USBSolutions. January 4, 2008.
Table of Contents. What'sNotes for MCHPFSUSB v1.3.htmMCHPFSUSB Firmware User's Guide© 2007 Microchip Technology Inc. DS51679A MCHPFSUSB FirmwareUser's Guide Page 2. MCHPFSUSB FIRMWARE USER'S GUIDEPICDEM FS USB Development Board User's GuideChapter 4. “Using the Demo Tool Application – DM163025” refers to the“MCHPFSUSB Firmware User's Guide” (DS51679), which describes how.
Hi,i want to UART bootloader code for pic18f25k50.i just want a working code so that later i can program pic18f25k50 using Com Port only.instead of pickit 3 all the time.18F25K50 and 18F4550 in the title???MikroE propose a Bootloader with HID serial terminal.as the ' Ready for PIC board with 18F45K22' bootloader allready loaded inside the PIC. Hi,i want to UART bootloader code for pic18f25k50.i just want a working code so that later i can program pic18f25k50 using Com Port only.instead of pickit 3 all the time.Fair enough - as others have pointed out there are lots of options out there.However, be aware of a couple of points in taking this approach:- most bootloaders you will find will NOT allow you to debug your code. Adding a bootloader should be one of the LAST things you do.- the PicKit3 will be a lot faster, reliable and will let you debug the app and bootloader as well.
It really should be the main programmer you use for the development phase- keep in mind what code you will need to run in the PC to communicate with the PIC via its UART. It will probably have to read from the HEX version of the code, handle all of the handshaking with the bootloader etc. Therefore look for bootloader code that either has a suitable PC companion program or has the protocol documented well enough for you to write your own.(I've used the term PC above; however if you are planning on upgrading the firmware in the field, then you may want some more portable means to deliver the firmware to the PIC. This might be a laptop, but you might also consider the needs of the field engineer and create a small programmer device for them.)Susan.