UART Problem on Arduino 101

Discussion in 'UDOO X86' started by ElCarl, Apr 23, 2018.

  1. ElCarl

    ElCarl New Member

    Joined:
    Apr 23, 2018
    Messages:
    3
    Likes Received:
    0
    A project I am working on requires communication between an external Arduino Uno board and the Arduino 101-compatible chip on the UDOO x86. The Uno is using all of its GPIO pins, so I cannot use SPI or I2C without a redesign & loss of functionality.
    As such, I have been trying to use serial to communicate, with the Uno transmitting with Serial and the UDOO's Arduino receiving on Serial1.
    However, all calls to Serial1.available() return 0, and data cannot be read. I know that the Uno is working correctly, since the data can be read from it with SoftwareSerial. Just in case, I have also set the onboard chip to connect a SoftwareSerial instance on pins 2 & 3 directly to pins 1 & 0 and transmit, but Serial1 still does not read anything.
    Here is the code I have been using to test with it connected to itself from SoftwareSerial to Serial1:
    Code:
    #include <SoftwareSerial.h>
    
    SoftwareSerial soft(2, 3);
    
    void setup() {
        Serial.begin(9600);
        Serial1.begin(19200UL);
        soft.begin(38400UL);
    
        while (!Serial);
    }
    
    void loop() {
        soft.print("test");
        if (Serial1.available()) {
            Serial.println("Data: ");
            Serial.println(Serial1.read());
        }
        else {
            Serial.println("No data");
        }
        delay(500);
    }
    Is there anything obvious that I have missed, or any good documentation on the UDOO's Arduino UART connections?
    As a fallback I can use the SoftwareSerial library, but given that Serial1 should be available, I'd rather not if possible due to the drawbacks of SoftwareSerial.
     
  2. waltervl

    waltervl UDOOer

    Joined:
    Dec 12, 2015
    Messages:
    2,314
    Likes Received:
    580
    Why do you format the baud rate value (extension UL)? I have never seen that before.

    For Softwareserial it is known to be troublesome. Also there is a special Curie Softwareserial menu entry in the Arduino IDE. Did you use that one?
     
  3. ElCarl

    ElCarl New Member

    Joined:
    Apr 23, 2018
    Messages:
    3
    Likes Received:
    0
    The UL suffix is to designate it as an unsigned long - on reflection definitely not necessary, but I was getting desperate!
    As far as I can tell, SoftwareSerial is not the issue in this case, since the onboard Arduino is able to receive data using the SoftwareSerial, but the limited baudrate of SoftwareSerial (along with the issues with disabling interrupts) make it unsuitable for the project which has a fairly high throughput of data.
    Am I misunderstanding something, or should the Serial1 object work properly with the UDOO x86 (Advanced+, in case that matters)?
     
  4. waltervl

    waltervl UDOOer

    Joined:
    Dec 12, 2015
    Messages:
    2,314
    Likes Received:
    580
    There is no reason why the Serial1 object should not work on the Arduino 101 of an Udoo X86.
    You did crosswire the lines? So Tx Arduino Uno goes to Rx of Arduino 101 and vice versa?

    It could be that Arduino 101 is sending 3.3V signals that the 5V Arduino Uno is not understanding.... So it could need a level converter
     
  5. ElCarl

    ElCarl New Member

    Joined:
    Apr 23, 2018
    Messages:
    3
    Likes Received:
    0
    Yes, the lines are crosswired, both when testing from the Uno to the 101 and on the 101 self-test.
    There is no transmission from the 101 to the Uno, the Uno is the only transmitter between the two. I have tried both with a level converter between them and without (since the Arduino 101 is stated to be 5 V tolerant for logic input), unfortunately neither works.
    If someone has access to an UDOO x86, could they try running the sketch given in the first post? It would hopefully let me know whether I've got a hardware or a software issue!
     

Share This Page