User guide
SFSU - Embedded Systems Tutorial Nano- Electronics & Computing Research Lab
87
The hardware can be broken down in the following subsystems.
1. Memory Subsystem
2. Video Pipeline Subsystem
3. Touch Panel Subsystem
Memory Subsystem
The FPGA provides multiple options for memory storage. It provides on chip memory, off chip SRAM
FLASH and SDRAM and a SD Card SPI interface. In this chapter, SDRAM is used as a source for the
Scatter Gather DMA for VGA controller. SRAM is not used for this particular design. On-chip memory
of the Cyclone 4 FPGA is used to store local data for the application program run on Nios II processor.
The stack for the application is built in the on chip memory itself for faster access. Flash memory is
included in the system for program code storage. Flash programmer in Nios II IDE is used to program the
code into the flash. When this is done, the FPGA will boot up with the Nios II processor for image
display and the application will load automatically.
The SD Card controller needs to be included to provide appropriate control and data signals
for SPI interface, which connects the SD Card socket to the processor. Image from the SD Card will be
read out using simple memory pointers. The SDRAM is used as a frame buffer to store images for the
VGA controller to read. The SD Card cannot feed images to the VGA controller and hence SDRAM is
required as a buffer to connect to the VGA controller.
Software Design
For software implementation the VGA module, touch screen and SD Card are initialized first. Then a
home screen appears on the T-Pad which allows the user to touch and initialize the SD Card to read the
images. After the image is displayed by the pixel buffer on the T-Pad, the character buffer displays the
ALU options. After the user selects/touch one of the options of ALU, the character buffer is refreshed
and the result is displayed. After the result is displayed, the software waits for the touch input to any other
option and respective results are shown.
For initializing the touch screen and the VGA, Hardware Abstraction Layer is used provided by Altera.
The SD card controller is initialized using SPI. Once these components are initialized, the home screen
appears on the T-Pad’s screen. After the user selects a particular mode, images are read one by one from
the SD Card. Then using JPEG library, we decode the image data into hex format. This hex data is passed
to the buffer and pushed into video pipeline. Image corresponding to this data is then displayed. The
latency with which the image is displayed depends on the size of the hex data and therefore ultimately on
the image size. The flow chart for the software is shown below: