⚠️
Hi there.. thanks for coming to the forums. Exciting news! we’re now in the process of moving to our new forum platform that will offer better functionality and is contained within the main Dialog website. All posts and accounts have been migrated. We’re now accepting traffic on the new forum only - please POST any new threads at//www.xmece.com/support. We’ll be fixing bugs / optimising the searching and tagging over the coming days.
4 posts / 0 new
Last post
Gerbers
Offline
Last seen:1 year 9 months ago
Joined:2017-10-30 22:11
Wakeup on i2c interrupt

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:
IM_Dialog
Offline
Last seen:1 month 2 weeks ago
Joined:2016-12-06 22:25
Hi Gerbers,

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

Oz
Offline
Last seen:2 years 5 months ago
Joined:2018-10-11 07:20
Hi,

Hi,

How did you configure your device as an i2c slave?

Regards,

Gerbers
Offline
Last seen:1 year 9 months ago
Joined:2017-10-30 22:11
Oz? From Australia? Anyway,

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);

}