FX3 GPIF II for Display RGB

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
VlKh_2251656
Level 5
Level 5
10 likes given 5 likes given First like received

Hello.

I have a debug board with FX3 chip.

I also have a display OSD057VA (640x480 pix) with a parallel interface (this one where there are signals vsync, hsync, clk, ...)

I want to connect this display to the FX3 board using, the GPIF 2 interface (configured for output).

Tell me, are there any ideas, how can this be done?

Thank you very much.

0 Likes
1 Solution

First add Out- EP in the descriptor file and then you will be able to see Bulk out EP in the tool. To send the video file out follow the following steps:

1. Select "Bulk out Endpoint".

2. Click on "DataTransfer" tab.

3. Select the appropriate values for wValue, Req Code, wIndex & Direction.

4. Select the "Transfer File" button, browse the file and send it.

Thanks & Regards
Abhinav

View solution in original post

14 Replies
lock attach
Attachments are accessible only for community members.
abhinavg_21
Moderator
Moderator
Moderator
50 likes received 25 likes received 10 likes received

Hi,

Yes it is possible to stream out video from USB to GPIF II state machine. I am attaching one demo firmware (UVCmaster) to send out data from GPIF II. Please note that this state machine is not sending any valid data. You have to modify it to take data from the DMA buffers and send it out.

In the uvcmaster state machine, three counters are used as follows: Data_Counter: used for H_active duration Control_counter: used to count number of lines in a frame Address_Counter: used for V_blanking duration. Three empty states are used as delay states for the H_blanking duration. Since each state can take a repeat count of 255 (max), the max possible H_blanking duration possible for this design is 255*3. There are four parameters to be filled in the uvcmaster firmware. These can be calculated as follows.

H_ACTIVE = ((Line_width)*(bytes_per_pixel)/(bus_width))

N_LINES = Frame_height

H_BLANKING and V_BLANKING can be approximated using the below formula.

(FRAME_ACTIVE+ FRAME_BLANKING) = FRAME_PERIOD

Where

FRAME_ACTIVE = ((H_ACTIVE + H_BLANKING)*(PCLK_PERIOD))*(N_LINES)

FRAME_BLANKING = (V_BLANKING)*(PCLK_PERIOD)

FRAME_PERIOD = 1/FRAMERATE

PCLK_PERIOD = 1/PCLK

The above formulae can be used to emulate the exact timings being used by a customer on his setup and then use the customer’s UVC firmware with this to easily reproduce their hardware setup and look for any shortcomings in the their firmware.

You have to change the PIB clock dividers to set the clock at GPIO 16 using pibClk.clkDiv = 5 parameter. See

#ifdef R_1920_1080_30

pibClk.clkDiv = 5;

#define H_ACTIVE (1920)

#define N_LINES (1080)

#define H_BLANKING (300)

#define V_BLANKING (100000)

#endif

See the above lines in the firmware.

To change the Horizontal blanking you have to modify the generated GPIF SM wave data. Refer to CyFxSetHBlanking() in the attached firmware.

If you have any other query do let me know.

Thanks & Regards

Abhinav

Thank you very much.

I think that put the image on LCD using GPIO II is a very promising opportunity.

Please tell me one more question.

Is it possible to output data from the program on "C" directly to the port DQ15-DQ0? Simultaneously to 16 pins ?

Or can it be done only using GPIF II designer?

I know there is a function:

CyU3PReturnStatus_t CyU3PGpifWriteDataWords (uint32_t threadIndex, CyBool_t selectThread, uint32_t numWords, uint32_t? Buffer_p, uint32_t waitOption)

But it uses DMA and GPIF, and threads. Now It's very difficult for me...

Is it possible to output directly from the "C" program?

Any that code:

     DQ = 0x3355;

It is really ?

Function

CyU3PGpioSetValue(pin, CyTrue);

change only one pin...

