By setting the OPTION_REG bit 3 I put the prescaler to the WD. I need a 1:1 TIMER 0 in my application. So the bit PSA (OPTION_REG bit 3) has to be set. But by setting it the prescaler goes to the WD. My problem is that it generates a reset a short time after because of the WDT which should be disabled. So how can i get safely a timer 0 without prescaler and without an undesired WDT-reset? -----Message d'origine----- De : pic microcontroller discussion list [mailto:PICLIST@MITVMA.MIT.EDU]De la part de Dale Botkin Envoye : mercredi 28 aout 2002 16:18 A : PICLIST@MITVMA.MIT.EDU Objet : Re: [PIC]:problem with Watch-Dog On Wed, 28 Aug 2002, Samuel BOUQUET wrote: > Here is the #fuses line: > #fuses XT, NOPROTECT, NOWDT, PUT, NOPROTECT, NOBROWNOUT, NOLVP, WRT, CPD That's correct, and will disable WDT. > I read on a Microchip datasheet (Mid Range Reference Manuel, 33023.pdf) that > there are assemblary lines to get the PIC working on a good way (page 176).I > am working on it to try to get the timer working good. the WDT seems to be > stop with those instructions. That procedure is needed when switching the prescaler between the WDT and TIMER0, whether you have the WDT enabled or not. I think the problem is occurring when you manually set OPTION_REG bit 3. What are you trying to accomplish with that? This line: setup_counters (RTCC_EXT_H_TO_L, RTCC_DIV_2); will (safely) assign the prescaler to TIMER0, you don't need to do it yourself. The compiler will use the corerct procedure to avoid the problem noted in the midrange manual. Just delete the "bit_set (OPTION_REG, 3)" statement and I think you'll be OK. Dale -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body