Quantcast
Channel: Microcontrollers
Viewing all articles
Browse latest Browse all 217283

Forum Post: RE: TM4C129XNCZAD: Any sample code for UARTCharPutNonBlocking, using interrupt based communication instead of looping to wait and turn off RS485 transmitter?

$
0
0
[quote userid="345142" url="~/support/microcontrollers/arm-based-microcontrollers-group/arm-based-microcontrollers/f/arm-based-microcontrollers-forum/1420221/tm4c129xnczad-any-sample-code-for-uartcharputnonblocking-using-interrupt-based-communication-instead-of-looping-to-wait-and-turn-off-rs485-transmitter/5446907#5446907"] Starting on Line 87, I see what you posted: // // Loop while there are characters in the receive FIFO. // while(MAP_UARTCharsAvail(UART0_BASE)) { // // Read the next character from the UART and write it back to the UART. // MAP_UARTCharPutNonBlocking(UART0_BASE, UARTCharGetNonBlocking(UART0_BASE)); } [/quote] This is the code to echo back what is received. [quote userid="345142" url="~/support/microcontrollers/arm-based-microcontrollers-group/arm-based-microcontrollers/f/arm-based-microcontrollers-forum/1420221/tm4c129xnczad-any-sample-code-for-uartcharputnonblocking-using-interrupt-based-communication-instead-of-looping-to-wait-and-turn-off-rs485-transmitter/5446907#5446907"]//***************************************************************************** // // 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. // MAP_UARTCharPutNonBlocking(UART0_BASE, *pui8Buffer++); } }[/quote] UARTSend is the function to send any arbitrary length of characters to the UART. You can use this function to send whatever you want to send based on your application..

Viewing all articles
Browse latest Browse all 217283

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>