This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

ARM:UART Serial comunication on LM3S8962

I am working on LM3S8962 and need to write a program to comunicate with PC via UART. I use Labview inline C node to write codes using ARM_Serial.c which is from Keil Software.

The file has

int ARM_Serial_InitPort (int serDevNo, unsigned long baudrate, unsigned int  databits, unsigned int  parity,   unsigned int  stopbits)
int ARM_Serial_Write (int serDevNo, const char *buffer, int *length)

I tried to use them to control serial port, but it didn't work well. I used U0TX, U0RX and GND pins on micro controller to connect to a serial port in PC.

I couldn't find any information about ARM_Serial_InitPort and ARM_Serial_Write functions on the internet. Any information or tips about it would be very appreciatted.

Thank you.

Masa

Parents
  • I realized that I forgot to use ARM_Serial_OpenPort to open a serial port. Using the function, now it is communicating via serial port, however, characters get garbled. Is there any mistake?

    int ret;
    // PortNumber, serialDeviceNumber=PortNumber+1
    ret = ARM_Serial_OpenPort(1,2);
    
    //serialDeviceNumber, Baud, DataBits, Parity, StopBits
    ret = ARM_Serial_InitPort(2, 9600, 7, 0, 1);
    
    
    //write data to serial
    int l = 5;
    int ret;
    char *x;
    x="abcd";
    ret = ARM_Serial_Write(2, x, &l);
    
    

Reply
  • I realized that I forgot to use ARM_Serial_OpenPort to open a serial port. Using the function, now it is communicating via serial port, however, characters get garbled. Is there any mistake?

    int ret;
    // PortNumber, serialDeviceNumber=PortNumber+1
    ret = ARM_Serial_OpenPort(1,2);
    
    //serialDeviceNumber, Baud, DataBits, Parity, StopBits
    ret = ARM_Serial_InitPort(2, 9600, 7, 0, 1);
    
    
    //write data to serial
    int l = 5;
    int ret;
    char *x;
    x="abcd";
    ret = ARM_Serial_Write(2, x, &l);
    
    

Children