Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
04/05/12 07:11
Read: times


 
#187012 - Code
Responding to: ???'s previous message
hi,
this is software code for that...
Gate drive signal generate on Singal PIN (PORTA_PIN0)

unsigned short sync_time,alpha;
void PWM_module_init(void){ //initilization of PWM module

PWM_module_ch0 //config as input capture& both rising and falling edge interrupt Enable
PWM_module_ch1 //Output compare1
PWM_Module_ch2 //output compare2
Module_counter =0xFFFF; // free running
PWM_module_freq // 4MHz
}

void Input_capture_interrupt (void) {
clear flag;
sync_time =input_capture_count;
Output compare1 = sync_time + alpha; //[alpha = 0 to 40,000 counter value]
}
void Output_Compare1_interrupt(void) {
clear flag;
PortA_pin0 = 1; //send higt to port A pin 0
Output compare2 = sync_time + 40000; //[40,000 count = 10mS]
}

void Output_Compare2_interrupt(void) {
clear flag;
PortA_pin0 = 0; //send low to port A pin 0
Start_ADC;
}

void ADC_interrupt(void){

stop_ADC;
alpha=ADC_conversion_data; // 0-3.3V => 0-40,000;
}

i am getting almost perfect output but synchronization problem..
alpha is varying between 0-180'(0-10mS)



List of 18 messages in thread
TopicAuthorDate
Gate pulse for anti paraller Thyristor configuration            01/01/70 00:00      
   Inductive VS resistive characteristics            01/01/70 00:00      
    :( not even single person is interested in this post......            01/01/70 00:00      
      what?            01/01/70 00:00      
      Power Electronics            01/01/70 00:00      
   Thank for Replay and your interest            01/01/70 00:00      
   Code            01/01/70 00:00      
      Established Synchronization But.......            01/01/70 00:00      
      ?            01/01/70 00:00      
         Not function            01/01/70 00:00      
      Code Does not make sense            01/01/70 00:00      
         for understanding only....            01/01/70 00:00      
            Confusion, more like            01/01/70 00:00      
         Formating ....            01/01/70 00:00      
            It is always, but especially when ....            01/01/70 00:00      
         Problem Resolved            01/01/70 00:00      
            Please share            01/01/70 00:00      
               Ya sure....            01/01/70 00:00      

Back to Subject List