HOWTO - LogicPort Trigger on Serial Character

I was working on a serial multiplexor based on a Propeller development board. Because there could be many serial streams coming into or out of the mux, I needed to be able to analyze the serial stream in real-time to debug it and verify and validate it was working as I expected.

I bought a LogicPort 34 channel logic analyzer to help me do the job but figuring out the best way to get it to trigger on an incoming or outgoing serial character took me a little time to figure out. This is a quick tutorial on how I did it.

First the setup and application. I have 6 serial streams (3.3v) attached to a Propeller development board. 4 serial streams are for devices such as GPS, cellular modems, OLED displays, etc. 1 serial stream is an upstream, multiplexed packet so a single microprocessor can read data from up to 4 serial streams and a single micro can conversely send data to multiple serial ports. 1 serial stream is for a supervisor console which can configure the various ports baud rates as well as virtually bridge serial ports.

Using the Propeller development board, I broke out the various pins into an edge connector which had an additional header I could use for probes on any pin. The bottom right hand pins in the picture below lead to a testbed of USB to serial boards I can drive with a test framework I wrote in Ruby to drive any of these ports and automatically determine if the mux is operating correctly.

DSCF0611

The header just above the flat row of leads is for the LogicPort probes. The probe we’ll focus on in this tutorial is the yellow probe shown below which is monitoring the control console (supervisor) port I use to type commands into the mux for configuration, stats, and status.

logicport 13

An example console session might look like this where I am typing commands into the mux console (Propeller firmware):

logicport 14

Using a typical serial stream like this, I’m going to show you the setup for triggering on an outgoing character to the console port on the mux. I’m assuming you already know how to initialize and wire up your LogicPort to a probe/pin and how to add signals into LogicPort host software on your PC. These are all covered by the LogicPort tutorials.

Setup Pattern and Edge Columns in the LogicPort



Make sure you have a Pattern B and an Edge B column in your signal table. If “Pattern B” isn’t a column in your signal table, you can add it by right clicking below the table and choosing Add Column. Add these columns shown below:


logicport 15


Add the signal(s) to monitor



After I’ve added signals my basic signal setup looked like this:

logicport 3

The Yellow probe that will monitor the output pin for the console is shown here as D4.

Set the trigger conditions



Next set up the trigger conditions as follows from the Setup->Trigger... menu of the LogicPort software:

logicport 2

I used the Level B condition which is important to note for when you specify which signal will be the trigger. Apply these trigger conditions.

Associate the trigger condition with the signal



Back on the main LogicPort window, set the signal which will be the trigger signal by doing this:

In the Pattern B column of the signals table, make sure all signals are set for ‘X’ except the one signal you want to monitor (D4 in this example).

logicport 10

In the trigger signal Pattern B column, put a 0 instead of an X. This is the trigger level we’re interested in because the serial bits by default start with a transition to logic level 0. In the Edge B column, set it for a falling edge as shown in the example above.

This configuration will then ask the LogicPort probe to trigger on a falling edge of the transmit port which will indicate the first character being transmitted out of the mux (device under test.)

Adjust the sample period attributes



After this trigger setup is complete, you should adjust the sample attributes for your serial stream:

Since I’m using a 3.3v USB to serial devices to talk to the port, I set my logic threshold to 1.75v - other values could easily work as well to define the threshold, but this value worked well for me.

logicport 5

Set the pretrigger buffer to something like 75% (you can vary this.)

logicport 6

For a serial stream of 115,200 as this supervisor port, the sample period of 1us worked well:

logicport 7

With different baud rates, you will want to adjust these values - experimentation is required in my experience.

Sample rate of 1MHz was sufficient to capture the bits and to allow the LogicPort to interpret the stream.

logicport 4


Acquire data by a trigger from a serial port



After the trigger is configured and the sample attributes are set up, you can try your first trigger.

Select the trigger icon or continuous trigger icon to tell the LogicPort to start sampling and look for the trigger condition. Now, cause your device under test to send some data out the port where you are monitoring (D4 in this example is the transmit side of the console port.)

Once a character is transmitted, the LogicPort should trigger and show you the wave form it found which triggered:

logicport 1

I have set up a LogicPort serial interpreter on the supervisor port so I can see both the wave form as well as the ASCII decoding of the characters:

logicport 11

The interpreter needs to be setup similar to this for most 3.3v serial streams from micros and devices such as GPS’s (Postiive logic sense, no parity, one stop.)

logicport 8

Using these techniques you can now trigger on any serial character coming into or out of a device you’re monitoring with a LogicPort.
asdfasdf