I'm using an NRF8001 with an ATMEL ATMEGA 328P (the microcontroller from an Arduino). I need the microcontroller to go to sleep, but still allow the BLE chip to advertise and wake the microcontroller upon connection. It seems as though the BLE chip should advertise (after calling BTLEserial.pollACI()) while the microcontroller is sleeping, but this is not the case. Is this possible? If so how? Thanks in advanced.
void sleepNow(){
set_sleep_mode(SLEEP_MODE_PWR_DOWN);
sleep_enable();
attachInterrupt(0,ADAFRUITBLE_RDY, LOW); //Pin 2 is interrupt
sleep_mode();
sleep_disable();
detachInterrupt(0);
}
void loop() {
BTLEserial.pollACI();
digitalWrite(7,HIGH); //Flashes an LED
delay(1000);
digitalWrite(7,LOW);
sleepNow();
}