Question: i need my code in keill u vision to use these parameters for teraterm. Baud Rate 1 1 5 2 0 0 8 bits, odd
i need my code in keill u vision to use these parameters for teraterm.
Baud Rate
bits, odd parity, stop bits
Prescaler
:
#include
#include
#include
#include TMCh
#include "LabThu.h
#include TMCNCPDTh
Function to setup GPIO for UART
void setupGPIOvoid
Enable the clock for GPIO Port P
SYSCTLRCGCGPIO ; Enable clock for GPIO Port P
while SYSCTLPRGPIO & ; Wait for the clock to be ready
Enable the clock for UART
SYSCTLRCGCUART ; Enable clock for UART
while SYSCTLPRUART & ; Wait for the clock to be ready
Configure GPIO pins for UART
GPIOPAFSEL ; Enable alternate function on PP and PP
GPIOPPCTL GPIOPPCTL & ~xFFxx; Set PCTL for UART
GPIOPDEN ; Enable digital function on PP and PP
Function to setup UART
void setupUARTvoid
Disable UART before configuration
UARTCTL & ~x; Clear UARTEN bit to disable UART
Set baud rate
uintt brd ; Integer part of the BRD
uintt fbrd ; Fractional part of the BRD
UARTIBRD brd;
UARTFBRD fbrd;
Set UART configuration: bit data, odd parity, stop bit
UARTLCRH xxxx;
Enable UART
UARTCTL x; UARTEN TXE RXE
int mainvoid
uintt c;
setSysClkMHz; Do NOT remove. Set the System clock to MHz
RedirectOutput; Do NOT remove. Redirect output from U to the terminal via U
setupGPIO; Setup GPIO for UART
setupUART; Setup UART
bannerStart typing. You should see the keys echoed on the terminal";
ECHO loop
while
Echo keys back to you
This tests your connection
c readUART; Read from UART make sure this function reads from UART
writeUARTc; Write to UART make sure this function writes to UART
return ;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
