>X-Sender:
spam_OUTgnorrisTakeThisOuT
earthlink.net
>X-Mailer: Windows Eudora Light Version 1.5.4 (32)
>Date: Tue, 24 Feb 1998 09:21:22 -0500
>To:
.....jorgegfKILLspam
@spam@MAIL.TELEPAC.PT
>From: Gene Norris <
gnorris
KILLspamearthlink.net>
>Subject: RS232 code
>
>Is this it? I saved this around November of last year.
>
>Hope this helps, Gene.
>
>
>
>;TXBYTE: send 1 byte @ 9600 baud: 1 RAM, 15 (16) ROM, 1043 cycles
>;enters with data in w, exits with w trashed.
>;Copyright (C) 1995 Dwayne Reid. May be freely used so long as this
>;copyright notice is retained.
>
>txbyte ; send byte in W at 9600 baud (4MHz osc), 8N1
> movwf temp
> movlw .10 ; 8 data + 1 start + 1 stop (inc for more stop bits)
> clrc ; start bit
>txloop ; bit time = 104.167 uSec
> skpnc
> bsf serport,dout ; output bit = carry
> skpc
> bcf serport,dout
>dloop ; 95 clk cycle delay
> goto $+1 ; 2-cycle NOP in 1 instruction!
> addlw b'00010000' ; increment upper nibble
> skpc ; delay = 6n -1 (1 less when falls thru)
> goto dloop ; loop sixteen times
> addlw -1 ; dec w, valid z, c=1 if w>=0 after decrement
> rrf temp,F ; carry will be set - shifted in as stop bit
> skpz
> goto txloop ; txloop is 104 clk cycles
> return
>
>
>
>
>
>Gene Norris
>
.....GnorrisKILLspam
.....earthlink.net
>E. Windsor, NJ USA
>
>