Forum Discussion
Altera_Forum
Honored Contributor
15 years agoHi,
I was also looking to use the graphics LCD in Stratix III. Good to see your post. I saw that same Graphics LCD is used in Cyclone III as well as Stratix III. I wanted to ask a few questions regarding how to make it work. Here is what I did after seeing your example ... In the standard NIOS example, I did the following things... 1) In SOPC builder, I put 6 different PIO ports - oled_data (8 bits), oled_csn(1 bit), oled_d_cn(1 bit), oled_e_rdn(1 bit), oled_rstn(1 bit), oled_wen(1 bit). 2) synthesized the whole thing in quartus and programmed to Stratix III. 3) Used eclipse, and the program is the following, which i modified # include <stdio.h># include <unistd.h># include "system.h"# include "altera_avalon_pio_regs.h" int main() { printf("Hello from Nios II!\n"); IOWR_ALTERA_AVALON_PIO_DATA(OLED_E_RDN_BASE, 1); // Set all glcd pins HIGH IOWR_ALTERA_AVALON_PIO_DATA(OLED_WEN_BASE, 1); IOWR_ALTERA_AVALON_PIO_DATA(OLED_D_CN_BASE, 1); IOWR_ALTERA_AVALON_PIO_DATA(OLED_CSN_BASE, 1); IOWR_ALTERA_AVALON_PIO_DATA(OLED_RSTN_BASE, 0); // Hard reset usleep(20); // Wait 20us; IOWR_ALTERA_AVALON_PIO_DATA(OLED_RSTN_BASE, 1); // Release reset; usleep(100000); // Wait 100ms); IOWR_ALTERA_AVALON_PIO_DATA(OLED_DATA_BASE, 0xe2); // Internal Reset IOWR_ALTERA_AVALON_PIO_DATA(OLED_DATA_BASE, 0xa2); // Bias = 1/9; 0xa3 for 1/7 IOWR_ALTERA_AVALON_PIO_DATA(OLED_DATA_BASE, 0xa1); // ADC = 1 (right to left); 0xa0 for 0(left to right) IOWR_ALTERA_AVALON_PIO_DATA(OLED_DATA_BASE, 0xc0); // Common direction = Normal; 0xc1 for inverse IOWR_ALTERA_AVALON_PIO_DATA(OLED_DATA_BASE, 0x28); // Set Power Control - Internal power circuits OFF ******* but looks better with 0x2f IOWR_ALTERA_AVALON_PIO_DATA(OLED_DATA_BASE, 0xe7); // Set Driver ON; 0xe6 for OFF IOWR_ALTERA_AVALON_PIO_DATA(OLED_DATA_BASE, 0xaf); // Display ON; 0xae for OFF IOWR_ALTERA_AVALON_PIO_DATA(OLED_DATA_BASE, 0xa5); // Entire Display ON - Turn ON all pixels (irrespective of RAM) usleep(500000); // Wait 500ms usleep(500000); IOWR_ALTERA_AVALON_PIO_DATA(OLED_DATA_BASE, 0xa4); // Entire Display NORMAL - Pixels correspond to display RAM return 0; } I couldn't see any change in the graphics LCD panel...it is always light with blue light and it stays same... can u tell what I might have done wrong.. thanks pramod