Shop OBEX P1 Docs P2 Docs Learn Events
How to use BS2 generate 2us time delay — Parallax Forums

How to use BS2 generate 2us time delay

brucefay1127brucefay1127 Posts: 6
edited 2011-12-07 13:06 in BASIC Stamp
How to use BS2 generate 2us time delay? because the pause command can only produce 1ms,i need 2us capture one time signal,major receive the "Sony ILX526A" this linear CCD,and this CCD's datasheet below:
http://www.eureca.de/datasheets/01.xx.xxxx/01.01.xxxx/01.01.0021/ILX526A.pdf
the clock pin i use 500kHz,so the cycle-time is 2us,i must capture 3000 times,but.....i don't know how to use BS2 generate 2us!! help me!!...

Comments

  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2011-12-07 10:39
    Hey Bruce,

    Welcome to the Parallax Forums! I can't think of a way to use the BS2 to do what you want. That CCD chip requires a continuous clock with a minimum frequency of 100 KHz, with duty cycle between 40% and 60%. The BASIC Stamp simply does not have a pulse ouput mode that can provide that. I know the Propeller chip could handle the job but, before I go so far as to recommend it, can you tell us more about your set-up? For example, what is doing the data capture? Do you have an A-to-D converter? Where is the pixel data being stored after it's captured?

    -Phil
  • Mike GreenMike Green Posts: 23,101
    edited 2011-12-07 11:00
    Although the BS2 can generate one approximately 2us pulse using a PULSOUT statement, it's just not fast enough to generate a series of 2us pulses to do what you want. The PULSOUT statement itself takes about 250us to execute. Maybe you could get 3000 clock pulses per second. You could theoretically use a SHIFTIN statement to generate a clock and shift in values, but the clock period is about 60us. More importantly, where would you put the data? The Stamps only have 26 bytes of variables.

    You need a much faster microcontroller with much more memory than the Stamps to do what you want. Depending on what you want to do with the CCD's analog output, you may need a high speed analog to digital converter as well. A Propeller for example would have the memory and speed.
  • brucefay1127brucefay1127 Posts: 6
    edited 2011-12-07 11:16
    Thanks Phil!!

    CLK tihs pin i use an external clock driver circuit(500kHZ OSC),and pixel output is from Vout this pin,i use high speed A/D convert,because traditional A/D(ADC0804) fast enough,pixel and clock is simultaneously,we must calculate cycle-time,a cycle followed by the voltage,for example,my clock is 500kHz,so cycle-time is 2us,i must capture a continuous signal,2us interval,a total of 3000 pixel voltage.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2011-12-07 11:21
    The Propeller chip could handle this task for you. In fact, it could even generate the clock signal without relying upon an external oscillator. Which ADC chip are you using?

    -Phil
  • brucefay1127brucefay1127 Posts: 6
    edited 2011-12-07 11:24
    Thanks Mike!!!

    oh my god......those pixel voltage data can't save on the array??sorry i never contact BS2,perhaps i may want to change IC...
  • brucefay1127brucefay1127 Posts: 6
    edited 2011-12-07 11:27
    I used ADC7821, can you tell me Propeller this IC detail type??thanks Phil!!
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2011-12-07 11:31
    Are you sure you typed that part number correctly? It doesn't come up in any search. Nevermind, I found an AD7821, which I'm sure is correct. Here's a link to the Propeller page:

    -Phil
  • brucefay1127brucefay1127 Posts: 6
    edited 2011-12-07 11:32
    Sorry...is AD7821...!!
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2011-12-07 11:36
    Your CCD chip and the ADC both run on a Vdd of +5V. The Propeller chip uses 3.3V, so there will be some voltage translation necessary between your acquisition system and the micro. Other than that, however, the Propeller could easily handle the clock generation and data acquisition.

    -Phil
  • brucefay1127brucefay1127 Posts: 6
    edited 2011-12-07 11:39
    Oh my god!!! Propeller looks great!! and really cheap....zaozhidaojiu buy this...price looks like BS2..
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2011-12-07 11:55
    Be sure to read all the introductory literature before selecting a part. You may want to get started with a QuickStart board or a Propeller Demo Board before diving in and building a circuit from scratch with individual components.

    -Phil
  • Duane DegnDuane Degn Posts: 10,588
    edited 2011-12-07 13:06
    Propeller looks great!! and really cheap....zaozhidaojiu buy this

    That's what I keep trying to tell people.

    Welcome to the forum brucefay1127.
Sign In or Register to comment.