Hello, I also thought about that. But context is completly saved when jumping to the interrupt routine. And this was working with the same firmware on the older production boards. And I made also a try and, direct before reading the port, I set the bank properly, but without impact on my issue. So I do not think, it is caused by software. I think, it is something wrong inside the PIC, but I do not know what ... Best Jens > Only I can think of (if that is really a software issue) is > that you have interrupt routine that is not saving the > context properly - so that you select the bank for PORTB, but > then an interrupt occurs, so the bank changes to TRISB and > you read that one instead of the port... > > Tamas > > > On Sun, Nov 9, 2008 at 3:04 PM, jmg wrote: > > > Hello, > > > > I have a small problem with a big impact on my application. > > > > I am using a 16F877A, running in a 5V environment with 10 MHz. > > I am using a timer interrupt (with 25ms) to read PORTB, > Bit5. This pin > > is defined as input. There is no write at all to this pin > by software. > > The internal pull-up is disabled. I am using an external > pull-up to 5V. > > This > > pin is connected to an external electronic (PS_ON_m Signal from a > > computer motherboard). > > > > When the incoming signal is high, I am always reading a high (1) on > > this pin by software. I have never seen, that a low was reed, when > > high was attached to this pin. > > But when the signal is low, it happens, that from time to > time, this > > pin is read as 1 instead of 0. I supervised the line with > an osci, and > > I never saw a glitch or spike or whatever. To be shure, I connected > > the pin direct to GND. But again, from time to time, I read a wrong > > values. This may happen after 30 seconds fro start or even > after 20 minutes. > > > > Well, we first build this application 18 month ago, and we > never saw > > this happen(with exactly the same firmware and revision > number of the > > PIC. Now, we had to build new boards, and now we have this issues. > > > > I first though, we could could have a problem with the pic > itself, so > > we checked for datecodes. The very first (we no issue) had > been from > > 2006, the failing ones had been from 2007. So we decided to replace > > the pic on one board. Now, with datecode from 2008, we > still see this > > issue. And we see it on all produced boards, meaing, we should not > > have shorts or bad soldering (very unlikly to have the same > fault on 5 boards). > > > > Any ideas, what could happen here? > > > > Best Regards > > > > Jens > > > > -- > > http://www.piclist.com PIC/SX FAQ & list archive View/change your > > membership options at > http://mailman.mit.edu/mailman/listinfo/piclist > > > > > > -- > Rudonix DoubleSaver > http://www.rudonix.com > -- > http://www.piclist.com PIC/SX FAQ & list archive > View/change your membership options at > http://mailman.mit.edu/mailman/listinfo/piclist -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist