This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CC2541: cc2541 cannot get into pm3 when it advertise data per scond

Part Number: CC2541

Hi:

There are some problems abount power consumtion in my new application(setting cc2541 advertising period 1s  and get accleration by MMA8451 before advertising ,  update the advertise data right away),

    It can work normally that get accleartion and advertise per second,but it takes more than 1.7mA during the cc2541 releax time (i nedd to under 1mA even  less)

it's my PCB design: 

In order to realizing my dest , there are some changes base on SimbleBLEPeripheral demo:

project define in Options:

INT_HEAP_LEN=3072
HALNODEBUG
OSAL_CBTIMER_NUM_TASKS=1
xHAL_AES_DMA=TRUE
HAL_DMA=TRUE
POWER_SAVING
xPLUS_BROADCASTER
HAL_LCD=TRUE
xHAL_LED=FALSE
HAL_UART=FALSE

including:

1) change the ADVERTISING INTERVAL       #define DEFAULT_ADVERTISING_INTERVAL          1600

2)change adverData[]

static uint8 advertData[] =
{
 
  0x08,  
  GAP_ADTYPE_MANUFACTURER_SPECIFIC,  //FF
  0x05,
  0,
  0,
  0, 
  0,
  0,
  0,
/*  
  // Flags; this sets the device to use limited discoverable
  // mode (advertises for 30 seconds at a time) instead of general
  // discoverable mode (advertises indefinitely)
  0x02,   // length of this data
  GAP_ADTYPE_FLAGS,
  DEFAULT_DISCOVERABLE_MODE | GAP_ADTYPE_FLAGS_BREDR_NOT_SUPPORTED,
*/
  // service UUID, to notify central devices what services are included
  // in this peripheral
  0x03,   // length of this data
  GAP_ADTYPE_16BIT_MORE,      // some of the UUID's, but not all
  LO_UINT16( SIMPLEPROFILE_SERV_UUID ),
  HI_UINT16( SIMPLEPROFILE_SERV_UUID ),

};

3: add two new fun in SimpleBLEPeripheral_Init():       a) InitBorad();    b) Initiic();

void InitBorad( void )
{
  CLKCONCMD &= ~0x40;                           
  while(CLKCONSTA & 0x40);                     
  CLKCONCMD &= ~0x47;                          
 
}
void Initiic( void )
{

  I2CWC &= ~0x80;      
  P2IF = 0;           
  HalI2CInit(HAL_I2C_SLAVE_ADDR_DEF, i2cClock_33KHZ);
  HalI2CWriteReg(0x2a,0x01); 
  HalI2CWriteReg(0x2b,0x1F);
}

4: add a new priod_event in SimpleBLEPeripheral_ProcessEvent

static uint32 sBp_adv_periodic_process_evt_period = 1000;  
uint16 SimpleBLEPeripheral_ProcessEvent( uint8 task_id, uint16 events )
{
  if ( events & SBP_ADV_PERIODIC_PROCESS_EVT )
  {        
    EA = 0; 
    PeriodicTask();
    EA = 1;    
    advertData[3] = accbuf[0];           
    advertData[4] = accbuf[1];           
    advertData[5] = accbuf[2];           
    advertData[6] = accbuf[3];          
    advertData[7] = accbuf[4];           
    advertData[8] = accbuf[5];          
    
    GAP_UpdateAdvertisingData(simpleBLEPeripheral_TaskID,   
                              TRUE,  
                              sizeof(advertData),  
                              advertData );             
  
    osal_start_timerEx( simpleBLEPeripheral_TaskID, SBP_ADV_PERIODIC_PROCESS_EVT, sBp_adv_periodic_process_evt_period ); 
           
    return (events ^ SBP_ADV_PERIODIC_PROCESS_EVT);    
  }
   ........ 
}

    ps: external fun

void PeriodicTask( void )
{ 
  int Offset;
  accbuf[0] = HalI2CReadReg(0x01);     
  accbuf[1] = HalI2CReadReg(0x02);      
  Offset=(accbuf[0]<<8)|accbuf[1];             
  Offset>>=4;                       
  accbuf[2] = HalI2CReadReg(0x03);
  accbuf[3] = HalI2CReadReg(0x04);
  Offset=(accbuf[2]<<8)|accbuf[3];              
  Offset>>=4;   
  accbuf[4] = HalI2CReadReg(0x05);
  accbuf[5] = HalI2CReadReg(0x06);
  Offset=(accbuf[4]<<8)|accbuf[5];              
  Offset>>=4;                        
}

 I really hope someone can help me to do my issure,Thank you all.