I thought I could use INPUT_PULLUP on all pins, but it turns out the ESP8266 only has fixed internal pullups of 10K on D3 and D4 (which is used for the built-in LED).
My open-collector opto-isolator is connected to D6, so I can't pull it up conventionally (PCBs are already made).
So I'm thinking of just hard-wiring pins D6 and D3 together, both declared as INPUT, and that, in theory, should provide the 10K pullup on D6.
Can anyone suggest any reason why I cant do this ?
Not from my experience, Jim. I had a pushbutton to GND connected to D0 input on one board of this project. Once the pin had been taken low, releasing the button it didn't go high again.
I scratched my head over this for hours wondering why, then I found this on a spec sheet.
I was able to add a 10K pullup on that board, but it will be more difficult to add to the board that is using D6 as an input.
Since D3 and D6 are opposite each other on the Wemos D1 mini, it would be easy to just link D3 and D6 together and drive both of them.
What did you do in the prototype and its debugging? You could use some 0805 SMD resistors and tack one to the pin and with a piece of kynar wire wrap wire connect the other end of the resistor to +. Then tack the wire in place with some hot melt glue.
It was such a simple circuit (1 input, and 1 output) I rushed into the PCB design as the project is urgent.
Anyway it would be so much easier to kynar wire pins D3 and D6 together, and use D3's internal 10K pullup. Or I could just change the code to use D3 as the input, and forget about D6 altogether. Presumably it will stay high impedance unless declared as an IO pin ?
So long as they are both declared as INPUT, should be OK, but just checking to be certain.
That falls into the should of, could of, wood of class. Next time you will know about those two pins. It is the simple circuits that usually come back and bite.
Well, in any case you can connect D3 and D6 together.
However, D3 which is GPIO0 is also one of the strapping pins, that's why it has an external pull-up.
You need to make sure you don't pull that pin LOW during boot-up