Hi: Does any have any idea how Domino signal processing would be able to handle pulses relative to the SCM20260 as described above? Skeller commented that it had signal control, but that does not address how it is implemented in Endbpoint, and with, I think, a different uP.
Thanks
I think the only way you are going to be able to get an answer is test it yourself.
Endpoint is new, and it is possible that nobody has tested the Signal processing functionality.
I have a new issue with my pulse counting circuit. I have modified my code to attempt to maintain a 10Hz sample rate by using a timer and the abort method. I find that this works very well at low frequencies (around 10-500kHz), but at I exceed 1MHz, it will fail returning a TIME of 0. The pulses are random, but continuous as seen on a logic probe. After the fail returning 0, the code will stop processing.
If the pulse train were to disappear, then it should time out with 0 count, but to trigger the interrupt will 0 TIME is leaving me confused. Suggestions appreciated!
private void ThreadTest()
{
Debug.WriteLine("Thread started");
var gpioController = GpioController.GetDefault();
// Start the timer
this.startTime = DateTime.Now; // Initialize the start time
this.isRunning = true;
//Debug.WriteLine("PWM Crontoller set to output " + this.freqOut / 1000 + "kHz. Duty cycle " + this.duty * 100 + "%");
var digitalSignalPin = gpioController.OpenPin(SC20260.Timer.DigitalSignal.Controller2.PB3);
var digitalSignal = new DigitalSignal(digitalSignalPin);
var waitForEdge = true; // Start capturing as soon as Capture is called
digitalSignal.OnReadPulseFinished += this.Digital_OnReadPulseFinished; //subscribe to the event
while (this.isRunning) {
digitalSignal.ReadPulse(1000, GpioPinEdge.RisingEdge, waitForEdge); // start reading the 1000 pulses
this.countReached = false;
while (this.countReached == false) {
// Wait for finish capture or maintain 10Hz sampling rate
this.usage = DeviceInformation.GetCpuUsageStatistic();
Thread.Sleep(100); // attempting to get a 10Hz sample rate
digitalSignal.Abort();
}
}
}
void Digital_OnReadPulseFinished(DigitalSignal senderX, TimeSpan duration, uint countX, GpioPinValue pinValue) {
var ticks = duration.Ticks; // ticks are 0.1uS'
if (ticks == 0) {
Debug.WriteLine("Digital_OnReadPulseFinished: duration is 0");
return; }
var microsecond = ((double)duration.Ticks) / 10;
var millisecond = ((double)duration.Ticks) / 10000;
var freq = (countX / microsecond) * 1000;
var elapsed = DateTime.Now - this.startTime;
this.cyclesRead +=1;
var s ="ET: " + elapsed.ToString(@"Ss\.fffff", System.Globalization.CultureInfo.InvariantCulture) + ", Count," + countX.ToString() + ", dur," + millisecond.ToString("N6") + ",ms, freq = ," +
freq.ToString("N3") + ", kHz,cpu," + this.usage.ToString("N3") + "," + this.pmtData;
Debug.WriteLine(s);
this.countReached = true;
}
Example of the output at failure:
ET: 00:07:30.1473850, Count,1000, dur,12.341700,ms, freq = ,81.026, kHz,cpu,10.878,
ET: 00:07:30.2511827, Count,1000, dur,21.175000,ms, freq = ,47.226, kHz,cpu,10.878,
ET: 00:07:30.3486286, Count,1000, dur,16.881800,ms, freq = ,59.235, kHz,cpu,10.878,
ET: 00:07:30.4789237, Count,1000, dur,28.723100,ms, freq = ,34.815, kHz,cpu,8.754,
ET: 00:07:30.5816858, Count,1000, dur,22.124100,ms, freq = ,45.200, kHz,cpu,8.754,
ET: 00:07:30.6282023, Count,1000, dur,1.774600,ms, freq = ,563.507, kHz,cpu,8.754,
ET: 00:07:30.7267623, Count,1000, dur,0.276200,ms, freq = ,3,620.565, kHz,cpu,8.754,
ET: 00:07:30.8275906, Count,1000, dur,0.278100,ms, freq = ,3,595.829, kHz,cpu,8.754,
ET: 00:07:30.9285973, Count,1000, dur,0.284800,ms, freq = ,3,511.236, kHz,cpu,8.754,
ET: 00:07:31.0295684, Count,1000, dur,0.256900,ms, freq = ,3,892.565, kHz,cpu,8.754,
ET: 00:07:31.1305989, Count,1000, dur,0.286700,ms, freq = ,3,487.967, kHz,cpu,8.754,
ET: 00:07:31.2315876, Count,1000, dur,0.275100,ms, freq = ,3,635.042, kHz,cpu,8.754,
ET: 00:07:31.3319669, Count,1000, dur,0.278900,ms, freq = ,3,585.515, kHz,cpu,8.754,
ET: 00:07:31.4326549, Count,1000, dur,0.282000,ms, freq = ,3,546.099, kHz,cpu,15.928,
ET: 00:07:31.5335910, Count,1000, dur,0.278900,ms, freq = ,3,585.515, kHz,cpu,15.928,
ET: 00:07:31.6346004, Count,1000, dur,0.287500,ms, freq = ,3,478.261, kHz,cpu,15.928,
ET: 00:07:31.7355912, Count,1000, dur,0.278600,ms, freq = ,3,589.375, kHz,cpu,15.928,
ET: 00:07:31.8365845, Count,1000, dur,0.273500,ms, freq = ,3,656.307, kHz,cpu,15.928,
ET: 00:07:31.9375838, Count,1000, dur,0.272100,ms, freq = ,3,675.119, kHz,cpu,15.928,
ET: 00:07:32.0385965, Count,1000, dur,0.284700,ms, freq = ,3,512.469, kHz,cpu,15.928,
ET: 00:07:32.1395950, Count,1000, dur,0.282500,ms, freq = ,3,539.823, kHz,cpu,15.928,
ET: 00:07:32.2405965, Count,1000, dur,0.282500,ms, freq = ,3,539.823, kHz,cpu,15.928,
ET: 00:07:32.3415861, Count,1000, dur,0.273700,ms, freq = ,3,653.635, kHz,cpu,15.928,
ET: 00:07:32.4426023, Count,1000, dur,0.288600,ms, freq = ,3,465.003, kHz,cpu,18.586,
ET: 00:07:32.5435907, Count,1000, dur,0.278200,ms, freq = ,3,594.536, kHz,cpu,18.586,
ET: 00:07:32.6441669, Count,1000, dur,0.273600,ms, freq = ,3,654.971, kHz,cpu,18.586,
Digital_OnReadPulseFinished: duration is 0
is frequency source changing? or read pulse sometime read 81KH then sometime 3.6MHz?
That is because of your code.
var ticks = duration.Ticks; // ticks are 0.1uS'
if (ticks == 0) {
Debug.WriteLine("Digital_OnReadPulseFinished: duration is 0");
return; }
you returned without setting this.countReached to true, but another thread you have a loop
while (this.countReached == false) {
// Wait for finish capture or maintain 10Hz sampling rate
this.usage = DeviceInformation.GetCpuUsageStatistic();
Thread.Sleep(100); // attempting to get a 10Hz sample rate
digitalSignal.Abort();
}
this will cause the loop runs forever.
Hi: Thanks for the reply. After I sent the message I realized why the code stopped processing. Below is the code I have now. What I am trying to do is sample a randomly spaced pulse train that varies between 9kHz to 10MHz, and I need to sample this every 125mS. The digitalSignal.ReadPulse will let me specify number of pulses but not time interval, so I need to interrupt using the Abort function, and read the duration and count to calculate frequency. This works fairly well, but at lower frequencies around 10kHz the abort frequently returns both a duration and count of 0. That is the problem I need to solve. Below, after the code, is a short segment of data that shows how many times this happens. A valid count in the hundreds is returned three times while a 0 count around 16 times. This is for a randomly time distributed pulses at a rate of 9000 pulses per second. The logic analyzer shows that the longest gap between pulses is <1mS. What could be causing this?
private void ThreadTest()
{
Debug.WriteLine("Thread started");
this.uart5 = UartController.FromName(SC20260.UartPort.Uart5); // send results out
var setting = new UartSetting() {
BaudRate = 115200
};
this.uart5.SetActiveSettings(setting);
this.uart5.Enable();
var gpioController = GpioController.GetDefault();
// Start the timer
this.startTime = DateTime.Now; // Initialize the start time
this.isRunning = true;
//Debug.WriteLine("PWM Crontoller set to output " + this.freqOut / 1000 + "kHz. Duty cycle " + this.duty * 100 + "%");
var heading = "Time from start, Count, Duration mS, kHz, cpu%";
this.uart5.Write(Encoding.UTF8.GetBytes(heading + "\r\n"));
Debug.WriteLine(heading);
var digitalSignalPin = gpioController.OpenPin(SC20260.Timer.DigitalSignal.Controller2.PB3);
var digitalSignal = new DigitalSignal(digitalSignalPin);
var waitForEdge = true; // Start capturing as soon as Capture is called
digitalSignal.OnReadPulseFinished += this.Digital_OnReadPulseFinished; //subscribe to the event
// Create a timer to get fixed interval sampling by aborting the pulse read every 125mS
var timer = new System.Threading.Timer(_ => digitalSignal.Abort(), null,2000 , 125);
while (this.isRunning) {
digitalSignal.ReadPulse(1000000, GpioPinEdge.RisingEdge, waitForEdge); // start reading the 1000 pulses
this.countReached = false;
while (this.countReached == false) {
// Wait for finish capture or maintain 8Hz sampling rate
this.usage = DeviceInformation.GetCpuUsageStatistic();
this.pulseReadFinishedEvent.WaitOne(); // Wait for the pulse read to finish
}
}
}
void Digital_OnReadPulseFinished(DigitalSignal senderX, TimeSpan duration, uint countX, GpioPinValue pinValue) {
var ticks = duration.Ticks; // ticks are 0.1uS'
var s = "";
var freq = 0.0;
var elapsed = DateTime.Now - this.startTime;
var microsecond = ((double)duration.Ticks) / 10;
var millisecond = ((double)duration.Ticks) / 10000;
if (ticks > 0) { freq = (countX / microsecond) * 1000; }
this.cyclesRead +=1;
s =elapsed.ToString(@"ss\.fff", System.Globalization.CultureInfo.InvariantCulture) + "," + countX.ToString() + "," + millisecond.ToString("F5") + "," +
freq.ToString("F3") + "," + this.usage.ToString("F3") + "," + this.pmtData;
Debug.WriteLine(s);
this.uart5.Write(Encoding.UTF8.GetBytes(s + "\r\n"));
this.UpdateStatusText("Duration: " + millisecond.ToString("F3")+ "mS Frequency " + freq.ToString("F3") + "kHz, count " + countX.ToString() +" CPU " + this.duty + "%", true);
this.countReached = true;
this.pulseReadFinishedEvent.Set(); // Signal that the pulse read is finished
}
Columns are time from start, count, duration, calculated freq, CPU%
00:00:51.7509666,0,0.00000,0.000,17.786,
00:00:51.8760197,0,0.00000,0.000,17.786,
00:00:52.0010031,0,0.00000,0.000,17.786,
00:00:52.1258137,0,0.00000,0.000,17.786,
00:00:52.2508017,0,0.00000,0.000,17.786,
00:00:52.3758510,0,0.00000,0.000,17.373,
00:00:52.5008155,0,0.00000,0.000,17.373,
00:00:52.6258933,0,0.00000,0.000,17.373,
00:00:52.7508566,601,66.48400,9.040,17.373,
00:00:52.8760263,0,0.00000,0.000,17.373,
00:00:53.0014203,489,53.35640,9.165,17.373,
00:00:53.1263333,0,0.00000,0.000,17.373,
00:00:53.2513036,0,0.00000,0.000,17.373,
00:00:53.3764173,0,0.00000,0.000,17.449,
00:00:53.5014104,0,0.00000,0.000,17.449,
00:00:53.6264894,0,0.00000,0.000,17.449,
00:00:53.7514658,0,0.00000,0.000,17.449,
00:00:53.8765220,488,54.35570,8.978,17.449,
00:00:54.0006820,0,0.00000,0.000,17.449,
May be a bit far fetched⦠or worseā¦
Perhaps writing to serial port is interferring with the PulseCount functionality.
Instead of writing to the serial port, store the results in a string array, and print out the stored results after the testing is complete.
I might also try storing the results in pre-allocated objects instead of using string formatting functions which could cause garbage collection.
Thanks for the suggestion. I changed the code and commented out all IO except to say the results was bad. Of course I did not get any good data, but I got the same amount of bad data with both count and duration at 0. I could tell by the time stamps that there were a few good readings. So that does not seem to be the cause.
type or paste void Digital_OnReadPulseFinished(DigitalSignal senderX, TimeSpan duration, uint countX, GpioPinValue pinValue) {
var ticks = duration.Ticks; // ticks are 0.1uS'
var s = "";
var freq = 0.0;
var elapsed = DateTime.Now - this.startTime;
var microsecond = ((double)duration.Ticks) / 10;
var millisecond = ((double)duration.Ticks) / 10000;
if (ticks > 0) { freq = (countX / microsecond) * 1000; } else { Debug.WriteLine("ticks are zero" + elapsed.ToString(@"ss\.fff", System.Globalization.CultureInfo.InvariantCulture));}
/* this.cyclesRead += 1;
s =elapsed.ToString(@"ss\.fff", System.Globalization.CultureInfo.InvariantCulture) + "," + countX.ToString() + "," + millisecond.ToString("F5") + "," +
freq.ToString("F3") + "," + this.usage.ToString("F3") + this.pmtData;
Debug.WriteLine(s);
this.uart5.Write(Encoding.UTF8.GetBytes(s + "\r\n"));
this.UpdateStatusText("Duration: " + millisecond.ToString("F3")+ "mS Frequency " + freq.ToString("F3") +
"kHz, count " + countX.ToString() +" CPU " + this.duty + "%",true);
*/
this.countReached = true;
this.pulseReadFinishedEvent.Set(); // Signal that the pulse read is finished
} code here
Hi:
My efforts to make a dependable pulse counting circuit as still having issues. I am having two main types of issues:
- Under some conditions, when the OnReadPulseFinished event is called by triggering the pulseReadFinishedEvent, the event returns 0 for both duration and count. For sure, there are pulses entering the circuit, and the forced read is after the designated interval.
- At 1MHz, as an example, 14nS pulses are measured correctly, but at 100kHz, 242nS pulses are not detected, but increasing the pulse width to 496nS results in perfect measurement.
I have spent many hours on this and found it to be repeatable. Of course I have examined the limits of performance (pulse width vs frequency) and it works under many conditions, but not mine. Should I purchase a new board? Can anyone verify under what conditions this works as expected? Is there differrent code to try - I need a 8Hz sample rate of a pulse stream with the pulse width of 20nS and a frequency of 1kHz to 5Mhz?
Here are some details:
A DDS Signal Generator/Counter was used to generate pulses 3.3V with 1.65V positive offset. A Saleae 8 channel pro logice probe was used to verify/measure both frequency, analog voltages and pulse width of the source. Frequency measurements are in kHz.
A constant 1MHz train of 14nS pulses were measured 100 times at a rate of 8Hz. The resulting statistics were: Mean: 1000.052, StdDev: 0.017, Min: 1000.036, Max: 1000.189, C.V.: 0.00%, n=100.
A constant 100kHz train of 242ns pulses were measured under the same conditions, but no data was reported - the count was 0 and the duration of the count was 0.
Increasing the pulse width to 336ns. at the same frequency, the results were Mean: 100.190, StdDev: 0.370, Min: 99.741, Max: 101.523, C.V.: 0.37%, n=100
Increasing the pulse width to 496ns. at the same frequency, the results were Mean: 100.126, StdDev: 0.178, Min: 99.955, Max: 100.518, C.V.: 0.18%, n=100, an improvement in CV.
At low frequency, 12kHz, 242nS pulses were not detected, but increasing the width to 800nS pulses are detected: Mean: 11.760, StdDev: 0.171, Min: 11.405, Max: 12.056, C.V.: 1.45%, n=100
private AutoResetEvent pulseReadFinishedEvent = new AutoResetEvent(false);
private double cyclesRead = 0;
private double freq = 0;
private string str = "";
private uint countX = 0;
private double millisecond = 0;
private TimeSpan elapsed;
private string statline = "";
private double usage;
private ArrayList freqOutReadings = new ArrayList();
private Statistics statistics = new Statistics();
private uint samples = 100;
private void ThreadTest()
{
Debug.WriteLine("Thread started");
this.uart5 = UartController.FromName(SC20260.UartPort.Uart5); // send results out
var setting = new UartSetting()
{
BaudRate = 115200
};
this.uart5.SetActiveSettings(setting);
this.uart5.Enable();
var gpioController = GpioController.GetDefault();
// Start the timer
this.startTime = DateTime.Now; // Initialize the start time
this.isRunning = true;
var heading = "Time from start, Count, Duration mS, kHz"; // , cpu%";
this.uart5.Write(Encoding.UTF8.GetBytes(heading + "\r\n"));
Debug.WriteLine(heading);
var digitalSignalPin = gpioController.OpenPin(SC20260.Timer.DigitalSignal.Controller2.PB3);
var digitalSignal = new DigitalSignal(digitalSignalPin);
var waitForEdge = true; // Start capturing as soon as Capture is called
digitalSignal.OnReadPulseFinished += this.Digital_OnReadPulseFinished; //subscribe to the event
// Create a timer to get fixed interval sampling by aborting the pulse read every 125ms
var timer = new System.Threading.Timer(_ => digitalSignal.Abort(), null, 2000, 125); // 125mS sample rate deaired
while (this.isRunning)
{
var startTime = DateTime.Now; // Start the timer
// this.usage = DeviceInformation.GetCpuUsageStatistic(); causes latchup, do not use!!
digitalSignal.ReadPulse(1000000, GpioPinEdge.RisingEdge, waitForEdge); // start reading pulses. as there is no tiime argument, use interrupt
if (this.cyclesRead > 0) { // ignore first pass at startup
// capture event details and send out serial port. Save frequency into stat array
this.freqOutReadings.Add(this.freq);
this.str = this.elapsed.ToString(@"ss\.F3", System.Globalization.CultureInfo.InvariantCulture) + ", " +
this.countX.ToString("F0") + ", " + this.millisecond.ToString("F5") + ", " +
this.freq.ToString("F3"); //, " + this.voltRatio.ToString("F3");
// this.uart5.Write(Encoding.UTF8.GetBytes(this.str + "\r\n"));
// compute statistics from previous series of readings
if (this.freqOutReadings.Count > this. Samples) {
this.statistics.ComputeStatistics((double[])this.freqOutReadings.ToArray(typeof(double)));
// sometimes count, duration are both reported as 0
if (this.statistics.Mean > 0) {
this.statline = ("Mean: " + this.statistics.Mean.ToString("F3") + ", StdDev: " +
this.statistics.StandardDeviation.ToString("F3") +
", Min: " + this.statistics.Min.ToString("F3") +
", Max: " + this.statistics.Max.ToString("F3") +
", C.V.: " + (this.statistics.StandardDeviation / this.statistics.Mean * 100).ToString("F2") + "%, n=" + this.samples.ToString());
} else { this.statline = "No data"; }; // data all reported as 0
this.freqOutReadings.Clear(); // reset the stat arrays
this.uart5.Write(Encoding.UTF8.GetBytes(this.str + " " + this.statline + "\r\n")); // with this frame, send stats on previous 100 frames on same line
}
// this.UpdateStatusText("Frequency " + this.freq.ToString("F2") + "Hz, Count = " + this.countX + ", duration " + this.millisecond.ToString("F2") + "mS", true);
}
digitalSignal.ReadPulse(1000000, GpioPinEdge.RisingEdge, waitForEdge); // start reading pulses. as there is no tiime argument, use interrupt
this.countReached = false;
this.pulseReadFinishedEvent.WaitOne(); // Wait for the pulse read to finish OR the digitalSignal.abort called every 125mS
// var endTime = DateTime.Now; // Stop the timer
// var elapsedMilliseconds = (endTime - startTime).TotalMilliseconds; // Get the elapsed time in milliseconds
// Debug.WriteLine($"Elapsed time: {elapsedMilliseconds} ms"); // Output the elapsed time
}
timer.Dispose();
}
void Digital_OnReadPulseFinished(DigitalSignal senderX, TimeSpan duration, uint counter, GpioPinValue pinValue)
{
var ticks = duration.Ticks; // ticks are 0.1uS'
this.countX = counter;
this.freq = 0;
var microsecond = ((double)duration.Ticks) / 10;
this.millisecond = ((double)duration.Ticks) / 10000;
this.elapsed = DateTime.Now - this.startTime;
if (ticks > 0) {
this.freq = (this.countX / microsecond) * 1000;
}
this.cyclesRead += 1;
this.countReached = true;
this.pulseReadFinishedEvent.Set(); // Signal that the pulse read is finished
}
Have you checked the detailed specifications for the processor chip as it regards this functionality?
Should I purchase a new board?
Might be worth a try. You are spending a lot of time diagnosing the issue. A new board/module is not expensive relative to your time.
I assume this is a custom board? If so, is it possible there is a routing issue which is creating some type of a filter on the board? Might be worth while to get a GHI board with the same module and repeat your tests to determine if there is something unique to your board.
Thanks Mike (and to Dat and Gus):
This is a GHI 20260D demo board with current NuGet downloads. Just in case, I ordered another board but todays testing suggests a bug.
I am firmly convinced that the issue arises in the digitalSignal.abort function which should terminate the operation early (before the requested number of pulses occurs). The GHI TinyCLR tutorials/Signal-control, abort example says " When aborted, an event is still triggered, which will contain whatever data/pulses was collected from the trigger to the time Abort
was called." In my experience, at pulse frequencies > 50kHz this works great, but at low frequencies this fails frequently (>50% of the time) as frequency reaches <10kHz. If you wait for the full count requested to occur, the frequency is reported correctly indicating that this is not a hardware or pulse train related issue.
As I have established that it can accurately measure a pulse train 20nS accurately at rates my application needs as an upper boundry (several MHz). This hardware looks pretty robust, but I would call this a ābugā.
Workarounds that I have considered mean less accurate pulse measurements at low frequencies, or missing data reports so frequent that the funactionality of the measurement is severly compromised in an application that requires wide dynamic range and high precision at the low end.
I am happy to work with the folks at GHI to try to find a workaound or test alternate methods.
Most recent test code:
using System.Collections;
using System.Text;
using System.Threading;
using GHIElectronics.TinyCLR.Devices.Adc;
using GHIElectronics.TinyCLR.Devices.Gpio;
using GHIElectronics.TinyCLR.Devices.I2c;
using GHIElectronics.TinyCLR.Devices.Rtc;
using GHIElectronics.TinyCLR.Devices.Uart;
using GHIElectronics.TinyCLR.Native;
using GHIElectronics.TinyCLR.Pins;
using GHIElectronics.TinyCLR.Devices.Signals;
using GHIElectronics.TinyCLR.Devices.Gpio.Provider;
using GHIElectronics.TinyCLR.Devices.Pwm;
using GHIElectronics.TinyCLR.Devices.Usb;
using GHIElectronics.TinyCLR.Devices.UsbClient;
using System.Diagnostics;
using GHIElectronics.TinyCLR.Devices.Spi;
using System;
namespace PulseCounter20260
{
internal class Program
{
private Timer readPulseTimer;
private TimeSpan elapsed;
private Timer abortTimer;
private DateTime startTime;
private Boolean pulsesRead;
private AutoResetEvent pulseReadFinishedEvent;
static void Main()
{
var program = new Program();
program.Run();
}
private void Run()
{
pulseReadFinishedEvent = new AutoResetEvent(false);
elapsed = new TimeSpan();
startTime = DateTime.Now;
var digitalSignalPin = GpioController.GetDefault().OpenPin(SC20260.Timer.DigitalSignal.Controller2.PB3);
var digitalSignal = new DigitalSignal(digitalSignalPin);
var waitForEdge = true;
digitalSignal.OnReadPulseFinished += new DigitalSignal.PulseReadEventHandler(this.Digital_OnReadPulseFinished);
pulsesRead = true;
while (true)
{
digitalSignal.ReadPulse(1000000, GpioPinEdge.RisingEdge, waitForEdge);
Thread.Sleep(125);
digitalSignal.Abort();
}
}
private void Digital_OnReadPulseFinished(DigitalSignal sender, TimeSpan duration, uint count, GpioPinValue pinValue)
{
var ticks = duration.Ticks;
if (ticks > 0)
{
var microsecond = ((double)duration.Ticks) / 10;
var freq = (count / microsecond) * 1000000;
Debug.WriteLine((DateTime.Now - this.startTime).TotalMilliseconds.ToString() + "s, count " + count.ToString() + ", freq = " + (freq / 1000.0).ToString("F3") + " kHz");
}
else
{
Debug.WriteLine("No clock found. Event failed. Ticks = " + ticks.ToString() + ", count = " + count.ToString());
}
pulsesRead = true;
}
}
}
Could you add an issue so we know exactly issue?
Also, you always need to use CanReadPulse to check before readpulse.
while (true)
{
if ( digitalSignal.CanReadPulse) {
digitalSignal.ReadPulse(1000000, GpioPinEdge.RisingEdge, waitForEdge);
Thread.Sleep(125);
digitalSignal.Abort();
}
}
The issue may not that, but it will help narrow down problem
Please see the solution in the TinyCLR forum which I thought was a better place this topic.
https://forums.ghielectronics.com/t/digitalsignal-abort-function-fails-at-low-frequency/25798/13