Searching \ for 'TRM0 simul. error' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/index.htm?key=trm0+simul+error
Search entire site for: 'TRM0 simul. error'.

Truncated match.
PICList Thread
'TRM0 simul. error'
2003\05\05@120943 by Dennis Crawley

flavicon
face
Hi all,
MPLAB 6.10 decrements TMR0 when TMR0 overflows and it hangs incrementing and
decrementing forever.
MPLAB 5.x, instead, stops perfectly; changing TOIF bit of INTCON register.
Could someone test this... or has an explanation?
Thanks to all

Dennis.

       PROCESSOR       16F84
       RADIX           DEC
       INCLUDE         "P16F84.INC"
       errorlevel -302

       cblock     0CH
Count
PASSES
       endc

       ORG     00H

       bsf     STATUS,RP0
       movlw   00000111B   ;1:256
       movwf   OPTION_REG
       bcf     STATUS,RP0
       CLRF    INTCON

MainLoop
       call    Delay
       MOVLW   1
       ADDWF   PASSES,F
       goto    MainLoop

Delay
       movlw   0X0B9
       movwf   TMR0
       BCF     INTCON,T0IF ;pulling overflow flag

DelayLoop
       btfss   INTCON,T0IF
       goto    DelayLoop
       return

       END

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email spam_OUTlistservTakeThisOuTspammitvma.mit.edu with SET PICList DIGEST in the body

2003\05\05@214652 by Rick Regan

picon face
>Hi all,
>MPLAB 6.10 decrements TMR0 when TMR0 overflows and
>it hangs
>incrementing and
>decrementing forever.
>MPLAB 5.x, instead, stops perfectly; changing TOIF
>bit of INTCON
>register.
>Could someone test this... or has an explanation?
>Thanks to all

It looks like your problem is that MPLAB 6.x
simulates a watchdog timeout whereas MPLAB 5.x does
not.  To see for yourself, add this to your asm file
and re-run under MPLAB 6.x:

__CONFIG _WDT_OFF

The watchdog will then no longer timeout and you
will reach the point where T0IF gets set.

>MainLoop
>        call    Delay
>        MOVLW   1
>        ADDWF   PASSES,F
>        goto    MainLoop

Why do you increment PASSES if you don't check it?
Also, you should probably initialize it to 0 instead
of relying on the powerup value.

__________________________________
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo.
http://search.yahoo.com

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email .....listservKILLspamspam@spam@mitvma.mit.edu with SET PICList DIGEST in the body

More... (looser matching)
- Last day of these posts
- In 2003 , 2004 only
- Today
- New search...