Sujet : Re: Need help with PI PICO...
De : news-1513678000 (at) *nospam* discworld.dascon.de (Michael Schwingen)
Groupes : comp.sys.raspberry-piDate : 24. Mar 2024, 14:31:48
Autres entêtes
Message-ID : <slrnv00aq4.524.news-1513678000@a-tuin.ms.intern>
References : 1 2 3
User-Agent : slrn/1.0.3 (Linux)
On 2024-03-23, The Natural Philosopher <
tnp@invalid.invalid> wrote:
My choice tree is between the GPIO out signal never being received by
the ultrasonic module, or the GPIO in signal is being missed by the Pi
PICO on account of possibly some interrupt masking its appearance until
it is too late and its gone low again.
Or there never is a signal on the module output. You should write your code
to cope with such problems - sample code/libraries often skips the error
handling, but that does not mean *you* can if you want reliable operation.
Hook up an oscilloscope or logic analyzer to check what is the case. A
cheap 8-channel USB logic analyzer is a great tool to have around when
working bare metal:
https://www.aliexpress.com/item/1005005993277484.htmlUsing the Saleae software on these is *not* allowed by the license, but
sigrok/pulseview work great:
https://sigrok.org/We are running bare metal-ish here.
Back in the day I would have used a chip emulator with hardware break
points.
And a cost of hundreds of thousands.
Nowadays, you would use a SWD debugger, since the debug/emulation logic is
already integrated in the RP2040!
Something like the JTAG Hat on a Raspberry PI:
https://www.schwingen.org/jtag-hat/or any SWD probe supported by OpenOCD (FTDI, CMSIS-DAP work fine), like the
Raspberry Pi Debug Probe (which works for the RP2040, but lacks reset
signals and support for voltages other than 3.3V):
https://www.raspberrypi.com/documentation/microcontrollers/debug-probe.htmlThat sets you back about 20€, and gives you instant breakpoint/single step
operation with full view of registers and memory contents.
cu
Michael
-- Some people have no respect of age unless it is bottled.