n Tue, Oct 18, 2016 at 2:37 AM, wrote: > > There is another way of doing it that removes the need for any pullups. > > Set the pins as outputs. Set the outputs to all ones. Now read them and > see which ones are high and which are low, and save the states. > > Now set all the pins as 0. Again read all the pins and compare the states > to the previous read. If the state has changed the output is not connecte= d > to anything. If the state doesn't change the output is shorted to somewhe= re > by the dip switch. > > It is really abusive to short digital outputs high or low like this. Many parts will withstand it, but it almost certainly exceeds the absmax ratings on the port outputs. To the original poster's point, I have noticed some designers that don't use internal pullups and always specify an external pullup / pulldown. Does anyone know a (rational) reason for this? Out of all the microcontroller's features, why would you choose not to use pullup resistors? --=20 Regards, Mark markrages@gmail --=20 http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .