Moteino will not run until reset has been jumped with ground

Started by sharkhat, February 01, 2017, 12:35:38 PM

TomWS

Quote from: perky on February 02, 2017, 07:36:58 AM
There is another possibility. The SPI of the 328P is used for programming as well as a master SPI when programmed. There is no pull-up on SCK, and could be sampled low when power is applied. That might put it into programming mode. However there's a pull-up on RST and both have to be sampled low so it might not be an issue. Trying a pull-up on SCK might yield something though.
Mark.
Good suggestion, Mark!


Felix

@sharkhat - can you try perky's suggestion of pulling up SCK and see if that makes a difference?
How about pulling up SS (D10)?
Any other progress on this from your end?
I am open to suggestions.

joelucid

Quotethe 'boot' LED never flashes until I temporarily ground DTR pin

Given that you mention 'boot' here I just looked at DualOptiboot. It seems there could be an issue: CheckFlashImage disables the watchdog before doing its thing. But then there is a potential endless loop in there when sending the SPIFLASH_STATUSWRITE command.

As I see it this could easily hang the 328p if the flash device id reads back as something other than 0 or 255 - which could happen with no flash attached.

Joe

Felix

Quote from: joelucid on February 02, 2017, 08:32:54 AM
As I see it this could easily hang the 328p if the flash device id reads back as something other than 0 or 255 - which could happen with no flash attached.
True, but why do I never see this?
I think a value other than 0/255 is caused by a noisy environment. In which case I would rather pull-up SS (D10).

perky


joelucid

Quote
True, but why do I never see this?
I think a value other than 0/255 is caused by a noisy environment. In which case I would rather pull-up SS (D10).

If you don't have a slave and you're reading spi don't you just get a sampling of the noise on miso? Seems to me that you would have to probe for a specific address rather than not 0 or ff to be sure you've got soneone to talk to. Regardless of D10.

perky

Quote from: joelucid on February 02, 2017, 09:17:28 AM
If you don't have a slave and you're reading spi don't you just get a sampling of the noise on miso? Seems to me that you would have to probe for a specific address rather than not 0 or ff to be sure you've got soneone to talk to. Regardless of D10.
See above post Joe, that uses the return value written to REG_SYNCVALUE1.
Mark.

TomWS

Quote from: joelucid on February 02, 2017, 08:32:54 AM
As I see it this could easily hang the 328p if the flash device id reads back as something other than 0 or 255 - which could happen with no flash attached.
Good sleuthing, Joe.  It seems a pullup on MISO would solve this problem.

Tom

perky

Anyway, this problem appears to be flash independent because it seems to happen with just the simple blinky sketch. I wait with interest for the result of the SCK pullup test.. ;)
Mark.

joelucid

QuoteAnyway, this problem appears to be flash independent because it seems to happen with just the simple blinky sketch. I wait with interest for the result of the SCK pullup test.. ;)
Mark.

No Mark, the code I mentioned is in the bootloader and gets executed on any watchdog reset. I'm not quite clear how this would happen on a simple power-up, but there are possible paths, e.g. Bootloader runs and uses a wdt reset to start app.

In any case this would explain why I never see the issue - given that I use a different bootloader.

So yeah - let's have a sck pull-up and a miso pull-up test.

Joe

Felix

Just did another test with 20x Moteino + RFM95 LoRa (no FLASH), powered from 2xAA (3.2v) via GND-VIN, nothing else attached, programmed with the RF95_client sketch from my RadioHead.zip (RF95_server as receiver), see moteino.com LoRa support page for link to zip.

Result: all nodes transmit to the receiver, never a glitch.

perky

Ah, sorry Joe. I was thinking this was a simple power-up blinky thing. Maybe worth eliminating the bootloader too...
Mark.

joelucid

QuoteMaybe worth eliminating the bootloader too...

Definitely if the OP has an ISP. Or maybe Tom could try it given he does see the issue. I sure think it would be valuable to cure the Reset angst. Would pay off quickly too considering all the tpl5010 Tom wouldn't need going forward ...  ;)

sharkhat

Quote from: Felix on February 02, 2017, 08:23:50 AM
@sharkhat - can you try perky's suggestion of pulling up SCK and see if that makes a difference?
How about pulling up SS (D10)?
Any other progress on this from your end?
I am open to suggestions.

I will try the pull up resistors.
So I am fairly new to this, when you suggestion 'pulling up' SCK you mean, to put a resistor between SCK(pin 13) and 3.3v, and then another wire from SCK to ground?

Felix

Quote from: sharkhat on February 09, 2017, 04:51:28 PM
So I am fairly new to this, when you suggestion 'pulling up' SCK you mean, to put a resistor between SCK(pin 13) and 3.3v, and then another wire from SCK to ground?
10K from SCK to VCC (3.3V).