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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
06/05/04 13:53
Read: times


 
Msg Score: +3
 +2 Informative
 +1 Good Answer/Helpful
#71832 - Scope Display of Complex Waveforms
A thread regarding I2C communications was closed before I got a chance to discuss how it was possible to observe complex waveforms on an oscilloscope. So here instead is my response to that subject.

To check timing of two wire interfaces I will routinely use an oscilloscope. A digital type scope with its single trigger / continuous display mode of operation can be very handy for this type of measurement but I happen to use an analogue type scope instead.

The key to a sucessful measurement it to arrange a bit of throw-away test code that runs the inteface in very short sequences. The code should be tweaked through several steps while the I2C is being checked out. One can start with a START followed by STOP in the first go. A second test could include a START / SLAVE / MEMADDR / BYTE sequence. In the case of a serial EEPROM I would program a loop to say read one byte over and over. For a typical I2C driver you need to exercise the code that handles the following 4 sequences - START, BYTE_OUT, BYTE_IN and STOP. The test loop should be designed to run the sequence on the I2C bus followed by a delay that is about 1.5 times as long as the bus transaction itself. For example, if the test sequence being measured is 400 µs then the delay time can be about 600 µsec.

Setup the oscilloscope with a probe on each of the SDA and SCL lines. Adjust the primary time base to trigger on the falling edge of the first SDA edge. Adjust the scope horz time base so that the whole transaction on the two wire bus is visable across the screen. I then use the "display 10X" feature of the scope so that the expands the horizontal sweep time out ten times wider. My scope has a multi-turn control that lets me scroll this waveform across the screen.

In some cases the two wire transaction that you are looking at will be longer than the portion displayed on the screen at the normal (non 10X) sweep rate. In these cases adjust the re-trigger HOLDOFF control on the scope so that the next scope trigger time is delayed past the end of the current transaction and armed in the delay time that you tweaked into test loop as described above.

If you happen to not have a scope with the above described features then there is another effective way to isolate the portion of the I2C sequence that you want to look at. This is done by using a spare processor port pin as a scope trigger. Program a pin to be an output and then connect the scope external trigger to this port pin. Note that most code that does an operation to talk to a two wire interface will be a sequence of subroutine calls that do the basic operations of START, BYTE_OUT, BYTE_IN and STOP. Arrange the test program in a loop and then place a SETBIT followed by a CLRBIT instruction to the trigger port bit right in front of the subroutine call that you want to see on the scope. (This scheme can get by without the delay time between repeats of the test loop). As each portion of the I2C bus transaction is checked the SETBIT/CLRBIT trigger generator can be moved down through the sequence of the subroutine calls.

I hope this helps!
Michael Karas


List of 5 messages in thread
TopicAuthorDate
Scope Display of Complex Waveforms            01/01/70 00:00      
   RE: Scope Display of Complex Waveforms            01/01/70 00:00      
      RE: Scope Display of Complex Waveforms            01/01/70 00:00      
         RE: Scope Display of Complex Waveforms            01/01/70 00:00      
            RE: Scope Display of Complex Waveforms            01/01/70 00:00      

Back to Subject List