Hello,
I am trying to use UART4 for one of my applications, but can't make it work.
I don't receive any data trough the terminal. Scoping the signal I notice that the TX pin level is constant high.
Here is my code:
#include <stdint.h> #include <stdbool.h> #include "driverlib/sysctl.h" #include "driverlib/gpio.h" #include "driverlib/gpio.c" #include "driverlib/pin_map.h" #include "inc/hw_memmap.h" #include "inc/hw_types.h" #include "inc/hw_gpio.h" #include "utils/uartstdio.c" #include "driverlib/uart.c" void UartSetup(void); int main () { int i; SysCtlClockSet(SYSCTL_SYSDIV_5| SYSCTL_USE_PLL | SYSCTL_OSC_INT | SYSCTL_XTAL_16MHZ); SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOF); UartSetup(); while(1) { for (i = 0; i < 1000; i++) { UARTprintf("\rHello Riko %d!", i); SysCtlDelay(40000); } } } void UartSetup(void) { SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOC); SysCtlDelay(3); GPIOPinConfigure(GPIO_PC4_U4RX); GPIOPinConfigure(GPIO_PC5_U4TX); SysCtlPeripheralEnable(SYSCTL_PERIPH_UART4); SysCtlDelay(3); GPIOPinTypeUART(GPIO_PORTC_BASE, GPIO_PIN_4 | GPIO_PIN_5); UARTClockSourceSet(UART4_BASE, UART_CLOCK_PIOSC); UARTStdioConfig(4, 9600, 16000000); }
It compiles but I don't get the output. I tried with UART0 and it worked just fine, but with UART4 don't have same outcome.
Please help. Thank you!