Padu, not enough info to determine where the problem might be. It sounds like when your device is off pic gets power from some where and it looks like portb internal pullup is enabled. Are you turning led on by applying 1 ? if yes then swap the led then drive Low to see if it goes a way. another possibility is you are driving portb led pin under interrupt that causes to dim. Check led pin see if there is any pulse if yes then that is software bug. Andre Abelian Padu wrote: >Hi, > >I'm doing some tests with the PIC (18F452) internal ADC on port RA3. Although everything is working perfectly, I noticed something that I found very curious. > >I'm using the RA3 as an ADC to measure voltage levels on a battery pack (typical 14.4V). Between the battery pack and the PIC port, there is a resistor divider circuit and a unit gain opamp working as a voltage buffer. >When the unit is on, I set one of the PORTB pins up to turn a LED on, and I notice that when I turn my device off, the "ON LED" is still lit, though not as bright as when the unit is powered on. I measure the VDD pin and there is some voltage there (around 2.5V when RA3 is around 4V). > >Is this bad for the uC? Should I have some kind of switch to disconnect the voltage measurement circuit when device is turned off? > >Cheers > >Padu > > -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist