3284 views|3 replies

9

Posts

0

Resources
The OP
 

TM4C serial port transmission failed [Copy link]

The code written according to the official routine uses serial port 2. If you don’t want to use interrupts to send and receive, use the sending function void UART2_init(void) { SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOD); SysCtlPeripheralEnable(SYSCTL_PERIPH_UART2); GPIOPinTypeUART(GPIO_PORTD_BASE,GPIO_PIN_6|GPIO_PIN_7); OPinConfigure (GPIO_PD7_U2TX); GPIOPinConfigure(GPIO_PD6_U2RX); UARTConfigSetExpClk(UART2_BASE,SysCtlClockGet(),115200,(UART_CONFIG_WLEN_8|UART_CONFIG_STOP_ONE|UART_CONFIG_PAR_NONE)); UARTEnable(UART2_BASE); } Main function: int main() { UART2_init(); while(1) { UARTCharPut(UART2_BASE,0XAA); } } The main function sends a byte 0XAA to the host computer. The host computer receives nothing. I don’t know why. Please give me some advice.

This post is from Microcontroller MCU

Latest reply

I don’t know if it is 1294. If it is 1294, you cannot use SysCtlClockGet() to get the current clock frequency and... You have not defined the UART clock source (call the function UARTClockSourceSet(UART7_BASE, UART_CLOCK_PIOSC); ). If it is 123, I don’t know.  Details Published on 2018-9-19 22:04
 

35

Posts

0

Resources
2
 
You can short-circuit two pins to debug to see if it can close spontaneously. The official serial port process can be used after modification.
This post is from Microcontroller MCU
 
 

5

Posts

0

Resources
3
 
What is the configuration of the serial port of the host computer? Is it the same as the configuration of UARTConfigSetExpClk(UART2_BASE,SysCtlClockGet(),115200,(UART_CONFIG_WLEN_8|UART_CONFIG_STOP_ONE|UART_CONFIG_PAR_NONE));? 115200, 8bit, 1 stop bit, no parity bit
This post is from Microcontroller MCU
 
 
 

1

Posts

0

Resources
4
 
I don’t know if it is 1294. If it is 1294, you cannot use SysCtlClockGet() to get the current clock frequency and... You have not defined the UART clock source (call the function UARTClockSourceSet(UART7_BASE, UART_CLOCK_PIOSC); ). If it is 123, I don’t know.
This post is from Microcontroller MCU
 
 
 

Guess Your Favourite
Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list