Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Electromagnetic interference on PIC16F877A?

Status
Not open for further replies.


Added after 5 hours 46 minutes:

I show you that it has now become IMPOSSIBLE for me to work on it.I can't touch my desk or the consequence will be worst.The MCU will be restarted. Actually I have taken a project to design a computer based ECG machine.I haven't start working on this yet. I will get electrodes and other necessary ICs on tommorow, tonight I was testing this circuit, so that I could write routines and set this device working fast for this project and I have to hurry up, because I have just a week to complete the whole projet. I had written different test program in the past, like serial test, timer test, LED test,etc. The program you see running in the hyperterminal is my serial test program.
In 1:40, I picked up an instrument that measures the electric energy presence.This doesn't use any cell or anything else. It contains an LCD, this device LCD is operated by the electromagnetic energy coming from the source. Maybe this device will be helpful in the future for solving this problem. As you can see in the video, I can't even touch my desk, accessing the keyboard and typing words on it seems like a DREAM COME true to me.Last time, when I had this same problem almost a year ago, it wasn't that severe.When I touched the MCU, then I see such symptoms. All my work is now stuck up.I choose this MCU, because I had used this one before and also it had a ADC for which I was in need of.
After 2:07, I show you the room, so you can see there is no inductive source or anything present in my room, that is causing this thing.Why is this circuit so sensitive that even I can't touch the desk far away from the circuit with my finger! I don't know what kind of a electromagnetic RESET switch that actually is. I have put bypass capacitor on every location necessary, but this is too much, way too much! even if I don't putt bypass capacitor, this symptoms can't be of that. There must be something else.

 

The Baud u have set in your programme posted in the first page shows a 20Mhz crystal. And your posted circuit shows a 3.6Mhz crystal. use 11.0592Mhz crystal + change it in your programme as well + use stablizing caps (22pF) with crystal as well.
 

It's so, because it's a new circuit and a new program. It really doesn't matter to put stablizing caps with crystal or not. I usually never use these in any of my design. I had made several Microcontroller circuit, that doesn't use stablizing caps and they work great.Capacitors are used here to actually FINE TUNE the frequency, if you see you never get 11.0592Mhz exactly, put capacitors on it, then you'll see crystal frequency gets very much close to that figure.

Code:
#include<16f877A.h>
//#use delay (clock=20000000)
#use delay (clock=03579545)
#fuses NODEBUG,HS,NOWDT,PUT,NOPROTECT

#use rs232(baud=2400,xmit=PIN_C6,rcv=PIN_C7)
main()
{
   int i;

   set_tris_a(0x00); //se
   set_tris_b(0x00); //se

   set_tris_d(0x00); //se
   set_tris_e(0x00); //se




   while(1) {
            i=65;
            do
               {
               putc(i);
               delay_ms(1000);
               i++;
               }
             while(i<=122);
            }
}
 

May be you are right to some extent. But whenever i dint use the cap my MCU would not work. So i adviced you.
 

It had never happened to me, they are just to fine tune the frequency and that's it.Any advice as what should I do?

Added after 4 minutes:

I have left this controller and I'm designing my project with another one. Will any body at EDABoard wants to see this circuit and check it up, if he/she might be interested to solve this.I'll send this to you and will pay for all the charges. If you will charge for this, then Private Mail me about your fees. I really want to know the reason.
 

Hai umery2k75
Just atempt a last thing. Put a copper tape on the top surface of the PIC, connect it to the ground of the circuit. Just power it then. I want you to try this because i had simillar problem and it is solved after this remedy. Its 90% static playing on the PIC. Good luck.
 

I've see similar behaviour on my old design for a custom PLC able to work on a 10 CV compressor system, PIC was used to drive a power relay, by using a TRIAC interface, for compressor engine and to switch on and off power fans, when the main compressor relay take to switch on the PIC reset itself. Solved by using a 10 nF capacitor from MCLR/VPP pin and ground, see the figure.

Hope it help

Bye
Powermos
 

Your pic can be a "fake" chip.
 

@pranam77
I have not checked that yet, because I'm over occupied in these days.I'll do that after a few days.I don't have a copper foil, I will do an alternative.

@TekUT
Nice post, I'll check that up soon.

@coshkun
I don't think it would be a fake chip. Chips are not that easy to be made fake.
 

