I'm not very certain on how to do this. I have isolated the issue down to the interrupt signals never reading a high value. The data ready interrupt, watermark interrupt (on byte level) and FIFO full interrupt are all stuck at ground and never update. If I set these values to a high value, the sensor will read a temp and pressure value but it will never change. I am still using the example code above for reading temp data. Is there any common reason that this could be occuring. The only file I changed from the given driver files was the common.c file to remove the coines platform utilization (it is not compatible with the nrf chip). This is my updated bmp3_i2c_read function: BMP3_INTF_RET_TYPE bmp3_i2c_read(uint8_t reg_addr, uint8_t *reg_data, uint32_t len, void *intf_ptr)
{
uint8_t dev_addr = *(uint8_t*)intf_ptr;
ret_code_t ret_code;
ret_code = nrf_drv_twi_tx(&m_twi, dev_addr, ®_addr, 1, false);
if(ret_code != NRF_SUCCESS)
{
return ret_code;
}
ret_code = nrf_drv_twi_rx(&m_twi, dev_addr, reg_data, len);
if (ret_code == NRF_SUCCESS)
return BMP3_INTF_RET_SUCCESS;
else
return 1;
} and this is my write function: BMP3_INTF_RET_TYPE bmp3_i2c_write(uint8_t reg_addr, const uint8_t *reg_data, uint32_t len, void *intf_ptr)
{
uint8_t dev_addr = *(uint8_t*)intf_ptr;
ret_code_t ret_code;
ret_code = nrf_drv_twi_tx(&m_twi, dev_addr, reg_data, len, false);
if (ret_code == NRF_SUCCESS)
return BMP3_INTF_RET_SUCCESS;
else
return 1;
} Additionally, I had to update the bmp3_interface_init function to the following: BMP3_INTF_RET_TYPE bmp3_interface_init(struct bmp3_dev *bmp3, uint8_t intf){
ret_code_t err_code;
const nrf_drv_twi_config_t twi_config = {
.scl = 27,
.sda = 26,
.frequency = NRF_DRV_TWI_FREQ_100K,
.interrupt_priority = APP_IRQ_PRIORITY_HIGH,
.clear_bus_init = false
};
err_code = nrf_drv_twi_init(&m_twi, &twi_config, NULL, NULL);
APP_ERROR_CHECK(err_code);
nrf_drv_twi_enable(&m_twi);
//****************************
int8_t rslt = BMP3_OK;
if(bmp3 != NULL){
/* Bus configuration : I2C */
if (intf == BMP3_I2C_INTF){
NRF_LOG_INFO("I2C Interface\n");
dev_addr = BMP3_ADDR_I2C_PRIM;
bmp3->read = bmp3_i2c_read;
bmp3->write = bmp3_i2c_write;
bmp3->intf = BMP3_I2C_INTF;
}
bmp3->delay_us = bmp3_delay_us;
bmp3->intf_ptr = &dev_addr;
}
else{rslt = BMP3_E_NULL_PTR;}
return rslt;
} I am sure that my hardware settup is correct because when I run the same code using an arduino bootloader for the nrf chip0, I am able to get the correct temp reading with no issues, using the same starter code and settup. I am just incapable of puttin the chip into low power/sleep mode using the arduino bootloader. Thnak you for your time and help, this has been a very frustrating issue.
... View more