Hi guys!
I'm having a problem with sampling a signal using gpio. Hope you can help me.
I'm using as base the stack 1.4.0 and project Keyfob, I modified that project to have one HID service with one characteristic of measurement interval with a data of 2 bytes (uint16) as notification.
The program is currently posting in that characteristic the count of how many pulses I can count (every second) using interruption over port P0.7 as input for the signal. For different signals I'm having the following count results:
* For frequency of 10KHz with pulsewidth of 100ns: a count of 9,980 (approx)
* For frequency of 50KHz with pulsewidth of 100ns: a count of 48,900 (approx)
So as you can see, for higher frequencies the device can't catch all pulses and that seems very reasonable couse each pulse involves interruption from sleep and that takes time in which we could probably lose some pulses. Now, i'm thinking about not using interruption for the input port, but instead check directly the status of P0.7. Now, that involves to not sleep. So here comes the question:
How can I append (maybe) a "task" that can run with high priority that doesn't need an event to run, and sampling this input with the minimum error?
I'd really apreciate your help