Forum Discussion
Altera_Forum
Honored Contributor
16 years agodev/uart_rs232
Hello!
I try to send data to the rs232 of the Nios Embedded Evaluation kit. I used the SOPC Builder and used the SOPC files of the Nios II System Architect Design Tutorial. There I put in the uart-rs232.(9600 Baud one stop Bit) In the top level Design I put an input on the rxd_to_the_uart_rs232 (default value VCC) and an output on the txd_from_the_uart_rs232. In Pin Setup I did this settings: Node Name: Direction: Location: I/O Bank: VREF Group: I/OStandard: rxd_to_the_uart_rs232 input IOBANK_8 8 - 2.5 V(default) txd_from_the_uart_rs232 output IOBANK_8 8 - 2.5 V(default) In Nios II IDE I compiled everything. The rs232 name: UART_RS232_NAME "/dev/uart_rs232" The program to send data is this: FILE *fp; fp = fopen("/dev/uart_rs232", "w+"); // also used wb+, w+ if(fp){ printf("open succesful\n"); fwrite('a', sizeof('a'), 1, fp); // also used fwrite('a', strlen('a'), 1, fp); fclose(fp); } else{ printf("Error writing rs232"); fclose(fp); } The file opens but I get no data out of the txd pin and I am sure I am using the right pin. What am I doing wrong? Please help!!15 Replies
- Altera_Forum
Honored Contributor
another and the my pictures will fallow...
- Altera_Forum
Honored Contributor
I have to make 5 post do put in Links.. so
- Altera_Forum
Honored Contributor
Thanks for the reply!
I tried this but nothing happened... I am sure it`s in the fpga.. Here are my setups. - Altera_Forum
Honored Contributor
In C 'a' is a character, while "a" is a string. fopen is expecting a pointer to a buffer, so you should use strings. Try with write("a", strlen("a"), 1, fp);
If it still doesn't work, I'd suggest to put a signaltap probe on your tx and rx signals. That way you would know if the problem comes from inside the FPGA or outside.