On Fri, 15 Nov 2002 09:19:43 -0600 you wrote: > So the BOR bit is only of use if you've checked the POR and find it was > not a cold boot. Have I got that right? (I wish the manual would just > come out and say that in plain english!) I am still confused as to why > the Status, TO bit seems to be cleared every time I cold start this thing. > The manual seems to say in plain english that this won't happen. FWIW, I consistently see both NOT_TO=1 and NOT_POR=1 upon Power On, which is also wrong. Table 14-4 clearly shows NOT_POR=0 at Power On. According to the PIC16F628 datasheet it should be possible to differentiate between Power-on Reset, Brown-out Detect, an external MCLR reset, and WDT timeout. Also the later two from SLEEP. Could anyone post some [pseudo] code to be placed at the start of a program and jump to arbitrary locations depending upon the reset conditions as above? This was my first effort, but I found it always jumped to 'Oops': bsf STATUS,RP0 ;BANK 1. btfsc PCON,NOT_POR ;is this Power-On reset? goto Oops ;no! not POR, must be WDT or BOD reset. bsf PCON,NOT_POR ;yes! set bit to detect future POR. bcf STATUS,RP0 ;BANK 0. -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu