nmit.201
Newbie level 2
Hi,
I have interfaced a pressure sensor which outputs a pulsed output whenever it senses any pressure.(Sensor output is amplified and is compared against a reference voltage and then fed to micro controller)
Sensor is fairly simple, and I have connected this to interrupt pin on LPC1768. I have configured it as an input pin with edge trigger enabled.
But I see number of counts counted inside the interrupt wrong. It is over counting these pulses and I am unable to find the reason for this, even after adding a small debounce for about 10ms this situation remains. Always count is higher than what it was supposed to be.
On a negative edge trigger ISR, Interrupts are disable, pending interrupts cleared, and a hardware timer is used as debounce which re-enabled back interrupt after debounce time.
Saw the output on a oscilloscope and pulses looks correct.
Any pointers?
Regards, Manjunath
I have interfaced a pressure sensor which outputs a pulsed output whenever it senses any pressure.(Sensor output is amplified and is compared against a reference voltage and then fed to micro controller)
Sensor is fairly simple, and I have connected this to interrupt pin on LPC1768. I have configured it as an input pin with edge trigger enabled.
But I see number of counts counted inside the interrupt wrong. It is over counting these pulses and I am unable to find the reason for this, even after adding a small debounce for about 10ms this situation remains. Always count is higher than what it was supposed to be.
On a negative edge trigger ISR, Interrupts are disable, pending interrupts cleared, and a hardware timer is used as debounce which re-enabled back interrupt after debounce time.
Saw the output on a oscilloscope and pulses looks correct.
Any pointers?
Regards, Manjunath