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

MCLR doesn�t restart the code (include schematics) Why?
Goto page 1, 2, 3, 4  Next
 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Helyos



Joined: 22 Oct 2003
Posts: 22

View user's profile Send private message

MCLR doesn�t restart the code (include schematics) Why?
PostPosted: Thu May 13, 2004 11:42 pm     Reply with quote

Hi, that is the problem.
I am using 16f876 and a res of 10K conected from 5v. to MCLR (pull-up).
When I disconect the power suply adn connect it, the chip start correctly.
But if I active MCLR line (low active, I connect 1-2 secconds to ground) the chip doesn�t start the code, why?
Thanks


Last edited by Helyos on Fri May 14, 2004 5:42 pm; edited 1 time in total
Ttelmah
Guest







Re: MCLR doesn�t restart the code, why?
PostPosted: Fri May 14, 2004 5:02 am     Reply with quote

Helyos wrote:
Hi, that is the problem.
I am using 16f876 and a res of 10K conected from 5v. to MCLR (pull-up).
When I disconect the power suply adn connect it, the chip start correctly.
But if I active MCLR line (low active, I connect 1-2 secconds to ground) the chip doesn�t start the code, why?
Thanks

Are you sure?.
Basically, if the signal is being pulled low, the chip will restart. However remember that register values will not be cleared to their 'power-on' state. Also remember that the restart will be quick. On a normal power cycle, a lot of the delay from hitting the switch, is for first the power supply rail to rise, then the oscillator to start, then possibly 'soft' delays (if the fuse is enabled to delay after power is applied before starting). A reset, can be _fast_...
You need to check that the pin is dropping (if it is not, you have found the problem!), and if it is, look carefully at how the code will behave.

Best Wishes
Helyos



Joined: 22 Oct 2003
Posts: 22

View user's profile Send private message

I try that, too
PostPosted: Fri May 14, 2004 2:21 pm     Reply with quote

Hi, first, thanks for your answer.
I tested all posibilities, I will put here the schematics of my circuit.
I know that has to be an electronic problem, because when I connect the power supply it starts correctly, and when I do a software reset (reset_cpu();) it resets and start again correctly, but if I press the reset button (connect the MCLR line with Ground -with or without a resistance-) it seems that reset (clean the display) but it doesn�t start again the program.
I hope that your opinions can help me. Thanks a lot.


Last edited by Helyos on Sun May 23, 2004 5:35 pm; edited 4 times in total
Hans Wedemeyer



Joined: 15 Sep 2003
Posts: 226

View user's profile Send private message

Just a question!
PostPosted: Fri May 14, 2004 11:11 pm     Reply with quote

This may not be on topic, and don't take offence.

I've seen this style of schematic drawing, it sometimes pops up in application note, and I often wonder who is teaching this style .... ?

OK if that's what you have been taught it's all you know but it sure looks like a mess.

Needles to say I don't like the style.

It does not allow a quick overview of the " function blocks". If you add european logic symbols it would be even worse...

For example:
If you draw a Colpits oscillator this way it can't be possible to identify it at a glance.
A simple tuned circuit would have the coil and capacitor separate and every connection would have to be studied before it became obvious it�s a tuned circuit.

If possible please explain what are the benefits, perhaps the original teacher made some claims about it. I'm seriously interested.
frankb



Joined: 08 Sep 2003
Posts: 7

View user's profile Send private message

PostPosted: Fri May 14, 2004 11:48 pm     Reply with quote

One thing jumps out. Q1 and Q2 are pinned out wrong AND are connected wrong as drawn. These aren't related to the reset problem but without a thorough H/W design check how many other things might be hooked up wrong? Re-drawing the circuit in a more traditional logical way might shake out a few bugs. The signals have no "flow" the way its presently drawn. Just my 2 cents.
Helyos



Joined: 22 Oct 2003
Posts: 22

View user's profile Send private message

Sorry and thanks
PostPosted: Sat May 15, 2004 12:21 am     Reply with quote

Excuse me, I didn�t know that a scheme could bother so much.
This fellow of schemata I seem to good because at a glance I can see an entire, necessary- and- exact- manner circuit, without need of symbols, but it is my opinion.
Thank you very much for your help with the problem with MCLR.
Greetings
frankb



Joined: 08 Sep 2003
Posts: 7

View user's profile Send private message

Didn't mean to offend you
PostPosted: Sat May 15, 2004 7:14 am     Reply with quote

Sorry Helyos Embarassed . I was just pointing out some errors that could be causing you problems. If you're comfortable with the way you draw schematics then you are welcome to keep doing it that way.
To trouble shoot your reset problem I would recommend doing the following:
1) Remove Q1 and Q2 from the circuit
2) Replace the PIC. It may be damaged depending on how Q1 and Q2 are really hooked up to it.
3) Disconnect everything else connected to the board connectors. (except power)
4) Verify with a scope or meter that the correct pin of the PIC is being pulled low by your reset signal and that the 5 volt power to it remains stable.
5) If this all looks OK and you still can't reset, measure the current being drawn by the circuit. From what I remember seeing on your schematic your current shouldn't be more than about 20 - 30 mA (without LCD connected). If it's more than that something may still be connected wrong.

I hope some of this helps you find the problem. Good luck and I sincerely appologize if I came on too strong Laughing
Helyos



