View Full Version : Counters question

05-20-2010, 10:19 PM
I need to:
1.) Excite a coil with a squarewave. I have done this with the synth object and it works fine.
2.) The output of the LRC circuit goes to one channel of the 3202-b 12bit 2 channel ADC. This works fine also.
3.) I want to tie another counter to send a squarewave identical to the excite wave directly to channel two of the ADC. I have not figured out if I can use the second counter of the same cog or not.
4.) I want to run the ADC object in one cog and use synth to give me the two square waves.

I am not that fluent in SPIN yet to make the whole process work.
The end result will be a graph of the voltage from channel one and channel two of the adc. Any help would be appreciated.
I will post my code if needed. It's not quiet finished.

Mike Green
05-21-2010, 01:54 AM
The Synth object allows you to specify which channel (A/B) you want to use. Just call Synth a 2nd time with the other channel specified (as "A" or "B"). Note that you won't get an identical squarewave. They will likely be out-of-phase because they're not started simultaneously. I assume that you've got some kind of buffer or amplifier between the Propeller and the LRC circuit. Just use another buffer to take the exciter signal and amplify and isolate it to provide to channel 2 of the ADC.

05-21-2010, 03:19 AM
Thanks Mike,
Could I use a different prop pin to produce the second signal and measure the voltage? The voltage will always be 3.3 v, right? When a metal object come close to the coil in the LRC circuit, the voltage changes. Would I need a buffer or something to protect the prop pin? Am I understanding it right?
Thanks for you help. My goal is to try to plot the LRC coil voltage change or impedance to the second signal. My ultimate goal is to plot inductive reactance (xl) to impedance of the circuit.