View previous topic :: View next topic |
Author |
Message |
digitalfreak
Joined: 16 Feb 2005 Posts: 25
|
ICD2 PIC18F452 ICSP |
Posted: Tue May 16, 2006 12:03 pm |
|
|
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)
|
�really can? |
Posted: Tue May 16, 2006 12:50 pm |
|
|
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
|
|
Posted: Tue May 16, 2006 1:05 pm |
|
|
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
|
|
Posted: Tue May 16, 2006 2:00 pm |
|
|
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
|
|
Posted: Tue May 16, 2006 2:24 pm |
|
|
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
|
|
Posted: Tue May 16, 2006 2:26 pm |
|
|
thx Mark thats exactly what i want...
my prevous reply was sent before reading urs!
have fun |
|
|
|