Author Topic: Waking ULPDelay(INFINITE) in loop() - From RADIO onCallbacks - No Pin waste  (Read 11230 times)

johncohn

  • RFduino Newbie
  • *
  • Posts: 8
  • Karma: +0/-0
    • View Profile

All,
   Love the Lazarus idea.. Tried the code and it works great.. i can wake the device out of deep sleep with a BTL connect.. and I can put it back into the deep sleep afterwards. The wystery though is that when I measure the current draw.. it doesn't seem to go down at all.   
From this code frag:
...

Code: [Select]
void setup() {
...
  Serial.begin(9600);

  RFduinoBLE.advertisementData = "ledbtn";

  // start the BLE stack
  RFduinoBLE.begin();
}

...

void loop()
{
  if (sleeping) {
    Serial.println("RFduino LOOP going to sleep forever");
    RFduinoBLE_ULPDelay(INFINITE);
  }
  if (Lazarus.lazarusArising()) {
    Serial.println("Lazarus has awakened!");
    Serial.println("");
  }
}

...
// when BLE_onConnect occurs
void RFduinoBLE_onConnect() {
  Serial.println("Connected");
  sleeping = false;
  Lazarus.ariseLazarus(); // Tell Lazarus to arise.
}


i can put the rfduino to sleep and wake it.. .. eg. here's my serial output

RFduino LOOP going to sleep forever
Connected
Lazarus has awakened!


..(Complete code is attached)


Everything seems to be functioning as expected (eg.. I'm driving LED strips.. and they work fine.. I can control them from my little homebrew cordova app on IoS.  ..turn them on, turn them off, put the device back into sleep..

I'm running the device from a 3.7V lipo battery with a 0.6v dropping diode. When I measure the quiescent current  of the device before sleep, during sleep and after waking it.. they seem almost identical.. within a very few couple of milliamps of 25mA either way .(much higher when I'm actually driving the light strips, of course)

SO .. why isn't the thing really going into  ultra low power mode ? I'm looking for 4-5 uA at that point.. right .. not 25mA..
any help much  appreciated !

-jc
« Last Edit: March 15, 2015, 10:37:58 PM by tolson »

tolson

  • Global Moderator
  • *****
  • Posts: 844
  • Karma: +19/-0
    • View Profile
    • Thomas Olson Consulting
Hi John,
Just a thought...
How is your circuit wired? Is the quiescent current you're measuring just t the RFduino itself, or also some other part of the rest of the circuit. The WS2811 draws some current even with no LEDs lit driven.

masterhost

  • RFduino Newbie
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
Hi everybody,  I just wondering if the LAZARUS library is compatible or can be compatible with GZLL library?  Thanks.

tolson

  • Global Moderator
  • *****
  • Posts: 844
  • Karma: +19/-0
    • View Profile
    • Thomas Olson Consulting
When using the Lazarus Library concept on Simblee you have to change the buried pin away from GPIO31. The Simblee has exposed all the GPIO pins now, except a couple. One being GPIO31 which they are now using to attenuate the Antenna. You might still be able to use it, but it may mess with the attenuator. This needs looking into. To be sure not to interfere just use a different GPIO that isn't being used.


« Last Edit: July 07, 2016, 02:33:55 PM by tolson »

kursatu

  • RFduino Newbie
  • *
  • Posts: 8
  • Karma: +0/-0
    • View Profile
Does lazarus really work with Simblee?
I couldn't get it to work and filed an issue at this git repo.
https://github.com/OpenHAK/lazarus
I recall that it was working with RFDuino.