Haberler:

Forum kuralları güncellendi LÜTFEN  okuyunuz:  https://bit.ly/2IjR3ME

Ana Menü

pic18f2550 ve glcd

Başlatan eozkantar, 02 Kasım 2011, 11:38:14

eozkantar

arkadaşlar 18f2550 ile glcd kullanmak istedim ,simulasyonda gayet güzel çalışıyor fakat devre  hiç bir şey yazmadı osilaskopta da sinyal göremiyorum acaba 20 mhz kristal kullanıyorum configlerde mi hata var acaba  configler aşağıda,  yardımlarınızı bekliyorum.tşk....

Device=18F2550
  XTAL=20

CONFIG_START
        FOSC = XT_XT    '     XT oscillator, XT used by USBFCMEN = OFF   
        PLLDIV = 1
        CPUDIV = OSC1_PLL2
        USBDIV = 2
        IESO = OFF
        PWRT = On
        BOR = OFF
        BORV = 0
        VREGEN = On   
        WDT = OFF
        WDTPS = 1
        MCLRE = off
        LPT1OSC = OFF
        PBADEN = On   
        CCP2MX = OFF
        STVREN = OFF
        LVP = On
        XINST = OFF   
        Debug = OFF
        CP0 = OFF
        CP1 = OFF
        CP2 = OFF
        CP3 = OFF
        CPB = OFF
        CPD = OFF
        WRT0 = OFF
        WRT1 = OFF
        WRT2 = OFF
        WRT3 = OFF
        WRTB = OFF
        WRTC = OFF
        WRTD = OFF
        EBTR0 = OFF
        EBTR1 = OFF
        EBTR2 = OFF
        EBTR3 = OFF
        EBTRB = OFF
CONFIG_END

Maxim

20mhz ise fosc=HS olması gerekir

eozkantar

fosc=HS 
yaptım değişen bişey olmadı

piskopatisa

MCLR ucuna +5V vermemiş olabilirmisin :)

Maxim


eozkantar

bu şekilde düzeltince çalıştı herkese tşk...


CONFIG_START
        FOSC = HSPLL_HS    ; HS Oscillator
        FCMEN   = On      ; Failsafe Clock Monitor Disabled
        IESO   = On      ; Int/Ext Oscillator Switch Over Disabled
        PLLDIV = 5          ' Divide by 5 (20MHz input)
        USBDIV = 2          ' Clock source from 96MHz PLL/2
        CPUDIV = OSC1_PLL2 '  [OSC1/OSC2 Src: /1][96MHz PLL Src: /2]
        PWRT   = On      ; Power Up Timer Enabled
        BOR = OFF             ; Brownout Reset Disabled
        WDT      = OFF      ; Watchdog Timer Disabled
        WDTPS   = 1         ; Watchdog Postscaler: 1:1
        MCLRE   = On      ; MCLR Enabled
        LPT1OSC   = On      ; T1 Oscillator Disabled
        PBADEN   = OFF      ; Port B A/D Enable Port B<4:0> digital on RESET
        CCP2MX = OFF             ; CCP2 Mux Muxed with RC1
        STVREN   = On      ; Stack Overflow Reset Enabled
        LVP      = OFF      ; Low Voltage ICSP Disabled
        XINST   = OFF      ; XINST Disabled
        Debug   = OFF      ; Background Debugger Disabled
        CP0      = OFF       ; Code Protection Block 0 Disabled
        CP1      = OFF       ; Code Protection Block 1 Disabled
        CP2      = OFF       ; Code Protection Block 2 Disabled
        CP3      = OFF       ; Code Protection Block 3 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
        WRT2   = OFF       ; Write Protection Block 2 Disabled
        WRT3   = OFF       ; Write Protection Block 3 Disabled
        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
        EBTR2   = OFF       ; Table Read Protection Block 2 Disabled
        EBTR3   = OFF       ; Table Read Protection Block 3 Disabled
        EBTRB   = OFF       ; Boot Block Table Read Protection Disabled
CONFIG_END

Lütfi AYYILDIZ

Config ayarlarını register içine datasheetten bakarak direk yazsaydık
CONFIG1L=%00100100 gibi bu şekildede yazılabilirmiydi?

Datasheetteki config1 registeri;
CONFIG1L: CONFIGURATION REGISTER 1 LOW (BYTE ADDRESS 300000h)       

7  6      5               4             3              2             1            0
— — USBDIV  CPUDIV1  CPUDIV0  PLLDIV2  PLLDIV1  PLLDIV0
bit 7 bit 0
bit 7-6 Unimplemented: Read as '0'

bit 5 USBDIV: USB Clock Selection bit (used in Full Speed USB mode only; UCFG:FSEN = 1)
1 = USB clock source comes from the 96 MHz PLL divided by 2
0 = USB clock source comes directly from the primary oscillator block with no postscale
bit 4-3 CPUDIV1:CPUDIV0: System Clock Postscaler Selection bits
For XT, HS, EC and ECIO Oscillator modes:
11 = Primary oscillator divided by 4 to derive system clock
10 = Primary oscillator divided by 3 to derive system clock
01 = Primary oscillator divided by 2 to derive system clock
00 = Primary oscillator used directly for system clock (no postscaler)
For XTPLL, HSPLL, ECPLL and ECPIO Oscillator modes:
11 = 96 MHz PLL divided by 6 to derive system clock
10 = 96 MHz PLL divided by 4 to derive system clock
01 = 96 MHz PLL divided by 3 to derive system clock
00 = 96 MHz PLL divided by 2 to derive system clock
bit 2-0 PLLDIV2:PLLDIV0: PLL Prescaler Selection bits
111 = Divide by 12 (48 MHz oscillator input)
110 = Divide by 10 (40 MHz oscillator input)
101 = Divide by 6 (24 MHz oscillator input)
100 = Divide by 5 (20 MHz oscillator input)
011 = Divide by 4 (16 MHz oscillator input)
010 = Divide by 3 (12 MHz oscillator input)
001 = Divide by 2 (8 MHz oscillator input)
000 = No prescale (4 MHz oscillator input drives PLL directly)

-Hasan-

__CONFIG _CONFIG1H, 0X02


ASM ' de bu şekilde yazılıyor. Proton ' da ASM ENDASM arasına yazılırsa olur belki.