UART

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

 HAI

   

 I want to convert Hex to Dec value and that decimal value display on pc using UART , Now  how can i send decimal value to UART ,which logic is apply here. plz help me for  programing

0 Likes
1 Solution
Anonymous
Not applicable

One way is to use the C compiler function - utoa() to convert from unsigned integer to a string and then use UART function - UART_PutString()

   

utoa() function accepts argument to set the base. For details refer C Language Compiler user guide.pdf in the documentation directory of PSoC designer installation folder. 

View solution in original post

0 Likes
6 Replies
Anonymous
Not applicable

One way is to use the C compiler function - utoa() to convert from unsigned integer to a string and then use UART function - UART_PutString()

   

utoa() function accepts argument to set the base. For details refer C Language Compiler user guide.pdf in the documentation directory of PSoC designer installation folder. 

0 Likes
MeenakshiR_71
Employee
Employee
100 likes received 50 likes received 25 likes received

You can also refer the C language compiler guide here; Table 5-1 on Page 24 can help you with the description of all available APIs and the header that has it.

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

Is your question related to converting from hex to ASCII or are you asking for how to send characters through UART?

   

 

   

Bob

0 Likes
Anonymous
Not applicable

 my question is -->

   

suppose if i take decimal value 12345, how can i send to pc using UART ? which conditions are use in c language?

0 Likes
Anonymous
Not applicable

 my question is -->

   

suppose if i take decimal value 12345, how can i send to pc using UART ? which conditions are use in c language?

0 Likes
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

Use the itoa(), ltoa(), ftoa() type functions, and send the character out

   

as a byte/char via UART send function, like

   

 

   

void UART_Write(char * aStr, BYTE bCnt)

   

 

   

Regards, Dana.

0 Likes