Altera_Forum
Honored Contributor
15 years agoFrame reader initialization
Hello,
I know there is already a lot on the forum about the Frame reader from the VIP suite, but I still don't get it running. I used the memtest software example to test the DDR Ram module of my Cyclone III Nios II evaluation kit (LCD 800 x 480 pixels) and it worked perfectly, so the harware design seems OK. I've implemented a Frame reader in the design (the same design with the test pattern generator works perfectly, so I think it must be the C-code for the initialization that contains some errors...). I want the LCD to display a complete white image, but the screen stays black. Here is the main.c file:#include <stdio.h># include <unistd.h># include <stdlib.h># include <string.h># include <ctype.h># include "system.h"# include <stdio.h># include <io.h>
typedef struct
{
unsigned int framebuffer;
}display_buffer;
int main(void)
{
display_buffer buffer;
//Make a White background
int xctr=0, yctr=0;
for( xctr=0; xctr<800; ++xctr ) {
for( yctr=0; yctr<480; ++yctr ) {
buffer.framebuffer = 0xFFFFFFFF;
}
}
//Frame 0 base adress
IOWR(ALT_VIP_VFR_0_BASE, 4, &buffer.framebuffer);
//Select frame 0
IOWR(ALT_VIP_VFR_0_BASE, 3, 0);
//number of words for frame 0 (800*480)=384 000
IOWR(ALT_VIP_VFR_0_BASE, 5, 384000);
//color cycles for frame 0 (800*480)
// see http://www.alteraforum.com/forum/showthread.php?t=20596&page=2
IOWR(ALT_VIP_VFR_0_BASE, 6, 384000);
// Frame 0 Reserved
IOWR(ALT_VIP_VFR_0_BASE, 7, 0);
//Frame 0 width
IOWR(ALT_VIP_VFR_0_BASE, 8, 800);
//Frame 0 Height
IOWR(ALT_VIP_VFR_0_BASE, 9, 480);
// Frame 0 Interlaced
IOWR(ALT_VIP_VFR_0_BASE, 10, 0);
//Start Frame Reader
IOWR(ALT_VIP_VFR_0_BASE, 0, 1);
printf("Frame reader initialized");
while(1);
return 0;
}
Any suggestions? Thanks! Best regards, Hans