Jump to content
 
  • 0

Programming a PICmcu with a different MCU and LVP


N9WXU
 Share

Question

  • Member

I have a system where I am using a PICmcu as an I/O processor handling lots of real-time activities.  My main processor is some larger ARM (like a Raspberry Pi).  I could implement a boot loader on the PICmcu but that is very complex and uses code space.  I would like to simply use low voltage programming (LVP) and teach my host CPU to program the PICmcu directly.  How do I do this?

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0
  • Member

I posed this question because I have seen it about as often as I have seen questions about boot loaders.

LVP is a fantastic choice for programming a PICmicro used in this situation.  Doing so will require a few things:

1) A hardware connection to the PICmcu from the host.

2) A host driver that can do the work.

Let us take these requirements in order.

First, the connection: While almost all the functions on a current generation PICmicro have selectable pins through the PPS feature, the LVP pins are NOT re-mappable.  That means you must hook them up first and then you can use PPS to steer some other interface onto the pins for the "normal" behavior.

Second, the software interface.  While Microchip Technology has never published a programming library for a host CPU, there are some interesting sources of information.  The best solution would be to adapt the software found here -> https://github.com/MicrochipTech/XPRESS-Loader Specifically, https://github.com/MicrochipTech/XPRESS-Loader/blob/master/MPLAB.X/lvp.c

The interface to the I/O pins is not well abstracted (assumes a PICmcu) but it would be trivial to the average user to create some init/set/clear functions and use those.

As a bonus, LVP and HV programming is identical except for the programming mode entry.  If your PICmcu does not have LVP and you have an easy way to apply 9-12v to the MCLR pin, then you can simply adjust the ICSP_init and ICSP_Release functions.

For the nitty-gritty of programming a PICmcu, you can look for programming specifications on Microchip's website.  Here is a link to a typical specification: http://ww1.microchip.com/downloads/en/DeviceDoc/41397B.pdf

  • Helpful 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   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.

 Share

 


×
×
  • Create New...