how can i use the internal WD-function | Arduino Compatible Compiler for LabVIEW Discussions | Forum

Avatar
Please consider registering
guest
sp_LogInOut Log In sp_Registration Register
Register | Lost password?
Advanced Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
sp_Feed Topic RSS sp_TopicIcon
how can i use the internal WD-function
August 12, 2015
7:46 am
Avatar
Adrian
Guest
Guests

Hello,

is there any possibility to use the watchdog in ATmega328P (arduino uno R3)?

Is the WD activated in the LabVIEW Arduino Compiler?

I hope that anybody can help me.

Many thanks.

Adrian

September 22, 2015
11:18 am
Avatar
Adrian
Guest
Guests

Hey,

i would like to restart an Arduino when an error occur. I thought, that i can use the WD function for that as a solution but I couldn't find a way how to do that.

Is there an other methode to restart an Arduino?

Many thanks,

Adrian

September 22, 2015
3:58 pm
Avatar
filipealtoe
Admin
Forum Posts: 98
Member Since:
March 12, 2015
sp_UserOfflineSmall Offline

Hello;

The Arduino Watchdog function hasn't been ported to the Compiler as an API VI. 

Here it is an alternate way to do what you need but it would require a small HW addition to the Arduino board. 

http://www.instructables.com/i.....-software/

Then you can use the Digital API to set the pulse that will reset the board to the corresponding pin.

 

Filipe

Cheers
Filipe

September 22, 2015
4:39 pm
Avatar
Steffan
Admin
Forum Posts: 408
Member Since:
March 12, 2015
sp_UserOfflineSmall Offline

Two other solutions for you that involve software only:

1) You could use one of the software reset methods found online (like in Step 2 of Filipe's link).  This is a similar ASM instruction:

asm volatile ("  jmp 0");

To wrap this in a LabVIEW API you could simply create a user library (see Porting an Arduino Library to LabVIEW section of user manual).  You would create a single VI for reset and place the above code in the Translator.vi for that VI.  Refer the the Template example as well for this approach.

2) Another easy approach would be to just wrap your entire top level VI in a while loop and just check your error condition inside of that, and on error, you finish your main code/loop and then the outside loop will start your main code over again.

October 6, 2015
11:09 am
Avatar
Adrian
Guest
Guests

Thank you very much for reply. It works fine! I use the Hardware-Reset solution.

Forum Timezone: UTC 0
Most Users Ever Online: 100
Currently Online:
15
Guest(s)
Currently Browsing this Page:
1 Guest(s)
Top Posters:
miche91: 33
scottj: 28
scadao: 23
Member Stats:
Guest Posters: 5
Members: 202
Moderators: 0
Admins: 3
Forum Stats:
Groups: 1
Forums: 2
Topics: 266
Posts: 1222
Newest Members:
pujacontrol
Administrators: geadmin: 22, filipealtoe: 96, Steffan: 356