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:
#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);
}
}
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:
#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);
}
}