In this demo, we will use a logic analyzer to examine several simultaneous PWM waveforms. The logic analyzer we use is the LA-2124 from Link Instruments. This is a 24 channel analyzer that can hold 128 Kbytes of data in the buffer, and samples at rates up to 100 M samples/sec (50 MHz bandwidth). There is no user manual, but if you start the logic analyzer program ("LA2124 Logic Analyzer" in Start Menu) there is quite a bit of information, including some useful tutorials.
Before doing this demo, review the Introduction to PWM page and Introduction to Logic Analyzers page. You may also find the PWM Using DBug12 demo helpful.
First, hook up the logic analyzer. Make the connections shown below in the ORDER they are shown:
   1. Connect the LA-2124 to the parallel port of the PC.
  2. Connect the power cube to a 120 VAC outlet, and then connect the DC power jack to the LA-2124.
   3. Using a mini-jumper cable, make a connection between the VSS2 ground pin on the Dragon12 to the topmost, leftmost ground pin on the LA-2124. The top is the side which shows the connection schematic and has other large print on it. The bottom side has the serial number, manufacturer name, etc.
      -- Be VERY careful that you are hooking up the VSS2 pin and NOT the VDD2 pin since the latter is high (5V)
   4. Using mini-jumper cables, make connections between from pin PP0 on the Dragon12 to pin "00" of the LA-2124, and pin PP1 to pin "01". This gives 2 PWM connections to Channels 0-1 of the LA-2124.
   5. The photograph below gives you an idea what you should have at this point. Note that in this photo there were 4 PWM connections to the LA2124 - yours will only have two PWM connections to the LA2124 (plus the gnd pin connection):
   6. Once the connections are made as above, use DBug12 to set up the registers needed to generate the following PWM waveforms (but do NOT yet start the PWM waveforms). Set up the following PWM0 output: a ~ 1 msec period with a ~10% duty cycle, and a PWM1 output of ~ 2msec period and a ~50% duty cycle. The DBug12 code to do this shown below is similar that from the PWM Using DBug12 demo except that we must also consider that we are using an additional channel PWM1:
      >mm a2 03    ; set PWM0 and PWM1 to use clock SA
      >mm a3 07    ; set PWMPERCLK with divider 128 (A clock rate = E/128) for both channels.
      >mm a8 04    ; set PWMSCLA to further divide SA clock by 4 (SA = E/(2 * 128 * 4) = 23,438 Hz,
      >mm b4 18    ; multiple PWM0 period by $18 = 24, 24 * 43 microseconds = 1.032 msec.
      >mm b5 30    ; multiple PWM0 period by $30 = 48, 48 * 43 microseconds = 2.064 msec.
      >mm bc 16    ; ($18 - $16)/$18 = (24 - 22)/24 gives PWM0 duty cycle = 8.3%
      >mm bd 18    ; ($30 - $18)/$30 = (48 - 24)/48 gives PWM1 duty cycle = 50%
   7. Start the PWM channels running with a "mm a0 03" command in DBug12. Note that if we wrote "mm a0 01" we would start just the PWM0 channel, and if we wrote "mm a0 02" we would start only the PWM1 channel, but NOT the PWM0 channel. To start both channels, we must write a binary %00000011 = $03 to the PWM enable register at address $A0.
   8. Start the Logic Analyzer from the Start menu - the program is called "LA2124 Logic Analyzer". Once it is started, set it up as noted below.
   9. From the top window Menu, select "Trigger > Trigger Word", and in the pop-up window set it to "xxxxxxx1" in the Ch 7..0 dialog box and Select Trigger = True. This will cause the logic analyzer to start collecting data once Ch.0 goes high, treating the other channels as "don't cares" as indicated by the x's.
  10. From the top window Menu, chose "Clock" and set it to 20 KHz, internal, 2 k samples. This means the data collection time will be 102.4 msec at a sampling rate of 20 KHz.
  11. In the Menu, choose "Trigger > Mode" and set it to single. This will give us a single shot of data each time we hit the "Go" button.
  12. Bring the "Timing View" window to the foreground by clicking on it. Resize by dragging as desired.
  13. Click on the "Go" button description in the toolbar at the top of the window. This will start the process.
  14. After a brief time, the screen should update, and you should see the timing waveforms. Check that the timings are as desired from the above criteria. Click on the +/- icons description to zoom in/out of the data to the desired resolution, and use the scrollbars if needed. Note that dashed vertical lines are the time divisions, and there values change as we zoom in/out of the window. You can also click and drag on the colored timing cursors (red, green, blue vertical lines) to see the time values of various events. For instance, if you drag the green (A) cursor to the leading edge of a pulse, and the blue (B) cursor to the falling edge, then you can read the "on" time for that pulse by looking at the A-B time difference value.
      - If you don't see any colored cursors, you may have to scroll around left/right to find them. You may also have to click/drag on the leftmost dotted line to reveal the cursors (the colored cursors are sometimes hidden there).
  15. Click on the "Go" icon several times and see how the data change. In particular, the Ch.0 waveform should always the same since we trigger on it, but the other channel may shift from screen to screen depending on their values when Ch.0 triggers.
  16. Click on the "Trigger Word" icon description and change the trigger word to "Ch 7..0" = "xxxxxx11". Data collection will start only when all pulses are high. Click on the "Go" button to see how the relative positions of the waveforms. Note that the leading pulses of the waveforms are all high since this is required by our trigger setting. If by chance you have waveforms which are exactly out-of-sync (one PWM channel always high when the other is low), then you will never be able to trigger on this trigger word.
  17. Set the trigger word as above to "Ch 7..0" to "xxxxxx00" and click "Go" several times. Note that the leading pulses are always low as determined by the trigger settings.
  18. Set the trigger back to "Ch 7..0" = "xxxxxxx1". Then click on the Statelist View window to bring it to the foreground, or choose "Statelist Window" under the "State" entry in the topmost window menu.
  19. Click on the "Go" button. Note how the binary words change with time. Verify that these match the values shown in the "Timing View" window. You can get higher time resolution in the "Statelist Window" by using the +/- of the rate zoom description icons.
  20. Once everything works as described above, the demo is done. If you are having problems, ask the TA for assistance.
Logic Analyzer