Pages: [1]   Go Down
Author Topic: Assert reset from LabView...  (Read 808 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi, I have an Arduino Due, using it as an Sram tester...I know when the serial monitor is invoked it asserts reset (~100ms). I am trying to figure out the control to accomplish this reset in LabView (with serial monitor closed).

What command or pin assertion accomplishes this? I have been trying through trial & error with no luck so far.

Otherwise having fun with it!
Logged

0
Offline Offline
Shannon Member
****
Karma: 221
Posts: 12710
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Have you tried the RESET pin?
Logged

[ I won't respond to messages, use the forum please ]

White River Junction, Vermont USA
Offline Offline
Full Member
***
Karma: 5
Posts: 106
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

You could monitor an available input pin, and trigger this routine in your code.

The hardware reset pin will always work though (and is probably a better choice)....

Code:
//key to allow software reset in RSTC_CR
const int RSTC_KEY = 0xA5;

// **** Z ****
// required parameters: none         // Software reset the processor
// Note: This will also terminate the current socket connection.
void Z_Reset_Processor(){
  DBG_PRINTLN("RESET command received from client.  Rebooting NOW!");
  RSTC->RSTC_CR = RSTC_CR_KEY(RSTC_KEY) | RSTC_CR_PROCRST | RSTC_CR_PERRST;
  while (true);
}

-Chris
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks, I know I can use the reset pin, but I am looking for a software solution (the pins I was referring to was dtr, cts etc.). The above function works (thanks!), but as the note says, it breaks the connection.

The basic question is; how does the arduino software assert reset? I was hoping someone could save me the trouble of rooting through the arduino source code.

Thank you.
Logged

Canada
Offline Offline
Sr. Member
****
Karma: 14
Posts: 450
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Check the schematic ... the "MASTER-RESET" signal is connected to both the SAM3X and the ATMEGA16U2-MU ... the ATMEGA will break your connection. Looks like a hardware modification is required.

Curious if your using the NI-VISA component to communicate to the serial port or a DLL function. I've had success with LabVIEW using FTDI's D2XX DLL for communication.
« Last Edit: January 24, 2014, 12:02:41 pm by dlloyd » Logged

Disclaimer: I sometimes implement the infinite monkey theorem when composing a reply.

Pages: [1]   Go Up
Jump to: