Serial TX/RX LED

@ptillisch:

Hi ptillisch,

I have difficulty finding where the two TX_LEDs and RX_LEDs are managed. Examining the "core" files I find only, at the "variant" level, the definition of the pins used, but I can't find their ultilization anywhere.

I believe that the routines that are responsible for turning them on/off, during serial transmission, are in the "bootloader," but I have difficulty finding them there as well.

Could you point me to where to look (both for MINIMA and WiFi)?

Thanks in advance,

Guglielmo

Sorry, I am not @ptillisch

It has been a while since I played with this, but sketch like:

void setup() {
    // put your setup code here, to run once:
    pinMode(LED_BUILTIN, OUTPUT);
    pinMode(LED_TX, OUTPUT);
    pinMode(LED_RX, OUTPUT);
}

uint8_t loop_count = 0;
void loop() {
    loop_count++;
    digitalWrite(LED_BUILTIN, loop_count & 1);
    digitalWrite(LED_TX, (loop_count & 2)? HIGH : LOW);
    digitalWrite(LED_RX, (loop_count & 4)? HIGH : LOW);
    delay(250);
}

Note: I think their pinout is sort of not good.

In particular it looks like the pins are named TX_LED and RX_LED, which does
compile and the like and does nothing.

However if you look at the cheat sheet:
Arduino UNO R4 Minima Cheat Sheet | Arduino Documentation
You will see they are named LED_TX and LED_RX

As for is any of the system code using them... Not sure... been awhile, but my recollection is not.

:grin: :grin: :grin: ... nice to see you Kurt :slight_smile:

Thanks, this whole part is clear to me and I have no problem with it; I really need to know where the two TX and RX LEDs are handled in order to modify the relevant routines (or ISRs).

I suspect that the routines responsible for turning them on/off during serial transmission are in the "bootloader", but I am having trouble finding them. :roll_eyes:

So ... this is why I asked ptillisch, who probably knows where they are hidden. :wink:

Guglielmo

This is clear by reading the file pins_arduino.h: :wink:

// LEDs
// ----
#define PIN_LED     (13u)
#define LED_BUILTIN PIN_LED
#define LED_TX      (21u)
#define LED_RX      (22u)

Guglielmo

Yep - but was suggesting that maybe the pin diagram from the minima documentation should be updated... :laughing:

AFAIK - I have not seen the RX and TX leds in use by the system... Could easily be wrong
But simple sketch that outputs to Serial does not do anything...

As for WIFI, they are hooked up to the hardware on the UART connecting the RA4M1 and ESP32...

So there is nothing in the sketches that control them.

1 Like

:scream: :scream: :scream: ... you are right ... I had never noticed this before, but on the MINIMA, the two LEDs do not blink while loading the code or while using the Serial port ... this is unbelievable ... they are not really managed.

Okay, that's better for what I need to do, but still ... another one of the inexplicable things about the MINIMA ... :slight_smile:

Guglielmo

Some info here if you do want to use them:
Do RX/TX LEDS glow? - UNO R4 / UNO R4 Minima - Arduino Forum

Brian