Altera_Forum
Honored Contributor
19 years agoGetting the LCD to work with NIOS II
I know a lot of people have had issues with this, and I've searched through and read many of them, but none of them have helped me. I'll go through my entire process here to make sure I'm not missing something in my setup.
I'm using Quartus 6.0 Web Edition Full and the NIOS II processor and IDE you can download with it. I'm working with Altera's DE2 board with the Cyclone II EP2C35F672C6 fpga. The LCD is the standard Optrex 16207. Using the SOPC builder, I've built a custom cpu consisting of the NIOS II/e, a JTAG UART, a UART (RS-232 serial port), an LCD (16207), and the user_logic_SRAM_16Bits_512K that comes on the DE2 board System cd. After generating the cpu, I: 1) put it on a block diagram 2) added input, output, and bidirectional pins 3) imported a pin assignment table 4) named each pin on the block diagram appropriately based on the pin assignment file 5) compiled the project Everything compiles fine and the pin assignments show up on the block diagram of the cpu, so I know they were assigned properly. From the SOPC builder, I open the NIOS II IDE, creating a workspace in my project directory. Now here is where I'm sort of guessing my way through things. I can add a new hello_world project from their template, which uses the JTAG UART to output "Hello from NIOS II!" When I use this template, the project compiles and works fine with my processor. So at this point, I'm fairly certain my processor works. /************************************************************** * THE PROBLEM: **************************************************************/ I want to write to the LCD. I've tried this many ways, from trying to use code from the HELLO_LED_0 example on the DE2 system cd to trying some code I found on these forums that looked like it might work. I've changed the standard output device on my project to the LCD and tried to write to it using fprintf and a file pointer to the lcd, but that didn't work either. On a side note, it seems that sometimes the simple "hello_world.c" program does not always run on my processor. Switching between projects in my workspace on the same cpu seems to screw it up every now and then and I can't run the hello world program. I get an error: Using cable "USB-Blaster [USB-0]", device 1, instance 0x00 Pausing target processor: not responding. Resetting and trying again: FAILED Leaving target processor paused So, to recap: if anyone could look at my process and think they have some code i could use to write to the lcd, I would very much appreciate it. If you see an issue with my process of building the process or creating a software project, let me know. Basically any input anyone has would be appreciated. Thanks for the time you spent reading this ridiculously long post; I only made it long so I would have to reply 9 times before someone understood what my problem actually was. -Ben PS, I don't have a card in the SD card slot.