______________________________________________________________________ > < > Bootloader v1.01 < > for < > PICos18 release 2.06 < > < > PICos18 - Real-time kernel for PIC18 family < > < > < > www.picos18.com www.pragmatec.net < >______________________________________________________________________< This file contains all necessary informations to use properly the PIC18 bootloader for PICos18 v2.xx. This loader let you design a multi-task application and load it into the PIC18 flash memory with a RS232 cable. Moreover the PICosSupervisor Windows application lets you control your PICos18 application (alarms, events, tasks, RAM acdces, ...). ______________________________________________________________________ > < > I - Zip file content < >______________________________________________________________________< The drv_can zip file contains : - COM.dll : Windows DLL used for the bootloader connection - Loader.dll : PICos18 Supervisor application - Supervisor.exe : Starter program - Bootloader_v1_00.zip : Bootloader sources for PIC18 only To use the PICos18 Bootloader, first unzip the package. Then unzip the Bootloader_v1_00.zip file into your current PICos18 directory (for instance C:\PICos18\Projects\). This bootloader is supposed to be use with PICos18 and has been tested with MPLAB 7.21 and C18 v3.02. It can be used to transfert any hex file, without being connected to PICos18. ______________________________________________________________________ > < > II - Bootloader settings < >______________________________________________________________________< At first you have to burn your PIC18 with the bootloader. To do it you can use a SCHAER+ programmer driven by PP18 or ic-prog for instance (or an ICD2 of course). The Bootloader_v1_00.zip file contents the loader.hex file for a PIC18F452 target running at 40 MHz. If you need to program a similar device at the same frequency you can use the loader.hex file for your PIC18. If you use a PIC18 quite different from the PIC18F452 or at a different frequency, then rebuild the bootloader as a PICos18 projet. The bootloader project files are provided in the zip file to let you rebuild easily the project. There are 2 importants settings for the target : #define __8BYTES_BLOC__ //#define __64BYTES_BLOC__ #define __40MHZ__ //#define __32MHZ__ The second one specifies the frequency (2 differents frequency are managed by the bootloader), and the first one selects if your target can program the flash memory 8 bytes per 8 bytes or with a 64 bytes buffer. Please have a look at your PIC18 datasheet to know how long is the buffer of your target. For instance the PIC18F452 has a 64 bytes general buffer to program the flash memory but can only do it 8 bytes per 8 bytes. ______________________________________________________________________ > < > III - First run < >______________________________________________________________________< If you connect a led to the RB4 pin of the PIC18 you will see the led blinking when the bootloader will run the first time. It means no program has been detected in memory and the bootloader is still waiting for a RS232 connection from the PC. To transfert a HEX file to the chip memory you have to start the PICos18 Supervisor. ______________________________________________________________________ > < > IV - PICos18 Supervisor (1) < >______________________________________________________________________< Under Windows (2K or XP) start the Supervisor.exe file. The application asks you for choosing a COM port. Select the one you want to connect to your target and set the baudrate at 115200. (The program works properly with a USB-serial converter based on a FTDI device). Click on the HEX icon to be able to select the DIPos18.hex file provided with the package as an example. Then click on the PIC18 icon called "Update PIC" (you can let the cursor up to the icon to know the widget function). If your target is blank (with just the bootloader in it) the Supervisor will program immediatly the target. If a program already exists, the Supervisor will ask you to reset the target to start the bootloader. If the connection between the PC and the target is OK then the transfert starts and the progressbar indicates the transfert status. ______________________________________________________________________ > < > V - PICos18 Supervisor (2) < >______________________________________________________________________< When the transfert is completed the bootloader reset the target automaticaly and start the application loaded previously. The DIPos18.hex file loaded as an example make the led connected to RB4 blinking after 2 secondes. Then click on the "read from PIC" icon to get all the information related to the PIC18 connected. The bottom window will be updated according to the information sent by the target. You will notice there are 3 tasks : - a RS232 driver - a supervisor - an example task that makes the led blinking ______________________________________________________________________ > < > VI - PICos18 Supervisor (3) < >______________________________________________________________________< Use the different icons to : - inspect and modify the RAM memory - inspect and modify the Alarms - inspect and modify the Events And select one of the tasks present in the application (bottom window) and right click to know the main operation you are able to make on the selected task : - suspend the task - run the task - reset the task - reset the target The debug menu is reserved for a futur action. ______________________________________________________________________ > < > VII - Conclusion < >______________________________________________________________________< You can use this bootloader to load any kind of HEX file into the PIC18. But you have to considere the PICos18 Supervisor only load the program section of the HEX file, then it won't chnage configuration bits already present in the PIC18. If you need special features of the config bits (like Watchdog) you have to rebuild the bootloader project with the appropriate settings. The PICos18 supervisor lets you have a basic control of your application but it is sometimes very usefull when you don't have any debuger to modify some global variables (for instance to setup a motor control PID). The PICos18 Supervisor should be involved a little bit more with a breakpoint feature (debug menu) and a C file editor. It is already working well but needs some improvment... /* End of File : bootloader.txt */