LowPowerLab Forum

Hardware support => Moteino => Topic started by: jdsmith89 on September 26, 2016, 06:13:01 PM

Title: Poblem w/battery power
Post by: jdsmith89 on September 26, 2016, 06:13:01 PM
I'm a relative beginner, and I have a beginner question. I'm trying to power my Moteino R4 from a battery (running the "Blink" sketch from the Programming Guide: https://lowpowerlab.com/programming/). The sketch/board operate just fine when plugged into my FTDI board and powered via USB (which also means the GND, 3V, RX, TX and DT pins are connected). But when I try to power the board from a 3.7V LiPo battery or an AC adapter, the Blink sketch runs only intermittently.

My wiring looks like Felix's suggestion in this thread: https://lowpowerlab.com/forum/moteino/moteino-usb-cannot-power-from-battery-(solved-broken-battery-wire)/msg4329/#msg4329, I've tried several different batteries, an AC adapter (at 4.5V, 6V, 9V), several different wires, I've verified continuity on the wires and battery, and I've tried the FTDI side's VIN/Ground pins as well as the "regular" VIN/Ground pins. I own two Moteinos and see the same behavior on both. I've also measured the output voltage from the 3.3V pin, and I'm reading 3.3V even when the sketch doesn't appear to be running (when I write "sketch doesn't run", I mean the light isn't blinking). It seems like the board is getting power from the battery/AC adapter, but the sketch only seems to run occasionally.

One more test/result: since the FTDI mode seems to work consistently, I tested various combinations of the GND/3V/TX/RX/DTR pins, and if the GND, 3V and DTR pins are connected to the Moteino (FTDI board is connected to my PC via USB), the sketch seems to run properly. If I disconnect the DTR pin and leave the GND and 3V pins connected (after momentarily disconnecting the 3V pin to cycle power), the sketch doesn't run. If I reconnect the DTR pin (and cycle power via disconnect/reconnect 3V), the sketch runs properly again. Same behavior on both boards, and it doesn't matter if the TX/RX pins are connected or disconnected. To summarize, if GND, 3V and DTR are connected between my FTDI board and the Moteino, success. If the DTR pin isn't connected, the sketch doesn't appear to run.

Any suggestions? Or additional info I could share?
Title: Re: Poblem w/battery power
Post by: TomWS on September 26, 2016, 06:49:49 PM
Try just grounding the DTR pin to the GND pin of the Moteino FTDI connector  (pins 1 & 6, without FTDI cable attached).  A clip lead will be ok for this test.

Tom
BTW, this 'fix' apparently is not needed in Michigan...
Title: Re: Poblem w/battery power
Post by: jdsmith89 on September 26, 2016, 07:34:42 PM
Thanks. Same results...the sketch doesn't run/runs very intermittently (like 5-10% of the time). Tested it on both boards.

Curious what happens if you all run the Blink sample "as-is" from the Programming Guide on a Moteino R4 with no extra flash from a battery and w/o the DTR pin connected (in Michigan).

I stripped the Blink sketch line by line until I got it to run consistently. Seems to be related to flash. The


  if (flash.initialize())
    Serial.println("SPI Flash Init OK!");
  else
  {
    Serial.println("SPI Flash Init FAIL! (is chip present?)");
    LEDTIME = 100;
  }


block in setup() (really, the flash.initialize()) and these two lines from the loop()


  word jedecid = flash.readDeviceId();
  Serial.println(jedecid, HEX);


seem to be the culprits in my case. If I pull/comment those lines, the Blink sample runs 100% of the time - on both of my boards - when connected to battery or AC or the FTDI board.
Title: Re: Poblem w/battery power
Post by: Felix on September 27, 2016, 08:25:54 AM
What about trying to pull up D8 and D10?
I would be interested in finding out exactly what's going on.
I do test the boards with some standard test sketches that verify the transmission and the SPIFlash. So if this had happened on my end, I would have seen the symptoms right away.
Title: Re: Poblem w/battery power
Post by: TomWS on September 27, 2016, 08:44:44 AM
Quote from: Felix on September 27, 2016, 08:25:54 AM
What about trying to pull up D8 and D10?
I would be interested in finding out exactly what's going on.
I do test the boards with some standard test sketches that verify the transmission and the SPIFlash. So if this had happened on my end, I would have seen the symptoms right away.
It might be a bad solder joint on the flash or in one of its signal paths.  That could show up connected during test, but could open intermittently.

Tom
Title: Re: Poblem w/battery power
Post by: jdsmith89 on September 27, 2016, 11:25:20 AM
Thanks for the suggestions; I appreciate your help. I'll pull up D10 and D8 and see if that changes anything.
Title: Re: Poblem w/battery power
Post by: Felix on September 27, 2016, 11:40:21 AM
The other option is for me to debug it and try reproduce the problem, you'd have to ship it back to me. If there's a problem with the board I'd fix or replace it, I'd do that service at no cost to you. But to avoid delays and the hassle, let's try whatever we can before we do that.
Title: Re: Poblem w/battery power
Post by: jdsmith89 on September 28, 2016, 11:51:26 PM
Thanks, Felix. I'm traveling for a few days. I'll test the pull up ASAP, but it might be a few days.