Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
Michael Karas
02/20/12 12:57
Read: 582 times
Beaverton Or
USA


 
#186075 - Diff Of TI and RI
Responding to: ???'s previous message
Dave,
The difference of the TI and RI flags in your simple test situation is that when you are casually single stepping the TI bit will normally be cleared unless you have just sent something within the last serial byte time. Since on polled transmit you would loop on the TI being set to hold up the output till the UART is able to take the next byte you would be able to single step right through the "wait while prev TX busy" loop as normally at finger and click speeds the bit will be cleared.

In contrast to this the RI flag in polled applications is tested in a loop to see if something has arrived. Since nothing comes in your test case with nothing coming in to the UART the bit will never get set and the loop "looking for next RX arrived" will hang.

Single stepping to JMP $ type instructions can be problematic in and of them selves depending on how the single step control logic is implemented. If the debugger uses a temporary breakpoint at the next opcode location it can be seen that a JMP $ would never get to the temporary breakpoint. (Not really sure how the SiLabs debugger does this).

I presume that you are using the SiLabs IDE and debugger. When I do debugging I rarely use single stepping because it is next to useless if you have active interrupts going on. The best strategy for debugging is to just set breakpoints and run till one gets triggered. Then study what the current MCU state is to see the cause of any problems. If the breakpoint is in an interrupt routine the best strategy is to then reset the device and restart again possibly with the breakpoint moved.

Michael Karas


List of 17 messages in thread
TopicAuthorDate
Help. Writing Hex code from serial port to External device      Dave McNamara      01/27/12 15:42      
   Look at this      Michael Karas      01/27/12 18:46      
      Using 8051      Dave McNamara      01/28/12 03:19      
   Why ASM?      Andy Neil      01/30/12 14:43      
      Design your subroutine(s)      David Prentice      01/30/12 15:20      
   RI Flag      Dave McNamara      02/20/12 08:48      
      READ_SERIAL      Michael Karas      02/20/12 09:25      
         RI setup      Dave McNamara      02/20/12 09:57      
            are you sure?      Erik Malund      02/20/12 10:04      
               CKCON      Dave McNamara      02/20/12 10:22      
                  well, then      Erik Malund      02/20/12 11:17      
                     Correct      Dave McNamara      02/20/12 12:11      
                        RI and TI      Erik Malund      02/20/12 12:24      
                           Ok      Dave McNamara      02/20/12 12:32      
                              Diff Of TI and RI      Michael Karas      02/20/12 12:57      
                                 Uart stall      Maarten Brock      02/22/12 07:01      
                        Oscilloscope      Per Westermark      02/20/12 17:04      

Back to Subject List