jbentham / uwb

Ultra-Wideband ranging tests
Apache License 2.0
6 stars 7 forks source link

dw1000_ranging.py closes after resetting positive reset pin #2

Open skweesel opened 3 years ago

skweesel commented 3 years ago

Hello,

I'm trying to test this repo with the UWB Click from Mikroe . I've wired this board to the raspberry pi (RPi) exactly as instructed in spi_server.py with one exception. The board from Mikroe has no negative reset pin (NRST) so this connection is omitted. I believe this is consequential as stated in the associated article:

I have provided a positive-going reset signal (RESET) and negative-going (NRST). This is because my early hardware had a transistor inverter in the reset line, so needed a positive-going signal. If you are connecting the RPi pin direct to the module, use the NRST signal. [And in case you’re wondering, I realise that the RPi mustn’t drive the module reset line high; my software does not do this, it drives the line low to reset, or lets it float.

Two RPis are running spi_server.py. The IP address for each RPi was copied to dw1000_ranging.py that runs on a third machine on the same network as the two RPi. When dw1000_ranging.py is run, it soon closes with this logged in console:

Connected to 192.168.1.86:1401 Connected to 192.168.1.184:1401 No interrupt from unit 1

And in console log on the first unit (192.168.1.86) I see: SPI_SERVER v0.13 Listening on UDP port 1401 Device ID: FF FF FF FF FF Reset pin 22

dw1000_ranging is exiting after this performing if not dw1.test_irq() on line 75 in dw1000_ranging.py . Can you help me understand what test_irq() does? Can you help me understand what the function check_irq() does in dw1000_regs.py? If this issues is as a result of not having a NRST pin to connect, is there a way to still work with this?

Thanks for the very detailed article. It was very enlightening.

jbentham commented 3 years ago

There are 2 main possibilities; either you haven't connected the IRQ line, or you have the wrong polarity of reset signal.

The UWB-click schematic shows there is no inversion in the RST line, it is directly connected to the module RSTn pin, so it should use the NRST output from my code.

Jeremy Bentham

On 26/04/2021 05:36, skweesel wrote:

Hello,

I'm trying to test this repo with the UWB Click from Mikroe https://www.mikroe.com/uwb-click . I've wired this board to the raspberry pi (RPi) exactly as instructed in spi_server.py with one exception. The board from Mikroe has no negative reset pin (NRST) so this connection is omitted. I believe this is consequential as stated in the associated article:

I have provided a positive-going reset signal (RESET) and
negative-going (NRST). This is because my early hardware had a
transistor inverter in the reset line, so needed a positive-going
signal. If you are connecting the RPi pin direct to the module,
use the NRST signal. [And in case you’re wondering, I realise that
the RPi mustn’t drive the module reset line high; my software does
not do this, it drives the line low to reset, or lets it float.

Two RPis are running spi_server.py. The IP address for each RPi was copied to dw1000_ranging.py that runs on a third machine on the same network as the two RPi. When dw1000_ranging.py is run, it soon closes with this logged in console:

|Connected to 192.168.1.86:1401| |Connected to 192.168.1.184:1401| |No interrupt from unit 1|

And in console log on the first unit (192.168.1.86) I see: |SPI_SERVER v0.13| |Listening on UDP port 1401| |Device ID: FF FF FF FF FF| |Reset pin 22|

dw1000_ranging is exiting after this performing |if not dw1.test_irq()| on line 75 in dw1000_ranging.py . Can you help me understand what test_irq() does? Can you help me understand what the function |check_irq()| does in dw1000_regs.py? If this issues is as a result of not having a NRST pin to connect, is there a way to still work with this?

Thanks for the very detailed article. It was very enlightening.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/jbentham/uwb/issues/2, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACNUSERWERI5CBVFIZIAZOTTKTUTPANCNFSM43SCE7PQ.

skweesel commented 3 years ago

I connected the RST pinout on the UWB Click board to the designated NRST pinout on the RPi (pinout 16 on the RPi). When I started spi_server.py I got my first hint of success: SPI_SERVER v0.13 Listening on UDP port 1401 Device ID: FF 30 01 CA DE

The device ID was no longer just FF FF FF FF FF. With spi_server.py running, running dw1000_ranging.py on another machine resulted in the following in console logs: Connected to 192.168.1.86:1401 Connected to 192.168.1.184:1401 150.232 153.886 150.045 153.619 150.884 152.141 ...

Success! It works! This is exactly the issue and solution mentioned in the article:

If you are connecting the RPi pin direct to the module, use the NRST signal.

I thought the breakout board (from OSH Park) used there had both a RST and a NRST pinout. On a closer inspection that breakout board only has a RST pinout. The RST pinout on the breakout board was connected to NRST (pinout 16) on the RPi

Thank you so so much for your help. Greatly appreciated!