Toby, I take it that you are new to PICs. You can send/receive 38400 just fine with a PIC, although it DOES take some ingenuity on storing the data. I have done just that, but unfortunately the storage routine is not disclosable. Suffice it to say that it's not especially easy. Now, for the send/receive code. Note that the code assumes the PC is transmitting 8,n,2 (not 1 stop) to give time to save the data. Also, data is sent and receivd on the same pin in this project, although that is not necessary. ;*************************************************************************** *********************************************** ; ; UART_TX ; ; Transmit W at 38400 out XBIT, 8,N,1 protocol. ; ; INPUTS: ; W ; ; OUTPUTS: ; n/a ; ; USES: ; Timer ; temp1 ; temp2 ; UART_TX :Speed_Delay_1 equ 9 ; 9 passes * 3uS per pass + 1 :Speed_Delay_2 equ 4 ; 26-14 overhead=38 clrwdt movwf temp1 movlw 8 movwf temp2 bsf XBIT ; Force STOP BIT condition initially movlw TRIS_RB_TX ; Set port to transmit tris RB ; Set as an output now movlw :Speed_Delay_1 movwf Timer:LSB bcf XBIT ; Send START bit :Loop1 decfsz Timer:LSB,F goto :Loop1 :Loop btfss temp1.0 ; Send DATA bits bcf XBIT btfsc temp1.0 bsf XBIT goto $+1 ; Waste four cycles to pad to exactly 13 goto $+1 nop movlw :Speed_Delay_2 movwf Timer:LSB :Loop2 decfsz Timer:LSB,F goto :Loop2 rrf temp1,F ; Set up for next bit decfsz temp2,F ; Done yet? goto :Loop ; No, repeat movlw :Speed_Delay_1 ; Send STOP bit movwf Timer:LSB bsf XBIT :Loop3 decfsz Timer:LSB,F goto :Loop3 movlw TRIS_RB_RX ; Set port to receive now tris RB retlw 0 ; ;........................................ ; ; UART_RX ; ; Receive char at 38400 in XBIT, 8,N,2 protocol. ; ; NOTE: We don't stick around for the stop bit! We should therefore ; have about 40uS to process the received character before the leading ; edge of the next start bit. ; ; INPUTS: ; none (but RB must be set for input on XBIT pin) ; ; OUTPUTS: ; temp1 = character received ; ; USES: ; Timer ; temp1 ; temp2 ; UART_RX :FullBitTime equ 4 ; 26 uS clrf temp1 ; character received movlw 9 ; bits to read in (start gets shifted ou t) movwf temp2 :WaitStart ; Wait for leading edge of start bit clrwdt btfsc XBIT goto :WaitStart goto $+1 goto $+1 btfsc XBIT ; Start bit still there? goto :WaitStart ; No, start over waiting - it was noise ; Yes... :Loop bcf C rrf temp1,F btfsc XBIT ; Sample bit, stuff into character buffe r bsf temp1.7 movlw :FullBitTime movwf Timer:LSB nop nop :BitWt nop decfsz Timer:LSB,F ; Wait 1 bit time (just a few instructio ns short...) goto :BitWt decfsz temp2,F ; Dec bit counter ; Done? goto :Loop ; No, loop retlw 0 ; Yes, return with char in temp1 ; ;........................................ ; ; UART_ChkIdle ; ; Wait for 2 character times of idle on receiver pin ; ; Character Time @ 38400 = 10x26 uS ; --> we need to wait 520uS min. ; 520uS / 5uS per pass = 104 passes UART_ChkIdle movlw 104 movwf Timer:LSB :Loop clrwdt btfss XBIT ; Transmitter "idle" right now? goto UART_ChkIdle ; No, reset timer decfsz Timer:LSB,F ; Timer expired? goto :Loop ; No, check bit again retlw 0 ; Yes, back to caller ; ;........................................ At 12:14 PM 12/14/98 -0700, you wrote: >I would like a 16F84@4MHz or a 12C671@10MHz to communicate with a PC at high speed (my goal is 38.4 kbps). The software uart given in AN555 from microchip says it can provide 4800 baud @ 4MHz or 19200 @ 10MHz. I am wondering if I can buy a separate hardware uart (usart?) and get better performance (with simpler software)? Any leads to where I can find examples/suggestions/help? ================================================================== Andy Kunz - Statistical Research, Inc. - Westfield, New Jersey USA ==================================================================