pic 18f26k200 ==> pic18f26k22

Başlatan sawyer, 31 Mart 2012, 21:47:40

sawyer

merhaba,
pic 18f25k20 kullanıyorum 3.3v 16 mHz de.
pic18f20k22 3.3v 16 mHz fakat hiç bir şey çaşılmıyor basit bir input ile in değeri bile yanlışlık nerededir kodu aşağıdaki gibidir.

#include <18F26K22.h>
#device adc=8
#DEVICE PASS_STRINGS=IN_RAM
#include <string.h>
#include <stdlib.h>



#FUSES NOWDT                    //No Watch Dog Timer
#FUSES WDT128                   //Watch Dog Timer uses 1:128 Postscale
#FUSES HS//#FUSES HS                 //Internal RC Osc, no CLKOUT
#FUSES NOPLLEN                  //4X HW PLL disabled, 4X PLL enabled in software
#FUSES NOFCMEN                  //Fail-safe clock monitor disabled
#FUSES NOIESO                   //Internal External Switch Over mode disabled
#FUSES NOBROWNOUT               //No brownout reset
#FUSES NOPBADEN                 //PORTB pins are configured as digital I/O on RESET
#FUSES MCLR                     //Master Clear pin used for I/O
#FUSES NOSTVREN                 //Stack full/underflow will not cause reset
#FUSES LVP                    //No low voltage prgming, B3(PIC16) or B5(PIC18) used for I/O
#FUSES NOXINST                  //Extended set extension and Indexed Addressing mode disabled (Legacy mode)



#use delay(crystal=16M,clock=16M) 
#use rs232(baud=9600,parity=N,xmit=PIN_C4,rcv=PIN_C5,bits=8,stream=PC)

#define PWR pin_A4
#define DCD pin_A0

void main()
{

   setup_adc_ports(NO_ANALOGS|VSS_VDD);
   setup_adc(ADC_CLOCK_DIV_2|ADC_TAD_MUL_0);
   setup_spi(SPI_SS_DISABLED);
   setup_wdt(WDT_ON);
   setup_timer_0(RTCC_INTERNAL|RTCC_DIV_64);
   setup_timer_1(T1_DISABLED);
   setup_timer_2(T2_DISABLED,0,1);
   setup_ccp1(CCP_OFF);
   setup_comparator(NC_NC_NC_NC);// This device COMP currently not supported by the PICWizard
   
while (True)
{
   fprintf(PC,"DCD:%d  PWR:%d\r\n",input(DCD),input(PWR));
   Delay_ms(1000);

}
}

esensoy

setup_wdt(WDT_ON);

fuses da kapamışsın ama altta açmışsın,
watchdog timer ı ya kapat, ya da resetle,


delay(1000)
'e dikkat
En tehlikeli an "zafer" anıdır.