- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi!
Below are my C codes using NIOS 2 IDE to send and read data using DE2 board through UART by RS232 port. Also, I build my own GUI to receive and send data to UART. After I read the data from my GUI and store the data in array prompt [10], I decide to display the array prompt [10] to my GUI by using several type of function calling, as shown coding below in bold style. However, from my GUI I cannot read the data sending. may i know how to solve it? Thanks! int main () { FILE* fp1; char prompt[10] ; fp1 = fopen(UART_0_NAME , "r+"); if (fp1) { while (1) { //I get the data from my GUI fgets(prompt, 8, fp1); // I send data to be displayed in my GUI fwrite (prompt , 1 , sizeof(prompt) , fp1 );cout<< prompt;
fputs (prompt,fp1); } fclose (fp1); } return 0; }
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Maybe test the reception and transmission separatly to be sure where the problem comes from. 1. Put only the code to send data (with a basic loop to wait between sendings) 2. Put only the code to receive data, and display the value on LEDs or something else
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page