How do I use an Arduino to switch another IC's pin (reset) t

I am trying to turn an IC’s reset pin to ground with an Arduino. It is a 5 LED array that has an IC controlling several flashing modes. I need to reset the IC to change modes and I want to use an Arduino Nano. I have seen an explanation setting an digital pin to input and then making it low and then setting the pin to output but I don’t understand the process. Supposedly it simulates a momentary push button switch using an Arduino.

Here’s the code I have been given:

pinMode(X, INPUT);

digitalWrite(X, LOW);

pinMode(X, OUTPUT);

delay(100);

pinMode(X, INPUT);

It works but I have no idea how.

I guess I need a very thorough explanation for someone from the slide rule era.

Thanks in advance.

You don’t always need to be as tricky as what you’re doing. If the only control of the reset pin is the Nano you can more simply declare the (Nano’s) pin to be an output and initialize it high. Then drive it low for a short time and then back high again. Thus you get a short, active low, reset pulse.

One reason you do the routine you’ve got is if you’ve got another “controller” also doing the reset. Perhaps it’s a manual push button you wish to preserve. In this case you don’t want to have the button ground the reset line while the Nano is working to drive it to a logic high voltage.

So you have a pullup on the reset line, either externally or by declaring the Nano pin to be an input and activating it’s internal pullup. Now if the switch grounds the reset line it’s no big deal. But when you want to the Nano to do the reset you have to make the pin an output and make it a logic low for the reset time. Then it goes back the being an input. You get the same active low reset pulse for the reset time, but before and after that time it’s just an input with a pullup. It won’t fight any other device trying to drive the reset line low.

pinMode(X, INPUT); // X is the pin number you are using as a reset driver. When pin X is in input mode it allows the internal pull up resistor of the driven device

//to hold the reset pin high (run state.)

digitalWrite(X, LOW); //Preset the output to LOW

pinMode(X, OUTPUT); // this will bring Pin X to low resetting the device

delay(100); // wait .1 second

pinMode(X, INPUT); // This will allow the pull up in the driven device to return to high (run state.)

// I would just do this if I was not planning to reset the device from more than one source such as a push button.

setup code

{

pinMode(X, OUTPUT);

digitalWrite(X,HIGH);

}

When you want to reset the device.

digitalWrite(X,LOW); // bring reset to low: reset state

delay(100); // very long for a reset pulse

digitalWrite(X,HIGH); // reset back to high: run state