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

NOMCLR no master clear question?

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



Joined: 13 Aug 2004
Posts: 58
Location: Turkey

View user's profile Send private message Visit poster's website

NOMCLR no master clear question?
PostPosted: Thu Oct 02, 2014 6:57 am     Reply with quote

Hi everybody,
I designed a board with pic18f6310,
my CCS compiler model 4.114

my fuse configuration is like that:
#include <18F6310.h>
#device adc=8
#FUSES WDT64
#FUSES INTRC_IO //High speed osc with HW enabled 4X PLL
#FUSES NOBROWNOUT //Reset when brownout detected
#FUSES PUT //No Power Up Timer
#FUSES NOSTVREN //Stack full/underflow will cause reset
#FUSES NODEBUG //No Debug mode for ICD
#FUSES NOIESO //Internal External Switch Over mode enabled
#FUSES NOFCMEN //Fail-safe clock monitor enabled
#FUSES NOXINST //Extended set extension and Indexed Addressing mode disabled (Legacy mode)
#FUSES PROTECT //Code not protected from reading
#FUSES NOLPT1OSC //Timer1 configured for low-power operation
#FUSES NOMCLR //Master Clear pin disabled

and I also connected the mcrl pin of the CPU to Vcc by using 4K7.

and I do this test.
using a metalik object only touching the mclr pin or route. the CPU resets.
this question is why the CPU resets?, it is supposed that by the fuse configuration that Master clear pin is disabled

seems that here the FUSE configuration has no effect
any suggestions ?

Cheers
_________________
Dr Suleyman CANAN
R&D Electronic Engineer
https://suleymancanan.wordpress.com

Do whatever you do with amateur spirit -
But always feel professional.
ezflyr



Joined: 25 Oct 2010
Posts: 1019
Location: Tewksbury, MA

View user's profile Send private message

PostPosted: Thu Oct 02, 2014 7:21 am     Reply with quote

Hi,

According to the datasheet for the 18f6310: "the MCLR input can be disabled with the MCLRE Configuration bit. When MCLR is disabled, the pin becomes a digital input."

So, the first thing I would do is to make sure that MCLR is *really* being disabled. To do that, I would look at how the configuration bits are actually being set by the compiler. You can do that by looking at the bottom of the .lst file. If the correct configuration is being set, then you can assume that the MCLR pin is just a digital input. At that point, I would see if any other pins show the same behavior. The problem might just be spurious noise pickup on *any* pin?

And, as a friendly suggestion, your signature line would sure be a lot more impressive if you hadn't misspelled the word 'professional'. I know you are not a native English speaker, so that is why I'm mentioning it!

John
scanan



Joined: 13 Aug 2004
Posts: 58
Location: Turkey

View user's profile Send private message Visit poster's website

PostPosted: Thu Oct 02, 2014 7:42 am     Reply with quote

ezflyr wrote:
Hi,

According to the datasheet for the 18f6310: "the MCLR input can be disabled with the MCLRE Configuration bit. When MCLR is disabled, the pin becomes a digital input."

So, the first thing I would do is to make sure that MCLR is *really* being disabled. To do that, I would look at how the configuration bits are actually being set by the compiler. You can do that by looking at the bottom of the .lst file. If the correct configuration is being set, then you can assume that the MCLR pin is just a digital input. At that point, I would see if any other pins show the same behavior. The problem might just be spurious noise pickup on *any* pin?

And, as a friendly suggestion, your signature line would sure be a lot more impressive if you hadn't misspelled the word 'professional'. I know you are not a native English speaker, so that is why I'm mentioning it!

John


The fuse configuration in the LST file is as follows:

Configuration Fuses:
Word 1: 0800 INTRC_IO NOFCMEN NOIESO
Word 2: 0D18 PUT NOBROWNOUT BORV20 WDT WDT64
Word 3: 01C3 CCP2C1 NOLPT1OSC NOMCLR
Word 4: 0080 NOSTVREN NOXINST NODEBUG
Word 5: 0000 PROTECT
Word 6: 0000
Word 7: 0001
the test was to see if the pin really turn into input or not. in this case no.

and thanks for your professional suggestions.
_________________
Dr Suleyman CANAN
R&D Electronic Engineer
https://suleymancanan.wordpress.com

Do whatever you do with amateur spirit -
But always feel professional.
Ttelmah



Joined: 11 Mar 2010
Posts: 19381

View user's profile Send private message

PostPosted: Thu Oct 02, 2014 8:22 am     Reply with quote

You have to be very careful with the MCLR pin....

Unlike other pins, it is also the Vpp pin. As such it does not have any protection diodes built in, and will reset the chip even if disabled, if it goes above the Vdd voltage. If you want to use it as an input pin, I suggest adding your own protection diode to Vdd, when using it.

This has been recorded here in past threads on other chips.

It only functions as a normal I/O pin, if it is 'inside' the normal supply range. So touching it can almost certainly trigger a reset.

Basically it has three circuits present. The 'normal' operation circuit. The MCLR circuit, and the Vpp circuit. If it goes outside the normal supply range, internal leakage can cause the MCLR circuit to operate even if disabled. Go high enough, and the Vpp circuit will start to operate...

I use it on a couple of chips, and for reliable operation as I/O, always have a jumper to connect a protection diode, when not programming.

It is fine, if connected to circuitry that ensures it is inside the supply range.
stinky



Joined: 05 Mar 2012
Posts: 99
Location: Central Illinois

View user's profile Send private message

PostPosted: Thu Oct 02, 2014 10:20 am     Reply with quote

Ttelmah, is your comment about the MCLR pin not having diode protection specific to the OP's device?
Ttelmah



Joined: 11 Mar 2010
Posts: 19381

View user's profile Send private message

PostPosted: Thu Oct 02, 2014 10:54 am     Reply with quote

No. Applies to all where it is also the Vpp pin.
Think about it Vpp has to go up to typically something like 12v....
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