Altera_Forum
Honored Contributor
15 years agoRS232 coding problem
Hi all,
I require to send/receive a character through the rs232 port, however i only be able to receive character. I had problem with sending the character out. Below is my coding for sending and receiving. Please kindly provide me with advise/solution. Thanks void serial() { int a = 99; char c; c=IORD_ALTERA_AVALON_UART_RXDATA(UART_0_BASE); printf("%c",c); // result shown is correct IOWR_ALTERA_AVALON_UART_CONTROL(UART_0_BASE, 0x40); IOWR_ALTERA_AVALON_UART_TXDATA(UART_0_BASE,a);//NO CHARACTER DETECTED }