Merhabalar..
Config_Start
OSC = HS ' High speed Oscillator (16 MHz)
IESO = OFF ' Int/Ext Oscillator Switch Over Disabled
PWRT = On ' Power Up Timer Enabled
BOREN = OFF ' Brownout Reset Disabled
WDT = OFF ' Watchdog Timer Disabled
WDTPS = 256 ' Watchdog Postscaler: 1:256
MCLRE = On ' External MCLR enabled
STVREN = On ' Stack Overflow Reset Enabled
LVP = OFF ' Low Voltage ICSP Disabled
Debug = OFF ' Background Debugger Disabled
PBADEN = OFF ' Port B ADC functions Disabled
CP0 = OFF ' Code Protection Block 0 Disabled
CP1 = OFF ' Code Protection Block 1 Disabled
CPB = OFF ' Boot Block Code Protection Disabled
CPD = OFF ' Data EEPROM Code Protection Disabled
WRT0 = OFF ' Write Protection Block 0 Disabled
WRT1 = OFF ' Write Protection Block 1Disabled
WRTB = OFF ' Boot Block Write Protection Disabled
WRTC = OFF ' Configuration Register Write Protection Disabled
WRTD = OFF ' Data EEPROM Write Protection Disabled
EBTR0 = OFF ' Table Read Protection Block 0 Disabled
EBTR1 = OFF ' Table Read Protection Block 1 Disabled
EBTRB = OFF ' Boot Block Table Read Protection Disabled
Config_End
en basitinden bu şekilde bir konfig girdiğimde hata alıyorum.Sorun nedir neresini eksik yapıyorum ?
18F25K22 çalışan config ayarı
(int osc 16mhz)
'-------------------------------------------------------------------------------
Device 18F25K22
Declare Xtal=16
OSCCON.6=1
OSCCON.5=1
OSCCON.4=1
OSCCON.1=1
OSCCON.0=1
;-------------------------------------------------------------------------------
Config_Start
FOSC = INTIO67 ;Internal oscillator block
PLLCFG = OFF ;Oscillator used directly
PRICLKEN = On ;Primary clock enabled
FCMEN = OFF ;Fail-Safe Clock Monitor disabled
IESO = OFF ;Oscillator Switchover mode disabled
PWRTEN = On ;Power up timer enabled
BOREN = SBORDIS ;Brown-out Reset enabled in hardware only and disabled in Sleep mode (SBOREN is disabled)
BORV = 190 ;VBOR set to 2.50 V nominal
WDTEN = OFF ;Watch dog timer is always disabled. SWDTEN has no effect.
WDTPS = 32768 ;1:32768
CCP2MX = PORTC1 ;CCP2 input/output is multiplexed with RC1
PBADEN = OFF
CCP3MX = PORTC6 ;P3A/CCP3 input/output is mulitplexed with RC6
HFOFST = OFF ;HFINTOSC output and ready status are not delayed by the oscillator stable status
T3CMX = PORTC0 ;T3CKI is on RC0
P2BMX = PORTC0 ;P2B is on RC0
MCLRE = INTMCLR ;RE3 input pin enabled; MCLR disabled
STVREN = OFF ;Stack full/underflow will not cause Reset
LVP = OFF ;Single-Supply ICSP disabled
XINST = OFF ;Instruction set extension and Indexed Addressing mode disabled (Legacy mode)
Debug = OFF ;Disabled
Cp0 = On ;Block 0 (000800-001FFFh) code-protected
CP1 = On ;Block 1 (002000-003FFFh) code-protected
CP2 = On ;Block 2 (004000-005FFFh) code-protected
CP3 = On ;Block 3 (006000-007FFFh) code-protected
CPB = On ;Boot block (000000-0007FFh) code-protected
CPD = OFF ;Data EEPROM not code-protected
WRT0 = OFF ;Block 0 (000800-001FFFh) not write-protected
WRT1 = OFF ;Block 1 (002000-003FFFh) not write-protected
WRT2 = OFF ;Block 2 (004000-005FFFh) not write-protected
WRT3 = OFF ;Block 3 (006000-007FFFh) not write-protected
WRTC = OFF ;Configuration registers (300000-3000FFh) not write-protected
WRTB = OFF ;Boot Block (000000-0007FFh) not write-protected
WRTD = OFF ;Data EEPROM not write-protected
EBTR0 = OFF ;Block 0 (000800-001FFFh) not protected from table reads executed in other blocks
EBTR1 = OFF ;Block 1 (002000-003FFFh) not protected from table reads executed in other blocks
EBTR2 = OFF ;Block 2 (004000-005FFFh) not protected from table reads executed in other blocks
EBTR3 = OFF ;Block 3 (006000-007FFFh) not protected from table reads executed in other blocks
EBTRB = OFF ;Boot Block (000000-0007FFh) not protected from table reads executed in other blocks
Config_End
;-------------------------------------------------------------------
Hocam geçen soracaktım kaldı.
xtal=16 demişsiniz oscon lar ile de 16 ya göre ayarlamışsınız osilatörü datasheet öyle diyor fakat devrede 20mhz kristal bağlı benim..
karta 16mhz kristal mı takmam gerekiyor yoksa 20mhz kristali 16mhz gibi mi bölüp çalıştırıyor osilatörü içeride ?
nihayetinde 20mhz kristal ile sizin osilatör ayarları ile gayet iyi çalışıyor niyahetinde usart haberleşmem var sorun yaratacak olsa en başta o çalışmazdı diye düşünüyorum..
Birde diğer config ayarlarının türkçe açıklamaları olsa çok güzel olurmuş..
@mustafa_cmbz hocam hata vermesinin nedeni yazım hatasından kaynaklanıyor. "P18F24K22.PPI" içeriğini inceleyip Config i tanımlarken buradaki yazımları referans alabilirsiniz. Bu MCU için "HS" hatalı bir tanımlama siz harici olarak 16MHZ üzerinde crystal kullanacaksınız "OSC = HSHP" şeklinde kullanmalısınız.
Device = 18F25K22
Config_Start
FOSC = INTIO67 ;interne oscillator A6, A7 poortfuntie
FCMEN = OFF ;Fail-Safe Clock Monitor disabled
IESO = OFF ;internal external switchover mode
PWRTEN = On ;power-up timer (18F25K22)
BOREN = On ;brown-out reset
BORV = 285 ;brown-out reset value (2,85V) (18F25K22)
WDTEN = OFF ;watchdog timer
WDTPS = 128 ;1:128 WDT prescalar
PBADEN = OFF ;analog port B<4:0>
STVREN = On ;;stack overflow reset
LVP = OFF ;low voltage programming
XINST = OFF ;Instruction set extension and Indexed Addressing mode disabled (Legacy mode)
Debug = OFF ;no debug
Cp0 = On ;Block 0 (000800-001FFFh) code-protected
CP1 = On ;Block 1 (002000-003FFFh) not code-protected
CP2 = On ;Block 2 (004000-005FFFh) code-protected
CP3 = On ;Block 3 (006000-007FFFh) not code-protected
CPB = On ;Boot block (000000-0007FFh) not code-protected
CPD = On ;Data EEPROM not code-protected
WRT0 = On ;Block 0 (000800-001FFFh) not write-protected
WRT1 = On ;Block 1 (002000-003FFFh) not write-protected
WRT2 = On ;Block 2 (004000-005FFFh) not write-protected
WRT3 = On ;Block 3 (006000-007FFFh) not write-protected
WRTC = OFF ;Configuration registers (300000-3000FFh) not write-protected
WRTB = OFF ;Boot Block (000000-0007FFh) not write-protected
WRTD = OFF ;Data EEPROM not write-protected
EBTR0 = On ;Block 0 (000800-001FFFh) not protected from table reads executed in other blocks
EBTR1 = On ;Block 1 (002000-003FFFh) not protected from table reads executed in other blocks
EBTR2 = OFF ;Block 2 (004000-005FFFh) not protected from table reads executed in other blocks
EBTR3 = OFF ;Block 3 (006000-007FFFh) not protected from table reads executed in other blocks
EBTRB = OFF ;Boot Block (000000-0007FFh) not protected from table reads executed in other blocks
Config_End
Declare Xtal = 8
;OSCCON = %01010000 ' 4MHz
OSCCON =%01100010 '// 8 MHz - 18F25K22