[SOLVED] trouble with pic12f675, sleeping after a while

Status
Not open for further replies.

zsolt1

Full Member level 6
Joined
Aug 11, 2012
Messages
367
Helped
50
Reputation
100
Reaction score
49
Trophy points
1,308
Location
Cluj-Napoca, Romania
Activity points
3,880
hi,
i use pic12f675 to measure a voltage on AN0 and control a rellay on GP5 in a while(1) loop. At the beginning the loop is executed . After a time not , seems like the execution is pending somewhere else. If i toggle power , the loop is executed correctly again . I disabled interrupts , watchdog and everything i don't need .
Is the cip faulty ?
 

It is possible to have a faulty PIC but they are usually very reliable.
Most likely the reason is noise from the relay operating is conducting back into the PIC and crashing the program. Please post your schematic so we can see how you have it wired.

Brian.
 

Hi,

... and post your code

Btw: Our answers can only be as good as your informations.

Klaus
 

rellay is on 12 V , has diode to cut autoinduction ...
code as usual: Config, Setup periferics .. while(1){get voltage, operate rellay } ...
PS MCLR is used
 

Hi,

again: About useless information. --> Show the true circuit (best: the PCB layout, too) and the complete code.

Klaus
 

don't know how to add code here , if i simply copy>paste here i get worning
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…