1

I am using an ATmega328PB and was looking at Arduino's and others' schematics that use it. All schematics I've found use a serial chip to communicate between USB and TX & RX. However, I do not need USB, and I plan to program the ATmega through ICSP.

Is it safe to leave these pins unconnected or connect them directly to LEDs like some Arduino boards do (like in the photo)? I wasn't able to find clear information about it.

enter image description here

I apologize if this is a silly question. Thank you!

2
  • With a 120 ohm resistor those leds will be quite bright.
    – 6v6gt
    Commented Jan 26 at 4:53
  • VCC will be connected to 3.3V, and the LED is rated for 2.7V with a forward current of 5mA. Should my resistors still have a greater resistance?
    – Acmek
    Commented Jan 26 at 5:03

1 Answer 1

1

Look at these pins as any other I/O pin. There is nothing special about them, if you do not enable their special function, in your case USART0.

This is what the data sheet says:

17.2.6 Unconnected Pins

If some pins are unused, it is recommended to ensure that these pins have a defined level. Even though most of the digital inputs are disabled in the deep sleep modes as described above, floating inputs should be avoided to reduce current consumption in all other modes where the digital inputs are enabled (Reset, Active mode and Idle mode).

The simplest method to ensure a defined level of an unused pin, is to enable the internal pull-up. In this case, the pull-up will be disabled during reset. If low power consumption during reset is important, it is recommended to use an external pull-up or pull-down. Connecting unused pins directly to VCC or GND is not recommended, since this may cause excessive currents if the pin is accidentally configured as an output.

Therefore, if you do not use USART0 and do not need these LEDs, you can get away with no external circuitry. Just enable the internal pull-ups.

2
  • Thank you so much! I was worried as other posts I have seen showed issues with floating TX and RX pins that interfere with their script, but as you stated, I can enable pull-ups to avoid this. Have a great day!
    – Acmek
    Commented Jan 26 at 7:45
  • @Acmek Better use the correct sources of information, for example data sheets and application notes. Forums posts are competent only in rare cases. Commented Jan 26 at 8:18

Your Answer

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

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