Hi All.
Following is a bare minimum code of interaction with UART3 on the Tiva-Launchpad.
#include <stdint.h>
#include <stdbool.h>
#include <string.h>
#include "inc/hw_memmap.h"
#include "driverlib/gpio.h"
#include "driverlib/pin_map.h"
#include "driverlib/sysctl.h"
#include "driverlib/uart.h"
#include "driverlib/rom.h"
int main(int argc, char** argv)
{
/*
* Set the clocking to run directly from the crystal.
*/
ROM_SysCtlClockSet(SYSCTL_SYSDIV_1 | SYSCTL_USE_OSC | SYSCTL_OSC_MAIN |
SYSCTL_XTAL_16MHZ);
ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_UART3);
ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOC);
GPIOPinConfigure(GPIO_PC7_U3TX);
ROM_GPIOPinTypeUART(GPIO_PORTC_BASE, GPIO_PIN_7);
ROM_UARTConfigSetExpClk(UART3_BASE, ROM_SysCtlClockGet(), 9600,
(UART_CONFIG_WLEN_8 | UART_CONFIG_STOP_ONE |
UART_CONFIG_PAR_NONE));
ROM_UARTCharPut(UART3_BASE, 'a');
while(1)
{
}
return 0;
}
The pin PC7 is connected to TX-pin of RS232-TTL, and the RS232-TTL further connected to a serial-USB converter.
Finally, the USB is inserted into my laptop running Ubuntu 14.04, and a putty-session opened (using the same BAUD settings as specified in code).
Whenever the program is loaded, a '0' is printed on the putty-session.
Anything wrong in the code? If not, I will proceed to specifying the details of RS232-TTL (don't want to clutter too many things in the question).
A lot of hours have been spent already on this, any help will be GREATLY appreciated.
Thanks and Regards,
Ajay