Touchy MCLR reset as Input pin - Page 1
Forum section: electronics / general

author: CorbPeters
author_rank: Newbie
timestamp: July 03, 2012, 07:16:11 am
content: Hello,As the title suggests I am having problems with my MCLR pin on a PIC18f4620. I have the MCLR configured as an input pin and have a 10k resistor through a diode to tie it to 5VDC, the diode for ICSP. The problem arrises when the MCLR pin is touched by metal or me the PIC resets even though MCLR is set to input pin. Brown out reset is disabled and virtually all of the other resets are disabled. When I connect the ground lead of the oscilloscope to the ground of the circuit board the problem goes away and I can touch the MCLR pin without a reset. Same idea happens with my ADC pins. The ADC is jumpy without the o-scope ground attached and fine with it. When I power the board from my usb port, no problems, when powered from other 5VDC sources with a 2 wire mains (live and neutral no ground) the problem occurs. My idea is that the ground needs to be tied to earth ground and it will work. The question is should I swap the mains connector with a three pin socket and run the mains ground to the DC ground? When the oscilloscope is attached that is essentially what is happening and making it work. The other question is why would this make it work? It is obvious there is a ground issue with my source but why would connecting the DC ground to mains earth ground change it?thanks,

author: amyk
author_rank: Super Contributor
timestamp: July 03, 2012, 07:50:48 am
content: You and large metal bodies will act as an antenna and pick up any EM from the environment. Static electricity also factors into this too.Why would you want to touch the pin anyway? It's ESD-sensitive. You'll probably damage it if you keep on doing that.The short answer: don't touch it.

author: Jon Chandler
author_rank: Frequent Contributor
timestamp: July 03, 2012, 08:11:04 am
content: Do you have 0.1 uF bypass caps on the power pins at the PIC? Strange things like this can occur without them.

author: CorbPeters
author_rank: Newbie
timestamp: July 03, 2012, 05:04:37 pm
content: Well I can avoid touching it, that isn't a big problem but the big problem is the ADC is also super jumpy and the problem goes away when the MCLR problem goes away. The project is a hexapod robot that I have built from the ground up and whenever the circuit is earth grounded it works fine but when it isn't earth grounded the ADC in the controller gets unstable so the robot will start twitching.The circuit does have the filter capacitor right next to the chip VSS VDD. I have tried small values and very large values to see if that would help but it hasn't.I attached the ground DC to the earth ground pin in the power supply and the problem went away. I understand that there can be some possible problems with this but it seems to be working well. I just wish I knew what the actual cause of the problem was.

author: PA0PBZ
author_rank: Super Contributor
timestamp: July 03, 2012, 06:45:36 pm
content: When you say that the ADC is 'jumpy', what are you feeding it with?Some external source that has a ground reference or does it also happen when you use a simple pot on VSS/VDD?

author: MikeK
author_rank: Super Contributor
timestamp: July 03, 2012, 07:23:16 pm
content: Do you absolutely need MCLR as an input? I never use it for anything other than reset.If you set the MCLR pin as reset (MLCRE) and tie it to Vdd via 10k, does your ADC problem go away? Is your diode the right way round? When MCLR is set as input and you're experiencing the problem, does Vdd appear at that pin?

author: Del Tapparo
author_rank: Newbie
timestamp: July 12, 2012, 11:21:25 pm
content: I have come to accept the fact that this is a problem with every PIC (at least the 4 or 5 that I have used). Puttting a 0.1uf cap on the pin solves the problem for me, but I now just make sure the MCLR input pin doesn't go to the outside world.

author: Niklas
author_rank: Frequent Contributor
timestamp: July 20, 2012, 10:50:45 pm
content: What kind of power supply do you have? Is it a switch mode one? If yes, try another power supply or a battery pack and see if the problems disappear. High frequency switch noice can cause a lot of strange problems.

author: David_AVD
author_rank: Super Contributor
timestamp: July 20, 2012, 11:02:53 pm
content: It would seem that there are other things at play here. A photo and/or schematic of the setup may reveal a lot more.

author: SteveyG
author_rank: Unknown
timestamp: July 30, 2012, 07:30:00 am
content: Quote from: David_AVD on July 20, 2012, 11:02:53 pmAgreed. I don't think I've seen any mention of issues with the MCLR pin in any errata for a Microchip part, and I've never had anything but the expected behaviour in any of my systems.

author: CorbPeters
author_rank: Newbie
timestamp: January 10, 2013, 11:59:04 pm
content: I apologize for the late post. For anyone still interested I decided the problem was a bad switching mode power supply. There may have been other issues as well but I made a new board and running off of a battery pack I see no issues. I also ran a wire from the mains ground pin to the negative terminal on the output (a "solution" I was not really comfortable with for several reasons) and that also seemed to fix the problem. I am thinking there was an issue with the ground reference making everything reset randomly. And if anyone is still interested in a picture of the project a video of an older version is on youtube here:Timmy the Hexapod's Controller] [url=https://www.youtube.com/watch?v=IBShMylFKrE#ws]Timmy the Hexapod's Controller. As I said this is a very old video and the project is much cleaner now.This is a more recent video showing the ultrasonic rangefinder interfacing through a PC program I wrote to interpret the data.The quality of the videos is not superb so I apologize for that. Thanks for the help and suggestions.

author: amyk
author_rank: Super Contributor
timestamp: January 11, 2013, 10:43:25 am
content: Not surprising, problem caused by SMPS noise.