For my project I need to measure the 'bouncetime' of a relay. My plan is to use the PULSIN-command which generates a timeout when a pulse is too long (the relay stopped bouncing). I will use this occurence to read out a second timer, that was started along with the PULSIN, to calculate te bouncetime.
Now, I realize that this second timer could exceed its full range before PULSIN generates a timeout. My thought was to use SETINFLAGS to monitor timer overflow and increase a variable that counts the number of overflows that occurred before PULSIN timed out.
However, the description of the command SETINTFLAGS states that only 1 input pattern is allowed at any time and I presume that PULSIN already uses timeroverflow interrupt. That means I couldn't use SETINFLAGS to monitor a second timer.
Is there a way to get around this problem? The bouncetime I'm going to measure is less then 15 msec and I'm using picaxe20x2.
Now, I realize that this second timer could exceed its full range before PULSIN generates a timeout. My thought was to use SETINFLAGS to monitor timer overflow and increase a variable that counts the number of overflows that occurred before PULSIN timed out.
However, the description of the command SETINTFLAGS states that only 1 input pattern is allowed at any time and I presume that PULSIN already uses timeroverflow interrupt. That means I couldn't use SETINFLAGS to monitor a second timer.
Is there a way to get around this problem? The bouncetime I'm going to measure is less then 15 msec and I'm using picaxe20x2.