??? 06/23/06 07:12 Read: times |
#118924 - details Responding to: ???'s previous message |
Erik Malund said:
"why it not block further burst of "LLLL...." " http://www.8052.com/forum/read.phtml?id=118878
The devil is in the details. jnb is a 2-cycle instruction. In jnb ti,$, ti is sampled only once per the 2 cycles, and the whole instruction is, of course, uninterruptible. If you are "lucky", ti gets set so that jnb succeeds to sample it before the interrupt occurs. If you are not, the interrupt occurs first, clears ti, and jnb ti,$ ends up looping infinitely. "Luck" here means the timing relationship between the state of timer (which is the source of baudrate) at the moment when mov sbuf,a occurs and jnb ti,$. You can even try it: insert an odd number of nop-s between mov sbuf,a and jnb ti,$, and there will be no more continouos train of L-s, only a single L after reset. This behaviour can be simulated only on simulators which exactly simulate the internal timing of '51 down to the individual states within the 12-clock cycle. Jan Waclawek |