Jump to content
Sign in to follow this  

Help with PICLoader and C2C/P2C

Recommended Posts

I am trying to use P2C with the Rick Farmer PICloader v1.1. I included some details from his web site. Thus far I have not been successful. Can anyone help?


How can I use P2C and/or C2C to compile code compatible with Rick Farmer's PICLoader? Here are some of the details:


In other C Pic compilers there is a PRAGMA "#pragma ResetVector 0x0003" to change the reset vector. How can I do this in P2C and C2C?


Here are the instructions from Rick Farmers page:


Writing Code for Use with PICLOADER


 PICLOADER's impact on user code is quite small. The only restrictions are that the user code reset vector moves from 0000h to 0003h and the last bank of program memory is reserved for the PICLOADER code.

 PICLOADER does not use interrupts, so aside from the  restrictions in code space you can pretty much write your code as if the PICLOADER did not exist. In addition, PICLOADER can be invoked by the user code at any time to initiate a code reload. Note that PICLOADER always returns control to the user reset vector when it exits, regardless of how and where a user program calls it. Also check to make sure that the default configuration fuses do not conflict with your design. For example, the watchdog timer and brown out detector are enable by default. A complete list of the fuse setting is described at the end of this document and you can change them as needed when you program the bootloader into your target chip. Here is a checklist  for  converting code to run with the bootloader.




 This is a checklist for converting a 16Cxx design to a 16F87x design that can be loaded and run with the PICLOADER resident bootloader.

1. Change the reset vector in your code from 0000h to 0003h.

2. Remove the __CONFIG statement from your code. The bootloader can not change the configuration fuses. If the default configuration fuses are not to you liking you can change them to whatever like when you install the bootloader with a device programmer.

3. If you use the default fuse setting make sure that your code executes a "clrwdt" instruction every 10 milliseconds.

4. Connect the TX and RX pins to an appropriate connector and or an RS-232 converter chip so that you can communicate with the bootloader.

Share this post

Link to post
Share on other sites

Join the conversation

You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • Create New...