Random theory question

When I tell the arduino to output HIGH on a certain pin for 1 second, is the signal actually continuous? Or is it really the equivalent of a pwm signal that equals the clock cycle per second of the CPU?

In other words, did I just generate a single peak or, in the case of the Uno, 16 million peaks?

1 Like

If pin 2 was an output pin, diditalWrite(2, HIGH); will place a DC 5v level on pin 2.

Are you going to show your code?

Continuous.

No code needed I think.

I’ve built a PEMF device and in my research came across this pic online. It seems like a really odd waveform, but it got me thinking that maybe the arduino could potentially be doing something similar. On a really micro level though.

Thanks for the replies.


It doesn't. It puts a solid 5V DC on the pin, as the others have said.

Perhaps extend the thinking a bit more, If the output pins really pulsed like that they would be usleless for a great many applications, and it would be well known.

To get a pwm on an output, you would have to use analogout()

analogWrite().

It’s my understanding that the cpu can only handle a set of instructions or actions once per clock cycle.

If that instruction is to open a transistor to output HIGH on a pin, it must be pulsing the transistor at its clock cycle right? Which would result in the continuous current because the transistor couldn’t switch at that rate.

The software turns on a hardware register, can we call it a flip flop.

The FF holds the state it was told to go to.

As a result once told to go to a HIGH, it stays HIGH until the FF is told to go LOW.

Similar to the light switch on the wall. Flip it up it will stay up until flipped down.

1 Like

I didn't remember the syntax, thanks for correcting me.

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