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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
01/13/09 20:01
Read: times


 
#161498 - no interrupts works
Responding to: ???'s previous message
disabling the serial interrupt while sending a string of bytes is the only way I can get it to work (aside from adding a 2 mS delay after sbuf is loaded with a byte)

This is working:

Test:
	CLR	ES		; Disable serial interrupts
	mov	dptr,#Test_String
	call	OutStr          ; added this routine instead of "mov sbuf,a"
	SETB	ES		; Re-enable serial interrupts
	ret
;********************************************************************
; Send a null terminated string out serial port
;********************************************************************
OutStr:
	clr a
      movc a,@a+dptr	; get character
      jz exit		; stop if char = null
;;	mov	sbuf,a	;Load SBUF
;;	jnb	TI,$	;this line makes no difference when using interrupts
	call	OutChar
      inc dptr		; point to next char
      sjmp OutStr
exit:
	ret

Test_String:
DB	'This is a Test',0dh,0ah,0
;-----------------------------------------------------------------
OutChar:
	mov	sbuf,a	        ;Load SBUF
	jnb	TI,$		;wait for last bit to transfer
	clr	TI		;get ready for next byte	
	RET			;

 

I just don't see how this works and the interrupt way does not??
Anyone?

for the incoming data reception, I must have interrupts enabled.


List of 23 messages in thread
TopicAuthorDate
serial interrupt?            01/01/70 00:00      
   Your Problem            01/01/70 00:00      
      still not working            01/01/70 00:00      
         you need to flag somehow the end of transmission            01/01/70 00:00      
            reply to Jan            01/01/70 00:00      
   Several            01/01/70 00:00      
      To Hans            01/01/70 00:00      
         And my reply to Charles            01/01/70 00:00      
   no interrupts works            01/01/70 00:00      
   the solution            01/01/70 00:00      
      Isn't that what Hans said?            01/01/70 00:00      
      Perfectly????? Prolly should look again.            01/01/70 00:00      
         Got to look ahead...            01/01/70 00:00      
         Another thing to consider            01/01/70 00:00      
            reply to Andy Neil            01/01/70 00:00      
         reply to Michael Karas            01/01/70 00:00      
      why is this a bad idea            01/01/70 00:00      
         Exactly why not perfect !!!            01/01/70 00:00      
         response to Jan Waclawek            01/01/70 00:00      
            interrupts forever            01/01/70 00:00      
            nope            01/01/70 00:00      
               Re: Erik            01/01/70 00:00      
   if you HAVE to mix ...            01/01/70 00:00      

Back to Subject List