Aug 30, 2014 #1 T theredkid Newbie level 5 Joined Apr 21, 2011 Messages 10 Helped 0 Reputation 0 Reaction score 0 Trophy points 1,281 Activity points 1,353 How to generate three phase PWM? Hello, I'm a newbie in these things and wondering how we can generate three phase (ab 25 kHz, 0 -5V) PWM in CCS C with PIC16/18. Thanx. I know the single phase only below: Code C - [expand]1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 #include <16F72.h> #use delay(clock=4000000) #fuses NOWDT,XT, NOPROTECT int value; main() { setup_adc_ports( ALL_ANALOG ); setup_adc(ADC_CLOCK_INTERNAL ); setup_timer_2 ( T2_DIV_BY_4, value, 2); set_adc_channel( 0 ); setup_ccp1(CCP_pwm); while(true) { delay_ms(100); value = read_adc(); setup_timer_2 ( T2_DIV_BY_16, value, 2); } } Last edited: Aug 30, 2014
How to generate three phase PWM? Hello, I'm a newbie in these things and wondering how we can generate three phase (ab 25 kHz, 0 -5V) PWM in CCS C with PIC16/18. Thanx. I know the single phase only below: Code C - [expand]1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 #include <16F72.h> #use delay(clock=4000000) #fuses NOWDT,XT, NOPROTECT int value; main() { setup_adc_ports( ALL_ANALOG ); setup_adc(ADC_CLOCK_INTERNAL ); setup_timer_2 ( T2_DIV_BY_4, value, 2); set_adc_channel( 0 ); setup_ccp1(CCP_pwm); while(true) { delay_ms(100); value = read_adc(); setup_timer_2 ( T2_DIV_BY_16, value, 2); } }
Aug 30, 2014 #2 H horace1 Advanced Member level 5 Joined Nov 18, 2008 Messages 2,118 Helped 596 Reputation 1,188 Reaction score 571 Trophy points 1,393 Location Norwich, UK Activity points 13,063 Re: How to generate three phase PWM? I know that dsPIC30F have a Motor Control PWM module (MCPWM) which will generate three phase PWM, see the GS004 application note Driving an ACIM with the dsPIC® DSC MCPWM Module https://ww1.microchip.com/downloads/en/DeviceDoc/93004A.pdf it may give you some ideas
Re: How to generate three phase PWM? I know that dsPIC30F have a Motor Control PWM module (MCPWM) which will generate three phase PWM, see the GS004 application note Driving an ACIM with the dsPIC® DSC MCPWM Module https://ww1.microchip.com/downloads/en/DeviceDoc/93004A.pdf it may give you some ideas