Pull-up resistors: first class I took in college where they were mentioned I didn’t get them…12 years later I still don’t get th…wait! I do get them, forget I said that, particularly if you’re my boss or colleague, I get them, ok? Forget it!
On the other hand, pull-ups have caused me some grief over the years (and by “grief” I mean fun fun times growling at the computer screen, at the board, at the oscilloscope, etc., and figuring out what’s wrong).
This one time, a colleague I was working with was enabling a UART interface on a small MCU with (supposedly) previously working code. In this particular device, which had the same UART as the original MCU for which the code had been written for, the transmit channel was operating correctly but the receive wasn’t. Of course it was getting late to finish this part of the project so we started scrambling for answers. First thing I asked this guy (who we’ll call “dude” for the purposes of this story) is whether he had checked the signal with an oscilloscope, the dude hadn’t. So we did, and found a strange waveform unlike what you would expect to see in a UART channel. The dude hadn’t checked the hardware out, he was obsessed with configuration bits, baud rate settings, pointers, interrupts, etc., turns out the signal wasn’t even getting there.
We went back to the hardware and discovered the problem: the channel was an open collector configuration (part of an optocoupler to be exact) and there was no way it would ever go to one. This MCU pin conveniently had an internal pull-up available so we enabled it and everything worked.
Not everything is software. Some error are so simple that they are easy to overlook. Always remember to be very methodic and cover all bases one by one, isolate variables and by all means, always have an oscilloscope at hand.