Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
08/24/05 14:15
Read: times


 
#99996 - 2 characters received in interrupt
hey everyone

an piece of my code couses bugs, probably due to my own mistake.
I noticed the uC hovers almost continue in the Serial interrupt routine althoug I don't understand why. The PC sends 2 chars.

I'll put out a short piece of code the entire code is at:
www.iae.nl/users/jeroenw/ASM/2SERVO2CTRL.asm

;---------Interrupt Routines----------

T0_INT
	clr	ES
	clr	TF0
	mov	TH0,	#0B7h	; set for 20 ms
	mov	TL0,	#00	;
	acall	SERVO1
EXIT	setb	ES
	ret

SER_INT
	clr	ET0
	clr	RI
	mov	A,	SBUF
	mov	R1,	A
	jnb	RI,	$
	mov	A,	SBUF
	CLR	RI
	mov	R3,	A
	setb	ET0
	ret


;---------Interrupt Calls----------------

	.org	000Bh		; T0 interrupt
	acall	T0_INT
	reti


	.org	0023h		; serial interrupt
	acall	SER_INT
	reti


the SERVO1 routine works OK, if the SER_INT routine is written like this and only 1 caracter is send by the PC (but has no extra control for the 2nd servo)

SER_INT
	clr	ET0
	clr	RI
	mov	A,	SBUF
	mov	R1,	A
	mov	R3,	A
	setb	ET0
	ret


Regards
Jeroen



List of 2 messages in thread
TopicAuthorDate
2 characters received in interrupt            01/01/70 00:00      
   comments            01/01/70 00:00      

Back to Subject List