Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

!! Flashing PIC Wirelessly

Status
Not open for further replies.

wylee

Full Member level 1
Joined
Feb 17, 2004
Messages
98
Helped
6
Reputation
12
Reaction score
3
Trophy points
1,288
Location
Malaysia
Activity points
1,031
reflashing code with rf

After seeing the problem faced by the Mars robots, Spirit and Opportunity ....

I come to think of implementing their idea of having a remote flashing circutary into my next wireless project

Does anyone know any circuit which can do this? I am hoping to flash PIC16F84

Using RF or IR as your transfer medium, uploading the new firmware code into a remote PIC circuit where it will flash and update itself...

This will be cool especially if your PIC circuit is located at some hard to reach environment
 

flashing pic

Hi,

It can be done as some companies do that.
What you need to do is this:
1. Use a bootloader - will come back to this in a sec.
2. Use a PIC that has twice the memory then your progrm needs\will need.

How it works:
The PIC will start with the bootloader. The bootloader will read whice part of the memory in the PIC is active and will start the program from there. If you will need to update, then the program itself ( not the bootloader ) will write the new software using RF/IR/RS-232 or any type of communication to the oposite place then the program bit that indicated the place in the memory. If all is ok, and CRC and other code is fine. Then the program bit wil change telling the bootloader to use the second program. Finaly the program will reset itself.
Bootloader will start again, and will go to the second program. And then you can change the program as many times as you need.
Thats all.
You can implament an external memory, but the cost will not be effective and you can have much more problems then using an internal memory.
If you will do somehting like that, please share it with us.
Good luck.
 

    wylee

    Points: 2
    Helpful Answer Positive Rating
picdem pic16f84a

Hi wylee,

If your plans are to update remotely (RF or IR) the flash of PIC16F84, you need a slave (second chip) in order to act as a gateway between the remote station and the PIC16F84.
Remember how you're programming the PIC16F84 ? Using the ICSP (In Circuit Serial Programming) based on hardware two I/O pins plus power, ground and VPP.
Inside PIC16F84 you'll not find a bootloader, thus you can't update it without an appropiate external device.
If you still insist to use the old PIC16F84 it's recommended to read the ICSP specification as well.
Start with page 33 of the file: https://ww1.microchip.com/downloads/en/DeviceDoc/30277d.pdf
Then build your gateway which will receive serial from RF transceiver and manage the flash update through ICSP interface.

But if you plan to switch to PIC16F87XA series or even better to PIC18 then things looks different.
Just because you can get all benefits from a bootloader deliberately included to give the user the ability to perform a flash update without an external device through ICSP interface.
You can read more at : https://ww1.microchip.com/downloads/en/DeviceDoc/00851b.pdf

Then all you have to do is to receive serial the information required for flash update through RF transceiver.
Obvious all communication protocol must resides on the bootloader section.
You can buy a PICDEM Z 2.4Ghz RF Card (code AC163027-2 $39 on Microchip site) or even the all kit (code DM163027_2 ) for a nice RF application in ISM band 2,4Ghz.
 

cc2420 + pic18

Flashing PIC WIRELESSLY is really a cool idea !!!

If you guys don't mind, I want to make it bit cooler further.

The wireless card shown by silvio is showing 2.4GHz, so an idea comes to my mind, "Is it possible to use simple WI-FI (802.11b) LAN CARDS to communicate with PIC via that card ? "
if that is possible, then we can right some simple VB application to flash PIC.

what do you guys think about the feasibility of this idea ?

if this idea is possible, then please tell how you guys think It could be implemented ?

agnivesh
 

pic16f84a programming software and bootloader

Hi agnivesh,

The PICDEM Z 2.4 GHz RF card uses the CC2420 RF 2.4 GHz transceiver manufactured by Chipcon. The CC2420 is an IEEE 802.15.4 compatible RF transceiver for the 2.4 GHz band. Please refer to www.chipcon.com for more information on the CC2420 RF transceiver.
The RF schematic and PCB design are a straight adoption of the CC2420 reference design published by Chipcon.

The PICDEM Z 2.4 GHz RF card is designed to demonstrate the Microchip solution for the ZigBee protocol for the 2.4 GHz frequency band. Thus, you can't use it with ordinary WI-FI card based on 802.11b
For the last one, you can use a nice board from www.edtp.com

But before proceeding with WI-FI cards read these four articles:

**broken link removed**

**broken link removed**

**broken link removed**

**broken link removed**
 

www.edtp.com/ wifi

Hi agnivesh,

All what you said is possible. If you take into account what i wrote. No matter what interface you are using, as long as you stick to having enough memory ( using one or two PIC ) you can do it very simple.
I wouldnt use 2 PIC as it is expensive and wil maek your harware bigger and more complax.
 

pic programming wirelessly

You don't need a PIC that has twice the memory than your program needs.
It will be waste of space and increased costs. In two words, BAD IMPLEMENTATION.

I'll repeat:
The PIC16F87X family of microcontrollers has the ability to write to their own program memory. PIC18 familly, too.
The PIC16F84, NOT, even if you split the total memory in half.
Wylee was concerned to update the flash of PIC16F84. It's not possible without an additional chip. That's why I said two chips.


Read the application note AN732 from Microchip site.

Two terms are used:
"boot code" that refers to the bootloader code that remains permanently in the micro.
"user code" that refers to the user's firmware written into flash memory by the boot code.

Read the conclusion on page 9:
"Using a bootloader is an efficient way to allow firmware
upgrades in the field. Less than 3% of the total program
memory is used by the boot code and the entire program
memory available on a PIC16F877 can be programmed
in less than one minute at 19,200 baud."

If you are afraid that the update procedure could freeze in the midle, then are more efficient ways to solve the problem.
Not using two equal program memories (I know that feeling when you are able to recover from a freeze update using the second half program).
 

    wylee

    Points: 2
    Helpful Answer Positive Rating
programming pic wirelessly

Hi,

For past experiance, this is the best way that i would take. I dont think you will be able to insert a code for decoding RF or any other protocol in the bootloader...
When i design a ssystem, i want to have fail safe. I cant send any one of my people all over the world just because the system missed one char when it was updating remotly...
But then again, there is not one way to solve a problem, we do what we need to do.
Good luck.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top