1

Can I use the TX/RX on pins 0, 1 (to a serial slave device) while also having the USB port dedicated PC communication?

  • actually When you uploading a sketch to your board through USB programing port that time the skect might go to the serial device which is connected with Arduino through Rx and Tx pin – Prayuktibid Apr 7 '17 at 4:40
  • @Prayuktibid I couldn't see any signal on pins 0 or 1 with a scope when using the USB port, even with those pins set to an output. – 101 Apr 7 '17 at 4:47
  • 1
    @Prayuktibid he is using a Leonardo which has separate USB and hardware serial. – gre_gor Apr 7 '17 at 13:06
  • How to use USB and TX/RX at the same time? – Aye Chan Myat Phyoe Oct 1 '18 at 14:44
2

32u4 is multi-serial uC. USB connection works on default serial communication which can be used via Serial.print("somevalue"). On the other hand if you want to use RX/TX on pins 0, 1 which are actually RXD1 and TXD1. So, if you use Serial1.print("somevalue"). So the answer is a yes. You can use USB and RX/TX (hardware serial) at the same time.

  • Great, thanks. Do you know how this compares with other boards? Apparently the Uno can't do use both. – 101 Apr 7 '17 at 8:50
  • 1
    Arduino Uno can't do this, it has only one hardware serial. Atmega 2560 has 4 hardware serials. Having multiple serials are always handy. With Uno you just stuck and have to use software serial if the case more than one serial. Most of the time Software Serial doesn't treat you well, it is just a workaround after all. – Sener Apr 7 '17 at 11:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.