View previous topic :: View next topic |
Author |
Message |
rvalor
Joined: 16 Apr 2009 Posts: 18 Location: Spain
|
Use the MCLR pin as a digital input???? |
Posted: Thu Jul 16, 2009 6:31 am |
|
|
Hello everybody in this forum¡¡
I'm programming a PIC18F4550 mcu...
In my application there isn't need of a reset signal so I plan to use this pin as a digital input:
pin nº 1 : MCLR/VPP/RE3
In software I use this preprocessor directive:
FUSES NOMCLR
and In hardware I connected this pin to the ICSP VPP pin, and to a bluetooth module ( this module, has a digital output that goes to high level when a remote connection is achieved...)
The problem I have is when I try to programm the device using my PICkit 2 programmer it doesn't detect the micro, when I disconnect MCLR pin from the bluetooth module the problem disapears.
How can I use this pin??? Can everybody give any advice???
I tested it connecting a 10k pull-up resistor as usually is done when MCLR is used but the same problem appears...
Thank you very much, and sorry for my english¡ |
|
|
bungee-
Joined: 27 Jun 2007 Posts: 206
|
|
Posted: Thu Jul 16, 2009 7:14 am |
|
|
You can use this pin as digital input. What you describe is problem when programming the PiC and other things are connected to this pin. Problem is that in programming mode this pin receives ~12V of Vpp for programing purposes, if this voltage is lower then programing can not be done.
You need to add switch and when you program your pic you disconnect your pheripherals and in normal operation you connect them back.
There is application note on Microchip's page regarding ICSP and connections look also there
P.S.: Or if you use TQFP/QFN package you can use secondary programing pins. |
|
|
rvalor
Joined: 16 Apr 2009 Posts: 18 Location: Spain
|
|
Posted: Thu Jul 16, 2009 7:47 am |
|
|
Thank you very much bungee-
I've seen the ICSP application note, I didn't noticed that about the volts in the VPP pin,
I will not use this pin as a digital input because I have no simple way to disconnect the bluetooth module while programming...
Thank you very much¡¡ |
|
|
bkamen
Joined: 07 Jan 2004 Posts: 1615 Location: Central Illinois, USA
|
|
Posted: Thu Jul 16, 2009 9:55 am |
|
|
Well, a manual switch is ugly.
You could use a P-MOSFET to shut off (open) the input line from the bluetooth module during programming. And then close it (turn on) when not programming.
This would be automatic.... over manual (yuk)
-Ben _________________ Dazed and confused? I don't think so. Just "plain lost" will do. :D |
|
|
|