Have you changed the duty
Have you changed the duty cycle yet? Your PWM should work as far as I can see, but running with zero duty cycle will make it appear to not work, since it isn’t doing anything.
Have you changed the duty
Have you changed the duty cycle yet? Your PWM should work as far as I can see, but running with zero duty cycle will make it appear to not work, since it isn’t doing anything.
thanks, duty cycle?
Thanks, then i had read it correct :0) nice to know that i did someting correct :0)
in my program at etc. “fuldf”, that should be the place where i set my duty cycle for fast forward
fuldf movlw 0xff
movwf CCPR1L
movlw 0x80
movwf CCPR2L
The reason they are different is that the motors dont run at the same speed, so it is to correct that.
In the subrutine “init” i clrf CCPR1L and clrf CCPR2L, so they are cleared. Is that wrong?
Or is it in the subrutine “init” that i shall set my duty cycle, if so how do it get it to drive with different speed?
It’s wrong to clear the
It’s not wrong to clear the CCPRxL registers, but for debugging purposes it’s not very useful.
Why don’t you just try to get your PWM running correctly at a single speed determined in the init subroutine (50% duty is a good starting point), and then once that’s sorted you can work on the code that will control the motor speed in the real program. Since the PWM duty cycle is currently being changed in several locations throughout the code, it becomes harder to determine the source of any problems.