Understand the input and output

Hi everyone, since this is my first time asking a question on the forum, sorry if I put the question on the wrong topic.

My question is: Is it a problem to send the same value to the same port many times?? See the code below to understand what i'm trying to say:

int pin = 8;

void setup(){
  pinMode(pin, OUTPUT);  
}

void loop(){
  digitalWrite(pin, HIGH);
  delay(1000);
}

So, to resume the question: Send the same value every second to the same port, and not change this value is going to be a problem in the future (or now in the present, I don't Know...)? Thank you in advance.

Not a problem.

Whatever value you set on an output pin does not change until you send a new value to the pin.

Usually this is not a problem, but there is an issue with the new mbed based Arduinos (Nano 33 BLE/Sense). They will create a short glitch to LOW level when you write HIGH to the output again. So when you do this many hundreds/thousands of times a second you get a square wave out of the pin.

A problem is you are wasting processing time in doing so.

All you need to do is send the output once when it’s needs to change state.

SamuelSemmler:
Hi everyone, since this is my first time asking a question on the forum, sorry if I put the question on the wrong topic.

My question is: Is it a problem to send the same value to the same port many times??

You mean a pin.

A port is a group of pins controlled by common internal registers, you don't seem to mean this.

When you write a new state to an output pin it doesn't matter at all if its different or the same as last time, its just latched to the appropriate state - it does what you tell it, when you tell it, without question.

(Ignoring any bugs with particular hardware of course).

there is an issue with the new mbed based Arduinos (Nano 33 BLE/Sense)

Such bugs, especially if hardware, are completely unacceptable. If true, throw that piece of trash in the waste bucket.

jremington:
Such bugs, especially if hardware, are completely unacceptable. If true, throw that piece of trash in the waste bucket.

This is a software issue. The way Arduino uses pins and mbed uses pins do not fit together.

Understood, Thank you all for the answers…