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

Pin 4 MCLR on Pics

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



Joined: 10 Feb 2019
Posts: 26

View user's profile Send private message

Pin 4 MCLR on Pics
PostPosted: Fri Feb 22, 2019 6:13 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Fri Feb 22, 2019 6:56 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Sat Feb 23, 2019 12:23 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Sat Feb 23, 2019 1:38 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Sat Feb 23, 2019 1:57 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Sat Feb 23, 2019 4:03 pm     Reply with quote

Some PICs, like 16F648a can't be programmed with a PICkit3 if you select internal osc and nomclr... found that out this week.... Crying or Very sad
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

View user's profile Send private message

PostPosted: Sun Feb 24, 2019 3:14 am     Reply with quote

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. Sad

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

View user's profile Send private message

PostPosted: Sun Feb 24, 2019 6:28 am     Reply with quote

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