Joined: 22 Oct 2003
Posts: 22

View user's profile Send private message

Thank you
PostPosted: Sat May 15, 2004 4:55 pm     Reply with quote

Thank you very much for your time. I answer your questions:
1) I haven�t the transistors conected. In the schematics they seem are wrong (colector, base emisor) but they are well, I put that order for pins reasons (for the layout)
2) I tested the circuit with 3 micros, the same results in three.
3) If I disconnect all I can�t verify that the circuit resets. I tried disconnect the eeprom, the serial/parallel converter, and the same results.
4) I verify with the multimeter and with an osciloscope the signal, and the signal seems correct, from 4,9 v to 0,1 and then became high again.
5) The circuit (with all connected except LCD) current working well is 8,3 mA (with peaks of 14 mA when the buzzer sounds). If I press reset (MCLR to ground) it became 7,1 mA continously and it doesn�t work. :(
What�s wrong??? I�m desperate...
ajt



Joined: 07 Sep 2003
Posts: 110

View user's profile Send private message

Remove the 2uF capacitor
PostPosted: Sat May 15, 2004 7:33 pm     Reply with quote

You might try removing the capacitor on the MCLR line. The PIC has a noise filter on the MCLR line so the cap is unecessary. Possibly the slow rise of the signal is problematic
_________________
Al Testani
Guest








R4
PostPosted: Sat May 15, 2004 10:04 pm     Reply with quote

What is R4 doing ?
One side is connected to MCLR and the other side is BMCLR what does BMCLR do ?????

If you are pulling MCLR low by grounding BMCLR of R4 then it will not reset the uP.

The Cap on MCLR is not needed.

If you just cleaned up your schematci and draw it in a conventional mannor, to boot, read the data sheet and perhaps you can get this thing working.
ajt



Joined: 07 Sep 2003
Posts: 110

View user's profile Send private message

R4 and C2
PostPosted: Sun May 16, 2004 8:26 am     Reply with quote

Actually R4 alone would not keep the chip from resetting. The data sheet says max low input on MCLR is 0.2Vdd. With C2, however, strange things could happen. R4 and C2 should be eliminated in any case.
_________________
Al Testani
Helyos



Joined: 22 Oct 2003
Posts: 22

View user's profile Send private message

Disconnected
PostPosted: Sun May 16, 2004 12:06 pm     Reply with quote

The R4 is disconnected and the capacitor is disconnected too. The same results. What�s wrong???
Guest








Re: R4 and C2
PostPosted: Sun May 16, 2004 3:01 pm     Reply with quote

ajt wrote:
Actually R4 alone would not keep the chip from resetting. The data sheet says max low input on MCLR is 0.2Vdd. With C2, however, strange things could happen. R4 and C2 should be eliminated in any case.


If R4 is pulled low with a PIC output then it would be a potential divider.
Voltage at MCLR could be (using data sheet values)
10K + 1K across 5Volts puts MCLR at 0.45V only if Vol is 0V, and many PIC's are close to that.
However Vol for a PIC pin can be as high as 0.6 V so, if this were a worst case situation MCLR could be at 1.05V ! Which is not ideal is you want to guarantee a reset. It's still OK but not the best...

I think the guy has wired something wrong and can't see the forest for the trees. With that horrible schematic to boot what else can go wrong.

It time ti draw conventional schematics and get a clear overview of what is connected to where... !
Guest








Re: Disconnected
PostPosted: Sun May 16, 2004 3:21 pm     Reply with quote

Helyos wrote:
The R4 is disconnected and the capacitor is disconnected too. The same results. What�s wrong???


I think you wired something wrong. Hey! even the best of use do that from time to time....

Get this clear, there is no magic about pulling MCLR low. The world has not decided to make pulling MCLR low a major issue....
Assume you have made a mistake and look at it with fresh eyes.

BTW you would be well served if you moved towards drawing somewhat more conventional schematics, after all it's been done for the past 65-75 years (of I've been doing it for 45) and there has to be a reason for it..... it works.

One nice thing about the "normal" schematic is it gives the reader a clear view of the functions available. You may be gifted with being able to keep every connection and it's meaning in your head, but for mere mortals (of which i'm one) need to see the overal view.

Your schematic style is not special to you, I've seen it before. I think it's being taught by some radical school somewhwere and I sure would like to know if they claim any adavantage, becasue there is none.

Example: if you draw 2 transistors and four resistors and 2 power symbols one a page, the way you do, and if you simply lable them the way you do, with a quick glance they would mean NOTHING.
However if drawn in the classic style it would look like a Schmidt trigger or flipflop and it's electrical function/meaning is instantly known. More time does not need to be spent on figuring out and reading all the connection lables of the individual components, as is the case using your style.

OK I'll get off of the soap box now....
Long live classic schematic drawing...
ajt



Joined: 07 Sep 2003
Posts: 110

View user's profile Send private message

rewire
PostPosted: Sun May 16, 2004 7:54 pm     Reply with quote

I agree.... I think that isolating MCLR totally, connecting a 51K resistor to Vcc (with no cap) and grounding the MCLR end of the resistor will surely reset the processor. Resetting a PIC is not rocket science.
_________________
Al Testani
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Goto page 1, 2, 3, 4  Next
Page 1 of 4

 
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