I want change 16 (or 😎 pins simultaneously.

Thank you very much.

0 Likes

Hi,

If you use CyU3PGpioSetValue(pin, CyTrue); to set 16/32 bit bus width one by one then it will consume huge delay.  We don't have any API to set 16/32 GPIO pins simultaneously without using GPIF interface. You can use CyU3PGpifWriteDataWords()  to set the GPIO pins simultaneously.

Thanks & Regards

Abhinav

Many thanks !

Unfortunately, the documentation is not very clear on how to use this method (CyU3PGpifWriteDataWords() ). What is a threads, how to connect them?

I found a similar subject

https://community.cypress.com/thread/20982?start=0&tstart=0

There is an example.

What about reading the data? Do the same?

0 Likes

The count of threads is 4 ?

I can start 4 threads simultaneously ?

0 Likes

Hello.

What pins are: frame valid, line valid, datas, and so on ?

I dont't find pin descriptions in project.

0 Likes

streamer.jpg

How use this program for video -> usb -> lcd chain ?

0 Likes

I find next sygnals on board (fx2 super speed exploere kit) by my oscilloscope:

Above 25 MHz - pclk

Ctl_11 - line valid (?)

Ctl_12 - frame valid (?)

It's right ?

Where I find data sygnals ?

Where is data enable pin ?

0 Likes

Please explain this code:

void CyFxSetHBlanking (uint16_t horizBlanking)

{

if(horizBlanking >= 3* 0xFF)

return;

uint16_t numFulls = horizBlanking / 0xFF;

//uint32_t * arrays[] = {&CyFxGpifWavedata[5].leftData[2], &CyFxGpifWavedata[6].leftData[2], &CyFxGpifWavedata[9].leftData[2]};

//uint8_t i, index = 0;

horizBlanking -= numFulls * 0xFF;

switch(numFulls)

{

case 3: CyFxGpifWavedata[5].leftData[2] |= (0xFF << 22);

CyFxGpifWavedata[6].leftData[2] |= (0xFF << 22);

CyFxGpifWavedata[9].leftData[2] |= (0xFF << 22);

break;

case 2: CyFxGpifWavedata[5].leftData[2] |= (0xFF << 22);

CyFxGpifWavedata[6].leftData[2] |= (0xFF << 22);

CyFxGpifWavedata[9].leftData[2] |= (horizBlanking << 22);

break;

case 1: CyFxGpifWavedata[5].leftData[2] |= (0xFF << 22);

CyFxGpifWavedata[6].leftData[2] |= (horizBlanking << 22);

CyFxGpifWavedata[9].leftData[2] |= (0x00 << 22);

break;

case 0: CyFxGpifWavedata[5].leftData[2] |= (horizBlanking << 22);

CyFxGpifWavedata[6].leftData[2] |= (0x00 << 22);

CyFxGpifWavedata[9].leftData[2] |= (0x00 << 22);

break;

}

...

}

0 Likes

Don't find

CY_FX_GPIFTOUSB_PATTERN

handler in source code...

0 Likes

Hi,

This code is modifying the GPIF wave data in the gpif2config.h file generated by GPIF designer tool. This code will change the counter values so as to obtain the desired HBlanking in the code.

Please note that the code that I had shared is just a reference for designing GPIF Master. This firmware has only In-endpoint exposed to the host but in your application you have to send video file out so you have to add Out-EP in the descriptor file. Please refer to the AN65974 to see how to send data out from the host and commit it to GPIF side.

Thanks & Regards
Abhinav

0 Likes

First add Out- EP in the descriptor file and then you will be able to see Bulk out EP in the tool. To send the video file out follow the following steps:

1. Select "Bulk out Endpoint".

2. Click on "DataTransfer" tab.

3. Select the appropriate values for wValue, Req Code, wIndex & Direction.

4. Select the "Transfer File" button, browse the file and send it.

Thanks & Regards
Abhinav

Many thanks !

0 Likes

Hi,

In the attached project please open the GPIF project folder(Image_sensor_out.cydsn) then double click on (Image_sensor_out (CYFX file)), you will find the GPIO pin number there. Those GPIO pin numbers can be mapped to the hardware pin using datasheet.

Thanks & Regards
Abhinav

0 Likes