Generating Clock Signal?
lenny1337
Posts: 26
I need a 5khz -8000khz clock for one of my linear array optical sensors, however if i say 'high 5 low 5' kind of thing on the bs2 the fastest "clock" i can get out is about 600hz. i tried with the px24 and got about 2khz, still shy of the minimum needed for this sensor
Is there a better way to get a clock signal w/o external hardware?
Thanks
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Lenny Bogdanov
Systems Concept Center
Is there a better way to get a clock signal w/o external hardware?
Thanks
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Lenny Bogdanov
Systems Concept Center
Comments
FREQOUT can also generate a pulse stream for a fixed period of time with a frequency up to around 32KHz.
The BS2 is not really a "real-time" platform that generates rock-solid timing. Instead it's an extremely easy to use and reliable embedded processor at about 2000 Basic Instructions Per Second, with its own clock and its own linear regulator. Thus, you'll probably need some external hardware (a 555 perhaps) to generate the signal you want. You CAN use the BS2 to 'gate' that signal on and off, however.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Rick
·
Quote from PBasic help:
PULSOUT sets Pin to output mode, inverts the state of that pin; waits for the specified Duration; then inverts the state of the pin again; returning the bit to its original state.
edit: Units for Duration are 10 µs for the BS1, 2 µs for the BS2, BS2e, and BS2pe, and 0.8 µs for the BS2sx, BS2p, and BS2px.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Rick
Post Edited (RDL2004) : 7/27/2007 11:15:28 PM GMT
That creates a square wave of 111.3 kilohertz, lasting for 128 low time slots and 128 high time slots.
www.emesys.com/BS2PWM.htm
There are 100 some discrete frequencies available with different choices of the duty parameter, but only when it is a power of two are they spectrally pure, evenly spaced pulses. But is can be very useful in some situations to generate a specific number of pulses at something like a specific rate.
Lenny, one possible outside chip for you might be the LTC6903 or LTC6904 "silicon oscillator" from www.linear.com. Frequency range 1 khz to 68 mhz, 10 bits per octave resolution in digital (SPI or I2C) frequency setting. 8 pin msop.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tracy Allen
www.emesystems.com
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Lenny Bogdanov
Systems Concept Center
Post Edited (lenny1337) : 7/28/2007 5:43:37 AM GMT
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Lenny Bogdanov
Systems Concept Center