Hi
I have connected PA0 to PK4 directly. Initialize both UART0 and UART7 as the Uart_echo example. Place both UART0/7 interrupt handler in the vector table.
void
UART7IntHandler(void)
{
unsigned long ulStatus;
unsigned char prefix[3] = "7";
//
// Get the interrrupt status.
//
ulStatus = UARTIntStatus(UART7_BASE, true);
//
// Clear the asserted interrupts.
//
UARTIntClear(UART7_BASE, ulStatus);
//
// Loop while there are characters in the receive FIFO.
//
while(UARTCharsAvail(UART7_BASE))
{
UARTSend(prefix, 1);
//guc_UartRcvd = UARTCharGet(UART7_BASE);
//UARTCharPutNonBlocking(UART0_BASE,
// UARTCharGetNonBlocking(UART7_BASE));
}
}
void
UART7Configure(void)
{
SysCtlPeripheralEnable(SYSCTL_PERIPH_UART7);
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOK);
//
// Set GPIO K4 and K5 as UART pins.
//
GPIOPinConfigure(GPIO_PK4_U7RX);
GPIOPinConfigure(GPIO_PK5_U7TX);
GPIOPinTypeUART(GPIO_PORTK_BASE, GPIO_PIN_4 | GPIO_PIN_5);
//
// Configure the UART for 115,200, 8-N-1 operation.
//
UARTConfigSetExpClk(UART7_BASE, SysCtlClockGet(), 115200,
(UART_CONFIG_WLEN_8 | UART_CONFIG_STOP_ONE |
UART_CONFIG_PAR_NONE));
//
// Enable the UART interrupt.
//
IntEnable(INT_UART7);
UARTIntEnable(UART7_BASE, UART_INT_RX | UART_INT_RT);
}
One key on PC will trigger the endless of 7 on the hyper-terminal. Why it happens like that?
Thanks,
-Hailin