Hi Chris, thanks for your replay. in my case i only want to send data instead of asci= i in hex. number 2. if I just use=A0 sprintf(output, "%x", variable);=A0 uart4 doesn't see it =A0putcUART4(output[i])=A0 works but then I need to convert data ascii to hex this is what use instead of sprintf. // ************************************************************************= ***** // void UARTTxBuffer(char *buffer, UINT32 size) // ************************************************************************= ***** void Send_String_to_U4(const char *buffer, UINT32 size) { =A0 =A0 while(size) =A0 =A0 { =A0 =A0 =A0 =A0while (U4STAbits.UTXBF =3D=3D 1); //wait until ready "RS232" =A0 // =A0 =A0 =A0U4TXREG =3D *buffer; =A0 =A0 =A0 =A0 putcUART4(*buffer); =A0 =A0 =A0 =A0 buffer++; =A0 =A0 =A0 =A0 size--; =A0 =A0 } } in pic32 there is a command starts with _32 to mention witch uart to send d= ata to before sprintf() I forgot the name. how can i cast using putcUART4() thanks On Sunday, December 29, 2013 9:09 AM, Chris McSweeny = wrote: =20 I don't know pic24, but in general two ways to do what you're trying to do in c. 1) Use fprintf - usage: fprint(file, format, parameters...) e.g. fprintf(uart4, "%x", variable); - though I don't know if you can use uart4 directly in that way, or if there is a way to pointfprintf at uart4. 2) Use sprintf - usage: sprintf(char*, format, parameters...) e.g. char output[20]; sprintf(output, "%x", variable); for(i=3D0; iwro= te: > Hi all, > > I am using pic24 and for some reason I am unable to figure out how to sen= d > massage to uart 4 using printf(). > I also use putcUART4() but in my case i want to use printf() to do > conversion between hex or ascii. what I remember supposed > to be a command to point it to uart4 before using printf() or any uart. > does anyone have any idea? > > thanks > > AA > -- > http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive > View/change your membership options at > http://mailman.mit.edu/mailman/listinfo/piclist > --=20 http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist --=20 http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .