I2C Slave with power saving

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

I2C Slave with power saving

Jump to solution
1,138 Views
frank-lin-Sunon
Contributor II

Hi, 
I am using LPC802 and trying to use it as an i2c slave device.
I had already build a project with out power saving and work good.
But when i trying to let it go into power-down mode, it works strange.
Is there any sample for me to study?

attach file is the code i'm using.

Labels (2)
0 Kudos
1 Solution
1,063 Views
frank-lin-Sunon
Contributor II

I change the code to 

LPC_SYSCON->BODCTRL = 0;
PowerDown();
LPC_SYSCON->BODCTRL |= 1 << 4;
 
and everything runs good.

View solution in original post

0 Kudos
4 Replies
1,064 Views
frank-lin-Sunon
Contributor II

I change the code to 

LPC_SYSCON->BODCTRL = 0;
PowerDown();
LPC_SYSCON->BODCTRL |= 1 << 4;
 
and everything runs good.
0 Kudos
1,119 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

Hi frank-lin-Sunon 

I2C slave can wake up Power Down mode. We need to make sure I2C interrupt is enabled.

Regarding to demo code. Under MCUXpresso SDK, there is  power_mode_switch_lpc. This demo doesn't include exact I2C wakeup. the demo wakeup sources are :

1. PB3,wakeup key

2. Wkt timer

3. PB2, reset key

You can refer them are reference.

 

Have a nice day,

Jun Zhang

 

0 Kudos
1,115 Views
frank-lin-Sunon
Contributor II

I had try using gpio wake up from power-down mode and delay about 10ms to get i2c signal.
It can wake up, but often return nack at address or all 0 bit when master try to read data (never work).

What setting do i have to do to let i2c can wake up mcu in power-down mode?

I had read the code of AN12125 and surprise it didn't include power saving.

0 Kudos
1,110 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

Hi frank-lin-Sunon 

Please make sure you follow the right process before enter power down mode. especially configure FRO as main clock

ZhangJennie_0-1641888156563.png

 

besides, please also make sure if you well configure I2C as wake up

ZhangJennie_1-1641888237276.png

 

when checking, use logic analyzer to measure I2C clock and data, if there is correct signal there.

Hope this helps,

Jun Zhang

 

0 Kudos