Forum Discussion
Altera_Forum
Honored Contributor
12 years agoHello!
  I made some change in my code, but it still very similar to yours... I'm geting no response of the data that Im sending throught Rs232... I can send some data, using the Altera U.P. write function, but the data that I receive, is "not what i send", i think the problem maybe is the type of the data (alt_u8), but i already tried char value, hexa value and bin value, and I never get success, I only receive strange values. I'm using Tera Term, and another simple terminal. None of them worked. Thank you! # include <stdio.h> # include <system.h> # include <string.h> # include <stdlib.h> # include <unistd.h> #include "altera_up_avalon_rs232.h"; int main() { int c; printf("\033[2J"); // printf(" start\n"); alt_u8 data; unsigned int space; alt_u8 error; //data = 0x42; //- letra A alt_u8 temp; //alt_u8 RS232_dev; alt_up_rs232_dev* RS232_dev = alt_up_rs232_open_dev (RS232_NAME); for(c=1; c<=1000000; c++) //delay {} space = alt_up_rs232_get_available_space_in_write_FIFO(RS232_dev); printf("%d\n", space); while (1) { temp = alt_up_rs232_read_data(RS232_dev, &data, &error); printf("feddbackREAD:%d ", temp); printf("errosREAD: %d\n", error); temp = alt_up_rs232_write_data(RS232_dev, data); printf("feedbackWRITE: %d ", temp); printf("valorDATA: %d\n", data); for(c=1; c<=1000000; c++) //delay {} }   return 0; }