Shop OBEX P1 Docs P2 Docs Learn Events
Having problems with COUNT — Parallax Forums

Having problems with COUNT

Capt. QuirkCapt. Quirk Posts: 872
edited 2008-12-19 23:39 in BASIC Stamp
' {$STAMP BS2}
' {$PBASIC 2.5}
cycles VAR Word
DO
COUNT 15, 100, cycles
cycles = cycles * 10
DEBUG HOME, "Frequency = ", DEC5 cycles, " Hz"
LOOP

Nice and simple program from the Parallax "[font=Arial,Bold size=5][font=Arial,Bold size=5]IR Remote for the Boe-Bot" that goes along with the attached schematic for verifying the frequency of a 555 timer. The program doesn't count anything. Replace COUNT with PULSIN and I get data. I have no problem flashing an red colored LED with the 555, but·I can't seem to measure it with the current program. [/font][/font]
[font=Arial,Bold size=5][font=Arial,Bold size=5][/font][/font]
[font=Arial,Bold size=5][font=Arial,Bold size=5]I have also tried taking the led out of the circuit and driven the 555's pin4 high, with no success.[/font][/font]
[font=Arial,Bold size=5][font=Arial,Bold size=5][/font][/font]
[font=Arial,Bold size=5][font=Arial,Bold size=5]With nothing hooked up, COUNT does tend to float a bit and show numbers, but as soon as it's conected, nothing.[/font][/font]
[font=Arial,Bold size=5][font=Arial,Bold size=5][/font][/font]
[font=Arial,Bold size=5][font=Arial,Bold size=5]Any ideas?[/font][/font]
[font=Arial,Bold size=5][font=Arial,Bold size=5][/font][/font]
[font=Arial,Bold size=5][font=Arial,Bold size=5]Bill···[/font][/font]

Comments

  • MikerocontrollerMikerocontroller Posts: 310
    edited 2008-12-19 04:04
    Maybe PIN 7 isn't crossing the 1.4 volt logic threshold?
  • Capt. QuirkCapt. Quirk Posts: 872
    edited 2008-12-19 04:57
    I also set up an SX 28 to drive an LCD on my PDB, then I hooked the BS2 up in·the place of the led,__no-go.
  • Beau SchwabeBeau Schwabe Posts: 6,568
    edited 2008-12-19 08:07
    Capt. Quirk,

    What "flavor" of BS2 are you using?· ...BS2,BS2e,BS2sx,BS2p,BS2pe, BS2px, etc.
    And what frequency (ballpark) are you trying to read?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.
  • Carl HayesCarl Hayes Posts: 841
    edited 2008-12-19 15:49
    A couple of things:

    (1) Your schematic shows (apparently) a connection to BS2 P7 (or maybe pin 7, which is P2), but your program counts P15.

    (2) You say you can flash a LED. If you can see it flash, it's probably flashing slower than 15 times per second. Your COUNT statement says to count for 1/10 second. How many counts did you expect in 1/10 second?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    · -- Carl, nn5i@arrl.net
  • Capt. QuirkCapt. Quirk Posts: 872
    edited 2008-12-19 17:09
    I am using the regular BS2 and I am trying to flash an IR led @38Khz·(1 for now) with the 555, to eliminate the need for the BS2 to perform that task. The LED visually flashes when the reset (BS2 pin 6 on the diagram) goes from high to low and cuts·power to the 555 (555's pin 4)·and the·led. The LED does go·brighter or dimmer, depending on the location of the 10k pot.

    I started with pin 7, changed the program to pin 15, because it's easier to use. Also I thought I would need to set it the pin as an Input to work with COUNT and that didn't seem to help.

    I created another program using PULSIN and a 100 ms Pause statement, and I was getting readings around 210. Maybe I should be satisfied with that, but I was trying to figure out what I did wrong with the COUNT statement.

    Thanks

    Bill
  • Carl HayesCarl Hayes Posts: 841
    edited 2008-12-19 18:11
    Reading the manual, on a BS2 the waveform (pulse train) should be such that neither the HIGH portion nor the LOW portion of the waveform (pulse train) can be shorter than 4.16 microseconds. Perhaps (and only perhaps) your waveform is so unsymmetrical that this criterion is not met?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    · -- Carl, nn5i@arrl.net
  • Capt. QuirkCapt. Quirk Posts: 872
    edited 2008-12-19 23:39
    Is that something that may be interfered, by using·PDB bread board? The schematic and what I am trying to do is part of Parallax's "IR Remote for the Boe-Bot Book"

    I am going to try and use ViewPort to measure the output, does anybody know if I need to use anything more than inline 1K resistor to test the signal with a Propeller?

    Bill






    Post Edited (Capt. Quirk) : 12/19/2008 11:47:44 PM GMT
Sign In or Register to comment.