Tool/software: Code Composer Studio
Hi,
Attached is small piece of code that is supposed to send data from the board to the PC via serial link. However, I'm not receiving anything on my PC.
Also, when I check UART0_DR register in the debug mode, DATA bits are empty. The settings of the putty are the same as in the board (9600,8,1,none).
#include <stdint.h>
#include <stdbool.h>
#include "C:\ti\TivaWare_C_Series-2.1.4.178\inc\hw_memmap.h"
#include "C:\ti\TivaWare_C_Series-2.1.4.178\inc\hw_types.h"
#include "C:\ti\TivaWare_C_Series-2.1.4.178\driverlib\sysctl.h"
#include "C:\ti\TivaWare_C_Series-2.1.4.178\driverlib\gpio.h"
#include "C:\ti\TivaWare_C_Series-2.1.4.178\inc\tm4c1294ncpdt.h"
void delayMs(int a);
void UART0Tx(char c);
int main(void)
{
//SysCtlClockFreqSet((SYSCTL_XTAL_25MHZ | SYSCTL_OSC_MAIN | SYSCTL_USE_PLL | SYSCTL_CFG_VCO_480), 120000000);
SYSCTL_RCGCUART_R|=0X01;
while ((SYSCTL_PRUART_R & 0x01) != 0x01){};
UART0_CTL_R&=~(0X00000000);
UART0_IBRD_R=104;
UART0_FBRD_R=11;
UART0_LCRH_R=0X60;
UART0_CC_R=0X00;
UART0_CTL_R=0X301;
SYSCTL_RCGCGPIO_R=0x01;
while ((SYSCTL_PRGPIO_R & 0x01) != 0x01){};
//GPIO_PORTA_AHB_AMSEL_R=0x00;
GPIO_PORTA_AHB_PCTL_R=0X11;
GPIO_PORTA_AHB_AFSEL_R|=0X03;
GPIO_PORTA_AHB_DEN_R=0X03;
//delayMs(1);
while(1)
{
UART0Tx('t');
UART0Tx('e');
UART0Tx('s');
UART0Tx('t');
UART0Tx(' ');
}
}
void delayMs(int n)
{
int i,j;
for(i=0;i<n;i++)
{
for(j=0;j<3180;j++)
{
;
}
}
}
void UART0Tx(char c)
{
while((UART0_FR_R & 0X80)!=0X80){};
UART0_DR_R=c;
delayMs(10);
}
Does anyone have a clue?
Regards