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 by serial port to hyperterminal



i have written a code for sending  a single char to hyperternminal but now working ...

SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOA);
SysCtlPeripheralEnable(SYSCTL_PERIPH_UART0);
GPIOPinConfigure(UART0_BASE);
GPIOPinConfigure(UART0_BASE);
GPIOPinTypeUART(GPIO_PORTA_BASE, GPIO_PIN_0 | GPIO_PIN_1);
// configure UART baud, data bits, parity, stop bits, and flow control
UARTConfigSetExpClk(UART0_BASE, SysCtlClockGet(), 9600, UART_CONFIG_WLEN_8);
UARTFlowControlSet(UART0_BASE, UART_FLOWCONTROL_NONE);


while(1)
{

GPIO_PORTG_DATA_R=0x00;
delay(1000);
GPIO_PORTG_DATA_R=0xFF;
delay(1000);
UARTCharPut(SYSCTL_PERIPH_UART2,'B');

}

can anybody give me a working code ??

  • Hi,

    1) Why twice GPIOPinConfigure(UART0_BASE) ? First, the parameter passed is wrong, the real call is

    GPIOPinConfigure(unsigned long ulPinConfig) - read the comments before this function definition in gpio.c file. Take into account it may not be useful for your micro - you don't told us which is the micro used and/or you have your own board or use a development board from TI.

    2) Similar problem for the call UARTCharPut() - SYSCTL_PERIPH_UART2 is wrong (not the same as UART2_BASE) and should be UART0_BASE since you did not initialized UART2, but UART0.

    3) If you use a TI board, then UART0 of the micro is directed to USB and seen as a virtual COM port - take the number of that port and assign it to hyperterminal.

    4) Search this forum - there are many posts dealing with the UART0 configuration.

    Petrei

     

  • Hello Raj Kumar,

    I would like you to work with the sample code, UART ECHO. This will be available with your CD manual given along wit the development board.

    As for the next step figure out the hardware connectivity problem in-case if you connect the board via cable.

    I guess you would be able to find out the soln..

    You have enabled UART0 for transmission but I really wander that why you use UART2 to print the character B. => UARTCharPut(SYSCTL_PERIPH_UART2,'B'); 

    Also whenever you post in TI forum please do mention the type ob board you are using .

    I guess this could solve your problem.