02-16-2012 11:06 AM
I am getting an error 5002 when I try to run the very simple code below. I am trying to send a pwm to an Arduino pin, but it's not even initializing the board correctly. I read some forums that said to increase the timing rate in the init.vi and I increased it first to 1000 and then to 2000, no success.
The forums also said to make sure the baud rate is the same across the board. I noticed the Serial.begin(19200) in the firmware sketch and I changed the baud rate in my code to 19200, no success. The arduino shows up fine in my device manager and it also shows up fine in the labview measurement & automation thing. The only weird thing is that the arduino stopped showing up in my arduino serial port menu after a while.
Any suggestions or ideas?
02-16-2012 12:23 PM
What board type are you using?
If its an Uno you want to set that to 115200 if you are using a mega the default is 9600
02-16-2012 12:50 PM
Also make sure you download the latest update. It fixed all my problems.
Create a COM and Board Type constant also with your baud.
02-18-2012 02:49 PM
I'm using the Mega 2560. I know I have to change the baud rate in the code (which is the 19200 in the pic above). I changed it to 9600, but where else do I have to change the baud rate?
02-18-2012 02:51 PM
I think I have the latest updates...I just downloaded everything in January.
How do I create a COM constant? And I thought the board type thing I have in my code is a board type constant...is it not?
02-18-2012 03:29 PM
I have updated my software, I changed the baud rate to 9600 in MAX, the code, the vi, and the windows device manager, I increased the timeout...I don't know what else to do.
When we run the vi, the LED labelled L blinked twice, then the tx and rx pins started blinking rapidly, then the LED labelled L blinked twice again. I have tried to follow the advice I've seen on other threads, but nothing is working. Although I have not tried to do any hardcore editing of the init.vi itself
02-18-2012 06:12 PM
This is where the problem is within the Init.vi. I have no idea what this means or how to solve it...
02-20-2012 09:16 AM
There was also a february update which fixed the 5002 error for most people. If you have that one and are still seeing this issue post back.
02-21-2012 07:45 AM
I updated all of my software and I'm still having that issue. I set the baud rate to 19200 in the windows device manager, max, and the init.vi (because that's what the Serial.begin is using in the firmware). I increased my timeout to 5000.
Any ideas?
02-21-2012 09:24 AM
The baud rate in the firmware should by default be set here:
#if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__)
#define DEFAULTBAUDRATE 9600 // Defines The Default Serial Baud Rate (This must match the baud rate specifid in LabVIEW)
#else
#define DEFAULTBAUDRATE 115200
#endif
so if you have a Mega its 9600 or if you have anything else its 115200. Not sure where you are seeing the 19200 rate.