Nigel Johnson

Debuuging SCI RDRF bit in Codewarrior

Discussion created by Nigel Johnson on Nov 14, 2011
Latest reply on Nov 15, 2011 by kef

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 ((SCI1SR1 & 0x20) == 0){};          // wait until received data
    temp = SCI1DRL;




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!



Nigel Johnson