Forum Discussion

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

Frame Reader Initialization

Hello,

I want to implement a Frame Reader which should read data from memory and send its AVALON Video protocol to an alpha blending mixer. My clocked video output settings for PAL are:

Image Width/Active pixels: 720

Image Height/Active lines: 576

Bits per Pixel per color planes: 8

Color plane transmission format: sequence

Interlaced Video

Pixel fifo size: 720

Fifo Level at which to start output: 719

Video in and out use the same Clock

Use control port

Sync signals: Embedded in video

Active picture line: 23

Horizontal blanking: 24

F rising edge line: 313

F falling edge line: 1

Vertical blanking rising edge line: 311

Vertical blanking: 25

I have written the value 128 to all corresponding addresses of the ram. For test purposes I am using the onchip ram for this. The RAM has two masters, the NIOS II and the frame reader. The settings of the frame reader are:

Bits per pixel per color plane: 8

Number of color planes in parallel: 1

Number of color planes in sequence: 2

Maximum Image width: 40

Maximum Image height: 40

Master port width: 64

Read master FIFO depth: 64

Read master FIFO burst target: 32

Use separate clock for the Avalon MM master interface: unchecked

(The data-width of the onchip RAM is 64.)

For initialisation of the frame reader I have written the following function which is called in once the main function of my NIOS II software:

void initFrameReader()

{

alt_printf("Initialize Frame Reader.\r\n");

// start Frame Reader

IOWR(FRAMEREADER_BASE, 0, 1);

// Frame Select

IOWR(FRAMEREADER_BASE, 3, 0);

// Frame 0 Base Address

IOWR(FRAMEREADER_BASE, 4, ONCHIP_MEM_BASE);

// Frame 0 Words

IOWR(FRAMEREADER_BASE, 5, 800); // 40*40 / ( 64/(8*4) ) = 800

// Frame 0 Single Cycle Color Patterns

IOWR(FRAMEREADER_BASE, 6, 6400); // 40*40*4 number of pixels in the frame multiplied by the number of single cycles required to represent one pixel

// Frame 0 Reserved

// IOWR(FRAMEREADER_BASE, 7, 0); // reserved for future use ?

// Frame 0 Width

IOWR(FRAMEREADER_BASE, 8, 40);

// Frame 0 Height

IOWR(FRAMEREADER_BASE, 9, 40);

// Frame 0 Interlaced

IOWR(FRAMEREADER_BASE, 10, 8); // See VIP Processing Suite - Table 4-4

}

But as soon as I Activate the Layer the Frame Reader corresponds to, I do not get a valid picture. Even if I deactivate it on runtime, it does not get a valid picture anymore. I have to reset the cpu to get the alpha blending mixer get work again (with frame reader layer deactivated).

What could be the problem? I have double-checked the BSP-Editor, none of my program memory addresses are placed on the onchip-mem. Could it be an arbitration problem? As far as I know the arbitration of the sopc-builder is round-robin and only requesting masters are included in the arbitration. But I am not writing data to the onchip memory while the frame reader is reading data from the RAM.

Could someone double-check the initialisation settings of the frame reader? Did I miss something, or did I missunderstand anything?

I would be pleased if anyone can helb me.

21 Replies