18f4550 rb0 kesmesi

Başlatan bbs2006, 27 Nisan 2016, 22:12:24

bbs2006

Merhaba
18f4550 de rbo kesmesi için yazılmış örnek bir yazılım varsa yardımcı olursanız sevinirim. ccs c için

dursuncemal

hocam project wizart tan project olusturur iken inteerups bolumundeki 'external interrupt' yazan yeri isaretlediginizde kendisi otomatik olarak kodunuzun icine ext int fonsiyonunu dahil ediyor.
:=


Salih

#3
#include <18F4550.h>
#device adc=8

#FUSES NOWDT                    //No Watch Dog Timer
#FUSES WDT128                   //Watch Dog Timer uses 1:128 Postscale
#FUSES XT                       //Crystal osc <= 4mhz for PCM/PCH , 3mhz to 10 mhz for PCD
#FUSES PROTECT                //Code not protected from reading
#FUSES NOBROWNOUT               //No brownout reset
#FUSES PUT                      //Power Up Timer
#FUSES CPD                    //No EE protection
#FUSES STVREN                   //Stack full/underflow will cause reset
#FUSES NODEBUG                  //No Debug mode for ICD
#FUSES NOLVP                    //No low voltage prgming, B3(PIC16) or B5(PIC18) used for I/O
#FUSES NOWRT                    //Program memory not write protected
#FUSES NOWRTD                   //Data EEPROM not write protected
#FUSES IESO                     //Internal External Switch Over mode enabled
#FUSES FCMEN                    //Fail-safe clock monitor enabled
#FUSES NOPBADEN                   //PORTB pins are configured as analog input channels on RESET
#FUSES NOWRTC                   //configuration not registers write protected
#FUSES NOWRTB                   //Boot block not write protected
#FUSES NOEBTR                   //Memory not protected from table reads
#FUSES NOEBTRB                  //Boot block not protected from table reads
#FUSES NOCPB                    //No Boot Block code protection
#FUSES NOMCLR                     //Master Clear pin enabled
#FUSES LPT1OSC                  //Timer1 configured for low-power operation
#FUSES NOXINST                  //Extended set extension and Indexed Addressing mode disabled (Legacy mode)
#FUSES PLL12                    //Divide By 12(48MHz oscillator input)
#FUSES CPUDIV1                  //System Clock by 4
#FUSES USBDIV                   //USB clock source comes from PLL divide by 2
#FUSES VREGEN                   //USB voltage regulator enabled

#use delay(Xtal=4M,clock=48M)



#int_EXT
void  EXT_isr(void) 
{
// RB0 kesmesi. Kodlar buraya yazılacak
}

void main()
{
   setup_adc_ports(NO_ANALOGS|VSS_VDD);
   setup_adc(ADC_OFF);
   setup_spi(SPI_SS_DISABLED);
   setup_wdt(WDT_OFF);
   setup_timer_0(T0_INTERNAL | RTCC_DIV_1);
   setup_timer_1(T1_EXTERNAL|T1_DIV_BY_1| L_TO_H);
   setup_timer_2(T2_DISABLED,249,1);
   setup_timer_3(T3_DISABLED|T3_DIV_BY_1);
   setup_ccp1(CCP_OFF);   
   setup_comparator(NC_NC_NC_NC);
   setup_vref(FALSE);   
   
   enable_interrupts(INT_EXT_L2H)  
   enable_interrupts(GLOBAL);   
   
   
while(True){
  
}
}