This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

How to change baud rate using UART during run time?

i was trying UART on the EK-TM4C1294XL. Basically i have a task to write code
for uart. On uart teminal menu will get printed in which user will have a option
to choose specific settings for the serial terminal according to there requirment.
So user can be able to change baud rate suring run time. Here first thing need to check is
whether user entered right baud rate or not.

We have "UARTCharGet(UART0_BASE)" api so using this we can
get data from user but if user entered "9600" and it will come like this
9->0x39
6->0x36
0->0x30
0->0x30

Now the qustion arises that how we can pass the data to the function "MAP_UARTConfigSetExpClk"????????????????

Any help will be really appreciated!!

Below is my code.

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include <stdint.h>
#include <stdbool.h>
#include <stdio.h>
#include "TM4C129.h" // Device header
#include "RTE_Components.h" // Component selection
#include "FreeRTOSConfig.h" // ARM.FreeRTOS::RTOS:Config
#include "FreeRTOS.h" // ARM.FreeRTOS::RTOS:Core
#include "task.h" // ARM.FreeRTOS::RTOS:Core
#include "timers.h" // ARM.FreeRTOS::RTOS:Timers
#include "EventRecorder.h" // Keil.ARM Compiler::Compiler:Event Recorder
#include "EventRecorderConf.h" // Keil.ARM Compiler::Compiler:Event Recorder
//*****************************************************************************
#include "inc/hw_types.h"
#include "inc/hw_ints.h"
#include "inc/hw_memmap.h"
#include "inc/hw_nvic.h"
#include "driverlib/debug.h"
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

0