Help with Smart pins
bambino69
Posts: 126
in Propeller 2
I have code that will give me the frequency of a 50% duty cycle square wave in spin and in assembly.
I would now like to see it done with the smart pins. I think this one is what I need:
%01110 AND !Y[0] = Count A-input positive edges
How do I set that up in assembly?
Comments
There is quite a few smartpin modes that can provide frequency of pulses. And yep, that is one. All you need is the sample period and sample pulse count. Both can be provided by that mode.
Chip demo'd a sophisticated "reciprocal counter demo" - https://forums.parallax.com/discussion/170882/reciprocal-counter-demo/p1
Have a look at my PWM object that uses a smart pin mode -- it lets you set frequency and duty cycle. It's all Spin2, but very easy to convert to PASM2.
@JonnyMac
I like that object, I was actually using it last week to generate the square wave for testing. I now have the device this object was simulating and no longer need the generator, just a way to measure the period(frequency) of the square wave.
@evanh
What I need is in there, Just need to weed out what I don't need. Thanks!
Thanks again evanh! I got half way thru the thread and found it.
Sorry, I misunderstood what you were looking for.