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

USB low-full-high speed peripherals Forum Discussions

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

Hello,

I have interfaced fx2lp with sensor.sensor is sending one frame at one transfer in click.we are displaying one frame(360960bytes) in the windows side.but image is displaying as attached snap.why this splitting of image is happening even sensor sends only one frame?

regards,

geetha.

0 Likes
1 Solution
SrinathS_16
Moderator
Moderator
Moderator
250 solutions authored 100 solutions authored 100 likes received

Hello,

- Check the FV, LV connections on the board.

- Ensure that the FIFO is put into AUTO mode before triggering the image sensor.

- RAM load and EEPROM load of firmware does not make any difference.

- If the image seems to be shifting, check the raw data in the host application and modify the same to adjust for the shifting. Try to add a frame header in the firmware to identify the start of frame on the host application.

Best regards,

Srinath S

View solution in original post

0 Likes
17 Replies
SrinathS_16
Moderator
Moderator
Moderator
250 solutions authored 100 solutions authored 100 likes received

Hello Geetha,

- How is the image being processed by the host application. Have there been modifications to the older firmware/host application that was used?

- Does every frame data occur shifted or is it random?

Best regards,

Srinath S

0 Likes

Hello shrinath,

we modified firmware and host application.

host application is modified with one vendor commnd 0xb2.it will send this vendor command and ready to recieve data from the fx2lp(waiting for 360960 bytes data).

fx2lp firmware recieves the 0xb2 vendor command.when it will recieves the command,fx2lp sends one triggering pulse to image sensor,when image sensor recieves this pulse,it will give one fame(one frame_valid interrupt)i.e.360960bytes.

void TD_Poll( void )

{

if(vendor_com==1/*&&PA1==1*/)

{

count++;

vendor_com=0;

PD7=1;       //led pin

PD5=1;     //trigger pin to sensor

EZUSB_Delay(100);

PD5=0;

PD7=0;

//exposure_time=1;

EP6FIFOCFG = 0x08; //enable channel

}

}

void ISR_EXTR1( void ) interrupt 2

{

EP6FIFOCFG=0x00;  //disable channel

}

regards,

geetha.

0 Likes

Hello Geetha,

- The image data that you have shared is shifted because of the improper identification of the Frame Start header. If the image is cut and re-positioned as below, the proper image can be obtained.

pastedImage_0.png

- Please let me know how the header data is inserted in the firmware. Also, when the vendor command is sent by the host, it is not necessary that the image sensor starts sending a fresh frame of data. The image sensor is already sending its image data even before the vendor command is sent by the host. This is the reason for the start of the image to occur in between. So, to obtain a single frame of image, data equivalent to at least two frames of image needs to be read from the image sensor and processed by the host application.

Best regards,

Srinath S

0 Likes

Hello shrinath,

Please let me know how the header data is inserted in the firmware.

->we are not adding any header or footer.

The image sensor is already sending its image data even before the vendor command is sent by the host.

->image sensor is in snapshot mode,if i send pulse from the fx2lp,then only image sensor wlll send frame.i have measrued with the oscilloscope,sensor is sending one frame.

I have attached the control center code.

regards,

geetha.

0 Likes

Hello shrinath,

Sensor is sending only one frame.i am enabling dma channel only when frame valid is high and disabling the dma channel when falling edge is detected on the PA1 pin(frame valid is connected to PA1).

void ISR_EXTR1( void ) interrupt 2

{

EP6FIFOCFG = 0x00; //switching to manual mode

SYNCDELAY;

}

I am disabling the channel by switching to manual mode.

void TD_Poll( void )

{

PD5=0;

if(vendor_com==1)

{

vendor_com=0;

PD7=1;

PD5=1;   //this is the pulse for image sensor to trigger

EZUSB_Delay(100);

PD5=0;

PD7=0;

exposure_time=1;

}

if((PA1!=0)&&(exposure_time==1))

{

EP6FIFOCFG = 0x08; //Switching to Auto mode

    SYNCDELAY;

}

}

if image sensor recieves this pulse,then only it will send frame valid and line valid,otherwise there is no frame valid ,line valid and data.

please find the attached image for pulse(exposure Tew) ,famevalid and line valid

regards,

geetha.

0 Likes

Hello Geetha,

- Please explain what do the pins PD5, PD7 and the variable 'exposure_time' represent with respect to the waveform.bmp file that is shared.

