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 01:11
Read: 421 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      Yagnesh Mehta      03/29/12 01:03      
   Inductive VS resistive characteristics      Yagnesh Mehta      03/29/12 06:20      
    :( not even single person is interested in this post......      Yagnesh Mehta      04/04/12 04:58      
      what?      Stefan KAnev      04/04/12 14:43      
      Power Electronics      KONSTANTINOS L. ANGELIS      04/04/12 14:49      
   Thank for Replay and your interest      Yagnesh Mehta      04/05/12 00:07      
   Code      Yagnesh Mehta      04/05/12 01:11      
      Established Synchronization But.......      Yagnesh Mehta      04/05/12 01:41      
      ?      Stefan KAnev      04/05/12 10:29      
         Not function      Yagnesh Mehta      04/05/12 21:53      
      Code Does not make sense      Andy Neil      04/05/12 23:41      
         for understanding only....      Yagnesh Mehta      04/06/12 01:29      
            Confusion, more like      Andy Neil      04/06/12 05:29      
         Formating ....      Yagnesh Mehta      04/06/12 01:33      
            It is always, but especially when ....      Erik Malund      04/06/12 08:07      
         Problem Resolved      Yagnesh Mehta      04/06/12 22:23      
            Please share      Andy Neil      04/07/12 04:15      
               Ya sure....      Yagnesh Mehta      04/07/12 06:23      

Back to Subject List