Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Altera_Forum
Honored Contributor I
860 Views

Interacting with LCD screen using Linux on board, Cyclone V FPGA,

Hello, 

So, I'm still pretty much a beginner. I already viewed and ran an example design project for the I2C controller, this example interacts with the LCD screen, EEPROM and a few other things (https://www.altera.com/content/dam/altera-www/global/en_us/others/support/examples/soc/altera-socfpg...). I was able to run it on the board and it all works and was done through the USB Blaster port and configured from Eclipse. I want to try to only interact with the LCD only and building such a project from scratch and running an executable from the on board SD card through Linux. Is it possible to interact with the LCD from the SD card or does it only have to be done using the USB Blaster port. Also, the design example described makes use of Altera's HWLIB which is meant to interface to HPS hardware on board and the hiearchy and paths in the project are a mess, so i'm thus not sure about the way to go forward
0 Kudos
3 Replies
Altera_Forum
Honored Contributor I
40 Views

correct me if im wrong, you want to run a RTOS( in this case linux) in the FPGA and control the LCD screen? If so, instantiated the LCD screen in qsys, hook it up to nios, and make functions calls (provided by qsys when generated) in the RTOS. Hope this helps. 

-Trukng
Altera_Forum
Honored Contributor I
40 Views

Thank you for your reply, Yes, I have a linux installed on the SD card and i can execute basic exe programs on it. Sorry if i seem ignorant but I don't think the board (Cyclone V SoC) has a NIOS processor,it had an A9 Cortex ARM processor (it has a hard processor system (HPS)), so I'm not sure if what you're suggesting is possible in my case. Also, from what i understand from your response, if i want to interact with the LCD screen from my on chip linux then i ought to take a completely different path from that illustrated in the design example which makes use of a Hardware Library to relieve the programmer of low level programming and uses the JTAG cable to program the FPGA (it is furthermore a bare metal type of project if that information helps)

Altera_Forum
Honored Contributor I
40 Views

 

--- Quote Start ---  

correct me if im wrong, you want to run a RTOS( in this case linux) in the FPGA and control the LCD screen? If so, instantiated the LCD screen in qsys, hook it up to nios, and make functions calls (provided by qsys when generated) in the RTOS. Hope this helps. 

-Trukng 

--- Quote End ---  

 

 

Thanks for your reply. I've also come across many useful information, some of which also point in the direction you suggested. The design example i described is bare metal and may therefore not be suitable/accessible within the user space on the RTOS running on the SD card (Bare metal has hard physical addresses). The LCD (and its needed i2c interface) are part of the Hard Processor System (HPS) peripherals and i am thus not sure if a NIOS is needed (My impression is that NIOS is for FPGA peripherals). In Qsys, i unfortunately can't add the LCD as this device isn't listed under the peripherals. An approach i came across (useful for LEDs, push buttons...(General Purpose I/O)) involves instantiating an HPS system (that of Cyclone v...) and needed hardware.... Ultimately we include header files in C provided by Altera and use mmpas() to map phsical addresses to our virual user space and by knowing the offset of the registers for each peripheral, we can set their values accordingly. My problem is that for the LCD, there is only files related to the i2c bus which it is connected to; i know that the LCD address on that bus is 0x50, but I couldn't find any documentation or examples on how to access the registers of that LCD, except for the bare metal design example which is useless when running an RTOS. Any ideas? Also, could u plz elaborate a bit more about what u said about function calls in the RTOS, and how that is done (I'm sorry but I'm really a beginner)