- Also, explain the role of 'vendor_com' variable. Where is this variable set? In case this variable is set inside a vendor command handler, kindly, let me know what else are performed in that handler. In response #2, you have mentioned that the sensor receives the triggering pulse when the vendor command is called but in the below statement comment, you have mentioned that the image sensor is triggered by PD5 pin. Kindly, confirm.

          PD5=1;   //this is the pulse for image sensor to trigger

- Please share the oscilloscope trace of the slave FIFO interface signals.

Best regards,

Srinath S

0 Likes

Hello shrinath,

PD5 is the pin connected to one of the pin of an image sensor,this image sensor pin is know as EXPOSURE pin.if PD5 pulse referes to exposure pulse to image sensor.

PD7 is just connected to one LED(debug led).i am using this pin for testing purpuse(there is no specific function).

exposure_time variable is just a variable,when its set(means after giving trigger to image sensor),i am enabling the channel.

This is the code for recieving vendor command from pc.

BOOL DR_VendorCmnd( void )

{

  switch(SETUPDAT[1])

  {

  case Data_control:

vendor_com=1;

PD3=~PD3;          //debug gpio(toggles whenever recieves vendor command)

  break;

  }

  return(FALSE);

}

In order to get one image(360960bytes), frame valid get asserted one time and line valid get asserted 752 times.

i am doubting that,line_valid(slwr) will be the reason for image shifting?please let me know.

regards,

geetha.

0 Likes

Hello Geetha,

Thanks for the explanation.

- I understand that you have connected the LV pin of image sensor to the SLWR# pin of FX2LP. Please correct me if I am wrong,

- If that is the case, modify the code such that the slave FIFO is enabled to AUTO mode before triggering the image sensor through the PD5 pin. This can be done by having the below statements in the vendor command handler.

     EP6FIFOCFG = 0x08; //Switching to Auto mode

    SYNCDELAY;

- Performing the above modification would configure the FX2LP slave FIFO in AUTO mode and will be ready for the assertion of SLWR#. This will reduce any delays caused by the FX2LP firmware.

Please test using this change and let me know.

Best regards,

Srinath S

0 Likes

Hello shrinath,

I understand that you have connected the LV pin of image sensor to the SLWR# pin of FX2LP. Please correct me if I am wrong,

->yes,you are right.

i am able to get one frame when this code is in vendor command handler with slave.hex file when i load this file into RAM.

EP6FIFOCFG = 0x08; //Switching to Auto mode

    SYNCDELAY;

but if i load slave.iic file in large eeprom,same image shifting is happening.one frame is splitted into 4 parts.

why same project firmware resulting different output?

regards,

geetha.

0 Likes

Hello Geetha,

RAM load and EEPROM load should not make any difference. Please check if you are loading the correct IIC file. You can check for the timestamp before loading the same. Also, you can use Vend_Ax firmware to read the contents of the EEPROM and check if it matches with the generated IIC file.

Best regards,

Srinath S

0 Likes

Hello shrinath,

the problem is same,when i loaded slave.hex file for the first time,i was getting one frame.i repeated this 3 to 4 times(3 to 4 times programmed),again problem is same.image shifting is happening.

regards,

geetha.

0 Likes

Hello Geetha,

- Please let me know if you are saying that RAM load as well as EEPROM load shows shifted images.

- Are you switching the FX2LP to boot-loader before loading the firmware into the RAM?

Best regards,

Srinath S

0 Likes

Please let me know if you are saying that RAM load as well as EEPROM load shows shifted images.

->yes,both RAM and EEPROM loads,I am getting shifted images.

Are you switching the FX2LP to boot-loader before loading the firmware into the RAM?

->no.I have two boards,one board is RAM board and another board is eeprom board.

regards,

geetha.

0 Likes

Hello Geetha,

Each time before loading the firmware into RAM, are you resetting the device?

Best regards,

Srinath S

0 Likes

Hi shrinath,

YES.

regards,

geetha.

0 Likes

Hello shrinath,

i am not able to get one complete frame,please help us.

regards,

geetha.

0 Likes
SrinathS_16
Moderator
Moderator
Moderator
250 solutions authored 100 solutions authored 100 likes received

Hello,

- Check the FV, LV connections on the board.

- Ensure that the FIFO is put into AUTO mode before triggering the image sensor.

- RAM load and EEPROM load of firmware does not make any difference.

- If the image seems to be shifting, check the raw data in the host application and modify the same to adjust for the shifting. Try to add a frame header in the firmware to identify the start of frame on the host application.

Best regards,

Srinath S

0 Likes