Hello,
I would like to have the DA14580 sleep until interrupted by the i2C bus. I have configured the device as an i2c slave. However, when I enable extended sleep mode, the peripheral appears not to work. (the interrupt does not work).
I'm not sure if this information helps, but I'm using the Barebone project as a template.
thanks
Device:
Hi Gerbers,
Before entering sleep mode you will need to configure the pin(s) you want to use to wake the DA14580. Take a look at section 8.50 in the following (and reference the associated code) for more information about sleep/wake:
https://support.dialog-semiconductor.com/system/files/restricted/UM-B-05...
You can find some useful background information about sleep modes in the following document:
https://support.dialog-semiconductor.com/system/files/restricted/Trainin...
Best regards
IM_Dialog
Hi,
How did you configure your device as an i2c slave?
Regards,
Oz? From Australia? Anyway, Here it is. Cheers.
void i2c_slave_init(void) // I2C Slave Initialization
{
SetBits16(CLK_PER_REG, I2C_ENABLE, 1); // enable clock for I2C
SetWord16(I2C_ENABLE_REG, 0x0); // Disable the I2C controller
SetWord16(I2C_CON_REG, I2C_SPEED); // 100khZ , SLAVE MODE
SetWord16(I2C_RX_TL_REG, RX_PACKET_THRESHOLD); // Generate interrupt when qty (RX_PACKET_THRESHOLD) bytes received
// SetWord16(I2C_ENABLE_REG, 0x1); // Enable the I2C controller
NVIC_DisableIRQ(I2C_IRQn);
SetWord16(I2C_INTR_MASK_REG,(M_RX_FULL| M_RD_REQ)); // Disable all interrupts accept RX_FULL and RD_REQ.
NVIC_SetPriority(I2C_IRQn, 3);
// NVIC_ClearPendingIRQ(I2C_IRQn);
// NVIC_EnableIRQ(I2C_IRQn);
// NVIC_ClearPendingIRQ(I2C_IRQn);
}