FunFlyer
New Member
I want one of the chips to generate a signal with 8 pulses between 0.8 and 1.4 ms and a pause of 0.4ms in between. A ninth pulse is added to complete a frame of 25ms. I got this running when the chip is set to 32Mhz and a constant pulselength of 1.1ms is used. It´s all done by "PULSEOUT" and "PAUSEUS" commands.
Then I wanted to read pulses between 1.0 to 2.0 ms and uses those values to dynamically adjust first 8 pulses. I tried several approaches so far. None of them worked.
1. Get the Input just before outputting a pulse. That throws off the timing of the 0.4 ms pause.
2. Read the inputs (I tried two), then generate the output. I thought there should be plenty of time in the 25ms frametime, but unfortunately reading 2 pulses between 1 and 2 ms with the "PULSIN" commands takes about 50ms, I have no idea why, but thats what the signal look like on my scope.
3. I wanted to try multitasking (one for reading, one for creating the output) that didn´t get very far, since it´s not possible to use multitasking with 32Mhz, which I need to use the "PAUSEUS" command for the 0.4ms pause.
4. next idea is to use two 08M2 chips. But can´t figure out how to pass the data from one to the other. All I found are solutions that seem to be capable of everything short of making a PCAXE fly. I just need a simple oneway coms. in a "fire and forget" fashion, since a potentially false value is overwritten 25ms later anyway. So here´s the pseudocode for the chips:
Chip1:
read input chanel 1 (pulselength 1 to 2 ms, repeated every 25ms)
read input chanel 2 (pulselength 1 to 2 ms, repeated every 25ms)
send values to chip 2
start over
Chip 2:
receive values from chip 1
store them
generate the signal from the latest stored data
start over
Does anybody have any ideas? thanks in advance
Herbert
Then I wanted to read pulses between 1.0 to 2.0 ms and uses those values to dynamically adjust first 8 pulses. I tried several approaches so far. None of them worked.
1. Get the Input just before outputting a pulse. That throws off the timing of the 0.4 ms pause.
2. Read the inputs (I tried two), then generate the output. I thought there should be plenty of time in the 25ms frametime, but unfortunately reading 2 pulses between 1 and 2 ms with the "PULSIN" commands takes about 50ms, I have no idea why, but thats what the signal look like on my scope.
3. I wanted to try multitasking (one for reading, one for creating the output) that didn´t get very far, since it´s not possible to use multitasking with 32Mhz, which I need to use the "PAUSEUS" command for the 0.4ms pause.
4. next idea is to use two 08M2 chips. But can´t figure out how to pass the data from one to the other. All I found are solutions that seem to be capable of everything short of making a PCAXE fly. I just need a simple oneway coms. in a "fire and forget" fashion, since a potentially false value is overwritten 25ms later anyway. So here´s the pseudocode for the chips:
Chip1:
read input chanel 1 (pulselength 1 to 2 ms, repeated every 25ms)
read input chanel 2 (pulselength 1 to 2 ms, repeated every 25ms)
send values to chip 2
start over
Chip 2:
receive values from chip 1
store them
generate the signal from the latest stored data
start over
Does anybody have any ideas? thanks in advance
Herbert