Debuuging SCI RDRF bit in Codewarrior

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Debuuging SCI RDRF bit in Codewarrior

647 次查看
ve3id
Contributor III

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

标签 (1)
0 项奖励
回复
1 回复

392 次查看
kef
Specialist I

You should make sure data or memory windows do not include SCI or SPI registers, else flags of these modules may get cleared and your code will skip receive enents.

0 项奖励
回复