Hi Bar,
I see you got the error code 0x3 (NRF_ERROR_INTERNAL) and line number 0x9c = 156, can you also check the file name? It is a ASCII string pointed to by p_file_name? Which function is called before the error check on that line?
If we assume that was nrf_twi_mngr_perform(), then this is likely set in twi_event_handler() (and propagated via transaction_end_signal() etc...). Can you debug and see what is the event type in twi_event_handler() in this case?
Hi Bar,
I see you got the error code 0x3 (NRF_ERROR_INTERNAL) and line number 0x9c = 156, can you also check the file name? It is a ASCII string pointed to by p_file_name? Which function is called before the error check on that line?
If we assume that was nrf_twi_mngr_perform(), then this is likely set in twi_event_handler() (and propagated via transaction_end_signal() etc...). Can you debug and see what is the event type in twi_event_handler() in this case?
Hi.
In the twi_event_handler I get p_event 0x2003ff24 which is type NRF_DRV_TWI_EVT_ADDRESS_NACK
with the *p_file_name I get to function read_lm75b_registers_cb, in the twi example
and in my project I the event in read_all_cb
They are both the callback function to the TWI transfer
see the struct here:
static nrf_twi_mngr_transaction_t NRF_TWI_MNGR_BUFFER_LOC_IND transaction =
{
.callback = read_all_cb,
.p_user_data = NULL,
.p_transfers = transfers,
.number_of_transfers = sizeof(transfers) / sizeof(transfers[0])
};
Does it mean that the response from the sensor, was abnormal?
When I check on the scope I just see the SCL go down but the SDA doesn't. Even if I disconnect it from the other side (maybe it pullup all time) I still get SDA high all time. I am using PCA10056 with SDA,SCL connect to P0.28, P0.27. what could block the I2C operate like this?
Bar.
Hi,
There are always pull-ups on TWI, both on clock and data.
Based on the event type, the slave NACKed (which is an error condition). That indicates that the data/command sent to the sensor might not be acceptable for some reason, which you might see by comparing with the MAX30205 datasheet. In that case it makes sense to use a logic analyzer so that you see what is actually happening.
The slave can do clock stretching if it is busy, holding SCL low. If not, it should be held high by the pullup when there is no ongoing transaction.