Hi Ti community,
first thanks for advices that helped me to designed my custom board.
I used TIVA EK-TM4C123GXL as debugger, with CCS V5.4, and in custom board I used TM4C123FH6PMI.
I programmed some code like Blinker and channel 0 uart. all of them work very well.
now I tried to use uart3 in port C PIN6 and 7. but it doesn't work, it doesn't send anything. I wrote simple code exactly like channel 0 but it doesn't work.
this is my first codes with TI microcontrollers excuse me if my questions are so amateur.
channel 0 working code:
#include <stdint.h> #include <stdbool.h> #include "inc/hw_ints.h" #include "inc/hw_memmap.h" #include "inc/hw_types.h" #include "driverlib/gpio.h" #include "driverlib/interrupt.h" #include "driverlib/pin_map.h" #include "driverlib/sysctl.h" #include "driverlib/uart.h" int main(void) { SysCtlClockSet(SYSCTL_SYSDIV_4 | SYSCTL_USE_PLL | SYSCTL_OSC_MAIN | SYSCTL_XTAL_16MHZ); SysCtlPeripheralEnable(SYSCTL_PERIPH_UART0); SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOA); GPIOPinTypeUART(GPIO_PORTA_BASE, GPIO_PIN_0 | GPIO_PIN_1); UARTConfigSetExpClk(UART0_BASE, SysCtlClockGet(), 115200, (UART_CONFIG_WLEN_8 | UART_CONFIG_STOP_ONE | UART_CONFIG_PAR_NONE)); UARTEnable(UART0_BASE); while (1) { UARTCharPut(UART0_BASE, 'H'); UARTCharPut(UART0_BASE, 'i'); SysCtlDelay(2000000); } }
and this is channel 3 non working code:
#include <stdint.h> #include <stdbool.h> #include "inc/hw_ints.h" #include "inc/hw_memmap.h" #include "inc/hw_types.h" #include "driverlib/gpio.h" #include "driverlib/interrupt.h" #include "driverlib/pin_map.h" #include "driverlib/sysctl.h" #include "driverlib/uart.h" int main(void) { SysCtlClockSet(SYSCTL_SYSDIV_4 | SYSCTL_USE_PLL | SYSCTL_OSC_MAIN | SYSCTL_XTAL_16MHZ); SysCtlPeripheralEnable(SYSCTL_PERIPH_UART3); SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOC); GPIOPinTypeUART(GPIO_PORTC_BASE, GPIO_PIN_6 | GPIO_PIN_7); UARTConfigSetExpClk(UART3_BASE, SysCtlClockGet(), 115200, (UART_CONFIG_WLEN_8 | UART_CONFIG_STOP_ONE | UART_CONFIG_PAR_NONE)); UARTEnable(UART3_BASE); while (1) { UARTCharPut(UART3_BASE, 'H'); UARTCharPut(UART3_BASE, 'i'); SysCtlDelay(2000000); } }
I should say I checked connections very well and all connection are ok.