Hello fellow developers!
It is my first question in this board, so I will try to specify as good as I can. I am sorry if I am posting something which were already covered, but I struggled to find any solution to my current problem, and yet the only close case I could find on the topic was this:
Which were never resolved. OK, lets get to the case:
My task is to send information from my TIVA TM4C1294XL board to the PC, so that an application can grab the information and perform tasks according to information. The communication shall be able to go both ways, so that the PC is acting as a master, and the microcontroller as a slave.
I established my UART connection, using UART3, and the setup is looking as follows: (I am using a receive interrupt and setting up the UART to baud 9600, 1 stop bit, no parity, 8 bit length)
SysCtlPeripheralEnable(SYSCTL_PERIPH_UART3); GPIOPinConfigure(GPIO_PA4_U3RX); GPIOPinConfigure(GPIO_PA5_U3TX); GPIOPinTypeUART (GPIO_PORTA_BASE, GPIO_PIN_6 | GPIO_PIN_7 | GPIO_PIN_4 | GPIO_PIN_5); UARTConfigSetExpClk(UART3_BASE, SysCtlClockGet(), 9600, (UART_CONFIG_WLEN_8 | UART_CONFIG_STOP_ONE | UART_CONFIG_PAR_NONE)); IntEnable(INT_UART3); UARTIntEnable(UART3_BASE, UART_INT_RX); UARTEnable(UART3_BASE);
And I then connected the UART RX and UART TX to my FTDI Friend (F232RL chip), which then connects via mini USB to the PC.
I am trying to send data simply with following function, knowing that it will be converted to ASCII characters when I receive on the PC:
void SENDUART3(void) { uint8_t Byte = 0x39; UARTCharPut(UART3_BASE, Byte); }
I am supposed to receive a 9 on the TeraTerm console, but I am instead receing some bullshit characters, which are not even the same characters, and are not rightly interpreted. I have furthermore tried to change the sent value according to asciitable.com, without succes. I am starting to be really lost.
I am transmitting with the 120 [MHz] clock frequency, but I think it should make no difference?
The TeraTerm is setup to receive the right COMport according to my FTDI driver, the right baud rate, the right bit length, parity and stop bits.
To sum up: I can send bytes from uC to PC, but I receive weird values. I can send byte from PC to uC, but I cannot receive it in my uC, returning -1 from the UARTCharGet(); function.
Do you know how my problem can be solved? Can I do something else instead of using the FTDI, for example using the debugger cable to directly communicate with the PC application? Should I approach it in a completely third way?
Any help is much appreciated.
Thanks!