News:

PROTON pic BASIC Compilers for PIC, PIC24, dsPIC33

Main Menu

HPWM NOT WORKING IN DSPIC 33FJ12MC202

Started by Abdullah, Today at 03:52 PM

Previous topic - Next topic

Abdullah

HELLO Everyone
why are this code is not working
maybe my method is Wrong
Abdullah

Abdullah

Device 33FJ12MC202
Declare Xtal 32
Declare LCD_DTPin PORTB.0
Declare LCD_RSPin PORTB.4
Declare LCD_ENPin PORTB.5
Declare Create_Coff = On
Declare Watchdog = 0
TRISB=%00000000
Declare CCP1_Pin PORTB.10
Declare CCP2_Pin PORTB.11
Declare CCP3_Pin PORTB.8
Declare CCP4_Pin PORTB.9
Dim D1 As Byte = 127
Dim D2 As Byte = 127
Dim D3 As Byte = 127
Dim D4 As Byte = 127
Dim F1 As Word = 1000
Dim F2 As Word = 1000
Dim F3 As Word = 1000
Dim F4 As Word = 1000
Cls
Print At 1,2,"TEST HPWM 4 CH"
ABDULLAH:
HPWM 1,D1,F1
DelayMS 1
HPWM 2,D2,F2
DelayMS 1
HPWM 3,D3,F3
DelayMS 1
HPWM 4,D4,F4
DelayMS 1
GoTo ABDULLAH
End
Abdullah

Abdullah

Abdullah

Wimax

Hello,


Did you set the peripheral through PPS_Output macro or using a direct assignment ?
 
Something like this (check the device files):

PPS_Output(cOut_Pin_RPx, cOut_Fn_OC1)   ' Make RPx the pin for PWM1