Arduino Due reset

Hello I am working with LCD TFT screen and I want to reset Arduino Due when I click on reset button on screen. I am using asm volatile (" jmp 0"); but it is not working on Arduino Due

void software_Reset()
// Restarts program from beginning but 
// does not reset the peripherals and registers
{
  asm volatile ("  jmp 0");  
}

The command window says:

C:\Users\Nejc\AppData\Local\Temp\ccI1xdnX.s: Assembler messages:
C:\Users\Nejc\AppData\Local\Temp\ccI1xdnX.s:1361: Error: bad instruction jmp 0' C:\Users\Nejc\AppData\Local\Temp\ccI1xdnX.s:6004: Error: bad instruction jmp 0'

Thank you for your help.

I want to reset Arduino Due when I click on reset button on screen.

Why? Software reset is NOT the same as a hardware reset, and is rarely the correct solution.

Yes the best way would be a hardware reset, but the LCD will be in a box, so clicking on a button won't be possible :confused:

Use a hardware reset. I tested this and it works ok. Use a jumper from the reset socket to D8. Press 'r' on the serial monitor resets the Due.

void setup() {
  // put your setup code here, to run once:
  Serial.begin(115200);
  Serial.println("Setup");
}

void loop() {
  // put your main code here, to run repeatedly:

  if(Serial.available())
  {
    char ch = Serial.read();

    if(ch == 'r') pinMode(8, OUTPUT);
  }
}

but the LCD will be in a box, so clicking on a button won't be possible :confused:

If the LCD is in a box, how will the users see it? How will they interact with it?

If you meant that the Arduino will be in a box, with the LCD mounted to the box, there is NO reason you can't bring the reset switch out, too.

SufferTim thank you :slight_smile: did you use a resistor with jumper wire or directly into reset socket?
PaulS, how would you do that, so it would look esthetic? Thank you for answers :slight_smile:

I connected the sockets directly with a jumper wire. The reset circuit is held HIGH with a resistor.

There is one problem :confused: the reset socket is taken by LCD shield :confused:

There is one problem :confused: the reset socket is taken by LCD shield :confused:

Completely impossible.

The LCD screen will have to share. There is another way to connect to the reset circuit. There is a reset pin on the SPI connector in the center of the board.