Seo 0 Posted November 1, 2014 Share Posted November 1, 2014 Hi Everyone Im newbie in tiva c. I am writing code for adc. It sending with uart. I am sending adc values. a[3] = ulADC0Value[0]%10 + 48; ulADC0Value[0] = ulADC0Value[0]/10 ; a[2] = ulADC0Value[0]%10 + 48; ulADC0Value[0] = ulADC0Value[0]/10 ; a[1] = ulADC0Value[0]%10 + 48; a[0] = ulADC0Value[0]/10 + 48; UARTCharPutNonBlocking(UART0_BASE, a[0]); UARTCharPutNonBlocking(UART0_BASE, a[1]); UARTCharPutNonBlocking(UART0_BASE, a[2]); UARTCharPutNonBlocking(UART0_BASE, a[3]); But this sending only one charecter. I want to send data in a line. Example UARTCharPutNonBlocking(UART0_BASE,50); but its sending only 5 or 0 . I saw Uartprintf but its in stellaris. It didnt work for tiva c. Waiting Helps Thanks. Quote Link to post Share on other sites
L.R.A 78 Posted November 1, 2014 Share Posted November 1, 2014 You can use the UART Studio utility from TivaWare to send multiple bytes. Now if you don't want, for some odd reason, to use uart studio. The UART just sends 1 byte at a time. To send a string you need to send each byte at a time. There's a example in TivaWare called uart_echo. Remember to check TivaWare examples in TivaWare_C_Series-2.1.0.12573\examples. Chose your board and check them out You need to use a function kinda like this, which is what basically the UART Studio has (it has more things, like see if it's a double, int, a window console printf) //***************************************************************************** // // Send a string to the UART. // //***************************************************************************** void UARTSend(const uint8_t *pui8Buffer, uint32_t ui32Count) { // // Loop while there are more characters to send. // while(ui32Count--) { // // Write the next character to the UART. // ROM_UARTCharPutNonBlocking(UART0_BASE, *pui8Buffer++); } } Quote Link to post Share on other sites
Lyon 3 Posted November 2, 2014 Share Posted November 2, 2014 Hi, Two small observations: a) UART Studio is a new name, original one is "uartstdio", -stdio comes from standard input-output. UARTprintf provides formatted output only for integers, pointers, strings and chars, while floats or even doubles are avoided. L Quote Link to post Share on other sites
L.R.A 78 Posted November 2, 2014 Share Posted November 2, 2014 Hi, Two small observations: a) UART Studio is a new name, original one is "uartstdio", -stdio comes from standard input-output. UARTprintf provides formatted output only for integers, pointers, strings and chars, while floats or even doubles are avoided. L Doh!! i thought stdio was short for studio. This changes everything, i must now go eat so i can take such new knowledge (i am not kidding) Quote Link to post Share on other sites
Lyon 3 Posted November 2, 2014 Share Posted November 2, 2014 Hi, Today is still sunday, you have several hours to go out with/for girls, tomorrow wold be another good day to aquire new data.... L Quote Link to post Share on other sites
L.R.A 78 Posted November 2, 2014 Share Posted November 2, 2014 Eheh, i wish it was like that. I have to much to study to not consider Sunday just another week day (dam you MatLab and Fourier) spirilis 1 Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.