PDA

View Full Version : How to 18F4431 PPWM



hell_pk
- 6th July 2007, 05:34
Hi!
any code regarding the use of power PWM module pf 18F4431. I have PICDEM MC LV board. It has a CD that gives source code in asm. I use pic basic so i need some help in configuring PPWM.
thanks.

mister_e
- 6th July 2007, 08:11
you will need to be more specific in your requirement. There's A LOT of different way to use that one.

How many channels
which frequency
etc etc

maybe you could post yor ASM code or read that one and learn from it
http://www.picbasic.co.uk/forum/showthread.php?t=3891&highlight=ext%2A+modifier

hell_pk
- 6th July 2007, 10:30
I have attached a file in asm.How can we do this in pic basic pro which has been done in this file.i.e to control a BLDC motor.but mainly first i want to just understand how to use this PPWM module.check its outputs with scope then build my own code.i have read app notes "AN900" regarding control of motor. it explains nicely all the detail except code is in asm.
I tried to do it myself also, just output a 20Khz signal om PWM outputs using PPWM:

while true
PTCON0=00000000 'page 8,step 1
PTPERL=$63 'a guess
PTPERH=$00
PWMCON0=01000000 'step 3
PWMCON1=00000000 'step 4
DTCON=00001010 ' a guess
OVDCOND=00000000 'step 6
OVDCONS=00000000
'POVD=00000000
'SEVTCMP=$0000
'step 8
PDC0L=$00
PDC0H=$00
PDC1L=$00
PDC1H=$00
PDC2L=$00
PDC2H=$00
PDC3L=$00
PDC3H=$00

SEVTCMPL=$00
SEVTCMPH=$00
TRISC.0=1
PTCON1=10000000 'or PTCON1.7=1
wend