leorickings
Junior Member level 1
- Joined
- Oct 18, 2013
- Messages
- 17
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1
- Activity points
- 197
1. Introduce emi filter (Differential mode pi filter) in between voltage regulator (24V to5V) and line transformer (230V to 24V). Use 1uH inductor series with two 1uF capacitor parallel( both sides of the inductor)
2. Check the output filter capacitor of voltage regulator is enough, Put a 0.1 uF capacitor parallel to the electrolytic capacitor.
3. Introduce 0.1 uF capacitor very close to microcontroller vcc pin
Hi,
In an office enviroment Fluorescent lights are a well known cause of problems like that.
However as said its more likely to be weak design on your board in terms of shielding of the whole board or any inputs , used or unused.
Ideally set all unused pins to outputs, used shielded cable on any input lines, how close to the pic is the crystal, have you followed the datasheets pcb example for it.
If you have done all the points mentioned in the previous replies but are still getting problems, then post your full circuit with a pictures of both sides of your board and associate wiring.
The crystal and its associated 33pf capacitors must be as close as possible to the micro. All put 0.1uF ceramic between the power pins of the micro again as close as possible. 20 MHz on breadboard gives problem. Use 4 MHz for testing. Maybe the transformer (step down) you are using for power supply is not of good quality.
Hi,
Think you highlighted the cause of the problem, the Breadboard and the wires / component spacing - they will be acting as antenna , picking up every bit of electrical noise.
Using crystals and their caps on a breadboard also can cause problems due to poor contact with their fine leads - better to solder the three parts together and fit some short thicker leads to plug into the breadboard.
No mention of what Inputs to the pic you are using and how long their leads are.
You really need a pcb, with input leads shielded/filtered as needed.
Again without any more specific details hard to advise.
Is it possible to test all I/O on Scope/CRO during switching condition which gives u all answer. If no Scope then just try simple LED blinking code & test it, then start for ur code in which adding one by one routine.This exercise give u condition where problem occur
Hi,
Thanks for pointing the antenna issue, I never knew that...
So if making them on PCB solves the problem, will the same case occur again?
What does it mean to have poor contact for the crystal? I checked their connections and they are fine connected.
By 'lead', do you mean their "legs"? The components are all just plugged onto the breadboard as is, I never trim their "legs", at most I bent the "legs" to fit across the slots on the breadboard. Does that contribute to the problem?
I have 5 inputs, 3 from push buttons, normally open, one side connected to the +5Vcc of the PIC, another side connected to the ports and parallel to a resistor to ground.
Many other advanced ways avaliable -
https://www.digikey.com/us/en/techzone/microcontroller/resources/articles/protecting-inputs-in-digital-electronics.html
one input from a common ground 24Vdc signal, which I conditioned the signal with voltage divider with a capacitor across the portion I take input (the voltage divider 5V part).
one last input from a 230Vac signal, which I conditioned using transformerless power supply method, then optocoupled. So no common ground.
I had tried removing the 24Vdc input and 230Vac circuits from the system but the problem persists.
Sometimes when I turn on the system, thePIC initializes. The LEDs for the initialization code lights up like normal, but nothing works after that. No input triggers anything, it looks just frozen. I push the reset button, everything from the PIC goes off, when I release it, it initializes, and freezes again.
What is input leads shielded? Do I apply materials to the "legs"?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?