I want to turn on an output pin with 50% dutycycle and leave it on like 5 s then I tell it to put that pin low (will that turn the pwm off?)
can i do this with the software pwm?
similar to the hardware pwm but i don't have that option on the 16f685 the way i have it hooked up.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
It is possible to write your own loop for this, but a little tricky depending on other needed tasks. But doable. Start timer1, read the current value in your loop, toggle output depending.
If you are going to want to do other tasks, or need higher accuracy, then you will probably want to use an interrupt.
I have successfully used an interrupt to perform a software PWM with GCbasic.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I want to turn on an output pin with 50% dutycycle and leave it on like 5 s then I tell it to put that pin low (will that turn the pwm off?)
can i do this with the software pwm?
similar to the hardware pwm but i don't have that option on the 16f685 the way i have it hooked up.
See the PWMout command, it uses software PWM. After the PWMout command completes, set the output low.
Depending, you may decide to perform the PWM in other ways, such as an interrupt.
i don't want it to complete, i want it to run until i tell it to stop
It is possible to write your own loop for this, but a little tricky depending on other needed tasks. But doable. Start timer1, read the current value in your loop, toggle output depending.
If you are going to want to do other tasks, or need higher accuracy, then you will probably want to use an interrupt.
I have successfully used an interrupt to perform a software PWM with GCbasic.
Just to clarify, what are you looking for?
Do you want a 50% duty cycle for 5 second then go low?
or
Do you want a 50% duty cycle that goes low when triggered by another input?
Tom