Yeah, this sounds very strange.
As others have said, after power on and reset (POR) all the pins come up as inputs so they should not go either high or low for any duration. Leakage current into the pin is MUCH less than a uA (200nA max) so basically "any" sort of resistance (ie several mega Ohms) to either Vdd or Vss will pull the pin to that.
And it doesn't really matter what you do with the PORT or LAT registers until you also clears the TRIS bits in questions. Ie, at power up the pins are inputs (high impedence), then you "preset" their default state(s) by writing to PORT or LAT and finally you clear the corresponding TRIS bits to enable the output drivers.
The 18F2580 have pull-ups on PORTB (and PORTB only it seems). They are disabled on POR so they should not be able to pull the pin high. The current sourced thru the pull-up resistor is between 50 and 400uA so even WITH them enabled I don't think you'd see a LED light up.
More details please...


Reply With Quote

Bookmarks