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
  • Yes, it is.

    The header of the c file says

    /*----------------------------------------------------------------------------
     *      Name:    ARM_Serial.c
     *      Purpose: For Luminary Micro LM3SXXXX microcontrollers
     *               adapted from Template generic driver for LabVIEW
     *      Version: v1.00
     *      Note(s):
     *----------------------------------------------------------------------------
     *      This file is part of the uVision/ARM development tools.
     *      This software may only be used under the terms of a valid, current,
     *      end user licence from KEIL for a compatible version of KEIL software
     *      development tools. Nothing else gives you the right to use it.
     *
     *      Copyright (c) 2007 Keil Software.
     *---------------------------------------------------------------------------*/
    

    These codes bellow are test codes I wrote, which doesn't work. Did I make a mistake or do I need to do something else to use serial port?

    //initialize serial port
    int ret;
    ret = ARM_Serial_InitPort(0, 9600, 8, 0, 10);
    printf("initialize-ret:%d",ret);
    
    
    
    //Write data to serial port
    int l = 5;
    int ret;
    char *x;
    x="test";
    ret = ARM_Serial_Write(0, x, &l);
    printf("writing-ret:%d\n",ret);
    

Reply
  • Yes, it is.

    The header of the c file says

    /*----------------------------------------------------------------------------
     *      Name:    ARM_Serial.c
     *      Purpose: For Luminary Micro LM3SXXXX microcontrollers
     *               adapted from Template generic driver for LabVIEW
     *      Version: v1.00
     *      Note(s):
     *----------------------------------------------------------------------------
     *      This file is part of the uVision/ARM development tools.
     *      This software may only be used under the terms of a valid, current,
     *      end user licence from KEIL for a compatible version of KEIL software
     *      development tools. Nothing else gives you the right to use it.
     *
     *      Copyright (c) 2007 Keil Software.
     *---------------------------------------------------------------------------*/
    

    These codes bellow are test codes I wrote, which doesn't work. Did I make a mistake or do I need to do something else to use serial port?

    //initialize serial port
    int ret;
    ret = ARM_Serial_InitPort(0, 9600, 8, 0, 10);
    printf("initialize-ret:%d",ret);
    
    
    
    //Write data to serial port
    int l = 5;
    int ret;
    char *x;
    x="test";
    ret = ARM_Serial_Write(0, x, &l);
    printf("writing-ret:%d\n",ret);
    

Children