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 support@ccsinfo.com

How to use MCLR pin?

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



Joined: 24 Jun 2004
Posts: 285

View user's profile Send private message

How to use MCLR pin?
PostPosted: Wed Jul 28, 2004 9:48 am     Reply with quote

every chip has a MCLR pin, what this pin used for, can I use it a general I/O to receive and output data, if it is possible, how to check if MCLR is on/off and how to send high and low to it?
rnielsen



Joined: 23 Sep 2003
Posts: 852
Location: Utah

View user's profile Send private message

PostPosted: Wed Jul 28, 2004 9:55 am     Reply with quote

The MCLR pin is used as an external reset to the PIC. Some PIC's offer the option to use this pin as a regular I/O, usually programmed with the #fuses statement. The PIC, itself, does not 'drive' the MCLR pin but is pulled Low whenever the circuit needs to reset the PIC like some kind of supervisor circuit. The PIC can, however, reset itself via a Watchdog in case the proram 'hangs'. Read the data sheet to see if the MCLR pin can be used as a general I/O. You can, also, enable or disable the MCLR input on many PIC's.

Ronald
young



Joined: 24 Jun 2004
Posts: 285

View user's profile Send private message

PostPosted: Wed Jul 28, 2004 10:00 am     Reply with quote

for 12f675 I found out that GP3 is also the MCLR pin, how to define it as general i/0 and how to define it as MCLR using #fuses as you suggested?

Thank you
SherpaDoug



Joined: 07 Sep 2003
Posts: 1640
Location: Cape Cod Mass USA

View user's profile Send private message

PostPosted: Wed Jul 28, 2004 12:22 pm     Reply with quote

young wrote:
for 12f675 I found out that GP3 is also the MCLR pin, how to define it as general i/0 and how to define it as MCLR using #fuses as you suggested?

Thank you


Look at the CCS header file for the 12F675 (in your \Devices directory). All the fuse settings are defined there. You may also need the chip datasheet from Microchip to understand it.
_________________
The search for better is endless. Instead simply find very good and get the job done.
rnielsen



Joined: 23 Sep 2003
Posts: 852
Location: Utah

View user's profile Send private message

PostPosted: Wed Jul 28, 2004 12:48 pm     Reply with quote

In your CCS New Project Wizard, un-selecting the MCLR option will put a NOMCLR in your #fuses statement. Try this and then click on the 'View Code Generated' tab to see what is generated for the .h file. These are the 'fuses' that will be programmed when you 'burn' the code into your PIC. The data sheet looks like the GP3 pin is enabled to be an Input-only when the MCLR is disabled.
Guest








PostPosted: Wed Jul 28, 2004 1:02 pm     Reply with quote

Thank you for your great help!!! I am kinds of like a blind person walking on the street need all detailed instructions. I appreciated.
arunb



Joined: 08 Sep 2003
Posts: 492
Location: India

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

MCLR
PostPosted: Sat Jul 31, 2004 11:03 pm     Reply with quote

Hello,

I found that the PIC never functioned when the MCLR was left floating, but when I tied it to +5 Volt it became alright.

Is it OK to keep MCLR high permanently??

cheers
arun
rnielsen



Joined: 23 Sep 2003
Posts: 852
Location: Utah

View user's profile Send private message

PostPosted: Mon Aug 02, 2004 9:06 am     Reply with quote

Yes, you can keep MCLR tied 'high' permanently. Never leave it just 'floating' as it will cause you problems. MCLR would be used if you wanted to have an external circuit act as a supervisor and reset the PIC in case things went hay-wire. I simply pull mine high, through a pull-up resistor, and just leave it there. I do, however, use the MCLR input while I'm debugging my programs so that I can reset it without cycling power all of the time.

Ronald
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