fx2lp slavefifo

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

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

gui.bmpHello,

fx2lp is interfaced with image sensor in slavefifo mode .to diplay image on the pc side,we are developed GUI in control center application.for frame synchronisation ,we are included 8bytes header in the fx2lp firmware.This header is added when fx2lp is interrupted by frame valid using ISR.When frame valid is get asserted by image sensor ,this isr will get called.I am commiting this 8bytes header when it enters to the isr function in the bulk endpoint 6 and same header is looked in the control center and displaying image between two consecutive header bytes.frame valid get asserted for every 360960 bytes of image.image sensor is having 60frames per second and 752x480 resolution.we are able to recieve the image data in the windows side.but we found that there is 361480 bytes between two consecutive headers.that is extra 512  bytes are adding because we are inserting 8bytes hearder in the manual mode and bulk endpoint buffer size is 512bytes.fx2lp(8051) can support level sensitive(low or high) and only be falling edge trigger interrupt.currenty i made falling edge trigger interrupt.that is when frame valid becomes high to low transistion,i am adding this header that is at the end of frame valid.i am having doubt regarding this header inserted time/position matters in the windows side.so i am not sure about this.previous frame portion is also displaying in the current frame.is it because of this header posistion?or because of 512 extra bytes are coming ?please help me to sort out this problem.i have attached the screeen shot of images(video stream).

some times imges shifting is happening because of these reasons.we are not sure about this.

1)some times there is no exactly 360960+512 bytes between two consecutive headers,may be less or more

*fx2lp is not transmitting exactly 360960+512 bytes

*windows is not recieving exactly 360960+512 bytes

*data loss in fx2lp

*data loss in windows side

*data loss in the boundary between fx2lp and windows.

2)frame valid is not getting asserted in proper time.

gui12.bmp

please help me

regards,

geetha.

0 Likes
1 Solution

Hello Geethanjali,

The distorted image signal at the start of every line is because of the 8 byte header that is added to the beginning of every frame. In order to overcome this, neglect this header data in the host application and display only the data after the header.

Best regards,

Srinath S

View solution in original post

0 Likes
13 Replies
gean_3054931
Level 5
Level 5
10 likes given 5 likes given First like received

hello,

some one can help me?

regards.

0 Likes

Hello Geethanjali,

The distorted image signal at the start of every line is because of the 8 byte header that is added to the beginning of every frame. In order to overcome this, neglect this header data in the host application and display only the data after the header.

Best regards,

Srinath S

0 Likes

Hello shrinath,

I am adding integer count in the isr as follows.

#include "fx2.h"

#include "fx2regs.h"

#include "fx2sdly.h"

#include "syncdly.h"

int count=0;  //this is the count am adding

//void FX2LPSerial_XmitString(char *str) reentrant;

void ISR_EXTR1( void ) interrupt 2

{

    count++; //increment count when interrupt occur

  FIFORESET = 0x80; // activate NAK-ALL to avoid race conditions

  SYNCDELAY;

  EP6FIFOCFG = 0x00; //switching to manual mode

  SYNCDELAY;

  FIFORESET = 0x86;

  SYNCDELAY;

  EP6FIFOBUF[503] = 0x4D;

  EP6FIFOBUF[504] = 0x49;

  EP6FIFOBUF[505] = 0x4E;

  EP6FIFOBUF[506] = 0x44;

  EP6FIFOBUF[507] = 0x46;       

  EP6FIFOBUF[508] = 0x4C;

  EP6FIFOBUF[509] = 0x4F;

  EP6FIFOBUF[510] = 0x57;    // sample Byte header pattern that can be used to identify the start of frame

  EP6FIFOBUF[511] = count;

  EP6BCH=0x02; //512 bytes committed

  SYNCDELAY;

  EP6BCL=0x00;

  SYNCDELAY;

  EP6FIFOCFG = 0x08; //Switching to Auto mode

  SYNCDELAY;

  FIFORESET = 0x00; //Release NAKALL

  SYNCDELAY;

}

EP6FIFOBUF[511]  value recieved in the control center is incrementing properly 5A,5B,5C,5D,5E in both windows 7 and windows xp. The databytes between 2 header(MINDFLOW string) is 360960+512 in windowsxp.But this databyte is not exactly 360960+512 bytes in windows 7,it is varying(more/less than 361472bytes).why this kind of problem is happening?

regards,

geetha.

0 Likes

Hello Geetha,

- Please let know if the number of bytes of data is not 361472 bytes on every frame or is it occasionally erroneous.

- Also, is the FX2LP only device connected on the USB bus or are there other devices connected? Since the device uses BULK endpoints, there is no guaranteed bandwidth allotted.

Best regards,

Srinath S

Hello shrinath,

Please let know if the number of bytes of data is not 361472 bytes on every frame or is it occasionally erroneous.

->number of bytes of data is 361471 bytes on every frame on windowsxp.(count is properly incrementing)

->number of bytes of data is not 361471 bytes on every frame on windows7.(count is properly incrementing).

Also, is the FX2LP only device connected on the USB bus or are there other devices connected? Since the device uses BULK endpoints, there is no guaranteed bandwidth allotted.

->yes.there is no other usb devices are connected.(other than mouse,keyboard hid devices).

regards,

geetha.

0 Likes

Hello Geetha,

In case of Windows 7, let me know the number of bytes of data that is captured between successive headers.

Best regards,

Srinath S

Hello shrinath,

how can i attached file here?

regadrs,

geetha.

0 Likes

Hello Geetha,

- The advanced editor can be used to attach file.

- Please make sure that you are using latest drivers from Cypress (1.2.3.20).

- On the host application, ensure that there are no unnecessary statements, i.e in case your application has statements that are not relevant to the endpoint that is used to read the data, delete those.

Best regards,

Srinath S

lock attach
Attachments are accessible only for community members.

Hello shrinath,

please find the below attachement that contains the data recieved.

regards,

geetha.

0 Likes

Hello shrinath,

Please make sure that you are using latest drivers from Cypress (1.2.3.20).

->can you provide link for driver 1.2.3.20.

regards,

geetha.

0 Likes
lock attach
Attachments are accessible only for community members.

Hello Geetha,

Please find the attachment for the driver.

Best regards,

Srinath S

lock attach
Attachments are accessible only for community members.

Hello shrinath,

After updating windows7 version 1.2.3.20 also,the problem is same.

please find the attached doc.

regards,

geetha.

0 Likes

Hello Geetha,

Please reduce the resolution of the image sensor and test it. Since BULK endpoints are used, higher data bandwidth might not be allocated.

Best regards,

Srinath S

0 Likes