Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
7 years, 11 months ago.
Halls effects and interrupts
I need to read the status of all three hall effect sensors whenever I see a transition(both rise and fall). I have tried various methods with InterruptIn but none of them seems to match the results that I am expect from looking at a scope. I have seen some older posts that read doesn't work with InterruptIn but they are pretty out of date.
I could just spawn a thread that reads(DigitalIn) them as fast as possible manually not worry about the interrupts at all.
Does any one have a good experience/method for read IO reliable?
Thanks, Seth
What kind of timing accuracy do you require?
posted by Erik - 14 Dec 2016I think I got 40ms period on the halls, but that could get shorter as the wheel goes faster. Right now I am not sure I am getting even correct results.
posted by Seth King 14 Dec 2016At such speeds InterruptIn should be more than fast enough. Can you show your relevant code (between
posted by Erik - 15 Dec 2016<<code>> and <</code>>
on seperate lines), the wrong result you get and what you expect from your scope?