#include
#include
#pragma LINK_INFO DERIVATIVE ""
unsigned char RTIs1_Cnt = 0;
void MCU_init(void)
{
PORTB = 0xFF;
DDRB = 0x03;
CRGINT &= ~18;
RDRIV &= ~147;
INTCR &= ~64;
RTICTL = 127;
RTIs1_Cnt = 0;
CRGFLG = 128;
CRGINT = 128;
}
void main(void) {
/* put your own code here */
MCU_init();
EnableInterrupts;
for(;;) {} /* wait forever */
/* please make sure that you never leave this function */
}
#pragma CODE_SEG __NEAR_SEG NON_BANKED
void interrupt 7 RTIs1_Interrupt(void)
{
PORTB_BIT0 ^= 1;
RTIs1_Cnt++; /* Increment SW counter CntVar */
if(RTIs1_Cnt == 160)
{ /* Is it now the period time? */
RTIs1_Cnt = 0; /* Reset SW counter Cnt */
PORTB_BIT1 ^= 1;
/* Warning: This bean is not used by any other bean! */
}
CRGFLG = 128; /* Reset interrupt request flag */
}
|