Pulse Generation
Cenlasoft
Posts: 265
Hi,
I am working on an ultrasound transducer. I have downloaded some objects on PWM from OBEX and I am lost as to how to produce:
40 KHZ pulse with a pulsewidth of .5 ms and an interval of 20 ms between the pulses.
It seems that the objects give me a choice of providing PIN and Duty. it's confusing.
Can someone help me?
Curtis
I am working on an ultrasound transducer. I have downloaded some objects on PWM from OBEX and I am lost as to how to produce:
40 KHZ pulse with a pulsewidth of .5 ms and an interval of 20 ms between the pulses.
It seems that the objects give me a choice of providing PIN and Duty. it's confusing.
Can someone help me?
Curtis
Comments
You can always the counters in their own cog to pull this off; one counter would generate the 40kHz frequency, the other -- running in a synchronized loop could gate the signal (by applying a high to the modulation pin you can stop the signal; your output is active-low).
This works because the ctra output is OR'd with the pin output; when either is high the output will be high. You enable modulation by bringing the pin low so that the counter modulation comes through.
Thanks for your response,
I want to send a pulse to an ultrasound transducer (freq=40 khz) the pulse width = .5 ms and the time between these pulses is 20 ms. I guess its a stream because as soon as I send the pulse, I will listen for a response. I could use two pins if needed. Could you explain more about the counter generating a 40 khz and the gating process?
Curtis
I'll try it
Curtis
It's explained in the PE Lab book (by Andy Lindsay) and I think I covered it in my column about transmitting SIRCS.
-- http://www.parallax.com/Portals/0/Downloads/docs/cols/nv/prop/col/nvp4.pdf
You're basically setting the counter as a free-running oscillator to do the modulation. By ORing the pin with the counter you can gate the modulation output. Again, when "off" the pin output signal will be high so you circuitry should be configured for this.
Thanks,
Curtis