rda kesmesi

Başlatan ChiliPepper, 22 Ocak 2025, 10:52:15

ChiliPepper

Merhaba pic 18f67k22 ile kullandığım rda kesmesi kodlarını pic16f1939 için kullandığımda kesmeye girmedi nerede hata yapmış olabilirim.

#include <16f1939.h>
#device ADC=10
#include <math.h>
#FUSES NOMCLR
#FUSES PROTECT
#FUSES NOWDT                     
#FUSES NOBROWNOUT               
#FUSES NOLVP     
#FUSES INTRC_IO
#use delay(internal=4MHz)
#use rs232(baud=9600,xmit=PIN_C6,rcv=PIN_C7,stream=NEXTION,errors)
#include <internal_eeprom.c>
#int_rda
void RDA_isr()
{
   disable_interrupts(int_rda);
   output_high(buz);
   for(unsigned int aa=0;aa<=1;aa++)
      {
         unsigned int a;
         a = fgetc(NEXTION);
         if(aa==0 && a!=0)
         {
             hiz1=a;
         }
         else if(aa==1 && a!=0)
         {
             hiz2=a;
         }   
       
      }
    output_low(buz);
    enable_interrupts(INT_RDA);
}
void main()
{
  setup_spi(SPI_SS_DISABLED);
  setup_timer_1(T1_DISABLED); 
  setup_timer_2(T2_DIV_BY_16,255,1);
  setup_ccp2(CCP_PWM || pin_c1);
  setup_ccp1(CCP_PWM || pin_c2);
  set_pwm1_duty(0);
  set_pwm2_duty(0);
  set_tris_a(0x8F);
  set_tris_b(0xFE);
  set_tris_c(0xF9);
  set_tris_d(0xF0);
  set_tris_e(0xFC);
  setup_adc(ADC_CLOCK_DIV_8);
  setup_adc_ports(sAN0|sAN1); //an14 ntcsAN14|sAN15
  output_low(buz);
  output_low(depo_term);
  output_low(term1);
  output_low(term2);
  output_low(ventil);
  output_low(kontrol);
  output_low(ledk1);
  output_low(ledk2);
  output_high(ledm1);
  output_high(ledm2);
  enable_interrupts(INT_RDA);
  enable_interrupts(GLOBAL);
 
   while(1)
   {         
}


haberleşme yolunda kısa devre varmış konu silinebilir.