Having problems with COUNT
Capt. Quirk
Posts: 872
' {$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]
' {$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]
pdf
6K
Comments
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.
(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
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, nn5i@arrl.net
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