gnupic: Re: [gnupic] gpsim / TMR0


Previous by date: 7 Feb 2005 14:56:12 +0000 gpsim / TMR0, Tobias Schlottke
Next by date: 7 Feb 2005 14:56:12 +0000 Re: [gnupic] dsPIC support?, Major A
Previous in thread:
Next in thread: 7 Feb 2005 14:56:12 +0000 Re: [gnupic] gpsim / TMR0, Tobias Schlottke

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

Previous by date: 7 Feb 2005 14:56:12 +0000 gpsim / TMR0, Tobias Schlottke
Next by date: 7 Feb 2005 14:56:12 +0000 Re: [gnupic] dsPIC support?, Major A
Previous in thread:
Next in thread: 7 Feb 2005 14:56:12 +0000 Re: [gnupic] gpsim / TMR0, Tobias Schlottke


Powered by ezmlm-browse 0.20.