This code doesn't send data through the UART when I connect two Board-DE2 with a COM wire. I don't understand why it isn't operating. What's wrong?
#define RS232_UART_DATA ((volatile int*) 0x10001010)
#define RS232_UART_CONTROL ((volatile int*) (0x10001010+4))
int main()
{
unsigned char hwld[] = {'H','e','l','l','o',' ','W','o','r','l','d','\0'};
unsigned char *pOutput;
pOutput = hwld;
while(*pOutput) //strings in C are zero terminated
{
//if room in output buffer
if((*RS232_UART_CONTROL)&0xffff0000 )
{
//then write the next character
*RS232_UART_DATA = (*pOutput++);
}
}
}
Could you be more specific about "connect two Board-DE2 by Com wire"? Do you want two DE2 Boards to communicate with each other? According to the web link provided by @HansPassant above, you're supposed to connect the DE2 Board to a PC that runs TeraTerm. Try this setup first and make sure you enter the correct COM port settings in TeraTerm as mentioned on the webpage.