I found 2 possible bugs while programming XIAO nRF52840, with Arfuino IDE (board "Seeed nFR52 boards, v1.1.1).
I connect a square signal in a digital input, then i increment a counter and measure time (micros) between 2 interruptions, to get the frequency.
1st bug: If i configure the interrupt as “RISING” the counter shows a correct value. But if a configure the interrupr as “FALLING” i got the counter is multiplied by two. So “FALLING” is performing as “CHANGE”. Crazy!
2nd bug: The time periods measured are weird. With a 50Hz signal, readings are changing between 20507 and 19530 (instead 20000). With a 100Hz signal, readings are changing between 10742 and 9766. It doesn’ matter the frequency, the measured values are oscillating between 2 values, that have a fixed gap close to 1000micros.
I put the code here:
I have retested everything in a Arduino BLE SENSE (that use same nrf) , and with this controller everything works as expected.
I am worried about this text in Seeed webpage: " …Both libraries support very well when it comes to the BASIC usage, such as Led, Digital, Analog, Serial, I2C, SPI"… Does it means that some things will work, and others will not?