View previous topic :: View next topic |
Author |
Message |
Rez
Joined: 10 Feb 2019 Posts: 26
|
Pin 4 MCLR on Pics |
Posted: Fri Feb 22, 2019 6:13 pm |
|
|
Does pin 4 need a 10k resistor going to the Vdd positive if it is not being used? |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9243 Location: Greensville,Ontario
|
|
Posted: Fri Feb 22, 2019 6:56 pm |
|
|
Generally..yes... unless you can program the PIC with a fuse called 'nomclr'. Newer PICs have that option and it allows that pin to be reused as an input.
You'll have to read the datasheet for whatever PIC you're using, in the 'pinout description list' it'll say what the pin can be used for. |
|
|
Rez
Joined: 10 Feb 2019 Posts: 26
|
|
Posted: Sat Feb 23, 2019 12:23 pm |
|
|
The pics I use have the ability to use the nomclr fuse. If it is setup that way can I eliminate the resistor or should I still use it. |
|
|
alan
Joined: 12 Nov 2012 Posts: 357 Location: South Africa
|
|
Posted: Sat Feb 23, 2019 1:38 pm |
|
|
Always better to use a res on a input, otherwise chip may draw more power as the input may be in a undefined state. Can't connect to GND directly because then you can not program unless you use a jumper. |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19538
|
|
Posted: Sat Feb 23, 2019 1:57 pm |
|
|
There are some very dangerous things about the MCLR pin when NOMCLR
is used. It does not have protection to prevent it being taken above the
Vdd supply, and if it is taken above this it can trigger the start of
programming, or a reset even though MCLR is disabled. If you want to
use if as an input, you should add your own protection diode to it,
and like all inputs, it should not be allowed to float. |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9243 Location: Greensville,Ontario
|
|
Posted: Sat Feb 23, 2019 4:03 pm |
|
|
Some PICs, like 16F648a can't be programmed with a PICkit3 if you select internal osc and nomclr... found that out this week....
I have seen _mclr tied to VDD on a couple products. Don't know if that is 'legal'....just something I saw some time ago.... |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19538
|
|
Posted: Sun Feb 24, 2019 3:14 am |
|
|
This is a known bug with the Pickit3. The original software scripting tool
for this works. The later IPE tool doesn't, if NOMCLR is selected on some
devices!...
Eeek.
There is a workaround, if the code does not set the other ICSP pins as
output within about a second of starting. If you add a delay of about
a second into your code at boot, before setting the pin TRIS, you will
find the device remains programmable. This was documented on the
MicroChip forums about four years ago.
<https://www.microchip.com/forums/m801016.aspx> |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9243 Location: Greensville,Ontario
|
|
Posted: Sun Feb 24, 2019 6:28 am |
|
|
Thanks Mr. T ! Will try that out as my 'workaround' was to just use an 18F46K22. Tad 'overkill' for a 2 input, 2 output project. I like to keep the ICSP pins as ICSP pins so an 18 pin PIC like the 628, 648a seemed easy...
One day your head's going to explode with the knowledge stored up there !!
Jay |
|
|
|