CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

How is self programming different from ICSP?

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
whynotme



Joined: 07 Aug 2011
Posts: 1

View user's profile Send private message

How is self programming different from ICSP?
PostPosted: Sun Jan 08, 2012 1:11 am     Reply with quote

Hi everyone,

I read some PICs have the self programming feature, is it the ability to rewrite the PICs hex file by it own from inside?

I use Pickit2 to load the hex file to the PICs and normally a pin needs to be raised to 12V and some electrical requirements (I don't remember exactly). Does self programming need these kinds of electrics?

Can I do like this:
1. Send the new hex file to the PIC using USART, USB, I2C.
2. The PIC stores the file.
3. When it will be commanded, the PIC will change its features by updating the new program to its memory.

Thanks
Ttelmah



Joined: 11 Mar 2010
Posts: 19342

View user's profile Send private message

PostPosted: Sun Jan 08, 2012 2:46 am     Reply with quote

Most modern PIC's can write to their own program memory (self programming), _but_ there has to be a program in the chip to do this. Normally a program called a 'bootloader'. This code sits in the chip, and has to be written in using another method. It runs, and normally checks for some specific signal to be received, and when it is, then switches to receiving the incoming code, and writing it to the rest of memory. No, the PIC can't 'store the file'. There is normally at least 10* as much ROM as RAM, so the programming has to take place 'block by block' as the data arrives. To store the file, you would have to add another memory at least as large as the PIC's ROM.
Do a search on 'bootloader', and you will find a lot about this.

Best Wishes
Douglas Kennedy



Joined: 07 Sep 2003
Posts: 755
Location: Florida

View user's profile Send private message AIM Address

PostPosted: Sun Jan 08, 2012 11:27 am     Reply with quote

There is programming and then there is development. Final programming the PIC comes hopefully after development unless you are getting already proven code from elsewhere. Now for programming the chip a bootloader can accept input from several peripherals USB IC2 SPI UART whereas ICSP is restricted to a few specific pins. However the pins used for ICSP are often used for ICD in circuit debugging ( debugging with realtime devices like on a target board). The ICD like a bootloader is loaded into the PIC. Since a debugger adds great value during development and since it also can act as a programmer it is often the preferred choice since it can for a release avoid the overhead of a bootloader and if desired it can program in a bootloader. The bootloader has the disadvantage of taking up some space ( and it is very tricky for a bootloader to update itself) but this is offset if a PIC needs to be upgraded in the field since it avoids the need for end users to have to have an ICD type programmer. Many developers will use both the ICD ICSP and release a work product containing a bootloader.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group