HOW TO USE HPWM3 / 4 / 5 ON PORTG.0 PORTG.3 PORTG.4
EX
duty_1 var byte
duty_2 var byte
duty_3 var byte
duty_4 var byte
duty_5 var byte
mot1 VAR PORTC.2 'HPWM1
mot2 VAR PORTC.1 'HPWM2
mot3 var PORTG.0 'HPWM3
mot4 var PORTG.3 'HPWM4
mot5 var PORTG.4 'HPWM5
adcon1 = 7
TRISC = %00000000
TRISG = %00000
duty_1 = 255
duty_2 = 255
duty_3 = 255
duty_4 = 255
duty_5 = 255
gosub drive0
gogo:
GOSUB forward150
GoTo gogo
End
drive:
HPWM 1,duty_1,800
HPWM 2,duty_2,800
HPWM 3,duty_3,800
HPWM 4,duty_4,800
HPWM 5,duty_5,800
Return
drive0:
HPWM 1,0,800
HPWM 2,0,800
HPWM 3,0,800
HPWM 4,0,800
HPWM 5,0,800
Return
forward150:
High mot1
High mot2
High mot3
High mot4
High mot5
duty_1 = 100
duty_2 = 100
duty_3 = 100
duty_4 = 100
duty_5 = 100
GoSub drive
pause 100
Return
from ex
HPWM1 AND HPWM2 IS WORK
BUT NO SIGNAL OUT PORT G.0 G.3 G.4
THANK YOU