Hello,
I've got a time critical project measuring the speed of sound. I have a sine wave generator that can be triggered by a digital hi.
I have been developing a pcb board that triggers a hi when i particular frequency is detected.
Using the PICAXE-08 Chip I want to...
Setup:
PIN 1, PIN 3 as an Input
PIN 2, PIN 4 as an Output
Via Labview I want to start the program by making PIN 1 Hi.
wait 100ms
Set PIN 2 Hi to start the wave generator.
Goto a sub routine that starts an incremental counter as long as PIN 3 is lo.
PIN 3 will only go hi when the PCB picks up the the particular wave and outputs a hi.
When PIN 3 is hi, I want to go back to the Main code and apply some math to the counter value.
For example if after the math the figure is 6, go to another sub routine that will pulse PIN 4, 6 times.
Finally go the the start of the program to repeat the process.
We know that each operation occurs on 1 clock cycles. Depending on the counter sub rountine, the incremental count will also be one cycle. Meaning 6 counts at 4 Mhz is 0.000006 seconds. We can take into effect that it takes one clock to get to the routine adding one to the count.
Should I use this chip?
Any advice would be great. I don't have alot of time so I need a solution asap.
Cheers
Kamilan
I've got a time critical project measuring the speed of sound. I have a sine wave generator that can be triggered by a digital hi.
I have been developing a pcb board that triggers a hi when i particular frequency is detected.
Using the PICAXE-08 Chip I want to...
Setup:
PIN 1, PIN 3 as an Input
PIN 2, PIN 4 as an Output
Via Labview I want to start the program by making PIN 1 Hi.
wait 100ms
Set PIN 2 Hi to start the wave generator.
Goto a sub routine that starts an incremental counter as long as PIN 3 is lo.
PIN 3 will only go hi when the PCB picks up the the particular wave and outputs a hi.
When PIN 3 is hi, I want to go back to the Main code and apply some math to the counter value.
For example if after the math the figure is 6, go to another sub routine that will pulse PIN 4, 6 times.
Finally go the the start of the program to repeat the process.
We know that each operation occurs on 1 clock cycles. Depending on the counter sub rountine, the incremental count will also be one cycle. Meaning 6 counts at 4 Mhz is 0.000006 seconds. We can take into effect that it takes one clock to get to the routine adding one to the count.
Should I use this chip?
Any advice would be great. I don't have alot of time so I need a solution asap.
Cheers
Kamilan