How to set nRF52832 to do parallel input and output?

Nrf52832 I/O is from P0.00~P0.31, I want to use one of the I/O to do parallel input and output, how to set? For example, with P0.02~P0.17, these 16 I/O ports make a 16-bit input parallel port.

Another experiment was done today, if Bluetooth sends data (calling ble_nus_data_send function) timer240us into an interrupt is not accurate. If only the Bluetooth connection is successful and no data is sent, 40us is accurate. This is also a problem with other timers.Could you please help me find out what the reason is?

Please help resolve these problems, thanks!

Parents
  • If BLE is running, the CPU is switching between 32MHz RC clock and 32MHz XTAL clock. This generates jitter.

    You can switch the CPU to permanent using the XTAL clock. This will cost you 100uA more current.

    #include <zephyr/drivers/clock_control.h>
    #include <zephyr/drivers/clock_control/nrf_clock_control.h>
    static const struct device *const clock0 = DEVICE_DT_GET_ONE(nordic_nrf_clock);
    static void start_xtal32(void) {
    // run from XTAL clock
    (void) clock_control_on(clock0, CLOCK_CONTROL_NRF_SUBSYS_HF);
    }
Reply
  • If BLE is running, the CPU is switching between 32MHz RC clock and 32MHz XTAL clock. This generates jitter.

    You can switch the CPU to permanent using the XTAL clock. This will cost you 100uA more current.

    #include <zephyr/drivers/clock_control.h>
    #include <zephyr/drivers/clock_control/nrf_clock_control.h>
    static const struct device *const clock0 = DEVICE_DT_GET_ONE(nordic_nrf_clock);
    static void start_xtal32(void) {
    // run from XTAL clock
    (void) clock_control_on(clock0, CLOCK_CONTROL_NRF_SUBSYS_HF);
    }
Children
No Data
Related