Nios® V/II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® V/II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++

Reading from the RS232 Port

Honored Contributor II

Hello everybody, i'm a bignner in software development using Nios II and i'm trying to read some data sent from my computer to my De2-70. I built this, shown in the image below, using the Qsys tool.  


I followed the steps described here: 


This tutorial helped me sending data from the De2-70 to my computer using this code here: 

# include <stdint.h># include "system.h" int main(void) { volatile uint32_t *uart = (volatile uint32_t*) UART_BASE; char *str = "Hello from NIOS II\n"; while (1) { char *ptr = str; while (*ptr != '\0') { while ((uart[2] & (1<<6)) == 0); uart[1] = *ptr; ptr++; } } return 0; } 


I would like to know how to read the data sent from my computer? I tried to include "altera_up_avalon_rs232.h" to use the int alt_up_rs232_read_data(...), but when i compiled this code this lib was not found. 


Thank you all for the attention.
0 Kudos
0 Replies