Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 1

#pragma origin 4

#include "int16CXX.h"
int x;
interrupt myint (void)
{
INTCON.7=0;
int_save_registers
if(INTCON.2){
PORTA.0=!PORTA.0;
TMR0=x;
INTCON.2=0;
}
else if(INTCON.1==1)
{
x=10;
INTCON.1=0;
}
INTCON.7=1;
int_restore_registers
}
void main(void)
{
OPTION_REG=0b11010011;
INTCON.6=1;
INTCON.4=1;
INTCON.7=1;
TRISA.0=0;
TRISB.0=1;
x=50;
while(1){}
}

You might also like