flash.initialize() fails when powered from vIn... What ???

Started by VdesmedT, October 12, 2015, 06:33:56 AM

Felix

I don't know what to say .. it just works on my end, no issues with my FTDI adapter or with just a battery on VIN...
If you want to return your Moteino for investigation you are welcome to do so and I will compare yours with a vanilla Moteino.

VdesmedT

As I said, I'm pretty sure the Moteino is NOT the cause of the problem. I just found it weird I thought I made an obvious mistake that you or anyone with your skills might be able to point out. I will keep on investigate this and let you know when I found the issue..  pretty sure we will have a good laugh at the end  ;D

WhiteHare

#17
Did you ever discover the cause or a fix? 

I have just now run into what appears to be the exact same issue on a Moteino R4 with lowpowerlab's factory installed flash memory.  flash.initialize() returns true if I connect using the LowPowerLab FTDI connector but returns false if I don't use the FTDI connector and merely supply power through Vin using four fresh AA batteries in series (equals 6 volts).  Weird with a beard.

[Edit1: After the above, I upgraded to the most current version of lowerpowerlab's SPIFlash library, and the results are the same.  After running some very simple tests, flash memory does appear to not only initialize but also write and read correctly when connected using the FTDI.]

[Edit2: I tried the same thing with a different Moteino R4, and it was 100% reproducible on it as well.]

[Edit3:  I just now tried adding a 10K ohm resistor between D8 and 3.3V, as suggested by Felix above.  No change in results.]

[Edit4:  I just now upgraded to lowpowerlab's latest RFM69 library to see if that might help at all.  Nope.  No change in results.]

[Edit5: Here's the first real clue.  If I power the Moteino from the FTDI by *only* connecting the Vin and Gnd wires, then it's the same as if I powered it with a battery, and I get the same derailed results.  So.. Now I'll try hooking up additional wires until I find the one that makes it work again.]

WhiteHare

#18
The answer is: connecting DTR on the Moteino R4 to DTR on the LowPowerLab FTDI allows the flash memory to initialize.

WTF?

[Edit: Hooking up the FTDI's Tx to the Moteino's Rx doesn't "fix" the issue.  Neither does hooking up the FTDI's Rx to the Moteino's Tx.  Only hooking DTR to DTR "fixes" the issue.  However, that's obviously not much of an option if I want to initialize the flash memory when I'm running the Moteino by battery.  So... at least on the face of it, it looks like an electrical problem of some kind.]

WhiteHare

Solution: wiring the Moteino R4's DTR pin to ground solves the problem.

TomWS

Quote from: WhiteHare on February 01, 2016, 03:48:42 PM
Solution: wiring the Moteino R4's DTR pin to ground solves the problem.
If you search the forum for "DTR to ground" you will find a number of references to this phenomenon, eg, https://lowpowerlab.com/forum/index.php/topic,961.msg7606.html#msg7606

Tom

Felix

I tried it again, I still can't reproduce this. The radio will initialize with or without battery on my end. I just used a blinky with different blink rates depending on FLASH init result.