Page 1 of 1

UIC00B stepping non stop and finally MPLAB IDE hang

PostPosted: Fri Mar 29, 2013 3:22 pm
by khmok
Hi,

When I step through my code, I noticed that when come to bit shifting (data >> = 1), the UIC00B will step non-stop and finally hang.
Refer my code below.

Do you encounter the same thing? Please give some advice how to solve this.

CODE: SELECT_ALL_CODE
void OWWriteByte(int data)
{
   int i = 0;

   // Loop to write each bit in the byte, LS-bit first
   for (i= 0; i < 8; i++)
   {   
      OWWriteBit(data & 0x01);
      
      // shift the data byte for the next bit
      data >> = 1;
   }   
}

Re: UIC00B stepping non stop and finally MPLAB IDE hang

PostPosted: Tue Apr 02, 2013 10:43 pm
by robosang
what does "data >> = 1" means?

Re: UIC00B stepping non stop and finally MPLAB IDE hang

PostPosted: Wed Apr 03, 2013 12:08 am
by Brian Griffin
data >>= 1 is also:

data = data >> 1

:)