« Return to Thread: Generate interrupt signal and measure latency

Re: Generate interrupt signal and measure latency

by Ned Forrester :: Rate this Message:

Reply to Author | View in Thread

Peck H Koh wrote:
> Dear All,
>
> I'm hoping to use an external PIC microcontroller to generate a interrupt
> signal to control the sampling sequence of an ADC via the SPI bus on the
> Gumstix. I'm using the Connex 400xm-bt board.

Wrong approach, if you want uniform samples.  If you can tolerate 1ms
jitter in the samples, then proceed.  If you need tighter tolerance, you
will need to drive your ADC directly with the external clock, and then
FIFO enough data someplace (perhaps the NSSP FIFO is deep enough at 16
samples).

> The interrupt signal from the PIC needs to precede the point in time that
> the ADC reading will be taken, since it will cause an interrupt in the
> Gumstix, and that interrupt, however high priority, will take time to
> service (stacking registers etc.) before the ADC can be told to read. In
> order to program the timing sequence correctly, I'll need to measure the
> time it takes for the interrupt signal to activate the ADC and read the
> sample on the Gumstix, thereafter estimate how far in advance of the time
> that it should read we need to output the signal from the PIC.
>
> Can I ask if anyone has tried doing something similar? I'll greatly
> appreciate if anyone can advise me on how should I go about simulating this
> interrupt signal (without having the PIC) using one of the GPIO lines from
> the gumstix and then measure the latency? I'm really sorry if this sound
> straightforward to some of you as I'm new to this sort of programming.

You can generate a signal with a pulse generator, set to output a pulse
that goes from 0V to 3.3V.

You can measure the latency on an oscilloscope from that pulse to the
operation of the SPI pins in response to that pulse.  You could also
toggle any GPIO line, in place of actually running the SPI, if you
haven't gotten that far yet.  I don't think you can make this sort of
measurement in software, as too many things are dependent on the
interrupt service you are trying to measure.  You might have some luck
making calls to do_gettimeofday in the kernel.

--
Ned Forrester                                       nforrester@...
Oceanographic Systems Lab                                  508-289-2226
Applied Ocean Physics and Engineering Dept.
Woods Hole Oceanographic Institution          Woods Hole, MA 02543, USA
http://www.whoi.edu/sbl/liteSite.do?litesiteid=7212
http://www.whoi.edu/hpb/Site.do?id=1532
http://www.whoi.edu/page.do?pid=10079


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
gumstix-users mailing list
gumstix-users@...
https://lists.sourceforge.net/lists/listinfo/gumstix-users

 « Return to Thread: Generate interrupt signal and measure latency