nis2311
Member level 2
I want to store the data when POWER loss or Down.
So I connected to the interrupt Pin with help of diode
I used 1000uf/25V capacitor to store the power to write EEPROM DATA.
But interrupt working only when Gnd to VCC trigger but in my case trigger will be VCC to GNd.
I attached My circuit and code also.Please Find it,
Example Code:
So I connected to the interrupt Pin with help of diode
I used 1000uf/25V capacitor to store the power to write EEPROM DATA.
But interrupt working only when Gnd to VCC trigger but in my case trigger will be VCC to GNd.
I attached My circuit and code also.Please Find it,
Example Code:
Code:
void interrupt zero()
{
if(INT0IE && INT0IF)
{
eeprom_write(5,s);
}
}
void main()
{
ADCON0=0x00;
ADCON1=0x0F;
PORTB=0X00;
PORTA=0X00;
TRISC=0X00;
TRISA=0X00;
TRISB=0X03;
INT0IE=1;
PEIE=1; //Enable Peripheral Interrupt
GIE=1; //Enable INTs globally
INTEDG0=0;
while(1)
{
address(0x80);
dispstr("____ME___________");
s++;
_delay_ms(100);_delay_ms(100);_delay_ms(100);_delay_ms(100);_delay_ms(100);_delay_ms(100);_delay_ms(100);_delay_ms(100);_delay_ms(100);
}
}