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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
02/20/12 19:57
Read: times


 
#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            01/01/70 00:00      
   Look at this            01/01/70 00:00      
      Using 8051            01/01/70 00:00      
   Why ASM?            01/01/70 00:00      
      Design your subroutine(s)            01/01/70 00:00      
   RI Flag            01/01/70 00:00      
      READ_SERIAL            01/01/70 00:00      
         RI setup            01/01/70 00:00      
            are you sure?            01/01/70 00:00      
               CKCON            01/01/70 00:00      
                  well, then            01/01/70 00:00      
                     Correct            01/01/70 00:00      
                        RI and TI            01/01/70 00:00      
                           Ok            01/01/70 00:00      
                              Diff Of TI and RI            01/01/70 00:00      
                                 Uart stall            01/01/70 00:00      
                        Oscilloscope            01/01/70 00:00      

Back to Subject List