Go Down

Topic: Arduino Leonardo troubles reading from Serial1 (Read 11649 times) previous topic - next topic

ectar

I think I have some breakthrough ! Apparently FTDI module I have doesn't work properly, even It use to work with other setup before ! :(
I've connected it to Prolic USB/COM adapter and data is coming through.... I was so positive module is ok

ectar

Nope... still messy, now I get something over serial, but what I send not what I receive over Serial1 (COM3), instead of 1 I receive g and so on....
When I switch Putty to work with Serial (COM8) it works perfect....(same settings just different COM port) WTH !? :(

nickgammon

Please post technical questions on the forum, not by personal message. Thanks!

More info: http://www.gammon.com.au/electronics

ectar

#18
Feb 26, 2013, 04:27 am Last Edit: Feb 26, 2013, 04:29 am by ectar Reason: 1
Finally!!! I got it, apparently Prolific modules doesn't work properly with Leonardo, the very first one on the picture is Prolific as well, not FTDI.
So luckily I had one actual FTDI attached to my MultiWii controller, when I've used that one - now all works!

They actually partially working , writing data from Arduino to PC was fine! But not reading! Crazy... I have no idea why it was so messy with Prolific chip based Ser/USB breakout boards, any ideas?

randika@lk.aptinex.com

Please enable DTR and RTS in the usb terminal, then it'll be okay

this code work for me

#define LED 13

void setup() {
  // initialize both serial ports:
  pinMode(LED,OUTPUT);// active high
  digitalWrite(LED,LOW);
  Serial.begin(57600);
  while (!Serial) { }
  Serial1.begin(57600);
  while (!Serial1) { }
  delay(2000);
  Serial.println("TEST Serial");
  digitalWrite(LED,HIGH);
}

void loop() {
  // read from port 1, send to port 0:
  if (Serial1.available()) {
    digitalWrite(LED,HIGH);
    while(Serial1.available()){
        byte inByte = Serial1.read();
        Serial.write(inByte);
    }
    digitalWrite(LED,LOW);
  }

  // read from port 0, send to port 1:
  if (Serial.available()) {
    digitalWrite(LED,HIGH);
    while(Serial.available()){
        byte inByte = Serial.read();
        Serial1.write(inByte);
    }
    digitalWrite(LED,LOW);
  }
}

Go Up