Driving ilx511 (CCD) of sony

Discussion in 'Embedded Systems and Microcontrollers' started by Bluestar88, Dec 28, 2014.

  1. Bluestar88

    Thread Starter New Member

    Nov 16, 2014
    23
    0
    I wanna use FPGA for driving CCD.(Driving Timing and clock driving). My CCD is ilx511. What type pf FPGA do you recommend? Does everybody any experice about it? Or any schematics for using a type of FPGA?
     
  2. kubeek

    AAC Fanatic!

    Sep 20, 2005
    4,670
    804
    Since a CCD is basically an analog device, you will need to use an A/D converter to decode the output. Page 6 in the datasheet you forgot to post shows how the timing works.
    Basically any FPGA should work, but it really depends on what you want to do with the data once you have it.
     
    Bluestar88 likes this.
  3. Brownout

    Well-Known Member

    Jan 10, 2012
    2,375
    998
    For simple clock and timing, an enexpensive FPGA will do. Look at Xilinx Spartan or Altera Cyclone offerings. First, determine how many different pins you need, then decide how much logic you need and what the clock rates need to be. Use spec tables to chose your device based on these requirement. Most likely, the least expensive device will be more than adequate.
     
    Bluestar88 likes this.
  4. Bluestar88

    Thread Starter New Member

    Nov 16, 2014
    23
    0
    Thanks for helping, Can anyone help me about timing driving and clock driving ilx511?
     
  5. Bluestar88

    Thread Starter New Member

    Nov 16, 2014
    23
    0
    What expensive FPGA means?
     
  6. kubeek

    AAC Fanatic!

    Sep 20, 2005
    4,670
    804
    Could you be more specific?
     
  7. Brownout

    Well-Known Member

    Jan 10, 2012
    2,375
    998
    Sorry, I meant inexpensive. That means low cost.
     
  8. Bluestar88

    Thread Starter New Member

    Nov 16, 2014
    23
    0
    I searched alot about FPGA.
    Untill now, XCV300E, XCS2040, XC3S400, EPF10KTC144 and cyclone FPGA are used for driving CCD. I wanna choose one of them for driving ilx511. Which of them do you suggest?
     
  9. Bluestar88

    Thread Starter New Member

    Nov 16, 2014
    23
    0
    Does anyone know XCS2040? I studied a paper about ilx511 and XCS2040. But I can not it's datasheet.
     
  10. Brownout

    Well-Known Member

    Jan 10, 2012
    2,375
    998
    Forget about Virtex parts like the xcv300... Use the Spartan or Cyclone. They are cheaper and completely adequate for your application. Use the low cost Cyclone E variant, example the 5cea2. First you should have designed and simulated your code. Then you can use free Altera Quartus tools to try to build your project for the low cost Cyclone. After successfully building the deisgn, you'll know for sure if the part will meet you needs for speed and logic resources.
     
    Last edited: Dec 30, 2014
    Bluestar88 likes this.
  11. Bluestar88

    Thread Starter New Member

    Nov 16, 2014
    23
    0
    Hi guys.
    I decided to interface ilx511 with atmega....
    I collected some data about interfacing but I have some problems....Please help me...
    I red Ilx511 datasheet some times, I got that when the gate pulse (QROG) is high while clock pulse creates square waves to tell the sensor to shift along the pixels in the array.
    And when the gate pulse goes from high to low and stayes low tells the sensor to restart.

    So, For Clock pulse I should generate a pulse with 50% duty cycle (Squere pulse).
    To interface my atmega to read data from the ilx511 I need to read the data at every clock transition. I have created a 1MHz clock from my Atmega to provide to the ilx511 clock using the code below.
    Code (Text):
    1. void timer0_init(void)
    2. {
    3.    // Output compare pin controlled by a timer and tied to a specific
    4.    // pin number you cannot change
    5.    // i.e. OC0 = PB4 , OC1A = PB5 etc
    6.    // Runs in CTC mode so the OC0 pin will be applied directly by the timer
    7.    // by setting propoer COMxx in TCCR0
    8.  
    9.    TCCR0 = 0x00; //stop
    10.    ASSR = 0x00; //set async mode
    11.    TCNT0 = 0xF8; //set count
    12.    OCR0 = 0x07;
    13.    TCCR0 = 0x19; //start timer
    14.    DDRB |= (1 << PB4); // Toggle Pin PB4
    15.  
    16. // Enable Timer 0 interrupt to start interrupt (i.e OCIE0 in TIMSK)
    17.    TIMSK |= (1<<OCIE0);   // Set OCIE0 Timer 0 interrupt
    18.  
    19. }
    My intention is to use the Atmega analog comparator to read the ilx511 output value and provide a 0 or 1 into my data storage array.
    What I need to do is read a ilx511 output every clock transition (i.e. 500nSecs for 2Mhz) and store the value from the analog comparator. I have tried to synchronise an interrupt to work in conjunction with my Atmega 1MHz clock pulse to do the output recording as below:
    ISR(TIMER0_COMP_vect)
    {

    //Read ilx511 output !

    }

    But I have a problem about maching the speed of every interrupt and that of atmega. At 16MHz a cycle is 62.5ns.

    What do you suggest about matching the time and cycles?
     
  12. Bluestar88

    Thread Starter New Member

    Nov 16, 2014
    23
    0
    Nobody has no idea?
    What about generating a wave pulse for clock timing and Rog timing of ilx511?
    What frequency should be clk timing?
     
  13. Brownout

    Well-Known Member

    Jan 10, 2012
    2,375
    998
    You haven't really described your problem. You said you have a problem matching the speed, but you've given no more details. I don't know enough about your problem to make any suggestions. What is Rog timing?
     
  14. kubeek

    AAC Fanatic!

    Sep 20, 2005
    4,670
    804
    Especially when you were first talking about clocking it with an FPGA and now you are talking about atmega. Those are two vastly different beasts with very different capabilities.
     
  15. Bluestar88

    Thread Starter New Member

    Nov 16, 2014
    23
    0
    Okay, I know. First I wanted to do it with FPGA and now, I know that I can do it with Atmega128, So I want to know the basis of timing.
     
  16. kubeek

    AAC Fanatic!

    Sep 20, 2005
    4,670
    804
    I think you want to use a timer to generate the clock, and use that also to generate an interrupt that reads the comparator.
    The biggest problem I see here is where are you gonna store all those bits, as atmega has very little memory and stuffing the bits into bytes will be really slow.
     
    Bluestar88 likes this.
  17. Bluestar88

    Thread Starter New Member

    Nov 16, 2014
    23
    0
    Hi guys,
    I am driving ilx511 with atmega128,So I wrote the below code for it...is it correct? Do you have anu idea about it?
    Code (Text):
    1. while (1)
    2.       {
    3.                            TCCR1A=0x50;
    4.                      TCCR1B=0x09;
    5.                      OCR1AL=0x39;
    6.  
    7.                      
    8.                    for(j=1; j<2087 ;j++)
    9.                      {
    10.                      xx[j]=0;
    11.                      }
    12.                
    13.                  ROG=1;
    14.                  for(i=0;i<20;i++);
    15.                
    16.                  ROG=0;
    17.                
    18.                  for(n=0;n<20;n++);
    19.                 {                
    20.                
    21.                  for(i=0;i<20;i++);
    22.                  ROG=1;
    23.                  
    24.                        for(k=1; k<2087 ;k++)
    25.                       {
    26.  
    27.                              flag=0;
    28.                                  if (TIFR & (1 << OCF1A)) //bit is HIGH in TIFR
    29.                                 {
    30.                                  TIFR = (1 << OCF1A);  //clear the CTC flag
    31.                                 adc_value=read_adc(0);
    32.                                 xx[k]=ADCH;
    33.                                 }
    34.                    
    35.                        
    36.                        
    37.                           if (n>=15)
    38.                             {
    39.                              cc=(xx[k]*(n-15)+ADCH)/(n-14);
    40.                              xx[k]=cc;
    41.                             }
    42.  
    43.                     }
    44.                   ROG=0;
    45.                }
    46.              
    47.             putchar1('s');
    48.             delay_ms(100);
    49.               for(k=1; k<2087;k++)
    50.               {
    51.                putchar1(xx[k]);
    52.                delay_ms(10);                  
    53.               }
    54.          
    My main problem is how I can achieve to high level of frequencies? I wanna read ADC 2087 on high level of timer 1...But How? Please help me....I am confused..
     
    Last edited by a moderator: Apr 28, 2015
  18. Bluestar88

    Thread Starter New Member

    Nov 16, 2014
    23
    0
    No idea?
     
Loading...