Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
18 years ago

Reading from LCD display in nios2

Apparently, the LCD controller, that comes with nios2 is an output-only device. Therefore, attempts to read from it will return immediately indicating that no characters have been received.

Is there a way I can get the device to be read and write.

(The reason being that I am trying to build a module similar to the that. That is I would like to display character on the LCD, then read back those characters from the LCD display buffer to my computer screen. In that way I can store information to my device and retrieve them whenever I like. My device will be connected exactely as the LCD device.)

The following line of code will write to my LCD:

char file[16] = "Signal for Broke";

for(i=0;i<strlen(file);i++){

lcd_write_data(LCD_DISPLAY_BASE, file[i]);

usleep(20000)

}

But then if I try to read from the LCD buffer with the following code, it returns nothing.

for(j=0;j<16;j++){

printf("Buffer values", lcd_read_data(LCD_DISPLAY_BASE));

}

My guess is that, editing the .ptf document that comes with the LCD display may solve the problem. Does anyone out there has a clue?

very kind regards.
No RepliesBe the first to reply