Hello community,
I have been recently working with AFE4490 sensor from protocentral (breakout board).
Previously I have ported multiple sensors for my hobby projects and never faced any issue but I am not able to initialize the registers with this sensor in nrf52840.
Here are few things I trieD:
1. I evaluated this sensor with ESP32 C3 module and the sensor LED turns ON after succesful intialization.
2. Ported the C++ code base to nrf52840 SPI peripheral example code and description is mentioned below:
3. Used SPI pin as mentioned below:
4. Initialization routine for SPI is mentioned below:
nrf_drv_spi_config_t spi_config = NRF_DRV_SPI_DEFAULT_CONFIG;
spi_config.miso_pin = AFE_MISO_PIN;
spi_config.mosi_pin = AFE_MOSI_PIN;
spi_config.sck_pin = AFE_SCK_PIN;
spi_config.ss_pin = AFE_CS_Pin;
spi_config.frequency = NRF_DRV_SPI_FREQ_8M;
APP_ERROR_CHECK(nrf_drv_spi_init(&afe_spi, &spi_config, afe_spi_event_handler, NULL));
nrf_gpio_cfg_output(AFE_MOSI_PIN);
nrf_gpio_cfg_output(AFE_SCK_PIN);
nrf_gpio_cfg_output(AFE_CS_Pin);
nrf_delay_ms(300);
Original working Arduino write function mentioned below:
m more focused on register initialiozation. Once its success then I will proceed further with reading of SPo2 and heart rate values.
I am not sure where I am going wrong, I tried changing the modes to Mode 0,1,2,3 but nothing works. Its been a week now. Requesting somebody to help me on this.
Thank you.