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());
}
*/