FEZ Raptor + SignalCapture

I have been measuring signal by SignalCapture class on my FEZ Raptor. Input signal has 1kHz so i should get values near to 500 micro seconds. But result is like this:

468;
469;
438;
500;
437;
469;
469;
468;
469;
469;
469;
468;
469;
469;
469;
468;
469;
469;
469;


uint[] signal = new uint[2000];
SignalCapture pin = new SignalCapture(G400.PA27, Port.ResistorMode.Disabled, Port.InterruptMode.InterruptEdgeBoth);
pin.ReadTimeout = 5000;
pin.Read(false, signal);
Debug.Print("Done");

I know that G120HDR gave better results, from 499 to 501 micro seconds. In what could be the problem? Noise? Port selection?
Signal source is Rigol DS1064B Oscilloscope - port is connected to signal generator directly.

Thanks

Are you sure that G120 gave better results? They both use the same code. It is a simple software timer.

G120HDR result:

503;
497;
502;
501;
496;
502;
503;
497;
502;
497;
503;
495;
501;
503;
497;
503;
497;
502;
498;
501;

A few days ago I measured even better times on G120HDR. I can’t say what caused worsening. It seems that interrupts are triggered differently, on different levels. (?)

Interesting results. We will investigate.

would ambient temperature and/or crystal accuracy have anything to do with this?

Thank you. Another strenge behavior. SignalCapture do not respect parameter Port.InterruptMode.InterruptEdgeHigh. If “InterruptEdgeHigh” means every rising edge I should get time of one period. But with constant frequency I get:

2094;
7813;
2062;
7813;
2093;
7813;
2094;
7812;
2094;
7812;
2063;
7812;
2094;
7813;
2093;
7813;
2094;
7781;
2094;
7812;
2094;
7812;
2094;

Duty cycle of measured signal is approx. 21%.

@ Adam -

Nothing wrong in the firmware, just we use 32768 slow clock for time counter, so it can be different about 30us.
We improved it for next release.

OK. When the new release comes out? I am in trouble now… Could you send me prerelease version of assembly please?

@ Adam - It is a change in the firmware that still needs some testing. It will be in the next pre-release. We do not have a specific date yet, but it won’t be too long.