Sujet : Re: Need help with PI PICO...
De : dave (at) *nospam* davehigton.me.uk (David Higton)
Groupes : comp.sys.raspberry-piDate : 27. Mar 2024, 12:59:01
Autres entêtes
Organisation : Home
Message-ID : <0b542d485b.DaveMeUK@BeagleBoard-xM>
References : 1 2 3 4 5 6 7 8 9
User-Agent : Messenger-Pro/8.03 (MsgServe/8.01) (RISC-OS/5.29) NewsHound/v1.54
In message <
uu0rh5$2pcls$1@dont-email.me>
The Natural Philosopher <
tnp@invalid.invalid> wrote:
I am slightly curious as to how the PICO could miss what is a several
hundred microsecond wide pulse.
AFAICS there are many pitfalls:
1) An interrupt can be being serviced, so the pulse is over before you
get to see it.
2) If you're looking for a pulse, you should be looking edge triggered
rather than level triggered, but even then you may not get to react to
the edge immediately because of an interrupt being serviced, so you'd
get an anomalous result.
3) You can look level triggered, but you need to turn off all interrupts
to ensure you really are loking at it in real time.
4) I had a play with an ultrasonic ranger a couple of years or so ago.
I couldn't understand why I wasn't getting any return pulses at all.
I eventually realised that I was sending another start pulse before
the current cycle had finished.
Regardless, you need an escape from any and every potential infinite
loop. Whatever you're doing.
If you can use a hardware timer in the chip, that's a much more reliable
solution.
David