/* * Stellaris LAUNCHPAD LM4F120H5QR * Using UART to write a string into the Serial Monitor without using interrupts * Add the following to Pre-define NAME tab in the predefined Symbols in the Advanced Options * of the ARM compiler in the CCS Build in the project properties * ---> PART_LM4F120H5QR <--- */ #include <inc/hw_memmap.h> #include <inc/hw_types.h> #include <driverlib/gpio.h> #include <driverlib/sysctl.h> #include <driverlib/uart.h> #include <utils/uartstdio.c> void blinkled(void) { GPIOPinWrite(GPIO_PORTF_BASE, GPIO_PIN_1, 2); SysCtlDelay(200000); GPIOPinWrite(GPIO_PORTF_BASE, GPIO_PIN_1, 0); } int main(void) { /* * The System clock is run using a 16 Mhz crystal connected to the main oscillator pins of the microcontroller * This generates a internal clock signal of 400 Mhz using the PLL * The signal is prescaled by the system by 2 * Now we are defining a prescale of 5 in addition to make the clock frequency 40MHz * The system clock frequency must be less than or equal to 80MHz */ SysCtlClockSet(SYSCTL_SYSDIV_5|SYSCTL_USE_PLL|SYSCTL_XTAL_16MHZ|SYSCTL_OSC_MAIN); /* * Peripherals are enabled with this function. * At power-up, all peripherals are disabled. * System Clock to the peripheral must be enabled in order to use ADC */ SysCtlPeripheralEnable(SYSCTL_PERIPH_UART0); SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOA); // As GPIO Pins A0 and A1 are multiplexed with U0RX and U0TX SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOF); //Configuring the LED as output GPIOPinTypeGPIOOutput(GPIO_PORTF_BASE, GPIO_PIN_1); //Configuring the GPIO A0 and A1 for UART functionality GPIOPinConfigure(GPIO_PA0_U0RX); GPIOPinConfigure(GPIO_PA1_U0TX); GPIOPinTypeUART(GPIO_PORTA_BASE, GPIO_PIN_0|GPIO_PIN_1); IntEnable(INT_UART0); UARTIntEnable(UART0_BASE, UART_INT_RX | UART_INT_RT); UARTConfigSetExpClk(UART0_BASE, SysCtlClockGet(), 115200, UART_CONFIG_WLEN_8|UART_CONFIG_PAR_NONE|UART_CONFIG_STOP_ONE); /* * Configures the UART to use the current system clock * Sets the baud rate to 115200 and enables an 8bit no parity one stop bit communication(8-N-1) */ while(1) { unsigned char *buf = "Aravind RIG\n\r"; //Waits until the UART is Ready while(UARTBusy(UART0_BASE)); while(*buf != '\0') //Put the string character by character into the FIFO for transmission UARTCharPut(UART0_BASE, *buf++); blinkled();//blink led to denote a transmission SysCtlDelay(SysCtlClockGet()/2);//wait for a while } }
Ahaa, its pleasant conversation about this article
at this place at this webpage, I have read all that, so
now me also commenting here.