Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronic 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.

Register Log in

[SOLVED] Microcontroller Self Programming

Status
Not open for further replies.

tahir4awan

Full Member level 4
Joined
Nov 29, 2010
Messages
190
Helped
16
Reputation
32
Reaction score
16
Trophy points
1,308
Activity points
2,893
What is mean by self programming? I only know about two programing i.e programmer board programming and ICSP.
Does it mean that those microcontrollers which do not have ICSP capability are programmed with this method in which a boot code is copied to target microcontroller so that it can program itself without taking it out from the circuit.Am I right? or it is something else? Please explain.
 

KerimF

Advanced Member level 4
Joined
May 17, 2011
Messages
1,461
Helped
374
Reputation
756
Reaction score
370
Trophy points
1,363
Location
Syria
Activity points
12,314
What is mean by self programming? I only know about two programing i.e programmer board programming and ICSP.
Does it mean that those microcontrollers which do not have ICSP capability are programmed with this method in which a boot code is copied to target microcontroller so that it can program itself without taking it out from the circuit.Am I right? or it is something else? Please explain.
I use this technique with the SST89E58RDA MCU which is referred as In-Application Programming (IAP).
I believe if you read its datasheet you can have a good idea.
 

tahir4awan

Full Member level 4
Joined
Nov 29, 2010
Messages
190
Helped
16
Reputation
32
Reaction score
16
Trophy points
1,308
Activity points
2,893
It says in IAP mode one block of memory executes while other block of memory can be programmed or erased. I will ask again does it mean that those microcontrollers which do not have ICSP capability are programmed with this method in which a boot code is copied to one block of memory of microcontroller so that it can program other block of memory without taking out microcontroller from the circuit.
 

tahir4awan

Full Member level 4
Joined
Nov 29, 2010
Messages
190
Helped
16
Reputation
32
Reaction score
16
Trophy points
1,308
Activity points
2,893
But what is the purpose of a bootloader? Where do we use it?
 

jpanhalt

Advanced Member level 3
Joined
Jun 28, 2010
Messages
724
Helped
216
Reputation
442
Reaction score
219
Trophy points
1,323
Activity points
6,964
It "self programs", but uses up space too. I prefer ICSP for the smaller chips, which I am not sure can use the the bootloader either.
John
 

tahir4awan

Full Member level 4
Joined
Nov 29, 2010
Messages
190
Helped
16
Reputation
32
Reaction score
16
Trophy points
1,308
Activity points
2,893
I was right. Bootloader is used with those microcontrollers which do not have ICSP capability or Bootloader is used for convenience if we don't want to use an expensive programmer to program a microcontroller.
 

KerimF

Advanced Member level 4
Joined
May 17, 2011
Messages
1,461
Helped
374
Reputation
756
Reaction score
370
Trophy points
1,363
Location
Syria
Activity points
12,314
It says in IAP mode one block of memory executes while other block of memory can be programmed or erased. I will ask again does it mean that those microcontrollers which do not have ICSP capability are programmed with this method in which a boot code is copied to one block of memory of microcontroller so that it can program other block of memory without taking out microcontroller from the circuit.
In my case, first, I program the MCU using a conventional programmer (I erase anything on it). But in my firmware I write the instructions that let me reprogram it while the MCU is on board. These instructions are usually located in the smaller block while the main program resides in the larger one.
When I need to reprogram its main program (though usually I update some data in it only), I let the MCU read/write its new program from a serial EEPROM as 24C512 also on board. To be in the safe side, I add a small MCU which has the job to read the data or the new program from an external source and write it on this 24C512 while checking that all what it is received is 100% valid. Then when the download will complete, the small MCU signals the main MCU that a new data (or program) is ready for it on 24C512. For instance, the latter is also important as a backup in case power is cut during IAP mode.
 
Status
Not open for further replies.
Toggle Sidebar

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top