Problem to communicate an Arduino and Industruino IND. I / O

Hello everyone.

I have a problem when trying to communicate the Industruino IND. I / O , with an Arduino MEGA .

I am using the serial communication , in the case of Industruino I use the expansion port IDC , the pins D0 / RX and D1 / TX . While in the arduino mega pins RX1 / TX1.

The problem is I can not read in the Industruino the data sends the arduino mega, I can only send.

Below I leave the two programs:

Industruino:

typedef uint8_t SOCKET;
#include <SPI.h>
#include <Ethernet.h>
#define W5500_ETHERNET_SHIELD
#include <Indio.h> 
#include <Class_define.h> 
#include <Wire.h> 
#include <UC1701.h>

int incomingByte = 0;   

void setup() {
    Serial.begin(9600);   
   Serial1.begin(9600);

}

void loop() {

       incomingByte = Serial1.read();

      Serial.print("He recibido: ");

      Serial.println(incomingByte, DEC);

       incomingByte=0;
      delay(2000);
}

Arduino Mega:

void setup()
{
   
    Serial.begin(9600);
    Serial1.begin(9600);
    delay(500);
}

void loop()
{
   Serial1.write("B");

  delay(2000); 

}

If exchange programs , it works correctly .

Any help is received, greetings .

 

 

José Luis Torres Andrade
José Luis Torres Andrade
7
| 2 1 1
Asked on 3/1/16, 5:43 PM
0
vote
2931 Views

Dear José Luis, are you connecting the GND line of the Arduino Mega to the GND line on the IDC connector? The MCU section is galvanically isolated from your main power supply so you need to make sure the GND's of the two systems are tied together.

Loic De Buck
on 3/2/16, 4:50 PM

Dear José Luis, are you connecting the GND line of the Arduino Mega to the GND line on the IDC connector? The MCU section is galvanically isolated from your main power supply so you need to make sure the GND's of the two systems are tied together.

Loic De Buck
on 3/2/16, 4:51 PM

Hi Loic, thanks for answer me. Yes, each device is connected GND Rx(Arduino Mega) -- Tx (Industruino) Tx(Arduino Mega) -- Rx(Industruino) GND(Mega) -- GND (IDC Conector Industruino)

José Luis Torres Andrade
on 3/2/16, 4:59 PM

Your answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

Ask a Question

Keep Informed

About This Forum

This community is for professionals and enthusiasts of our products and services.

Read Guidelines

Question tools

21 follower(s)

Stats

Asked: 3/1/16, 5:43 PM
Seen: 2931 times
Last updated: 3/2/16, 4:59 PM