Hello Nordic community,
I'm working on a project using the nRF5340DK where I need to achieve precise control over three GPIOs with the following specifications:
- P0.07: Generate a 1 MHz continuous clock, toggling every 500 ns.
- P0.12 (pulse): Set HIGH for 500 ns on the 1st, 3rd, 5th, etc., rising edges of the P0.07 clock.
- P0.28 (rst_tdc): Set HIGH for 500 ns on the 2nd, 4th, 6th, etc., rising edges of the P0.07 clock.
The sequence is controlled using GPIOTE for toggling, TIMER for timing, and DPPI for coordination, and the operation is triggered by a Bluetooth command "02" from MATLAB.
However, when the sequence starts, I encounter a "Division by Zero" error, and the system halts. Here are the error details:
Here is my code:
Could anyone help point out what might be going wrong or suggest how to correctly configure the TIMER, GPIOTE, and DPPI for this type of operation? Any advice on debugging strategies for this kind of error would also be greatly appreciated.
Thank you!