Author Topic: How to I measure time between sending serial data and receiving it?  (Read 2077 times)

0 Members and 1 Guest are viewing this topic.

Offline francoisgenoliniTopic starter

  • Newbie
  • Posts: 2
Hi,

This is probably a logic analyser question.

I am a software engineer, originally trained as an electronics engineer (some time ago, in the 1980's).

I would like to measure the time it takes for a system under test to process serial data.

I have one unit under test with one serial input port (RS-232) and one serial output port (RS-232).
The unit under test does some calculation after input, and then outputs.
The objective is to measure the (output - input) time of about 100 milliseconds (or small multiples of this), and be able to see the variations (how many milliseconds or tens of milliseconds variation could there be).

So far we have connected the unit under test to a standard Windows PC (no special precautions or preparations).  This PC sends the serial data to the unit under tests, then waits for the response, and calculates the time taken between sending the test serial data, and receiving the result.
This PC uses serial to USB converters, uses .Net and a user interface and logs all results to file.

I would like now to have an independent alternative set of measurements.
First I will use an industrial PC with a special chipset that has multiple serial ports connected directly to the motherboard, no USB conversion.  I intend to recompile a customised real-time version of the Linux kernel in a command line only Linux distribution, and then log the results to memory.
I would have more confidence in the reliability of the data I get from this Linux box due to its much simpler make up, and the fact that I have more control over what runs on the system.

Then I would like to use a logic analyser.
I would expect to be able to configure the Linux box to send well defined serial data to the unit under test, then get the logic analyser to wait and trigger a serial capture and time stamp as soon as this specific serial data is detected in the input port of the unit under test, then configure the logic analyser to wait on the output serial port of the unit under test for a different specific serial data, and here again capture and time stamp the serial data on that second (output) serial port.

Is this the kind of test that logic analyser can do?  What make and model would I need for this?  Do they come with probes that are suitable for serial (RS-232)?  Would you know any UK shop or company that could help with purchasing or renting such a logic analyser?

Regards,

Francois Genolini

Aberdeen, Scotland



 

Offline f5r5e5d

  • Frequent Contributor
  • **
  • Posts: 349
if the serial data is easily isolated by short message time with no other confusing traffic then just look at the data lines with a digital 'scope with decent memory depth - even a low cost Rigol

and getting digital scope with a serial decode function is cheap too today

as for a board level/software solution "bare metal" (just C or assy, simple loop, interrupt, timer hardware - no OS ) serial monitoring with a demo board/arduino will be a lot more deterministic

https://www.google.com/#q=serial+bus+decoding
« Last Edit: June 19, 2015, 10:04:37 am by f5r5e5d »
 

Offline tautech

  • Super Contributor
  • ***
  • Posts: 28379
  • Country: nz
  • Taupaki Technologies Ltd. Siglent Distributor NZ.
    • Taupaki Technologies Ltd.
If you are just wishing to measure the time AND nothing else a DSO will do it.
Attach one channel to the incoming and the other to the outgoing, set the trigger to the outgoing with the appropriate rising or falling setting, then use "single shot".
Resultant capture "should" show the last of the incoming, triggered by the first of the outgoing.
Use graticules and the timebase setting to calculate the time.

Visualise that?
Avid Rabid Hobbyist
Siglent Youtube channel: https://www.youtube.com/@SiglentVideo/videos
 

Offline f5r5e5d

  • Frequent Contributor
  • **
  • Posts: 349
can buy DB-9 inline breakout boards too - no soldering, opening boxes needed
 

Offline EEVblog

  • Administrator
  • *****
  • Posts: 37740
  • Country: au
    • EEVblog
If you had access to the firmware source code you'd normally just make it toggle a pin when received and when sending and measure the time difference on a scope.
otherwise still just use a digital scope and measure the time period between the end of the receive packet and the start of the transmit packet.
 

Offline francoisgenoliniTopic starter

  • Newbie
  • Posts: 2
Thanks to all,

I like the Arduino answer best; I forgot about that.

Regards,

François Genolini

Aberdeen, Scotland
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf