I am trying to debug the following code...
void getSCI(void) // get modem's response and display on lcd
{
line = 1;
temp = 0;
char_Pos = 0;
first_reply =1;
while(1)
{
while ((SCI1SR1 & 0x20) == 0){}; // wait until received data
temp = SCI1DRL;
etc....
If I put a breakpoint at the entry to getSCI(), when it stops there I can see the RDRF bit set in SCI1SR1 and the correct data in SCI1DRL. But if I single-step (either C or assembly) as soon as I move off the line=1 line, the RDRF bit clears, and when I get to the test for it, it obviously is not thee to test.
I assume this s because the debugger is reading the registers ahead of the execution steps, but how can I stop this?
Any help appreciated, this is a side issue to the real problem I am debugging!
regards,
Nigel Johnson