Steve Hardy <spam_OUTPICLISTTakeThisOuT
MITVMA.MIT.EDU> wrote:
{Quote hidden}> I am using a 16C84 at 4MHz using TMR0 to generate interrupts every
> 100 cycles = 100us. This is done by 'bumping the clock forward' in
> the interrupt service routine. This is the code which works in the
> simulator (MPSIM):
>
> CYCLES equ 100
> ...
> movlw 258-CYCLES
> addwf TMR0,f
>
> This is the code which works in the real device:
>
> CYCLES equ 100
> ...
> movlw 259-CYCLES
> addwf TMR0,f
>
> Note the 258 for the simulator and 259 for the device, implying the
> device is _slower_ than the simulator.
>
> Now the question: Am I coming up against one of those limitations
> of the simulator related to simulating events on cycle boundaries
> rather than Tosc boundaries?
Maybe.
> Or am I commiting a PIC faux pas by doing such things to the timer?
No.
> Or is it just a bug in MPSIM?
Could be. What version of MPSIM are you using?
-Andy
Andrew Warren - .....fastfwdKILLspam
@spam@ix.netcom.com
Fast Forward Engineering, Vista, California
http://www.geocities.com/SiliconValley/2499