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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
09/21/06 06:02
Read: times


 
Msg Score: +1
 +1 Good Answer/Helpful
#124747 - A routine I used
Responding to: ???'s previous message
Hi Sanjib,
This is a routine I used for a Serial LCD Module at 19k2 and it works fine.
For 9600 you must adjust the delay routine.
Try:
SBDELAY:  MOV	R3,#45   ; Wacht bit tijd
SBT10:	  DJNZ	R3,SBT10 ; 45  	
	  RET       

Have a nice day
Robert

; Soft UART op 19k2

PUTSCHAR: PUSH  IE
	  CLR   IE.7	 ; Interrupts uit
	  PUSH  B
	  MOV   B,R3
	  PUSH  B	 ; Push R3
	  MOV   B,R2     ; Save R2 in B
	  
	  CLR	STXD	 ; Start bit laag
	  CALL  SBDELAY  ; Wacht Start bit
	  MOV	R2,#8	 ; Stuur 8 bits

PC10:	  RRC	A	 ; Bit naar carry
	  MOV	STXD,C	 ; Write bit
	  CALL  SBDELAY  ; Wacht Data bit
	  DJNZ	R2,PC10  ; Volgend bit

	  SETB	STXD	 ; stop bit
	  RRC	A	 ; A op orginele waarde
	  CALL  SBDELAY  ; Wacht Stop bit
	  	  
	  MOV   R2,B	 ; Restore R2  
	  POP   B
	  MOV   R3,B     ; Restore R3
	  POP   B
	  POP   IE
	  RET

SBDELAY:  MOV	R3,#22   ; Wacht bit tijd
SBT10:	  DJNZ	R3,SBT10 ; 22.5  	
	  NOP		 ; en de halve
	  RET       


List of 54 messages in thread
TopicAuthorDate
software UART Code            01/01/70 00:00      
   yeah,its a little game we play round here...            01/01/70 00:00      
   Some Help            01/01/70 00:00      
      A Little More Help            01/01/70 00:00      
         The danger of cut and paste            01/01/70 00:00      
            Homework            01/01/70 00:00      
   A routine I used            01/01/70 00:00      
      STXD            01/01/70 00:00      
      Thanks            01/01/70 00:00      
         ways to skin the cat            01/01/70 00:00      
            AND            01/01/70 00:00      
               that's why FAQs are...            01/01/70 00:00      
               Might be OK            01/01/70 00:00      
                  you are, of course, right, but he still should kno            01/01/70 00:00      
                     no worse than scanning keyboard, etc.            01/01/70 00:00      
                        Oh yeah            01/01/70 00:00      
                           Most of \'em did it without a timer or an int ...            01/01/70 00:00      
                              I did not know            01/01/70 00:00      
                                 There wasn't any '51 back then, but ...            01/01/70 00:00      
                                    I do remember the 10 CPS            01/01/70 00:00      
                                       The TTY was the rate-determining step            01/01/70 00:00      
                           re: Oh, yeah            01/01/70 00:00      
   get it here!            01/01/70 00:00      
      Oh no, not again!            01/01/70 00:00      
         he is just promoting his \"website\"            01/01/70 00:00      
            visit my site            01/01/70 00:00      
               well!            01/01/70 00:00      
                  OK, so where's the soft UART on your site?            01/01/70 00:00      
                     code            01/01/70 00:00      
                        I can't find it....            01/01/70 00:00      
                  SO why the registration, then?            01/01/70 00:00      
                     hmm.. nice question.            01/01/70 00:00      
                        state it so            01/01/70 00:00      
                           policy?            01/01/70 00:00      
                              what "fame:"            01/01/70 00:00      
                              contrary            01/01/70 00:00      
                                 leave it!            01/01/70 00:00      
                                    NOnonono! please...            01/01/70 00:00      
                                       I think he is confused ...            01/01/70 00:00      
                                          "Danish"            01/01/70 00:00      
                                             so it's ultimately Austrian?            01/01/70 00:00      
                                                in a way            01/01/70 00:00      
                                                   not as good a good product here ... ...            01/01/70 00:00      
                                    fit?            01/01/70 00:00      
                                       clear            01/01/70 00:00      
                                          clear is clear            01/01/70 00:00      
                                             agree with jan!            01/01/70 00:00      
                                                that's why I recommend you to put comments            01/01/70 00:00      
                                                   thank you!            01/01/70 00:00      
                                          Oh            01/01/70 00:00      
                                             Read it!            01/01/70 00:00      
                                                the thing            01/01/70 00:00      
   the code:            01/01/70 00:00      
      nice, but compiler dependent...            01/01/70 00:00      

Back to Subject List