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 it display to pc

   

How can i send decimal value through uart for psoc. which logic  is  use here

   

plz help me for programing

0 Likes
4 Replies
HeLi_263931
Level 8
Level 8
100 solutions authored 50 solutions authored 25 solutions authored

You might want to use the itoa() function: http://www.cplusplus.com/reference/cstdlib/itoa/

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
HeLi_263931
Level 8
Level 8
100 solutions authored 50 solutions authored 25 solutions authored

Where does this decimal value come from? Is it something you calculate in your program?

   

Otherwise, have a look at the API for the UART component (http://www3.cypress.com/?rID=48892 )

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

If you want to convert hex to dec char representation use spintf(). Then use

   

void UART_Write(char * aStr, BYTE bCnt) to send the data.

   

 

   

Or use the following to send as chars via Tx, using

   

 

   

void UART_PutSHexByte(BYTE bValue)

   

void UART_PutSHexInt(int iValue)

   

 

   

Regards, Dana.

0 Likes