bhyatyab
Joined: 26 Jan 2005 Posts: 13
|
Interrupt |
Posted: Fri Feb 18, 2005 3:26 am |
|
|
Hi
I need some help with interrupts. I want a delay. I want to use an interrupt on pin change to break this delay - RB0.
Please can any one help me as i don't know how to use it. Thanks
#include <18F452.h>
#device ICD=TRUE
#device adc=8
#use delay(clock=4000000)
#fuses NOWDT, WDT128, HS, NOPROTECT, NOOSCSEN, BROWNOUT, BORV20, PUT, STVREN, DEBUG, LVP, NOWRT, NOWRTD, NOWRTB, NOWRTC, NOCPD, NOCPB, NOEBTR, NOEBTRB
#use rs232(baud=9600,parity=N,xmit=PIN_C6,rcv=PIN_C7,bits=9)
#include <STDLIB.H>
void main(){
/* **************************************************************/
/* INITIALISATION SECTION
/*
/* Part of Bootup Sequence. All peripherals
/* are configured and activated.
/*
/* ************************************************************* */
enable_interrupts(GLOBAL);
delay_ms(10000); //always do this
enable_interrupts(GLOBAL);
{
while(input(PIN_B0));
while(!input(PIN_B0));
while(TRUE)
{
output_high(PIN_B3); //clear
delay_ms(1000);
output_low(PIN_B3);
delay_ms(1000);
}
}
} |
|