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.

UART communication from TM4C1230C3PM to Arduino Uno Rev.3 and USB connection from Arduino to PC

Other Parts Discussed in Thread: TM4C1230C3PM

I would like to communicate TM4C1230C3PM to  Arduino Uno Rev.3  using UART 

and want to see the output from TM4C1230C3PM using Arduino's serial monitor in the PC.

Is there any way I could accomplish this??


It kind of showed the output when I plugged the rx,tx pin from TM4C1230C3PM into Digital 0 and 1

however, the number seemed okay while the string values were awkward.

I figured out it was inappropriate to connect Digital 0 and 1 while using Serial monitor with USB connection for the Arduino.

So I set the rx,tx pin to Digital 2 and 3.

But now, the serial monitor  showed "Start UART test" and "connected" , but that was it. 

Here's my codes:

for TM4C1230C3PM

#include <stdio.h>
#include <stdint.h>
#include <stdbool.h>
#include <math.h>

#include "inc/hw_memmap.h"
#include "inc/hw_types.h"
#include "inc/hw_uart.h"
#include "inc/hw_gpio.h"
#include "inc/hw_ints.h"

#include "driverlib/pin_map.h"
#include "driverlib/rom.h"
#include "driverlib/rom_map.h"
#include "driverlib/adc.h"
#include "driverlib/gpio.h"
#include "driverlib/uart.h"
#include "driverlib/ssi.h"
#include "driverlib/sysctl.h"
#include "driverlib/systick.h"
#include "driverlib/fpu.h"

#include "utils/uartstdio.h"
#include "utils/softssi.h"

#include <string.h>

void ConfigureUART(void){


ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOA);
ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_UART0);

ROM_GPIOPinConfigure(GPIO_PA0_U0RX);
ROM_GPIOPinConfigure(GPIO_PA1_U0TX);
ROM_GPIOPinTypeUART(GPIO_PORTA_BASE, GPIO_PIN_0 | GPIO_PIN_1);

ROM_UARTClockSourceSet(UART0_BASE, UART_CLOCK_PIOSC);
UARTStdioConfig(0, 115200, 16000000);
}

int main(void){

UARTprintf("\n abcd");  

}

for Arduino

#include <SoftwareSerial.h>
SoftwareSerial port(2, 3); // Rx, Tx

void setup(){
Serial.begin(57600);
Serial.println("Start UART test");
port.begin(57600); 
Serial.println("connected");
}


void loop(){
if(port.available()){
Serial.print((char)port.read());
//Serial.print(port.read()); // trial 1
//Serial.write((char)port.read()); // trial 2
}
}

/*
void loop() // trial 3
{
if (port.available())
Serial.write(port.read());
if (Serial.available())
port.write(Serial.read());
}
*/

 

  • Hello Sukgyu,

    Do you mean that you want to communicate between Arduino and TM4C123. If yes then please take care of the following

    1, The Baud Rate for TM4C123 as per the code above is 115200bps. But the same for Arduino is 57600bps. They will not talk till the same baud rate is used
    2. The Arduino kits have 5V IO's while TM4C123 are 3.3V IO's. You would need a Level Shifter from TM4C123 to Arduino. On the other path it is OK as TM4C123 has 5V tolerant IO;s.

    Regards
    Amit