gnupic: Re: [gnupic] gpsim / TMR0
Subject:
Re: [gnupic] gpsim / TMR0
From:
Scott Dattalo ####@####.####
Date:
7 Feb 2005 14:56:12 +0000
Message-Id: <1107788168.5695.37.camel@localhost.localdomain>
On Mon, 2005-02-07 at 13:39 +0100, Tobias Schlottke wrote:
> Hi
>
> I dont understand the behaviour of TMR0 and gpism.
> It seems to me thet the timer is not incremented every
> cycle. Instead in conditional and/or goto instructions
> one increment is missing.
>
> My testbed looks like this:
>
> I'm simulating a 12c508. For testing I wrote this
> stupid little program:
>
>
> ========= 8< =====================
> ;; test.asm
> ;; assemble with: gpasm -p p12c508 test.asm
> include "p12c508.inc"
>
> org 0
>
> movlw 0
> OPTION
Tobias,
You need to set PSA to 1 in the OPTION register in order to get TMR0 to
count instruction cycles. With it set to 0, TMR0 counts every other
instruction. Also, remember that goto and skips are 2-cycle
instructions.
Scott