gnupic: problem with gpsim


Previous by date: 24 Jun 2002 13:30:46 -0000 SDCC sample program for 16F873?, Scott Ellis
Next by date: 24 Jun 2002 13:30:46 -0000 Re: problem with gpsim, Scott Dattalo
Previous in thread:
Next in thread: 24 Jun 2002 13:30:46 -0000 Re: problem with gpsim, Scott Dattalo

Subject: problem with gpsim
From: Diego ####@####.####
Date: 24 Jun 2002 13:30:46 -0000
Message-Id: <3D13664600000DBF@correo.adinet.com.uy>

Hello, i have a little problem gpsim, I'm sure you could help me.
I'm programming a 16f877, and this is the situation:

I configure TMR0 int, and then goes into a loop waiting for it. The problem
is that my loop is on page 1 of Program Memory and when TMR0 overflows,
the int occurs and the PC must jump to 0004h, but in simulation the PC jump
to 0804h. This is the code I'm using:


	list      p=16f877           
	#include "p16f877.inc"      
	errorlevel -302, -305	
	__CONFIG _CP_OFF & _WDT_OFF & _BODEN_ON & _PWRTE_ON & _XT_OSC & _WRT_ENABLE_ON
& _LVP_OFF & _DEBUG_OFF & _CPD_OFF 


;***** Variables en BANCO0*************************
	cblock	0x20
		w_temp 		 
		status_temp	
	endc	
;**********************************************************************
		ORG     0x000		
		clrf    PCLATH  
		goto	main		

		ORG     0x004        
ISR
		movwf   w_temp    
		movf	STATUS,w          
		movwf	status_temp       	

desGIE	bcf	INTCON,GIE	
	btfsc	INTCON,GIE
	goto	desGIE		

	movf    status_temp,w   
	movwf	STATUS            
	swapf   w_temp,f
	swapf   w_temp,w          
	
ISRend	bcf	INTCON,T0IF
	bcf	INTCON,INTF	
	retfie			

banco0  macro
        bcf     STATUS,RP0
        bcf     STATUS,RP1
        endm
banco1  macro
        bsf     STATUS,RP0
        bcf     STATUS,RP1
        endm

main

	clrf 	TMR0 		 
	clrf 	INTCON 		 
 	banco1
	movlw 	b'11000000' 	  
	movwf 	OPTION_REG 	
	banco0 
	bsf 	INTCON, T0IE 	; habilito interrupcion de TMR0
	bsf 	INTCON, GIE 	; habilito interrupciones globales

otraves
	bsf	PCLATH,3	
	bcf	PCLATH,4
	call	loop
	goto	otraves


	org 0800		; voy a pagina1
loop	
	nop
	goto	loop		 

	nop
_0804	nop		; 0804 
	nop
	nop	
	goto 	_0804	
	end


Thanks and excuse my english
Diego


PS: I'm using gpsim 0.20.14 in RedHat 7.1






Previous by date: 24 Jun 2002 13:30:46 -0000 SDCC sample program for 16F873?, Scott Ellis
Next by date: 24 Jun 2002 13:30:46 -0000 Re: problem with gpsim, Scott Dattalo
Previous in thread:
Next in thread: 24 Jun 2002 13:30:46 -0000 Re: problem with gpsim, Scott Dattalo


Powered by ezmlm-browse 0.20.