Disha Karnataki
Full Member level 5
- Joined
- Jul 20, 2013
- Messages
- 249
- Helped
- 9
- Reputation
- 18
- Reaction score
- 8
- Trophy points
- 18
- Location
- india
- Activity points
- 2,231
i have atmega 8L-8pu & i interfaced ir sensor tsop1738 & using a remote control the sensor is as here:https://www.edaboard.com/threads/131915/
here is the datasheet of the ic: http://www.atmel.com/images/atmel-2486-8-bit-avr-microcontroller-atmega8_l_datasheet.pdf
I connected the tsop1738 o/p to the INT0 PIN(i.e PORT D 2) of the micrcontroller.
Later i dumped the program & then the ISR routine program was executing continuously even without me pressing any key on the remote control. this sensor had to trigger for low level on the INT0 pin.
Later after sometime i figured that the INT0 pin was low irrespective of the any sensor connected to it & hence always interrupt occured.
It is sure that the interrupt pin is damaged.
so i am now left with only one interrupt pin INT1 which is donot want to damage it.
here is the code:
according to me there might be mistake in initializing the port can any one suggest me what is wrong :
here is the datasheet of the ic: http://www.atmel.com/images/atmel-2486-8-bit-avr-microcontroller-atmega8_l_datasheet.pdf
I connected the tsop1738 o/p to the INT0 PIN(i.e PORT D 2) of the micrcontroller.
Later i dumped the program & then the ISR routine program was executing continuously even without me pressing any key on the remote control. this sensor had to trigger for low level on the INT0 pin.
Later after sometime i figured that the INT0 pin was low irrespective of the any sensor connected to it & hence always interrupt occured.
It is sure that the interrupt pin is damaged.
so i am now left with only one interrupt pin INT1 which is donot want to damage it.
here is the code:
according to me there might be mistake in initializing the port can any one suggest me what is wrong :
Code:
#include<avr/io.h>
#include<avr/interrupt.h>
#include<util/delay.h>
//#include"lcd118010.h"
int main(void)
{
DDRD=0X00; //configuring as i/p
PORTD=0X0F; //sensor connected to PD2 PIN //i guess i am wrong somwhere here plz verify it i want to verify & dump the final program.
GIMSK|=1<<INT1; //initializing the interrupt-1
MCUCR=0X00;
sei(); //enabling global interrupts
while(1)
{
//----
}
}
SIGNAL(SIG_INTERRUPT1) //isr for interrupt-1 @ INT1
{
//some work done
}
Last edited: