Forum Discussion
Altera_Forum
Honored Contributor
9 years agoHow to Initialize Char LCD using PIO (De0-Nano)
Hello to the whole forum, this is my very first thread so please be kind with me(= I'm trying to drive a char LCD using my de0 nano but no results yet.. My lcd is a 5v unit but since I nee...
Altera_Forum
Honored Contributor
9 years agoHi I've been able to initialize it correctly.
I didn't set the biport output direction for all data pins. No I fixed it: IOWR_ALTERA_AVALON_PIO_DIRECTION(PIO_LCD_DATA_BASE , 0b11111111); Anyway I try to print some char after the initialization but no result, here's the code I used to print a char: IOWR_ALTERA_AVALON_PIO_DATA(PIO_LCD_DATA_BASE, 0x80); usleep(1); IOWR_ALTERA_AVALON_PIO_DATA(PIO_LCD_COMMAND_BASE, 0b001); usleep(2); IOWR_ALTERA_AVALON_PIO_DATA(PIO_LCD_COMMAND_BASE, 0b000); usleep(200); IOWR_ALTERA_AVALON_PIO_DATA(PIO_LCD_DATA_BASE, 0x41); usleep(1); IOWR_ALTERA_AVALON_PIO_DATA(PIO_LCD_COMMAND_BASE, 0b101); usleep(2); IOWR_ALTERA_AVALON_PIO_DATA(PIO_LCD_COMMAND_BASE, 0b100); usleep(200); I take some wide timing since I wanted to be sure the unit has time to do its internal operation.