Hi all I am new to Mbed and programming in general, I am working on a little project where I am using a counter to calculate the time between pulses. TimerStop is assigned to a digital input pin and on reciving a logic high the counter will stop.
I am currently dividing the counter value by the clock frequency to work out the time but it doesn’t seem quite as it should be.
The question is how many cycles will it take to increment the timer?
Any help would be appreciated
Gary
hear is the code:
for (Timer=0; Timer <=Tmax; Timer++) {
if (TimerStop)
device.printf("%d\n", Timer);
break;
}
Hi all I am new to Mbed and programming in general, I am working on a little project where I am using a counter to calculate the time between pulses. TimerStop is assigned to a digital input pin and on reciving a logic high the counter will stop.
I am currently dividing the counter value by the clock frequency to work out the time but it doesn’t seem quite as it should be.
The question is how many cycles will it take to increment the timer?
Any help would be appreciated
Gary
hear is the code:
for (Timer=0; Timer <=Tmax; Timer++) { if (TimerStop) device.printf("%d\n", Timer);
break; }