Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
10 years ago

Cyclone V GX Starter Kit, HDMI, SDCard and LPDDR2

Hello,

I buy this nice board. And I try create small application. I want:

1. NIOS gets picture from SDCard

2. NIOS puts pixel's information to LPDDR2

3. NIOS sets settings for ADV7213 (HDMI Transsmitter)

4. FPGA gets information from LPDDR2 and transssmit it to HDMI

5. User pushes down button and NIOS gets anouther picture from SDCard.

Now I can read from SDCard. I wrote HDMI module and I can set pixel's color (I have "X" and "Y" from screen.)

But I don't understand how I can use LPDDR2 no my HDMI module. I try start with "LPDDR2 SDRAM Controller with UniPHY v15.0"

For test I want push to LPDDR2 some information and read later. My code:


always @(posedge HDMI_TX_CLK)
begin
	if (generateImage) begin
		if (lpddr_request == 2'b10)
			lpddr_request <= 2'b00;
		else begin
			genX <= genX+1;
			if (genX >= screenW)
			begin
				genX <= 32'b0;
				genY <= genY + 1;
			end
			if (genY >= screenH)
			begin
				genY <= 32'b0;
				generateImage <= 1'b0;
				lpddr_request <= 2'b00;
			end else begin
			
				lpddr_address = genY*screenW + genX;
				
				if (genX >= genY)
					lpddr_write <= 32'hFF000000;
				else
					lpddr_write <= 32'h00FF0000;
				
				lpddr_request <= 2'b10;
			end
		end
	end else begin
    	
			if ( ~lpddr_ready )
			begin
				lpddr_request = 2'b00;
				RGB <= 24'hFFFFFF;
			end else 
			
			begin
				lpddr_request = 2'b11;
				lpddr_address = y*screenW + x;
				RGB = lpddr_read;
			end
			
	end	
end

I calculate "x" and "y" with vertical and horizontal sync.

P.S. I watched all videos on youtube with keywords:"LPDDR2 FPGA Altera and ect".