Hi John, 1st of all, if the ONLY interrupt u need enabled is RB0 then INTCON = 90; //enables global and RB0 interrupts 2ndly, ur interrupt routine should be set up this way: static void interrupt isr(void){ //RB0 interrupt if (INTF){ // do something INTF=0; //clear RB0 interrupt flag } } FYI, u can only have one interrupt routine which means all ur interrupts should be handled within that one routine! so for example if u needed to have TMR0 interrupt enabled as well as RB0, then the above interrupt routine would look like this: static void interrupt isr(void){ //TMR0 interrupt if (T0IF){ // do something T0IF=0; //clear TMR0 interrupt flag } // RB0 interrupt if (INTF){ // do something INTF=0; //clear RB0 interrupt flag } } hope this helps. BTW, if u needed to have TMR0 interrupt enabled, then u would need to set the value in the OPTION register appropriately. this might be a good time to have a look at the datasheet for the PIC in use. seyi "J.A.YOUNG" wrote: > Thanks very much to all for the array size stuff, I'm using the bit array to > store my potentials and wall data, so cutting down on memory, but will put in > my project that another type of chip would be more appropriate. > > > > For the current pic i'm going to use the dead simple 'follow-the-left-hand- > wall' technique. I've written the basic code, but at the moment its a case > of "move 1 square, stop. read sensors. go again", so I'm trying to setup an > interrupt on RB0 so that when the Left-Hand Sensor changes, I can jump to the > decision code. > > As yet my program runs and compiles but doesn't do anything on a change to B0. > I've kind of pieced the code I need together from the PICCLITE manual and other > tutorials, and can see there's stuff about option registers, but nothing I've > tried has made a difference. Code to try out the interrupt is below. > > void interrupt sensor() > { > int i; > PORTA=255; > for (i=40;i--;) continue; > } > > main() > { > TRISA=0; > TRISB=3; > > //OPTION=192; tried fiddling with this code but I'm just > //INTCON|=(1< > for (;;) > { > PORTA=0; > } > } > > Simple stuff no doubt, but any ideas??? cheers, > john > > -- > http://www.piclist.com hint: The PICList is archived three different > ways. See http://www.piclist.com/#archives for details. -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads