Hello!
I have a project that puts out simpe on/off 0-5V signal clock frequency for a low frequency oscillator. The oscillator varies in period between 100Hz and 0.025Hz (10ms to 40s). I'm looking at using an 08M2 to read that clock output, convert it to beats per minute (simply 60,000/ms = BPM), and display the BPM on an LCD. I'll try to figure out how to print to an LCD in the future, but I'm trying to wrap my head around how to get the PICAXE to read the clock signal efficiently. Below is the datasheet for the chip producing the clock signal.
(datasheet for LFO chip: http://www.electricdruid.net/datasheets/TAPLFO2Datasheet.pdf)
In my project, the PWM is also unused, but I think interpreting the clock signal might be easier?
I thought the 'puslin' command could be used, but that has a timeout period of 655ms, not nearly long enough to read the slowest pulse reading from the LFO.
My second thought was to use the 'count' command. The PICAXE can read every 20us, and can count for up to 65s, so it will be able to count the fastest and slowest pulses. The problem I'm having here is with the period. In order to get the longest reading, the period would have to be slightly over 40s, or 40000 in the command. That means that the program would only update the BPM display every 40s. That's a very long time to wait for a read out when trying to dial in a certain BPM, especially when in the higher Hz range.
Is there another command that might be more useful, or perhaps a way to alter count or pulsin that would make it more useful/update the display in real time? Perhaps the PWM output would be of more use?
Thanks in advance for guidance. The project is in it's infancy, so besides the TAPLFO chip and using a PICAXE, no hardware is set in stone yet. I appreciate any help!
I have a project that puts out simpe on/off 0-5V signal clock frequency for a low frequency oscillator. The oscillator varies in period between 100Hz and 0.025Hz (10ms to 40s). I'm looking at using an 08M2 to read that clock output, convert it to beats per minute (simply 60,000/ms = BPM), and display the BPM on an LCD. I'll try to figure out how to print to an LCD in the future, but I'm trying to wrap my head around how to get the PICAXE to read the clock signal efficiently. Below is the datasheet for the chip producing the clock signal.
(datasheet for LFO chip: http://www.electricdruid.net/datasheets/TAPLFO2Datasheet.pdf)
In my project, the PWM is also unused, but I think interpreting the clock signal might be easier?
I thought the 'puslin' command could be used, but that has a timeout period of 655ms, not nearly long enough to read the slowest pulse reading from the LFO.
My second thought was to use the 'count' command. The PICAXE can read every 20us, and can count for up to 65s, so it will be able to count the fastest and slowest pulses. The problem I'm having here is with the period. In order to get the longest reading, the period would have to be slightly over 40s, or 40000 in the command. That means that the program would only update the BPM display every 40s. That's a very long time to wait for a read out when trying to dial in a certain BPM, especially when in the higher Hz range.
Is there another command that might be more useful, or perhaps a way to alter count or pulsin that would make it more useful/update the display in real time? Perhaps the PWM output would be of more use?
Thanks in advance for guidance. The project is in it's infancy, so besides the TAPLFO chip and using a PICAXE, no hardware is set in stone yet. I appreciate any help!