PIC18F2520 KOD PROTEUSTA ÇALIŞIYOR FAKAT TEST DEVRESİNDE ÇALIŞMIYOR?

Başlatan cagatays, 28 Ocak 2014, 14:29:26

cagatays

Merhaba arkadaşlar, elimdeki 18F2520 ile 7segment Display yakmak istiyorum. yazdığım kodu proteuste simule edince çalısıyor fakat kurduğum test devresinde simule edince çalışmıyor. External osilator kullanıyorum 20MHZ lik kondansatorlerim 33pf. Sanırım yaptığım CONFİG ayarlarında bir sıkıntı var yada osilatorle ilgili. Yazdığım kod aşağıda yardımcı olursanız sevnirim.
Kolay gelsin...
#include <18F2520.h>
#device adc=8

#FUSES NOWDT                    //No Watch Dog Timer
#FUSES WDT128                   //Watch Dog Timer uses 1:128 Postscale
#FUSES HS                       
#FUSES NOPROTECT                //Code not protected from reading
#FUSES BROWNOUT                 //Reset when brownout detected
#FUSES BORV20                   //Brownout reset at 2.0V
#FUSES NOPUT                    //No Power Up Timer
#FUSES NOCPD                    //No EE protection
#FUSES NOSTVREN                   //Stack full/underflow will cause reset
#FUSES NODEBUG                  //No Debug mode for ICD
#FUSES NOLVP                      //Low Voltage Programming on B3(PIC16) or B5(PIC18)
#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 PBADEN                   //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 LPT1OSC                  //Timer1 configured for low-power operation
#FUSES MCLR                     //Master Clear pin enabled
#FUSES XINST                    //Extended set extension and Indexed Addressing mode enabled

#use delay(clock=20M, oscillator) 
#use rs232(baud=9600,parity=N,xmit=PIN_C6,rcv=PIN_C7,bits=8)
#USE STANDARD_IO (a)
#USE STANDARD_IO (b)
#USE STANDARD_IO (c)





   
   
   
   
void main()
{

   setup_adc_ports(NO_ANALOGS|VSS_VDD);
   setup_adc(ADC_OFF|ADC_TAD_MUL_0);
   setup_spi(SPI_MASTER|SPI_L_TO_H|SPI_CLK_DIV_4);
   setup_wdt(WDT_OFF);
   setup_timer_0(RTCC_INTERNAL);
   setup_timer_1(T1_DISABLED);
   setup_timer_2(T2_DISABLED,0,1);
   setup_timer_3(T3_DISABLED|T3_DIV_BY_1);
   setup_comparator(NC_NC_NC_NC);
   setup_vref(FALSE);
   
   while(true)
   {
   
   
   output_b (0xEB);
   delay_ms( 1000 ); 
    
   output_b (0x4C);
   delay_ms( 1000 );
   
   output_b (0x49);
   delay_ms( 1000 ); 
    
   output_b (0x2B);
   delay_ms( 1000 );
     
   output_b (0x19); 
   delay_ms( 1000 ); 
    
   output_b (0x18);
   delay_ms( 1000 ); 
   
   output_b (0xCB); 
   delay_ms( 1000 ); 
    
   output_b (0x08);
   delay_ms( 1000 ); 

   }
}

RaMu

proteus şemanı foto olarak,
kurduğun devreyi foto olarak ekle
bakalım bağlantı hatası, eksik var mı diye.

Şimdilik söyleyebileceğim;
Mclr pinini dirençle + ya çekmeyi unutmuş olabilirsin,
displayler ortak anod mu katod mu yanlış bağlamış olabilirsin
Sorularınıza hızlı cevap alın: http://www.picproje.org/index.php/topic,57135.0.html

Ali_54

#use delay(clock=20M, oscillator)  şeklinde hiç denememiştim.
ben çöyle kullanıyorum.
#use delay(clock=20000000)  .

yada osikatörü komple çıkartt. devreye takma koda da şunu yaz.
#use delay(internal=8000000)

33p yerine ben 22p kullanırım. 33 fazla olabilir belki
1 harf öğretenin 4 gün kölesi olurum.

Recep METE

Arkadaşım isiste çalıştığına göre devrede de çalışması gerekir.Kurduğun devrenin fotoğrafını yükle anında sorununu çözelim.Kesinlikle kurduğun devre veya devre elemanlarında sıkıntı var.
printf(lcd_putc,"\f  Ne kadar okursan oku, bilgine, yakışır şekilde davranmıyorsan cahilsin demektir.  \n   semfero");d

MT

Isiste islemci toprak baglantilari otomatik yapilir baglamasan bile arka planda baglidir. Devrenizde islemci topraklarini kontrol ediniz.