Search the Community
Showing results for tags 'Millis()'.
I am trying to detect the width of a pulse signal (that should be anywhere from 1ms to 20ms wide) using two ISRs on the MSP430G2553. One ISR is triggered by the rising edge, and the other by the falling edge. The first ISR reads micros() and stores the value in a variable called Time1. The second ISR reads micros() and stores the value in a variable called Time2. The pulse width of the signal is equal to Time2-Time1. The problem is, Time1 and Time2 always end up being equal, even though they are read in two different ISRs on two separate signal edges-- this should be impossible. Any