Haberler:

Foruma Resim Yükleme ve Boyut Sınırlaması ( ! )  https://bit.ly/2GMFb8H

Ana Menü

Zero-Cross

Başlatan ChiliPepper, 13 Ağustos 2025, 14:02:08

ChiliPepper

Merhaba zero-cross ile 4 adet rezistans sürmeye çalışıyorum. Osiloskopla baktığımda zerocross doğru şekilde çalışıyor. Bağlantı ve kod aşağıda. Sorunum kart normal bir şekilde çalışırken 1-2 gün sonra 1. ve 2. rezistanslar kendiliğinden çalışıp yanıyor. Bağlantı veya kodda sorunum var mı emin değilim kontrol edebilir misiniz.





#int_ext
void dis_kesme()
{   
   counter=0;
   enable_interrupts(INT_TIMER0);
   
}

#int_timer0
void kesme()
{
   set_timer0(68); 
   counter++;
   
  if(rez_on1==1)
   {
      rez_ac1=1;
      if(counter>rhiz1)
      {
         output_high(rez1); 
      }
      if(counter>97)
      {
         output_low(rez1);
      }
   }
   
   if(rez_on2==1)
   {
      rez_ac2=1;
      if(counter>rhiz2)
      {
         output_high(rez2);
      }
      if(counter>97)
      {
         output_low(rez2);
      } 
   }
   
   if(rez_on3==1)
   {
      rez_ac3=1;
      if(counter>rhiz3)
      {
         output_high(rez3);
      }
      if(counter>97)
      {
         output_low(rez3);
      }
   } 
   
   if(rez_on4==1)
   {
      rez_ac4=1;
      if(counter>rhiz4)
      {
         output_high(rez4);
      }
      if(counter>97)
      {
         output_low(rez4);
      }
   }

   if(rez_on1==0&&rez_ac1==1)
   {
      rez_ac1=0;
      output_low(rez1);
   }
   if(rez_on2==0&&rez_ac2==1) 
   {
      rez_ac2=0; 
      output_low(rez2);
   }
   if(rez_on3==0&&rez_ac3==1)
   {
      rez_ac3=0;
      output_low(rez3);
   }
   if(rez_on4==0&&rez_ac4==1)
   {
      rez_ac4=0;
      output_low(rez4);
   }



   if(rez_ac1==0&&rez_ac2==0&&rez_ac3==0&&rez_ac4==0)
   {
      output_low(rez1);
      output_low(rez2);
      output_low(rez3);
      output_low(rez4);
      counter=0;
      clear_interrupt(INT_TIMER0);
      disable_interrupts(INT_TIMER0);  
      disable_interrupts(int_ext);
   }
   if(counter>98)
   {
      clear_interrupt(INT_TIMER0);
      disable_interrupts(INT_TIMER0);  
   }
   }

   setup_timer_0(RTCC_DIV_4 | RTCC_8_BIT);  
   set_timer0(68); 

Melih1802

Bence BT138 Test için uygun kriterde abartılı bir seçim yap test et.