Home/Support/Support Forum/How can I measure the time between 2 events using the icapture function on the Xbee S3 programmable?

How can I measure the time between 2 events using the icapture function on the Xbee S3 programmable?

0 votes
Hello, I just want to get the time between to digital pulses. I read the help, but I couldn't figure out it.


This is the code that Im working. Thanks

#include <xbee_config.h>
#include <types.h>

unsigned int counter =0;

unsigned int number, captcount=0;


void main(void)
{
sys_hw_init();
sys_xbee_init();
sys_app_banner();

//Interruption Routine

icapture_config(icapture0, ICAPTURE_RISING, TRUE, 1000000); //icapture_config(xpin_t pin, uint8_t edge, bool_t enable, uint32_t max_u_secs)


/*icapture0 to trigger an interrupt on rising edges, expecting a maximum of 1 second between edges:
* */

for (;;) {

number = icapture_captcount_to_usec(icapture0, captcount);

sys_watchdog_reset();
sys_xbee_tick();
}
}
asked Jan 26, 2015 in DigiMesh Proprietary Mesh Networking by tonofre New to the Community (6 points)

Please log in or register to answer this question.

...