You are here

UART | Cypress Semiconductor

UART

Summary: 4 Replies, Latest post by danaaknight on 19 Feb 2013 11:06 AM PST
Verified Answers: 0
Last post
Log in to post new comments.
YVRAO's picture
User
56 posts

 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

hli
user_78878863's picture
User
2759 posts

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

YVRAO's picture
User
56 posts

  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?

hli
user_78878863's picture
User
2759 posts

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 )

user_14586677's picture
User
7648 posts

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.

Log in to post new comments.