with a 4Mhz Xtal, and the code that I use, I can get 9600 baud Tx or Rx not both, because I'm not using interrupts to keep the routine as simple as possible, you can include it almost in any program with minor modifications, I know that here in the list are better ones but this one is very simple :-). Serial TX routine: ; ************************************************* ; ** transmit routine ** ; ** W must have the data to be transmitted ** ; ************************************************* ; Note: _tx is the bit used for transmit data, must be set as output. ; baudrate is a constant see initialization. ; you must declare as registers the follow: txreg, delay & count ; send mov txreg, W clrb _tx ;send start bit mov W, #baudrate mov delay, W mov W, #9 mov count, W txbaudwait decsz delay jmp txbaudwait mov W, #baudrate mov delay, W decsz count jmp sendnextbit mov W, #9 mov count, W setb _tx ;send stop bit retw #0 sendnextbit rr txreg sb C ;check next bit to tx jmp setlo setb _tx ;send a high bit jmp txbaudwait setlo clrb _tx ;send a low bit jmp txbaudwait ; end ; ********************************************* ; ** Serial RX routine ** ; ** before call this one ; ********************************************* ; same as below but _rx must be declared as pin, and configured as input. ; also declare rcreg as register ; count must have the value 9 before call this routine (needed only the ; first time you call it). ; receive snb _rx jmp $-1 mov W, #baudrate mov delay, W rxbaudwait decsz delay jmp $-1 mov W, #baudrate mov delay, W decsz count jmp recvnextbit mov W, #9 mov count, W retw #0 recvnextbit clrb C snb _rx setb C rr rcreg jmp rxbaudwait ; Remember that when you call receive routine, it will keep looping until a low state (start bit) can be detected, then it will get the 8 bits and exit routine, if you are planning to receive many bytes, you must call this one again, as much as characters to receive you are especting. with some programming you can modify that to do other jobs in the mean time, but keep in mind the timming factor, at 4Mhz and high baud rates it's very critical!. there is no parity check, only 8N1 format. At the start of the program you must declare the follow: ; ; definitions... ; count equ $10 delay equ $11 txreg equ $12 rcreg equ $13 ; clockrate equ 2000000 ;Xtal value (2Mhz in this case) fclk equ clockrate/4 baudrate equ ((fclk/2400)/3-2) ;2400 is the baud rate ; ; for 4mhz clockrate must be .4000000, etc. but remember that not all combinations work, you must done this calculation by hand to make shure that the baudrate value will not be more than FF or it won't work, in this case the value is : 2e6/4= 5e5/2400 = 208/3 = 69-2 =67.44\ , the value for the baudrate constant will be 67, remember that if the decimal component is more that .5 you must round up the number to avoid errors, also, the smaller value for baudrate, the higher posibility of reception error, so if the number is bigger, will work better. I hope that it can be useful for you, anyway if doesn't work write me and i will try to help you... see you. Leandro J. Laporta (LU2AOQ) mail: lu2aoq@yahoo.com wrk: Arg. Assoc. for Space Tech. ham: TCP/IP high speed group HSG