Hi,
I have used UART0 on the launchpad and i am able to view the results on HyperTerminal, and also in simulation by opening the UART#1 window . But when I use UART1 (PB1-PB0), I am not able to view the result in simulation on any of the three windows (UART#1,UART#2,UART#3). When I select Debug->Run, the program runs without throwing any errors. But like I said eariler, is there any way to view result in simulation/real board?
Thanks in advance
Edit: I even tried measuring the voltage at PB1(Tx of UART1), but it just reads 0v. Are PB1-PB0 one of those locked pins? Because, when in debug mode, Port B appeared to be locked. I posted a pic below.
Edit:This is my configuration for uart1 on port b. I know the names mightbe slightly different, but you should still understand them.
#define UART1_DR_R (*((volatile unsigned long *)0x4000D000))
#define UART1_FR_R (*((volatile unsigned long *)0x4000D018))
#define UART1_IBRD_R (*((volatile unsigned long *)0x4000D024))
#define UART1_FBRD_R (*((volatile unsigned long *)0x4000D028))
#define UART1_LCRH_R (*((volatile unsigned long *)0x4000D02C))
#define UART1_CTL_R (*((volatile unsigned long *)0x4000D030))
#define UART_FR_TXFF 0x00000020 // UART Transmit FIFO Full
#define UART_FR_RXFE 0x00000010 // UART Receive FIFO Empty
#define UART_LCRH_WLEN_8 0x00000060 // 8 bit word length
#define UART_LCRH_FEN 0x00000010 // UART Enable FIFOs
#define UART_CTL_UARTEN 0x00000001 // UART Enable
#define SYSCTL_RCGC1_R (*((volatile unsigned long *)0x400FE104))
#define SYSCTL_RCGC2_R (*((volatile unsigned long *)0x400FE108))
#define SYSCTL_RCGC1_UART1 0x00000002 // UART0/1 Clock Gating Control
#define SYSCTL_RCGC2_GPIOB 0x00000002 // port A/B Clock Gating Control
void UART_Init(void){
SYSCTL_RCGC1_R |= SYSCTL_RCGC1_UART1; // activate UART1
SYSCTL_RCGC2_R |= SYSCTL_RCGC2_GPIOB; // activate port B
UART1_CTL_R &= ~UART_CTL_UARTEN; // disable UART
UART1_IBRD_R = 26; // IBRD = int(16,000,000 / (16 * 38400)) = int(26.041)
UART1_FBRD_R = 3; // FBRD = int(0.1267 * 64 + 0.5) = 8
// 8 bit word length (no parity bits, one stop bit, FIFOs)
UART1_LCRH_R = (UART_LCRH_WLEN_8|UART_LCRH_FEN);
UART1_CTL_R |= UART_CTL_UARTEN; // enable UART
GPIO_PORTB_AFSEL_R |= 0x03; // enable alt funct on PB1-0
GPIO_PORTB_DEN_R |= 0x03; // enable digital I/O on PB1-0
// configure PB1-0 as UART
GPIO_PORTB_PCTL_R = (GPIO_PORTB_PCTL_R&0xFFFFFF00)+0x00000022;
GPIO_PORTB_AMSEL_R &= ~0x03; // disable analog functionality on PB
}
