ptricks,
Since the TRIS register is defined at POR and a clear command will take care of the undefined data in the PORT register, what glitch occurs on this line? Even if the TRIS register somehow came up as an output after POR, it would only last until initialization, right? That would only be a few microseconds. Since the RC time constant is several orders of magnitude larger than that, it should have a negligible effect on the charge, right?
If the time being measured isn't critical then I guess it wouldn't matter.
I don't understand what you're saying about using the pin to measure capacitor discharge. The resistor in-line with the capacitor limits current to less than a milliamp. Surely Microchip intended the pin to be used for loads in this range?
I appreciate the feedback, but I don't see what prevents this from being reliable.
The best explanation is in the app note AN879 where they discuss the reason for implementing the ULPWU module when anyone could have just used a rc .
I don't know how timing critical your application is but something to consider.
http://ww1.microchip.com/downloads/en/AppNotes/00879D.pdf--------------------------------------------------------------------
the problem is that a normal digital-input
structure consumes high-crowbar currents when a
slowly changing voltage is applied to it. The
digital-input structure will consume a few hundred
micro amps when driven by an analog voltage that is
not close to the rail voltages (VSS and VDD). To combat
these high-crowbar currents, Microchip has introduced
an ULPWU module, which provides an analog input
that can be used to implement a RC timer.
-------------------------------------------------------------------
Another app note AN607 recommends that if you have a pin as an input that has a voltage present at power off that it have a schottky between the pin and the voltage source to avoid a false power on reset. I have seen chips that do not completely reset because of microamps of power on a pin.
http://ww1.microchip.com/downloads/en/appnotes/00607b.pdfThe only time I can find when Microchip recommends to use external pull-up/down resistors is after they mention internal resistors are disabled and pins reset to inputs on POR. As Rufus said, an external source is obviously needed in this situation.
Microchip tends to scatter information between app notes, but the idea is that the chips state at power on should not be the basis for if a circuit works or not . Even more true with parts that have an internal voltage regulator. In your situation it might not matter much but it is a bad idea to rely on that when designing a circuit.