This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

I am using the uVision2 compiler and I can't store the SBUF in local variable.(I am using the debug

void getSBUF() interrupt 4 using 1
{
  char  temp = 1;
  unsigned char rData[3]
  static short n = 0;
  short i ;

  if (RI==1)
   temp = SBUF;

   RI = 0;
   TI = 0;
}

// This is part of the routine

Parents
  • I can't work the debugger, but when I have tried I've had the impression that the following happens:

    'temp' isn't referenced again in the function after the 'temp=SBUF' assignment therefore it ceases to exist meaning you can't see its value in the debugger.

    Maybe it would be best if you posted your entire code, if that is too big just post your entire ISR.

    Are you certain that SBUF contains the character you expect?

    Stefan

Reply
  • I can't work the debugger, but when I have tried I've had the impression that the following happens:

    'temp' isn't referenced again in the function after the 'temp=SBUF' assignment therefore it ceases to exist meaning you can't see its value in the debugger.

    Maybe it would be best if you posted your entire code, if that is too big just post your entire ISR.

    Are you certain that SBUF contains the character you expect?

    Stefan

Children
No data