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.
please help me