Author Topic: Touchy MCLR reset as Input pin  (Read 7342 times)

0 Members and 1 Guest are viewing this topic.

Offline CorbPeters

  • Contributor
  • Posts: 5
Touchy MCLR reset as Input pin
« on: July 03, 2012, 07:16:11 am »
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,
 

Offline amyk

  • Super Contributor
  • ***
  • Posts: 6813
Re: Touchy MCLR reset as Input pin
« Reply #1 on: July 03, 2012, 07:50:48 am »
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.
 

Offline Jon Chandler

  • Frequent Contributor
  • **
  • Posts: 545
    • Throw Away PIC
Re: Touchy MCLR reset as Input pin
« Reply #2 on: July 03, 2012, 08:11:04 am »
Do you have 0.1 uF bypass caps on the power pins at the PIC?  Strange things like this can occur without them.
 

Offline CorbPeters

  • Contributor
  • Posts: 5
Re: Touchy MCLR reset as Input pin
« Reply #3 on: July 03, 2012, 05:04:37 pm »
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.
 

Online PA0PBZ

  • Super Contributor
  • ***
  • Posts: 4342
  • Country: nl
Re: Touchy MCLR reset as Input pin
« Reply #4 on: July 03, 2012, 06:45:36 pm »
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?
Keyboard error: Press F1 to continue.
 

Offline MikeK

  • Frequent Contributor
  • **
  • Posts: 577
  • Country: us
Re: Touchy MCLR reset as Input pin
« Reply #5 on: July 03, 2012, 07:23:16 pm »
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?
 

Offline Del Tapparo

  • Contributor
  • Posts: 9
Re: Touchy MCLR reset as Input pin
« Reply #6 on: July 12, 2012, 11:21:25 pm »
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.
 

Offline Niklas

  • Frequent Contributor
  • **
  • Posts: 344
  • Country: se
Re: Touchy MCLR reset as Input pin
« Reply #7 on: July 20, 2012, 10:50:45 pm »
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.
 

Offline David_AVD

  • Super Contributor
  • ***
  • Posts: 2607
  • Country: au
Re: Touchy MCLR reset as Input pin
« Reply #8 on: July 20, 2012, 11:02:53 pm »
It would seem that there are other things at play here.  A photo and/or schematic of the setup may reveal a lot more.
 

Offline SteveyG

  • Supporter
  • ****
  • Posts: 740
  • Country: gb
Re: Touchy MCLR reset as Input pin
« Reply #9 on: July 30, 2012, 07:30:00 am »
It would seem that there are other things at play here.  A photo and/or schematic of the setup may reveal a lot more.

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

Offline CorbPeters

  • Contributor
  • Posts: 5
Re: Touchy MCLR reset as Input pin
« Reply #10 on: January 10, 2013, 11:59:04 pm »
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[/url]. 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.
 

Offline amyk

  • Super Contributor
  • ***
  • Posts: 6813
Re: Touchy MCLR reset as Input pin
« Reply #11 on: January 11, 2013, 10:43:25 am »
Not surprising, problem caused by SMPS noise.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf