Use LED_BUILTIN_TX as another digital pin on custom Leonardo?

I have a custom board layout based on a Leonardo board. I load a Leonardo bootloader into the board, to start off, before loading my sketches.
The pin that is connected to the TX LED on a commercial Leonardo board is not connected to anything on my board.

The following is defined in pins_arduino.h

#define LED_BUILTIN_TX 30

I couldn't find any other references to this name.

If I want to start using this as another digital output on a future layout, can I just start controlling the predefined LED_BUILTIN_TX (digital pin 30)? (ie use digitalWrite comands)

Or is there something in the Leonardo bootloader that might override what I set this pin to, relating to USB transmission activity?

What stops you from trying? Just check (if needed) how the pin is influenced by serial and/or hid functionality.

The TX LED pin will be controlled by the bootloader during uploads; not sure of exact details.

I only have one board that I might even be able to get direct access to the PCB right now, and the pin doesn't go out to any test pad, and I am nervous about trying to probe such a tiny pin pad I think I have A5 available. I think I'll use that instead. The risk is too great, because having LED_BUILTIN_TX change low to high or high to low unexpectedly could be disastrous.

I thought that you had a board with the pin broken out already.

A short could indeed cause problems.

There is no risk to damage the processor if you control the TX LED from software.

As I stated, I was looking at using this for a future layout. No processor damage, but if something other than my sketch flips that bit from high to low at the wrong time, (in the middle of trying to transfer data to it) what I am trying to control with that bit could get into a bad state. I have re-evaluated my new layout and i have a different pin I can use. Not as conveniently placed but will work without worrying about secondary functions.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.