3

I'm using arduino pro micro Atmega32u4 5v 16Mhz

I want to use it to make a HID Keyboard and Mouse but I ran out of pins so I was wondering if I can use the RX and TX pins as digital input pins. Will it work? Will it affect the communication of the arduino to the computer?

3
  • 2
    Should be fine. Communication is done natively in USB with the ATmega32u4, TX and RX (D0, D1) are free for other tasks.
    – towe
    Sep 22, 2020 at 7:49
  • 1
    RX/TX pins on Micro are Serial1
    – Juraj
    Sep 22, 2020 at 11:03
  • Not a problem on the Pro Micro. You tag also mentions Pro Mini. On those it could be a problem. If your code doesn't use Serial, then there is no problem there. But there could still be a problem during uploading the code. If for example a button is connected to either pin, and this button is pressed, it could block uploading, and could even cause a short if the other side of the button is directly connected to Vcc or GND.
    – Gerben
    Sep 22, 2020 at 15:45

2 Answers 2

1

Using TX and RX on a 32U4 does not affect PC communication. It uses a competent different communication channel.

You can use those pins for digital operation with no problems, you just won't be able to use Serial1 for communication with serial peripherals.

1

Welcome to ASE.

  1. Communication between the PC and the Arduino Pro Micro happens through the USB, unlike the Arduino Uno and Mega, which use the RX and TX lines.
  2. In your case, the USB pins of the Micro are used to communicate with the PC. Hence, the RX and TX pins are available for digital input and output operations.

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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