2006/6/8, Tom Sefranek wrote: > I believe this is EXACTLY what I cloned for my code. > But I'll check when I get to work. Hi Tom, How thing goes? > >#include > >#include > > > >#define SPEN 0x8000u > >#define TXEN 0x0400u > >#define TRMT 0x0100u > >#define TXBF 0x0200u > >#define RCDA 0x0001u > > > >int write(int handle, void *buffer, unsigned int len) > >{ > > int i; > > > > switch (handle) > > { > > case 0: > > case 1: > > case 2: > > if ((U2MODE & SPEN) == 0) > > { > > U2BRG = 0; > > U2MODE |= SPEN; > > } > > if ((U2STA & TXEN) == 0) > > { > > U2STA |= TXEN; > > } > > for (i = len; i; --i) > > { > > while (U2STA & TXBF); > > U2TXREG = *(char*)buffer++; > > } > > break; > > default: > > break; > > } > > return(len); > >} Just a point need to clarify for above example: You might want to move the default: break; part to join up with cases 1, 2 and 3... Note that in that example, if the program execution reachs that point, no output is actually processed, BUT the function will return (len) anyway. Or you might want to write your own implementation at all. Best wishes, -- WH Tan -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist