garg29
Advanced Member level 1
Hi all
m designing a project using pic16f877 (4Mhz)and ds1302.the controller unit drives the relay which furthur drives a star delta strater of three phase motor.
i have to save the runtime of the motor on power failure.so as soon as the power fails my system generates an interrupt and the runtime of motor is saved.
now the problem is as soon as my pic gives start command to relay and relay to starter due to back emf of starter my microcontroller section hangs up ...i have tried following hardware solutions:
1 . adding decoupling capacitors
2. flywheel diode on the relay
3. better ground lines
if i remove the interrupt from the code my controller section works fine..what might me the problem? m sending the part of code for interrupt
.
.
.
.
.
.
void interrupt isr ()
{
if(INTF)
{
INTF=0;
WriteByteToEE(TotalRunTime,0x0B);
}
}
.
.
.
.
.
.
.
void main(void){
.
.
.
.
PEIE=1;
T1CON=0X30;
INTE=1;
GIE=1;
.
.
.
.
.
.
.
}
waiting for reply
m designing a project using pic16f877 (4Mhz)and ds1302.the controller unit drives the relay which furthur drives a star delta strater of three phase motor.
i have to save the runtime of the motor on power failure.so as soon as the power fails my system generates an interrupt and the runtime of motor is saved.
now the problem is as soon as my pic gives start command to relay and relay to starter due to back emf of starter my microcontroller section hangs up ...i have tried following hardware solutions:
1 . adding decoupling capacitors
2. flywheel diode on the relay
3. better ground lines
if i remove the interrupt from the code my controller section works fine..what might me the problem? m sending the part of code for interrupt
.
.
.
.
.
.
void interrupt isr ()
{
if(INTF)
{
INTF=0;
WriteByteToEE(TotalRunTime,0x0B);
}
}
.
.
.
.
.
.
.
void main(void){
.
.
.
.
PEIE=1;
T1CON=0X30;
INTE=1;
GIE=1;
.
.
.
.
.
.
.
}
waiting for reply