From 288d0f72eb6b8a11c00aa8c731af50a01fcf5646 Mon Sep 17 00:00:00 2001 From: iabdalkader Date: Thu, 25 Feb 2021 23:48:04 +0200 Subject: [PATCH 1/4] NANO: Reduce ISC I2C frequency to standard. --- src/omv/boards/NANO33/omv_boardconfig.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/omv/boards/NANO33/omv_boardconfig.h b/src/omv/boards/NANO33/omv_boardconfig.h index 5edb318cc..bb2ddb68c 100644 --- a/src/omv/boards/NANO33/omv_boardconfig.h +++ b/src/omv/boards/NANO33/omv_boardconfig.h @@ -104,7 +104,7 @@ #define ISC_I2C_ID (0) #define ISC_I2C_SCL_PIN (2) #define ISC_I2C_SDA_PIN (31) -#define ISC_I2C_SPEED (CAMBUS_SPEED_FULL) +#define ISC_I2C_SPEED (CAMBUS_SPEED_STANDARD) // I2C0 #define TWI0_ID (0) From 972dec4bbda529fee70d86e116e1bbb8816d813a Mon Sep 17 00:00:00 2001 From: iabdalkader Date: Thu, 25 Feb 2021 23:48:28 +0200 Subject: [PATCH 2/4] NANO: Define reset pin. --- src/omv/boards/NANO33/omv_boardconfig.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/omv/boards/NANO33/omv_boardconfig.h b/src/omv/boards/NANO33/omv_boardconfig.h index bb2ddb68c..1be88fdc9 100644 --- a/src/omv/boards/NANO33/omv_boardconfig.h +++ b/src/omv/boards/NANO33/omv_boardconfig.h @@ -125,7 +125,7 @@ // DCMI #define DCMI_PWDN_PIN (29) -//#define DCMI_RESET_PIN (30) +#define DCMI_RESET_PIN (30) #define DCMI_D0_PIN (32+2) #define DCMI_D1_PIN (32+3) From d4859f58a89284da9ab6bacc4d1554774548cc9a Mon Sep 17 00:00:00 2001 From: iabdalkader Date: Thu, 25 Feb 2021 23:48:55 +0200 Subject: [PATCH 3/4] NANO: Remove NO STOP from readb. --- src/omv/ports/nrf/cambus.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/omv/ports/nrf/cambus.c b/src/omv/ports/nrf/cambus.c index 88f67f32e..7601eeb1f 100644 --- a/src/omv/ports/nrf/cambus.c +++ b/src/omv/ports/nrf/cambus.c @@ -114,7 +114,7 @@ int cambus_readb(cambus_t *bus, uint8_t slv_addr, uint8_t reg_addr, uint8_t *reg nrfx_twi_enable(&bus->i2c); nrfx_twi_xfer_desc_t desc1 = NRFX_TWI_XFER_DESC_TX(slv_addr, ®_addr, 1); - if (nrfx_twi_xfer(&bus->i2c, &desc1, NRFX_TWI_FLAG_TX_NO_STOP) != NRFX_SUCCESS) { + if (nrfx_twi_xfer(&bus->i2c, &desc1, 0) != NRFX_SUCCESS) { ret = -1; goto i2c_error; } From eba6ad937d2cd5e9ca44e9558305c36166f40bb6 Mon Sep 17 00:00:00 2001 From: iabdalkader Date: Thu, 25 Feb 2021 23:49:57 +0200 Subject: [PATCH 4/4] NANO: Configure PDWN and RST in sensor_init --- src/omv/ports/nrf/sensor.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/omv/ports/nrf/sensor.c b/src/omv/ports/nrf/sensor.c index 367a7f6b8..aa11e9ea7 100644 --- a/src/omv/ports/nrf/sensor.c +++ b/src/omv/ports/nrf/sensor.c @@ -144,14 +144,6 @@ static int dcmi_config() _hrefPort = portInputRegister(digitalPinToPort(DCMI_HSYNC_PIN)); _pclkPort = portInputRegister(digitalPinToPort(DCMI_PXCLK_PIN)); - #if defined(DCMI_PWDN_PIN) - nrf_gpio_cfg_output(DCMI_PWDN_PIN); - #endif - - #if defined(DCMI_RESET_PIN) - nrf_gpio_cfg_output(DCMI_RESET_PIN); - #endif - return 0; } @@ -159,6 +151,16 @@ int sensor_init() { int init_ret = 0; + #if defined(DCMI_PWDN_PIN) + nrf_gpio_cfg_output(DCMI_PWDN_PIN); + DCMI_PWDN_HIGH(); + #endif + + #if defined(DCMI_RESET_PIN) + nrf_gpio_cfg_output(DCMI_RESET_PIN); + DCMI_RESET_HIGH(); + #endif + /* Do a power cycle */ DCMI_PWDN_HIGH(); mp_hal_delay_ms(10);