Hello, I need to know if is possible use 1 TIVA to be my transmitter, and another to be the receiver. Theres is some code example for that? A example for transmitter, and one for receiver.
I'm using TM4C123G.
Thanks
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
João,
Yes, it is perfectly possible.
You can connect each of the 8 uarts of your Tiva to 8 different targets, no problem.
Just use the TivaWare UART examples to learn how to transmit and receive bytes. And then, create your own rules as to what "the bytes mean".
We have several successful cases of transmissions at 921600 bps, and if your electric connection is good enough, you can probably double that with no errors.
Saudações
Bruno
PS: You can test your software using only one Launchpad: the "loopback mode" would send back to the same uart port - but it is nicer if you add two cables connecting different Tx and Rx, so that you can have, for example, UART1 talking to UART2.
Hello. I getted a frequency of 93Kbps, with a bound rate of 921600. How could I get send the bytes more fast than that?
Using TM4C123G, my code:
// // Variables // //***************************************************************************** uint32_t count_buffer; char TX_BUFFER[] = {0xFF}; //***************************************************************************** // // Send Byte by byte // //***************************************************************************** void Send_Data(void) { /* ---------------------------------------------------------------------------------------------------------------- */ // LED On GPIOPinWrite(GPIO_PORTF_BASE, GPIO_PIN_1, GPIO_PIN_1); /* ---------------------------------------------------------------------------------------------------------------- */ UARTCharPutNonBlocking(UART1_BASE, TX_BUFFER[0]); //UARTCharPutNonBlocking(UART1_BASE, TX_BUFFER[1]); UARTCharPutNonBlocking(UART1_BASE, '\n'); /* ---------------------------------------------------------------------------------------------------------------- */ // LED Off GPIOPinWrite(GPIO_PORTF_BASE, GPIO_PIN_1, ~GPIO_PIN_1); /* ---------------------------------------------------------------------------------------------------------------- */ } int main(void) { // // Set the clocking to run directly from the crystal. // SysCtlClockSet(SYSCTL_SYSDIV_1 | SYSCTL_USE_OSC | SYSCTL_OSC_MAIN | SYSCTL_XTAL_16MHZ); // Configure FPU - Lazy stacking FPULazyStackingEnable(); // Enable FPU FPUEnable(); SysCtlPeripheralEnable(SYSCTL_PERIPH_UART1); SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOB); SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOF); SysCtlDelay(3); //Set GPIO F1, F2 and F3 as Output pins. GPIOPinTypeGPIOOutput(GPIO_PORTF_BASE, GPIO_PIN_2 | GPIO_PIN_1 | GPIO_PIN_3); // // Set GPIO B0 and B1 as UART pins. // GPIOPinConfigure(GPIO_PB1_U1TX); GPIOPinTypeUART(GPIO_PORTB_BASE, GPIO_PIN_0 | GPIO_PIN_1); // // Configure the UART for 921.600, 8-N-1 operation. // UARTConfigSetExpClk(UART1_BASE, SysCtlClockGet(), 921600, (UART_CONFIG_WLEN_8 | UART_CONFIG_STOP_ONE | UART_CONFIG_PAR_NONE)); //Isso da uma frequencia de aprox 93Kbps // Enable UART1 FIFO buffer UARTFIFOEnable(UART1_BASE); // Enable UART1 UARTEnable(UART1_BASE); while (1) { GPIOPinWrite(GPIO_PORTF_BASE, GPIO_PIN_2, 0xFF); Send_Data(); // LED Off GPIOPinWrite(GPIO_PORTF_BASE, GPIO_PIN_2, 0x00); } }