PIC16xx is more tolerance to EMI then many other MCU's. I newer have any problems with this MCU's (possible because of asm programming... :) ) Caps near xtall MUST BE. Some examples of MCU can start without it, but it will not be good work. About serial resistor with MCLR pin: without this resistor your device mau be broken at reset time, because of triac effect. Read Microchip manuals. And what about fuse bits? (BOREN & WDT)
 

hi all room. i'm making a topic using pic 16f877a is " measuring speed motor , controller and display on lcd ". but i'm starter learning pic ,idon't know so much.
please help me circut and source code
thank a lot!
 

I am having the same problems with the UART and my body coming close / touching the microprocessor and then the system freeks out.

I am using both the pic16F88 and a Pic18F and they are both having this issue.

When / if I solve this problem I will let you know what solved it for me.
 

b4bb4ge said:
I am having the same problems with the UART and my body coming close / touching the microprocessor and then the system freeks out.

I am using both the pic16F88 and a Pic18F and they are both having this issue.

When / if I solve this problem I will let you know what solved it for me.

Mainly check the 0V connection, MCLR and Vcc quality.

Bye
Pow
 

    umery2k75

    Points: 2
    Helpful Answer Positive Rating
Hi,
First off all excuse me for mi english because i'm Dutch.
Second I have great respect for you for having so much patient with your problem.
Now i will try to soulve your problem (I hope so).
I will come directly to the point your PIC's mclr input is broken .
Why? look at the image I send with my post.
56_1223498265.jpg

This is what Microchip reccomends as circuit for MCLR. In the datasheet from the PIC16F877A you can read that the mclr-input schould at least be pulled to ground with a 100 Ohms resistor, and not directly via a pushbutton to Vss. I will give you the solution for your problem if you want to try this test first.
Shut down your powersuply and thoutch the GND from your suply with one hand.
Put on your suply while holding the gnd and try to touch your pic or mclr input with your other hand......
problem is gone IS IT?????

No, see YES

YES : ok first change the mclr circuit as in datasheet
( i sujest R1 10k; R2 1k5; C 470nF).
Since your pic has broken mclr input you can do two things:
first by a new one sorry(money)
second are you intersted????it worked for me.........
 

    umery2k75

    Points: 2
    Helpful Answer Positive Rating
Try this one.... Add a 22pF cap on each leg ( both sides ) of the Xtal then to ground.... also try configuring all unused analog ports to DIGITAL....
 

Yeah I know the last post stated to use the caps, but, for some reason the original poster refuses to use the caps because he thinks they are for no reason.... I strongly recomend to use the 22pF caps! you are dealing with data communications that require some what accurate timing... If you have a pic running an Xtal with no caps, the timing would be all over the place...... If original poster cant figure it out, I will take a look and make the circuit myself and see what I can find.... So, if you want, send me CURRENT schematic and SOFTWARE for everything....
 

@jerelectric
Thanks for this, I'll try them up soon.
@TekUT
Thanks for your valuable advise.

Added after 43 seconds:

I always used to use the capacitors on the xtal in past, I think they don't work as an compensator on a range of temperature or for slight deviation of voltage.They are to self tune, because one day I was using the 20Mhz crystal on PIC and measured the frequency on running circuit by digital oscillscope without capacitor, it showed some deviated frequency(didn't remember), suppose it came out to be as 20.05Mhz. But when your are about to compile your program, you might have written a C line in your program, if your are using a compiler like PIC-C
Code:
#use delay (clock=20000000)
.This is the reason of problem. You are telling your compiler wrong frequency, whereas it's running on slightly different frequency.If you then add capacitor on crystal, the error will reduce more less, oscilloscope might show then 20.00003Mhz. Now you might now have errors in your running program.With that experiment, I think capacitors helps the crystal for tunning it to represent the frequency for what they are made to represent.Now you have less chances of getting error in your program as without using capacitor. But if you don't add capacitors and change your code line to
Code:
#use delay (clock=20050000)
. Then all is good.It will have the same meaning.I think. But still I will add 22pF on xtal and see it,if it don't bother me again.
 

I've built hundreds of PIC kits and programmers etc, they ALL have 18pf thru 22pf caps on the 20MHz crystals. You're having problems, I'm not. So it really doesn't matter why you think they're used, if the datasheet says use em, use em.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top