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.

send data from Stellaris LM4F232 device to a PC(hyperterminal - RS232) via UART1

Other Parts Discussed in Thread: MAX232

Hi guys,

Good day!!

I am trying to send data from   Stellaris LM4F232 device to a PC(hyperterminal - RS232) via UART1  and I found some example codes shown below. but these are for UART0. Can anyone show me the documentation regarding the functions used in the code below? I can't seem to find it in the package from Stellaris EKL-LM4F232 Evaluation Board.

//
    // Set the clocking to run directly from the crystal.
    //
    ROM_SysCtlClockSet(SYSCTL_SYSDIV_4 | SYSCTL_USE_PLL | SYSCTL_XTAL_16MHZ |
                       SYSCTL_OSC_MAIN);

    //
    // Initialize the UART.
    //
    ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOA);
    ROM_GPIOPinConfigure(GPIO_PA0_U0RX);
    ROM_GPIOPinConfigure(GPIO_PA1_U0TX);
    ROM_GPIOPinTypeUART(GPIO_PORTA_BASE, GPIO_PIN_0 | GPIO_PIN_1);
    UARTStdioInit(0);

    UARTprintf("Hello, world!\n");

Thanks,

Sherwin

  • Believe that which you seek is w/in StellarisWare\docs - file is "SW-DRL-UG-8555.pdf"  This is the User Guide which will list & detail the non-ROM versions of those functions.

    Use care in connecting the raw MCU to any PC - you need an RS232 level shifter to lower the voltage levels on the PC side - hope your MCU is ok...

  • cb1_mobile said:
    Use care in connecting the raw MCU to any PC - you need an RS232 level shifter to lower the voltage levels on the PC side

    Rather than mess about with RS232, I suggest that you get some of these:

    http://www.ftdichip.com/Products/Cables/USBTTLSerial.htm

    You will need the 3V3 version - it has the correct logic voltage levels to connect direct to a microcontroller's UART pins.

    I note that TI now ship these with some of the Stellaris kits...

  • thanks for pointing me to the right document... and yes  I got my HW set-up pretty sure.. we've got a level converter in our uart to rs232 connection.. its just that I don't have any document to refer on those functions used by the examples.. 

    cheers,

    sherwin tiongson

  • sherwin tiongson said:
    those functions used by the examples

    Which functions?

    Regarding documentation on the UART... functions, see: http://e2e.ti.com/support/microcontrollers/stellaris_arm_cortex-m3_microcontroller/f/474/t/113624.aspx

  • Andy Neil said:
    Rather than mess about with RS232

    Agreed that "all in one" such cable is efficient/simplification.

    However - in at 2 least cases - bad things can happen!

    a) PC or device may not have USB port.  (unlikely for PC - but thousands of instruments/devices walked the earth avec Tyranosaurus & co. - bellowing via RS232)

    b) Imagine poster's MCU board - 3-4 years out - with "handy-dandy" 0.100" header - just "waiting" for raw, RS232 signal plug-in.  (can you say arrivederci MCU?)

    If poster is like most - documentation specifying "that" FTDI cable ONLY shall be used - will be long gone - would be repair crew will "plug-in" @ RS232 levels - and sparks will fly.  (this reporter has personally witnessed - more than once...)

    Sometimes the "mess" of solid - "always there" hardware (i.e. on board level shifter) pays large dividends...

  • cb1_mobile said:
    PC or device may not have USB port.  (unlikely for PC - but thousands of instruments/devices walked the earth avec Tyranosaurus & co.)

    It is by far and away more likely that a PC will not have an RS232 port than that it will not have a USB port.

    The request was specifically about connection to a PC;  agree that connection to other devices - particularly "non-host" devices - is an entirely different matter!

  • Hi andy,

    the functions are below

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

    thnanks again for pointing me to the docs.. this will help me a lot..

  • cb1, Do you have a part num for one of these? Do you also need a driver for rs232? Ed
  • Ed said:
    one of these?

    Brevity often desirable - not so much when clarity is required.  A CMOS to RS232 level translator (tx & rx) will properly mate your MCU to a PC's serial port or non-PC device generating RS232 levels.  We use exotic "combo" IC - manages both RS232 & RS485/422 - likely too much for your ap.  TI makes several - look for their cross for MAX232 - with 3V power and 3V CMOS levels.  (older devices were 5V)

    Should "one of these" have meant the FTDI "all in one" cable - the FTDI web-site should quickly solve.

    During your experimentation you may seek to talk "MCU to MCU."  Use of the level translators here is not required if your separation is under a meter or so.  We find it useful to route both CMOS and RS232 levels to our connectors - with the safety of unfilled 0-ohm Rs required to enable MCU to MCU level serial commo.