|
|
#include "90s8535.h"
interrupt [EXT_INT0] void ext_int0_isr(void)
{
PORTA=PORTA ^0x1; //toggle the LSB of port A
}
void main(void)
{
DDRA=0x01; //port A LSB set for output
GIMSK=0x40; //set the INT0 bit to enable external interrupt 0
MCUCR=0x02; //set the ISC01 to activate on a falling edge
#asm("sei") //enable the global interrupt enable bit
while(1)
; //do nothing - the interrupt does it all
}
/* This programm toggles the LED attached to Port A, bit 0, each
* time the pushbutton attached to the INT0 pin is pressed.
*/
E-mail: info@telesys.ru