Author Topic: Moteino will not run until reset has been jumped with ground  (Read 13335 times)

TomWS

  • Hero Member
  • *****
  • Posts: 1930
Re: Moteino will not run until reset has been jumped with ground
« Reply #15 on: February 02, 2017, 08:03:33 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

  • Administrator
  • Hero Member
  • *****
  • Posts: 6866
  • Country: us
    • LowPowerLab
Re: Moteino will not run until reset has been jumped with ground
« Reply #16 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.
« Last Edit: February 02, 2017, 08:53:38 AM by Felix »

joelucid

  • Hero Member
  • *****
  • Posts: 868
Re: Moteino will not run until reset has been jumped with ground
« Reply #17 on: February 02, 2017, 08:32:54 AM »
Quote
the '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

  • Administrator
  • Hero Member
  • *****
  • Posts: 6866
  • Country: us
    • LowPowerLab
Re: Moteino will not run until reset has been jumped with ground
« Reply #18 on: February 02, 2017, 08:52: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

  • Hero Member
  • *****
  • Posts: 873
  • Country: gb
Re: Moteino will not run until reset has been jumped with ground
« Reply #19 on: February 02, 2017, 09:02:12 AM »
I thought this was sort of covered in this thread, and that no attempt would be made to access the flash if it wasn't detected as fitted:
https://lowpowerlab.com/forum/rf-range-antennas-rfm69-library/(rfm69-library)-initialize-function-always-returns-true/msg16566/#msg16566
Mark.

joelucid

  • Hero Member
  • *****
  • Posts: 868
Re: Moteino will not run until reset has been jumped with ground
« Reply #20 on: February 02, 2017, 09:17:28 AM »
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

  • Hero Member
  • *****
  • Posts: 873
  • Country: gb
Re: Moteino will not run until reset has been jumped with ground
« Reply #21 on: February 02, 2017, 09:29:12 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

  • Hero Member
  • *****
  • Posts: 1930
Re: Moteino will not run until reset has been jumped with ground
« Reply #22 on: February 02, 2017, 09:32:32 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

  • Hero Member
  • *****
  • Posts: 873
  • Country: gb
Re: Moteino will not run until reset has been jumped with ground
« Reply #23 on: February 02, 2017, 09:42:35 AM »
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

  • Hero Member
  • *****
  • Posts: 868
Re: Moteino will not run until reset has been jumped with ground
« Reply #24 on: February 02, 2017, 10:01:33 AM »
Quote
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.

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

  • Administrator
  • Hero Member
  • *****
  • Posts: 6866
  • Country: us
    • LowPowerLab
Re: Moteino will not run until reset has been jumped with ground
« Reply #25 on: February 02, 2017, 10:04:40 AM »
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

  • Hero Member
  • *****
  • Posts: 873
  • Country: gb
Re: Moteino will not run until reset has been jumped with ground
« Reply #26 on: February 02, 2017, 10:12:52 AM »
Ah, sorry Joe. I was thinking this was a simple power-up blinky thing. Maybe worth eliminating the bootloader too...
Mark.

joelucid

  • Hero Member
  • *****
  • Posts: 868
Re: Moteino will not run until reset has been jumped with ground
« Reply #27 on: February 02, 2017, 10:30:03 AM »
Quote
Maybe 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

  • NewMember
  • *
  • Posts: 10
  • Country: us
Re: Moteino will not run until reset has been jumped with ground
« Reply #28 on: February 09, 2017, 04:51:28 PM »
@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

  • Administrator
  • Hero Member
  • *****
  • Posts: 6866
  • Country: us
    • LowPowerLab
Re: Moteino will not run until reset has been jumped with ground
« Reply #29 on: February 10, 2017, 07:24:03 AM »
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).