- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Greetings. Quite simply my LCD doesn't "work" with Nios II. It has and does work with Nios I.
From the simple "web server" default reference design where the display should show something like: "Nios II, IP address: xxx.xxx.xxx.xxx" (or equivalent), to the count_binary reference design, to writing my own (quick) code: FILE *fp_LCD=0;
fp_LCD = fopen(LCD_DISPLAY_NAME,"w"); // open LCD for write
if(fp_LCD==0)
printf("\nError Opening %s\n\n",LCD_DISPLAY_NAME);
else
{
printf("LCD opened, ready for access!\n");
fprintf(fp_LCD,"Hello LCD");
fclose(fp_LCD);
}
Does anyone have their LCD working? Any special tricks? FYI, I have the Nios-devkit-1C20, and I have upgraded the FLASH to use the factory_recovery for Nios II... Thanks, -Terry
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Have you got the compact flash card plugged in? It doesn't work with Nios II if the compact flash card is plugged in, this is barely mentioned in a readme text file somewhere!
Adrian- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
How on earth did you find this out!!!!!!
Perhaps I need to do more reading! Thanks, it worked! Regards, -Terry- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It's one of those things that if you know it, you know it.
Sorry, Where could we have documented this to make more people see it? I ask so we can doc it somewhere better for the next release.- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Kerri:
I see that it is posted in the documents/errata.txt file. I should have read through this before beating my head against the wall! FYI, I searched the "Nios II Software Developer's Handbook", then checked the "Nios II Processor Reference Handbook" under Section II Peripheral Support. I see that the SDRAM Controller, DMA, PIO, Timer, JTAG UART, UART, SPI, EPCS, CFI, and SysID peripherals are nicely defined. Then again, since the LCD is nothing more than a PIO, it doesn't have to be included here... After checking through those two docs, I referred to the "Nios II Device Drivers" library in my IDE, and browsed to the altera_avalon_lcd_16207 directory. I briefly looked through the .c and .h files but didn't have much luck... It appeared to me that it "should" work. I am not really answering your question here so let's try this: In short, the best place to start looking should have been the readme.txt & errata.txt, but I figured I had something wrong and that it wasn't really errata at all. Having said that, I'm thankful for the Nios Forum because someone is bound to know the answer! Cheers, -Terry- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'll give that feedback to the doc people.
Note that with Reader you can do a search (rather than a find) and it will search all the pdf's in any directory. Wouldn't have helped you here (since the errata and readme are in txt format), but might be helpful other times.- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
All: I have gotten the LCD working correctly using fprintf; but it appears as though I have found a "bug"
Here is some test code based on the Hello_World reference#include <stdio.h># include "system.h"
int main()
{
FILE *fp_LCD=0;
printf("Hello from Nios II!\n");
fp_LCD = fopen(LCD_DISPLAY_NAME,"w"); // open LCD for write
if(fp_LCD==0)
printf("\nError Opening %s\n\n",LCD_DISPLAY_NAME);
else
{
printf("LCD opened, ready for access\n");
fprintf(fp_LCD,"This message should scroll across the screen... ");
}
return 0;
}
After compiling and downloading, the code appeared on the LCD, displaying the first 16 characters. Kind of made sense until I looked through the lcd HAL driver and see that the text should scroll. I won't get into details, but I played around with the code for hours, comparing to the count_binary.c reference design which works. I came across this: The alt_sys_init.c file that gets created for my hello_world is slightly different than the count_binary.c, not suprising really, but check this out: void alt_sys_init( void )
{
//ALTERA_AVALON_LCD_16207_INIT( LCD_DISPLAY, lcd_display );
ALTERA_AVALON_DMA_INIT( DMA, dma );
ALTERA_AVALON_EPCS_FLASH_CONTROLLER_INIT( EPCS_CONTROLLER, epcs_controller );
ALTERA_AVALON_CFI_FLASH_INIT( EXT_FLASH, ext_flash );
ALTERA_AVALON_TIMER_INIT( SYS_CLK_TIMER, sys_clk_timer );
ALTERA_AVALON_TIMER_INIT( HIGH_RES_TIMER, high_res_timer );
ALTERA_AVALON_JTAG_UART_INIT( JTAG_UART, jtag_uart );
ALTERA_AVALON_LAN91C111_INIT( LAN91C111, lan91c111 );
ALTERA_AVALON_SYSID_INIT( SYSID, sysid );
ALTERA_AVALON_UART_INIT( UART1, uart1 );
ALTERA_AVALON_LCD_16207_INIT( LCD_DISPLAY, lcd_display );
}
By default, the first line is enabled and the last line doesn't exist. This doesn't scroll the text. By commenting out the first line and moving the driver initilization to the end (as shown), the text scrolls!!! I haven't gone through the trouble of seeing which driver is interferring with the LCD, but I thought you may be interested! Regards, -Terry
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
hi tjd,
Sorry to bring this topic back up. But the work around you came up with, did it work with the compact flash card inserted in the dev kit? My design involves using a compact flash card to store data which is then fed into the sdram. I am trying to upgrade to a nios2 system right now, but if I cannot use the lcd with the cf card inserted, it might pose a problem. The design i have currently can be used as a stand alone product or attached to a pc, but requires the lcd in stand alone mode. thanx, -Quan- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Quan,
Funny you should ask... Short answer - No, I haven't got both the CF and the LCD working together. Verbose answer: I was trying to get the LCD to work with the compact flash card plugged in, but had little luck. I see that the chip select lines of the Compact Flash are not "disabled" (ie pulled high), nor is the CF_POWER line "disabled". (pulled low) I tried to make a change but got hung up on a problem with downloading my ref design. It seems that I can't mod the full_featured ref design and successfully download it. I suspect this is a silly bug on my part that I haven't had time to look further into... Side note: Has anyone else experienced this? Doesn't really help, but may provide some insight... -Terry- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Strictly an FYI, re:
<div class='quotetop'>QUOTE </div> --- Quote Start --- I tried to make a change but got hung up on a problem with downloading my ref design. It seems that I can't mod the full_featured ref design and successfully download it. I suspect this is a silly bug on my part that I haven't had time to look further into... Side note: Has anyone else experienced this?[/b] --- Quote End --- Turns the PC I am using isn't properly licensed for Nios/Nios II. As a result, I needed to program with the full_featured_time_limited.sof rather than the full_featured.sof file. I will advise if/when I make headway. Cheers, -Terry- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Terry,
I haven't tried the full_featured ref design of the nios II yet. I am still only using the nios I but if these are problems not cannot be fixed yet, then i will not do the full upgrade path. There is the legacy upgrade path to enter into the nios II realm, I wonder if the legacy lcd drivers will still work with the nios II? I'll have to try it in the next couple of weeks. Please update if you find a fix on this, and i will do the same. thanx, -Quan- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
UPDATE:
It appears as though I have a work-around to the LCD errata that was discovered previously in this post re: <div class='quotetop'>QUOTE </div> --- Quote Start --- The LCD will not operate if the Compact Flash card is plugged in[/b] --- Quote End --- I have the LCD now working with the CF card plugged in to the devkit... Here's how: I tied the internal I/O pins: CF_CS_N to Vcc to disable the Compact Flash chip select and set CF_POWER to GND to disable power to the CF interface... Note that if you want to talk to the CF card, you will have to enable both the CS and CF_POWER signals; thus running into the same problem as before... (or so it seems). temp fix anyways. -Terry- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Terry,
Which ref design are you using that has these CF_CS_N and CF_POWER signals already labelled? In the older nios I, these are part of the standard ref design. I can toggle the CF_POWER lines to re-initialize the cf when needed, but in all of these new nios II ref designs, these signal lines do not exist in the bdf file. as a matter of fact, i was not able to find any ref design that contains any available lines for the usage of the compact flash. i wonder why? -Quan- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Quan,
I had to add these signals to the .BDF file myself. FYI, I am using the Cyclone Reference Design, but I am sure the same applies for the 1S10 & 1S40 as well. -Terry- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Because of pinout restrictions, the CF shares pins with what the Nios team defined as the LCD connector.
You might get around this problem by wiring the LCD to a different set of pins. We haven't tried this yet. But we will very soon. If you try this and it works please tell us.- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Kerri,
I recently took the full_featured ref design and moved the LCD from PROTO1 J10 to PROTO2 J15. If anyone would like me to send you the updated pinout list, let me know. Really all it took was a quick look at the schematic to ensure the proper pinout was applied. The LCD now works properly, and I can talk to my CF device. Regards, -Terry- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
That's great news. Thanks for sharing!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
--- Quote Start --- originally posted by tjd@Jul 15 2004, 01:08 PM kerri,
i recently took the full_featured ref design and moved the lcd from proto1 j10 to proto2 j15.
if anyone would like me to send you the updated pinout list, let me know. really all it took was a quick look at the schematic to ensure the proper pinout was applied.
the lcd now works properly, and i can talk to my cf device.
regards,
-terry --- Quote End --- Hi Terry, I would like to see the updated pin file if you don't mind posting it or email it to me. My situation will be a bit different in that I will need to share the pins like in the old nios configuration. I have built a daughter board to attach to use the PROTO2 pins and so i won't be able to relocate to any of the PROTO2 pins. I'm looking through and comparing the old lcd driver with the newer ones and trying to see if I can reach a happy medium. Actually come to think of it, i wonder if the hardware was changed? You mentioned moving the LCD from PROTO1 J10 to PROTO2 J15, on my board the lcd is attached to the PROTO1 J12. Also I forgot to mention i am using the Cyclone dev kit from Altera. -Quan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quan,
I have included the pin list that I have cut-and-pasted out of my Assignment Editor.Proto2_LCD Location PIN_U10
Proto2_LCD Location PIN_V10
Proto2_LCD Location PIN_W10
Proto2_LCD Location PIN_Y10
Proto2_LCD Location PIN_V11
Proto2_LCD Location PIN_U11
Proto2_LCD Location PIN_W11
Proto2_LCD Location PIN_Y11
Proto2_LCD_E Location PIN_T10
Proto2_LCD_RS Location PIN_Y9
Proto2_LCD_RW Location PIN_W9
As you can see, I used the same pin names as the reference design, but prefixed each name with Proto2_ <div class='quotetop'>QUOTE </div> --- Quote Start --- You mentioned moving the LCD from PROTO1 J10 to PROTO2 J15, on my board the lcd is attached to the PROTO1 J12. Also I forgot to mention i am using the Cyclone dev kit from Altera.[/b] --- Quote End --- I too am using the Altera Cyclone dev kit, and I meant proto1, J12. Sorry for the confusion. Regards, -Terry
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Terry,
thanx for the update. I see what you mean. I will try something similar to this but keep it for proto1 so that proto2 is available for my daughter board. -Quan
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page