Generate non-uniform pulse
engineear
Posts: 4
I am looking to generate two non-uniform pulse on two output lines to cycle two individual components. The cycle time is on the order of 5 milliseconds. I have the sequence in a spreadsheet with the on/offs for each component at each 5ms time step. Is there an easy way to have the propeller take the sequence from a spreadsheet or do i have to create a line for every timestep?
Comments
Doing it in real time with ever changing data might be a bit more difficult.
H
How big is the spreadsheet ?
If you only need this once, a copy/paste/edit can work, if you want to create many 'build variants' then I've used programs like FreeBasic to do simple file table conversions.
If you want this more 'live', FreeBasic can also do File to Serial Data quite easily.
[www.freebasic.net &
fbide.freebasic.net & this Debug is quite good
http://www.freebasic.net/forum/viewtopic.php?f=8&t=13935
]
and if you store the differences instead the 5ms on/off values and use waitxx
the file can be smaller and the processing faster
once i understand your code better I think i am going to try and implement it.
First off, I will try to explain a little better what i am trying to do. The table below shows a part of the pulse cycle I would like to do.
Then, I have a question regarding the code you uploaded.
The following line in your I think puts the Pulse_1 in high for "pw * -US_001"
phsa := pw * -US_001
I am not sure whether the US_100 is defined anywhere.
As before, this runs in its own cog -- for grins as I don't know what you're doing with these pulses. When enabled, the code will run through the entire table. If you want the outputs to stop as soon as enable is released, I can show you how to code that (it's easy).