Go Down

Topic: Standalone DUE, ie- w/o USB connections. Sometimes - ERASE at Power Down?? (Read 495 times) previous topic - next topic

danwahl

THE ANSWER:
Ok, first more explanation of the environment:
I have deleted the DUE 3V3 regulator and the two Thermal Resisters on the USB +5v inputs.
I did this so that I could embed the DUE on another circuit board, it is actually soldered down
with pins. The power supplies are independent DIN rail units which run from the 120v line.
{so what is happening?}
I put a scope on the +5, the +3v3, and the ERASE signal.
When turned off the +5 drops first thus removing the power from the 16R2. When the power
dives the 16R2 issues an ERASE pulse. The +3v3 which powers the SAM remains high for about
400ms. So as far as the SAM is concerned it has received an ERASE command.
{what does this mean for the rest of the world}
Well maybe nothing other than a warning, BUT in the DUE the +5v powers the +3v3 regulator.
So the +5 must drop first. Depending on the load current for the +3v3 the +3.3 could remain
around for enough time so that the above scenario could occur. I don't have another DUE
to check this out at the moment. SO BEWARE. If the conditions I have identified are sufficiently
close in margin - this flaw could be out in the wild on some DUE or in some situations where
power supplies are connected as I have.
------------------------
AN update 0.4 - To clarify: When the DUE fails to run after power off/on try this:
Reload the sketch - Hold Reset button while turning off power and wait a few seconds.
Turn power on. The DUE should work if my suspicion is correct.
Holding Reset while power down prevents the SAM from doing anything including
running the Flash ERASE sequence.
------------------------
AN update 0.3 - After some time running the problem re appears!
All you guys that have had "reset" problem or have added caps to the reset switch etc,...
Beware that the real problem may be this:
[the operational theory at the moment is: sometimes the ERASE command from the
ATMEGA 16U2 acting as the USB interface issues a spurious ERASE at Power-Down!]
I suspect that the method of noticing 1200 baud connection at the programming port
and then issuing Reset and Erase prior to uploading the complied code, is flawed.
What may be happening is that at Power Down the 16U2 is somehow confused and
creates the ERASE. This could be electronic problem or firmware. Not sure.
===It would be nice if someone would join me in the pursuit===
------------------------
AN update 0.2 - This morning the code behaves,... system was off all night, might this be
some purely electronic issue? Others have reported similar behavior.
--Does anyone know about a DUE test program to exercise the board? --
------------------------
AN update 0.1 - I have a suspicion that what is happening is that the DUE is being Erased,....
------------------------
Greeting DUEers!

I have an urgent problem with a DUE project.

I have used the DUE in several embedded projects and it works well.
Each of the projects I have done prior used the USB port as the main
communication device routinely.

In this current design I want the DUE to power up and operate without
either of the USB ports being used to communicate.
ie- actually not connected to the DUE via either USB port.

In this design I want to communicate with another single board computer
via the Serial1 port.
This works well when I am in the development mode and the programming
port is connected.

However,  when I disconnect the USB programming port and cycle the
power, the program does not communicate
via Serial1. It seems that the USB port must initiate the boot process
and then goto void setup().
Or is it some type of electronic reset issue? I don't know.

What am I missing? How can I get the void setup() to run at power up
time without any USB connected?
thanks

Below is a stripped down version of my code.
--------------------------------------------------
#include <stdio.h>

boolean stringComplete  = false;
char inputString [80];
int stridx;

#define PORT Serial1
#define EVENT serialEvent1
//#define PORT Serial
//#define EVENT serialEvent

void Printf(char*s) {
  PORT.print(s);
}

void setup() {
  char buf[80];

  PORT.begin(19200);
  //
  sprintf(buf, "Alive!\n");
  Printf(buf);
   while (!PORT) { // the presence of this while loop is not the problem
    ;
   }
}

void loop()
{
  int  cnt;
  char buf[80];

  if (stringComplete)
  {
    Printf(inputString);
    stridx = 0;
    stringComplete = false;
  }
}

void EVENT() {
  while (PORT.available()) {
    inputString[stridx++] = (char)PORT.read();
    inputString[stridx] = (char)0;
    if (inputString[stridx - 1] == '\n') {
      stringComplete = true;
    }
  }
}



Go Up