Shop OBEX P1 Docs P2 Docs Learn Events
Reading a 0.6v frequency — Parallax Forums

Reading a 0.6v frequency

JavalinJavalin Posts: 892
edited 2012-01-17 11:25 in Propeller 1
Hey,

Trying to get a http://www.sparkfun.com/products/9768 light-2-frequency IC working but it outputs a 0.2v - 0.6v signal. Using the propeller counters in DUTY mode:

setup: (pin 4)
    ' setup light frequency counter
    dira[LIGHT_FREQ]~
    light_sample_period := clkfreq/5
    lightFreqNextSampleTime := cnt + light_sample_period
    ctra := %00110 << 26
    ctra += LIGHT_FREQ
    frqa := 1

read:
    repeat
        ' light frequency sensor
        if cnt-lightFreqNextSampleTime > light_sample_period
            sys_lightfreq := phsa
            phsa := 0
            lightFreqNextSampleTime := cnt + light_sample_period
            debug.dec(sys_lightfreq)
            debug.tx(13)

gives:
32005958
32004902
32009574
32004902
32009574
32005958
32004902
32009574
32004902
32009574
32005958
32004902
32009574
32004902
32009574
32005958
32004902
32009574

Does the prop recognise that lower signal on a I/O pin?

light_sensor_waveform.png


Any other ideas?

Ta,

James
800 x 600 - 25K

Comments

  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2012-01-17 11:19
    You must have it hooked up wrong. I've used those parts and their "high" output level is nearly Vdd. The datasheet confirms it. Also, DUTY mode is for output, not counting pulses. What you want is one of the edge-sensitive modes, e.g. %01010.

    -Phil
  • Duane DegnDuane Degn Posts: 10,588
    edited 2012-01-17 11:21
    James,

    Are you sure your device is connected correctly?

    After looking at the datasheet, I don't see any indication it would output such a limited range.

    What voltage are you using to power it?

    Edit: Phil beat me again.
  • CircuitsoftCircuitsoft Posts: 1,166
    edited 2012-01-17 11:23
    I see no reason why you need to measure a .6v level. The datasheet for the part shows a (nearly) rail-rail output. Are you sure it's running at 3.3v? You may be better off running it at 5V, since that's what the datasheet characterizes it at. Just put a resistor (1-10k) between the output pin and the pin on the prop.

    If it really is a .6v level, you could put a resistor divider between the pin and +3.3V, such as 4.7K/3.3K, which will give you a .5v cutoff voltage.
  • JavalinJavalin Posts: 892
    edited 2012-01-17 11:25
    in backwards... DOH

    thanks Phil!
Sign In or Register to comment.