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 CCS Technical Support

Programming target PIC with another PIC

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



Joined: 08 Aug 2005
Posts: 22

View user's profile Send private message

Programming target PIC with another PIC
PostPosted: Wed Oct 19, 2005 6:34 am     Reply with quote

Hi there

I have a project that i have to do using the PIC16F873 device. In this project i have to program a PIC16F873 device with another PIC16F873 device. I was wondering if CCS had built in functions that could help me do this and if yes which functions would they be. I have been trying to use the cc5x compiler but things didnt work out. I came to a dead end and things didnt quite work.

Another thing is that one person on this forum called Ttelmah gave me alot of great advice and thats how i knew what exactly to do. I only managed to get hold of this compiler yesterday and was wondering if he could help me out again if possible.

I really dont have much time left for my project. About 2 weeks and was hoping that he could give me some tips using this compiler and how to do my project in C.

All help will be greatly appreciated.
Thanks

Best Wishes
asmallri



Joined: 12 Aug 2004
Posts: 1635
Location: Perth, Australia

View user's profile Send private message Send e-mail Visit poster's website

PostPosted: Wed Oct 19, 2005 7:52 am     Reply with quote

On several projects I have used a master PIC to program slave PICs (PICs that are downstream from the master that cannot be reached directly). I have bootloaders in the master and slave PICs. I set up the Master PIC bootloader to have a special "Transparent Mode". In this mode it tranparently echo anything on its user interface port to whatever port or ports connect to the slave PICs. When I have finished programming the slave PICs I take the master out of transparent mode.

One way of doing this is to define your own unique "type 4" intel hex record which a master will use to put itself in transparent mode and some termination control character to drop it out of this mode. When in transparent mode the master examines the next character received via the user interface, if it is not the termination character it passes it to the slave interface.
_________________
Regards, Andrew

http://www.brushelectronics.com/software
Home of Ethernet, SD card and Encrypted Serial Bootloaders for PICs!!
Atma



Joined: 08 Aug 2005
Posts: 22

View user's profile Send private message

PostPosted: Wed Oct 19, 2005 8:04 am     Reply with quote

asmallri wrote:
On several projects I have used a master PIC to program slave PICs (PICs that are downstream from the master that cannot be reached directly). I have bootloaders in the master and slave PICs. I set up the Master PIC bootloader to have a special "Transparent Mode". In this mode it tranparently echo anything on its user interface port to whatever port or ports connect to the slave PICs. When I have finished programming the slave PICs I take the master out of transparent mode.

One way of doing this is to define your own unique "type 4" intel hex record which a master will use to put itself in transparent mode and some termination control character to drop it out of this mode. When in transparent mode the master examines the next character received via the user interface, if it is not the termination character it passes it to the slave interface.


Hi there

Thanks for your reply..
What I have to do in this case is program a target PIC using another PIC in the sense that this PIC should be able to erase, write to, read from and verify the target PIC. I have been following the PIC specification guide so far and have been trying to follow the commands..Did it so far using cc5x compiler. only thing is that its not working so thought to try out the ccs compiler since this is where i got my idea from.

So what i want to know is how would i erase a target PIC or write to a target PIC for instance using this compiler?Would it be difficult to convert from cc5x to the ccs compiler?

thanks
asmallri



Joined: 12 Aug 2004
Posts: 1635
Location: Perth, Australia

View user's profile Send private message Send e-mail Visit poster's website

PostPosted: Wed Oct 19, 2005 10:05 am     Reply with quote

There are a couple of ways you can do this. One is to emulate an external programmer and program the PIC using ISCP. The second way is for the target PIC to contain a bootloader. In which case you send commands to the target PIC. For example, the erase program memory command would erase all program memory space except the space occupied by the boot loader. This is the method I use. You could look at the sample CCS bootloader code to see how they do it. Similarly you could issue a command to read the program memory, in this case the bootloader would send all the program memory space except the space occupied by the bootloader.
_________________
Regards, Andrew

http://www.brushelectronics.com/software
Home of Ethernet, SD card and Encrypted Serial Bootloaders for PICs!!
Atma



Joined: 08 Aug 2005
Posts: 22

View user's profile Send private message

PostPosted: Wed Oct 19, 2005 10:12 am     Reply with quote

asmallri wrote:
There are a couple of ways you can do this. One is to emulate an external programmer and program the PIC using ISCP. The second way is for the target PIC to contain a bootloader. In which case you send commands to the target PIC. For example, the erase program memory command would erase all program memory space except the space occupied by the boot loader. This is the method I use. You could look at the sample CCS bootloader code to see how they do it. Similarly you could issue a command to read the program memory, in this case the bootloader would send all the program memory space except the space occupied by the bootloader.


hi there

What do you mean by emulate an external programmer?

thanks
asmallri



Joined: 12 Aug 2004
Posts: 1635
Location: Perth, Australia

View user's profile Send private message Send e-mail Visit poster's website

PostPosted: Wed Oct 19, 2005 10:39 am     Reply with quote

Lots of PIC programmers program the PIC in cicuit using In Circuit Serial Programming (ICSP). The Warp13A is an example of a PIC programmer that uses a PIC to program other PICs.
_________________
Regards, Andrew

http://www.brushelectronics.com/software
Home of Ethernet, SD card and Encrypted Serial Bootloaders for PICs!!
Atma



Joined: 08 Aug 2005
Posts: 22

View user's profile Send private message

PostPosted: Wed Oct 19, 2005 10:45 am     Reply with quote

asmallri wrote:
Lots of PIC programmers program the PIC in cicuit using In Circuit Serial Programming (ICSP). The Warp13A is an example of a PIC programmer that uses a PIC to program other PICs.


Hi..

ok i think thats the way that i have been working so far..because i have been using the in-circuit programming specification guide in order to program my target device. only problem is that the way that i did it doesnt work. I am not sure if it is a hardware problem or a software problem.

Would you have any advice using this method for me?
asmallri



Joined: 12 Aug 2004
Posts: 1635
Location: Perth, Australia

View user's profile Send private message Send e-mail Visit poster's website

PostPosted: Wed Oct 19, 2005 10:49 am     Reply with quote

Sorry - I do not use that method myself - bootloaders are easier :-)
_________________
Regards, Andrew

http://www.brushelectronics.com/software
Home of Ethernet, SD card and Encrypted Serial Bootloaders for PICs!!
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