static int j;
/////////////////////////////////////////////////////////////////////////
////////Interrupt Service routine for change on port b////////////
/////////////////////////////////////////////////////////////////////////
#int_rb
rb_isr ( )
{
///////////////////////////////////////////////////////////////////////
///////////////////////////Setup Timers////////////////////////////////
setup_timer_1(T1_DISABLED);
setup_timer_2(T2_DISABLED,0,1);
///////////////////////////////////////////////////////////////////////
//////////Setup interrupt on Port B change ////////////////////////////
///////////////////////////////////////////////////////////////////////
status = port_b; //read the status before enabling the interrupt
enable_interrupts(INT_RB);
The interrupt ocurs on change on port b, but as can be seen i have the interrupts disabled. The program never reaches the printf("reset"); line!
Why is this?
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
Posted: Fri Apr 02, 2004 12:02 pm
Where is your declaration for port_b ?
It should look like this, if you are using a 16F series PIC:
#byte port_b = 6
Neutone
Joined: 08 Sep 2003 Posts: 839 Location: Houston
Posted: Fri Apr 02, 2004 12:38 pm
It's just a guess but I would try clearing the interupt flag between these two lines.
Code:
status = port_b; //read the status before enabling the interrupt
enable_interrupts(INT_RB);
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum