Thanks, I should have said that: I want the output to be low for the short time (4+ms) and high for the long time (12+ms). I think the program should do that, but it doesn't. The output is high for the short time and low for the long time.
Thanks, I should have said that: I want the output to be low for the short time (4+ms) and high for the long time (12+ms). I think the program should do that, but it doesn't. The output is high for the short time and low for the long time.
Your main code looks fine:
Your startup code does not:Code:START: LOW GPIO.1 PAUSEUS 4168 ' ON TIME HIGH GPIO.1 PAUSEUS 4167 'DEAD TIME LOW GPIO.0 'SETS PIN 7 LOW PAUSEus 4168 'FOR 4.168 MILLISECONDS HIGH GPIO.0 PAUSEUS 4167 'DEAD TIME
This sets all pins to <U>inputs</U>. You want to use:Code:TRISIO = %111111
Code:TRISIO = %001000 '(since GPIO3 is input only anyway)
If it was me, i would use a timer interrupt, but add somes extra filter outside.
I don't understand what you mean by
Originally Posted by Russ Kincaid
Last edited by mister_e; - 6th May 2007 at 09:52.
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
What I mean by "upside down" is: When the programmed output is high, the output actually goes low and when the programmed output is low, it actually goes high. I don't understand that.
Russ
Hi Russ,
We are not trying to give you a difficult time about this inverted waveform thing. It is just difficult to tell what you are seeing on a recurring waveform. Do you have another circuit synchronized with this output? Are you referencing the measurement to the PIC common?
The timing may be difficult to see with a rapidly cycling code. You could change the code to seconds, just to watch the sequence.
It looks like you WANT the output to be HIGH for three time increments and LOW for one. (See attachment.) http://www.picbasic.co.uk/forum/atta...1&d=1178466510
Is the waveform LOW for three time increments and HIGH for one?
-Adam-
Ohm it's not just a good idea... it's the LAW !
Last edited by Russ Kincaid; - 6th May 2007 at 18:24.
Bookmarks