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.

UART to send command like generic terminal



Hi all,

I've been trying to operate a motor controller via RS232 from TIVA.

SCX11 controller RS-232c Specification:

Transmission - Start-stop synchronous method, NRZ (Non-Return Zero), full-duplex

Data length - 8bits, 1stop, no parity

Transmission speed - 9600

Protocol - TTY (CR+LF)

Terminal Specification
• ASCII mode
• VT100 compatible recommended
• Handshake: None
• Transmission CR: C-R
• Word wrap: None
• Local echo: None
• Beep sound: ON

My code:

void	CUART::initRS(void)
{
    //
    // Enable the GPIO Peripheral used by the UART.
    //
    SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOP);

    //
    // Enable UART6
    //
    SysCtlPeripheralEnable(SYSCTL_PERIPH_UART6);


    UARTConfigSetExpClk(UART6_BASE, _ui32SysClock, 9600,  	//was 8*115200
                            (UART_CONFIG_WLEN_8 | UART_CONFIG_STOP_ONE |
                             UART_CONFIG_PAR_NONE));
    UARTDisable(UART6_BASE);

    //
    // Configure GPIO Pins for UART mode.
    //
    GPIOPinConfigure(GPIO_PP0_U6RX);
    GPIOPinConfigure(GPIO_PP1_U6TX);
    GPIOPinTypeUART(GPIO_PORTP_BASE, GPIO_PIN_0 | GPIO_PIN_1);

    UARTEnable(UART6_BASE);
    //
    // Initialize the UART for console I/O.
    //
//    UARTStdioConfig(7, 9600, _ui32SysClock);

}

/*___________________________________________________
 *
 *
 */
void	CUART::txRS(char ascii)
{
	UARTCharPut(UART6_BASE, ascii);

}

/*___________________________________________________
 *
 *
 */

void	CUART::txSCX()
{
	char command;

	command = 'm';
	txRS(command);
	command = 'a';
	txRS(command);
	command = ' ';
	txRS(command);
	command = '1';
	txRS(command);

command = 0x0d;
txRS(command);
command = 0x0a;
txRS(command);

}

I looked into the terminal and see that the TIVA is only sending “m/r /n” instead of “ma 1/r/n”

See attached picture. First line is PC attempt, second line is TIVA attempt.

Looking through the forum posts I realized I may need delay/interrupt but I'm unsure if that is the cause of the problem

Any help appreciated

Thanks,

Stephen