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?

asked Sep 22, 2020 at 7:33
3
  • 2
    Should be fine. Communication is done natively in USB with the ATmega32u4, TX and RX (D0, D1) are free for other tasks. Commented Sep 22, 2020 at 7:49
  • 1
    RX/TX pins on Micro are Serial1 Commented 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. Commented 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.

answered Sep 22, 2020 at 11:40
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

Edgar Bonet
45.1k4 gold badges42 silver badges81 bronze badges
answered Sep 23, 2020 at 7:07

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.