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.

pic circuit gets reset automatically

Status
Not open for further replies.

engineer khan

Member level 3
Member level 3
Joined
Aug 31, 2012
Messages
66
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,288
Visit site
Activity points
1,833
I have designed a circuit based on pic18f452 my circuit gets reset automatically while I dont wanna reset, its great problem please provide me the solution, I have used 6 analog inputs and the ground is common if i dont make the ground common then it give garbage values and not work as needed , with common ground it works right but reseting again and again.......thanks in advance please I am too confuse help
 

Have you accidentally enabled an internal reset? Watchdog? Brownout? Is it REALLY 'resetting' or is there a bug in your code?

Do you have a noisy power supply/ground?
 

Once your code reached the last main() line and there's not any funcion or loop back, the MCU won't do anything since there is not any instruction.

Could it be the supply? Are you driving high currents from the same MCU supply? Current peaks may lower its voltage for a while and can turn off the MCU reseting it or making it to stop working till the next reset. Use fast response capacitors as ceramic near the MCU (in the PCB) of aproximately 100nF. That will help to keep the MCU turned on for that while when the current consumption is high.

That's all I can think of.
 

power supply is not noisy,and watchdogtimer is also disable still the problem remains

- - - Updated - - -

yes it comes to the end
 

yes it comes to the end
if you come to the end of main() in a 'normal' program (and execute the return statement) on a PC the program stops and control returns to the operating system
in the case of an embedded system the result is unpredictable but often it will reset
put a while() loop before the end statement, e.g.
Code:
 int main(void)
   ....
   while(1);     // endless loop
   end
which effectivly stops the program
 

Yes, mostly you will never want programs with an end; you can idle your MCU for power saving but the program should be able to start and restart again.

Use a while(1), do ... while(1); , for(;;);, etc to get a always true condition and a endless loop. That will allow your MCU to do its work all the time.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top