Arduino debugging using visual Macro

hi friends, did anyone tried arduino code debugging with atmel studio and visual macro.

Did you have a Programming question?

yes i want to test the example programs given in arduino library

Test or debug ? All the ones I have tried worked using the Arduino IDE.

actually, i want to test the serial software example given in arduino library, in program we r making 10, 11 pins of arduino as rx and tx pins, using this pins i want to send at commands to gsm module.

I have found that the simplest way to test SoftwareSerial is to use a second Arduino which is also running it. Send some data from Arduino 1 to Arduino 2 using SoftwareSerial to send and receive it and output the data received by Arduino 2 to the normal Serial monitor window.

Thanks, can you please tell me the connections,

How to connect the arduino1 to arduino2 and at the same time how to do simultaneous program.

You need 2 programs. One to send data, the other to receive data.

In both programs import the SoftSerial library, create an instance of SoftSerial like this

#include <SoftwareSerial.h>

SoftwareSerial mySerial(10, 11); // RX, TX

In both setup() functions set the SoftwareSerial speed like this  mySerial.begin(4800);

Connect pin 10 on each Arduino to pin 11 on the other one.
Now you can print from one Arduino to the other like this  mySerial.println("Hello, world?");and receive it on the other one like this

  if (mySerial.available())
  {
    Serial.write(mySerial.read());
  }

This will output the data received on SoftSerial to the serial monitor on the receiving Arduino. You will, of course need to begin the normal serial interface with the baud rate that you want to use.

Once this works you can improve the receiving code considerably but get the basics working first.

Thank u. It is working. :)

This program is working for only software serial pins of arduino. if i connect 10,11 pins of one arduino to tx, rx pins of other arduino board, then my serial monitor is unable to print.(iam getting some garbage values).

My actual task is to make communication between hardware serial pins and software serial pins.

This program is working for only software serial pins of arduino. if i connect 10,11 pins of one arduino to tx, rx pins of other arduino board, then my serial monitor is unable to print.(iam getting some garbage values).

But, no code, and your not telling us which Arduino is talking to the Serial Monitor.

You can't expect one Arduino to talk to the other and to the Serial Monitor using the one hardware serial port.

This is the code

Arduino1(tx):

#include <SoftwareSerial.h>

SoftwareSerial mySerial(10, 11); // RX, TX

void setup()
{
Serial.begin(9600);
Serial.println(“Goodnight moon!”);
mySerial.begin(4800);
delay(1000);
mySerial.println(“Hello, world?”);
}

void loop() // run over and over
{
mySerial.println(“Hello, world?”);
}

Code for Arduino2:(rx)

#include <SoftwareSerial.h>

SoftwareSerial mySerial(10, 11); // RX, TX

void setup()
{
Serial.begin(9600);
Serial.println(“Goodnight moon!”);

mySerial.begin(4800);
delay(1000);
}

void loop() // run over and over
{
if (mySerial.available())
Serial.write(mySerial.read());
delay(100);
}

i connected both 10 and 11 pins as u said, i got the output in arduino2(rx) serial monitor.

Now my doubt is if i connect ardunio1(tx) 10 and 11 pins to hardware serial pins of arduino2 tx and rx , iam unable to get the output.

if i connect ardunio1(tx) 10 and 11 pins to hardware serial pins of arduino2 tx and rx , iam unable to get the output.

Unable to get what output where? If you mean that you can’t use the hardware serial port on Arduino 2 to talk to Arduino 1 AND the serial monitor application, well, that is to be expected.