more pulse control
joe90
Posts: 16
I would like to generate four square pulses. I need help in modulating the pulse height while keeping the frequency the same. Also, I would like to also have offsets as seen in the attachment. (.zip of a .bmp). Any guidance is appreciated.
Comments
Does these need to be continous pulse trains or only so many pulses ?
What will determine with width of the variable pulses ?
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Cheap 4-digit LED display with driver IC·www.hc4led.com
COMING SOON "SD DATA LOGGER" www.sddatalogger.com
"I reject your reality, and substitute my own." Mythbusters
·
By the way, I am using SX-key, SX28 for this.
To read in the 15V I believe I should program in an anolog to digital converter.
What are the high and low times for the pulses ? Minimum and maximum for the variable pulses ?
Will the variable pulse always start at the same offset to the non-variable pulses ? In other words does the frequency of the variable pulses change, or just the duty cycle ?
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Cheap 4-digit LED display with driver IC·www.hc4led.com
COMING SOON "SD DATA LOGGER" www.sddatalogger.com
"I reject your reality, and substitute my own." Mythbusters
·
Pulses 1 and 2 should have the same off-set with 3 and 4. Basically the varying pulses need to keep their left side in the same place with respect to time. While the right side varies from 25us to 2us.
Let me know if the time periods I am using are inconvenient. I could increase the time scales a little if that would be better. Changing the times would only affect my plans and would not affect me monetarily.
Thanks,
So the variable pulses are always 20KHz with variable duty cycle from 4% to 50%.
From the picture I will assume that the sets of pulses are offset by 25uSec ? Is this correct ?
And it appears that wave 1 & 2 are > 50% duty cycle ? If so what duty cycle are they ?
Joe, you need to supply ALL information you have. This is turning into a tooth-pulling session.
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Cheap 4-digit LED display with driver IC·www.hc4led.com
COMING SOON "SD DATA LOGGER" www.sddatalogger.com
"I reject your reality, and substitute my own." Mythbusters
·
Yes, pulse 2 is offset by 25us. Pulses 3 and 4 have an up time of say 30us and a down time of 20us, or 60%. This is arbitrary in my case. It only needs to be >50%.
This is for a current-fed buck converter feedback loop and will be used to control six transistors.
Thankyou for your time,
Yes, you are right about the duty cycle and frequency of 3 and 4.
Yes, pulse 2 is offset by 25us. Pulses 1 and 2 have an up time of say 30us and a down time of 20us, or 60%. This is arbitrary in my case. It only needs to be >50%.
This is for a current-fed buck converter feedback loop and will be used to control six transistors.
Thankyou for your time,
Okay, a couple suggestions...
You will need to devise a way to measure the 15V input. You MIGHT get away with a voltage divider, but you will probably need an analog to digital converter. You could try running the 15V input thru at 100K resistor then to the pin and a 10K resistor to ground. That would make 15V = 1.36 volts (pin detects at about 1.4v).
There is no way you have have microsecond pulses when operating the SX at 32KHz. Even at 4MHz it will be tricky. I would go with 20MHz.
You also need to define the actual pin location on the SX chip for example:
Pin1 VAR RC.0
Pin2 VAR RC.1
Pin3 VAR RC.2
Pin4 VAR RC.3
I would keep the outputs on one port and the input on a different port. That will make the code easier because you can change all four outputs with one command.
Did you want to write the code in SX/B ? Or in assembly ?
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Cheap 4-digit LED display with driver IC·www.hc4led.com
COMING SOON "SD DATA LOGGER" www.sddatalogger.com
"I reject your reality, and substitute my own." Mythbusters
·
I would like a few more pointers with my SX/B code.
I have applied a variable DC source and used the voltage divider as recommended. I expect an increase in the pulse width as I decrease the voltage below 1.36V. I have checked this with an oscilloscope and found this not to be true. I am not able to generate any pulses.
At the output of the SX28, I have placed an RC network.
Thank you,
If you want pulse width modulation you need to get rid of the rc network and go with a current limiting resistor. Otherwise your outputs are just controlling voltage. The capacitor filters the pulse width like it does in a brigde rectifier circuit·and capacitor changing ac to dc.
Kevin
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Education And Experience Teaches Knowledge Not Arrogance ! (Unknown)
The Only Stupid Question Is The One Not Asked ! (Unknown, of coarse this is something that i would say)
Do Not Burn The Bridge That Has Brought You Forth You May·Need To Journey Back ! (Chinese)
· I think this is what you wanted.
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Cheap 4-digit LED display with driver IC·www.hc4led.com
COMING SOON "SD DATA LOGGER" www.sddatalogger.com
"I reject your reality, and substitute my own." Mythbusters