Other Parts Discussed in Thread: EK-LM3S8962, MAX232
I'm trying to use the EK-LM3S8962 UART1 to communicate with a Computer.First I connected the EK to a MAX232 transceiver and tried to run UART echo example. I use Motocross to receive and send chars at the COM Port.
The example worked fine, but when I made my own UART experimental program, very similar to the example, it didn't work...
After some time of debug I find out that when I call the RIT128x96x4Init (1000000) function, my program works fine and, at the same way, when I erase that function from the UART echo example (erasing, also, all the calls for the OLED), the sample don't work.
Do someone know if there is there any command inside RIT128x96x4Enable that is necessary to the UART to work?
My main function is as shown below (the UARTSend function is copy/pasted from the UART echo example):
SysCtlClockSet ( SYSCTL_SYSDIV_4 | SYSCTL_USE_PLL | SYSCTL_OSC_MAIN | SYSCTL_XTAL_8MHZ );
SysCtlPeripheralEnable ( SYSCTL_PERIPH_GPIOD );
SysCtlPeripheralEnable ( SYSCTL_PERIPH_UART1 );
GPIOPinTypeUART ( GPIO_PORTD_BASE , GPIO_PIN_2 | GPIO_PIN_3 );
UARTConfigSetExpClk ( UART1_BASE , SysCtlClockGet() , SerialBAUDRate , ( SerialNumBits | SerialStopBits | SerialParity ) );
UARTEnable ( UART1_BASE );
// RIT128x96x4Init(1000000);
UARTSend ( (unsigned char *) "A porta serial RS232 esta sendo acessada." , 41 );
while(1) {
*pBufferRX = UARTCharGetNonBlocking ( UART1_BASE );
if ( *pBufferRX != -1 ) {
UARTCharPutNonBlocking ( UART1_BASE , *pBufferRX );
pBufferRX++;
}
}
return 0;