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

ICD2 PIC18F452 ICSP

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



Joined: 16 Feb 2005
Posts: 25

View user's profile Send private message

ICD2 PIC18F452 ICSP
PostPosted: Tue May 16, 2006 12:03 pm     Reply with quote

Hi,

I am newbie to ICSP, iam trying to use it using ICD2 and MPLAB.

Did a quick serach and gone through the ICD poster, got fairly decent idea. I have seen mixed opinions about loosing pins PGC/RB6 and PGD/RB7

In my circuit RB6 and RB7 are connected to ChA and ChB of an optical encoder, hence I will be configuring them as inputs. - And I cannot avoid doing this bcoz I am maxed out on I/O's.

Iam planning to have a manual switch for both lines when doing programming. My question is do I need any configuration of bits or reassign IO's etc...for using ICSP...other than NOLVP

bottomline: Code-wise is it OK to have RB6 and RB7 as inputs?

Can ne body send me snippet of how these pins look like in code when in programming..

thanks,
sorry if this is something stupid.
carmarmu



Joined: 09 May 2006
Posts: 15
Location: Valencia (Spain)

View user's profile Send private message Send e-mail MSN Messenger

�really can?
PostPosted: Tue May 16, 2006 12:50 pm     Reply with quote

I think that�s not possible.
I believe that always you must use those pins, since when you include the order to use the ICD2, a small program is recorded in PIC,wich serves to communicate with the PIC through those pins when it�s in Debugger mode (in addition to programming it), therefore, if I�m not mistaken, you will always have to use pins PGC and PGD of your piece (it�s the piece that�s). If I�m mistaken,correct to me and thus I learn something new, but I believe that not it can.
Greetings.
_________________
**CaRmArMu** Valencia (Spain)
treitmey



Joined: 23 Jan 2004
Posts: 1094
Location: Appleton,WI USA

View user's profile Send private message Visit poster's website

PostPosted: Tue May 16, 2006 1:05 pm     Reply with quote

You can not reassign programing to other pins.
You must use what is in the spec sheet.
I use B6 and B7 for inputs all the time. You may be able to also. You may not even need a manual switch.
The easiest way is try it and find out.
As for debuging, when you debug those pins will be used for debug and the main function of those pins will be lost. But you may be OK with that.
Here is some more info.
Pay attention to the voltage levels on mclr.
http://ww1.microchip.com/downloads/en/AppNotes/00910a.pdf
Inside this reference is another reference to ICD AppNote.
and
http://ww1.microchip.com/downloads/en/DeviceDoc/51331B.pdf
see botom of page 22
Mark



Joined: 07 Sep 2003
Posts: 2838
Location: Atlanta, GA

View user's profile Send private message Send e-mail

PostPosted: Tue May 16, 2006 2:00 pm     Reply with quote

If you are just doing in-circuit programming then just disconnecting the pins for programming is fine. If the connected device will not affect the signal from the ICD then you do not even need to disconnect the device. The micro always comes out of reset with the GPIO as inputs so even if you used those pins as outputs, you'd be safe.
digitalfreak



Joined: 16 Feb 2005
Posts: 25

View user's profile Send private message

PostPosted: Tue May 16, 2006 2:24 pm     Reply with quote

treitmey wrote:
You can not reassign programing to other pins.
You must use what is in the spec sheet.
I use B6 and B7 for inputs all the time. You may be able to also. You may not even need a manual switch.
The easiest way is try it and find out.
As for debuging, when you debug those pins will be used for debug and the main function of those pins will be lost. But you may be OK with that.
Here is some more info.
Pay attention to the voltage levels on mclr.
http://ww1.microchip.com/downloads/en/AppNotes/00910a.pdf
Inside this reference is another reference to ICD AppNote.
and
http://ww1.microchip.com/downloads/en/DeviceDoc/51331B.pdf
see botom of page 22



Thx for the replies...

sorry i mis-spoke i donot mean to reassign programming pins...

what i meant was do i have to do anything else to make RB6 and RB7 to work as they are supposed to if i want to have ICSP...

i think the answer i got from ur post is NOTHING!. thats great ....

I may not be using ICD2 as debugger i am only worried about programming....so no need to worry about volatge levels also is that correct!...

please correct me if iam wrong:::

1) Pins 1 - 6 on ICD2 hook right to PIC in right places....
2) Connect it right PC-ICD2-PIC
3) Program PIC using ICD2
4) Disconnect ICD2
5) Back to using RB6 and RB7 as inputs


thx
digitalfreak



Joined: 16 Feb 2005
Posts: 25

View user's profile Send private message

PostPosted: Tue May 16, 2006 2:26 pm     Reply with quote

thx Mark thats exactly what i want...

my prevous reply was sent before reading urs!

have fun
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