Go Down

Topic: How can i measure 0.5 micro second pulse width with pulse in function (Read 1 time) previous topic - next topic


Hello all
I need to measure a pulse width up to .5 micro second resolution im using the below code

Code: [Select]
int pin = 7;
unsigned long duration;

void setup() {
  pinMode(pin, INPUT);

void loop() {
  duration = pulseIn(pin, HIGH);
See also

I tried using arduino uno, STM32F103C8T6, and Lolin NodeMCU ESP8266 CP2102  all are giving resolution of 1 micro second, and there is an error of +- 2 micro second

i have heard STM32F103C8T6, and Lolin NodeMCU ESP8266 CP2102 are faster than uno.. so it should give much higher accuracy right? but in my case all are same

can anyone help?


Go Up