2x16 ve 4x16 LCD Sorunu

Başlatan एक होना, 11 Haziran 2015, 23:44:49

एक होना

web de bulduğum devre ve kodlarını denemek için kendi pc im de deneme yaptım.
devre ve kodlar 2x16 lcd ekrana göre ben bunu 4x16 olarak düzenledim. sadece lcd ayar bölümünde yaptım.

sonuç olarak 4x16 lcd ekranda 3 ve 4 satırda yazılarda kayma oluyor bunu nasıl düzeltiriz ?



'****************************************************************
'*  Name    : UNTITLED.BAS                                      *
'*  Author  : [select VIEW...EDITOR OPTIONS]                    *
'*  Notice  : Copyright (c) 2015 [select VIEW...EDITOR OPTIONS] *
'*          : All Rights Reserved                               *
'*  Date    : 01/06/2015                                        *
'*  Version : 1.0                                               *
'*  Notes   :                                                   *
'*          :                                                   *
'****************************************************************
;-------------------------------------------------------------------------------
;**** Added by Fuse Configurator ****
; Use the Fuse Configurator plug-in to change these settings

Device = 18F2550

Config_Start
  PLLDIV = 12	;Divide by 12 (48 MHz oscillator input)
  CPUDIV = OSC1_PLL2	;[Primary Oscillator Src: /1][96 MHz PLL Src: /2]
  USBDIV = 1	;USB clock source comes directly from the primary oscillator block with no postscale
  FOSC = EC_EC	;EC oscillator, CLKO function on RA6 (EC)
  FCMEN = OFF	;Fail-Safe Clock Monitor disabled
  IESO = OFF	;Oscillator Switchover mode disabled
  PWRT = OFF	;PWRT disabled
  BOR = On	;Brown-out Reset enabled in hardware only (SBOREN is disabled)
  BORV = 3	;Minimum setting
  VREGEN = OFF	;USB voltage regulator disabled
  WDT = On	;WDT enabled
  WDTPS = 32768	;1:32768
  CCP2MX = On	;CCP2 input/output is multiplexed with RC1
  PBADEN = OFF	;PORTB<4:0> pins are configured as digital I/O on Reset
  LPT1OSC = OFF	;Timer1 configured for higher power operation
  MCLRE = On	;MCLR pin enabled; RE3 input pin disabled
  STVREN = On	;Stack full/underflow will cause Reset
  LVP = On	;Single-Supply ICSP enabled
  XINST = OFF	;Instruction set extension and Indexed Addressing mode disabled (Legacy mode)
  Debug = OFF	;Background debugger disabled, RB6 and RB7 configured as general purpose I/O pins
  CP0 = OFF	;Block 0 (000800-001FFFh) is not code-protected
  CP1 = OFF	;Block 1 (002000-003FFFh) is not code-protected
  CP2 = OFF	;Block 2 (004000-005FFFh) is not code-protected
  CP3 = OFF	;Block 3 (006000-007FFFh) is not code-protected
  CPB = OFF	;Boot block (000000-0007FFh) is not code-protected
  CPD = OFF	;Data EEPROM is not code-protected
  WRT0 = OFF	;Block 0 (000800-001FFFh) is not write-protected
  WRT1 = OFF	;Block 1 (002000-003FFFh) is not write-protected
  WRT2 = OFF	;Block 2 (004000-005FFFh) is not write-protected
  WRT3 = OFF	;Block 3 (006000-007FFFh) is not write-protected
  WRTC = OFF	;Configuration registers (300000-3000FFh) are not write-protected
  WRTB = OFF	;Boot block (000000-0007FFh) is not write-protected
  WRTD = OFF	;Data EEPROM is not write-protected
  EBTR0 = OFF	;Block 0 (000800-001FFFh) is not protected from table reads executed in other blocks
  EBTR1 = OFF	;Block 1 (002000-003FFFh) is not protected from table reads executed in other blocks
  EBTR2 = OFF	;Block 2 (004000-005FFFh) is not protected from table reads executed in other blocks
  EBTR3 = OFF	;Block 3 (006000-007FFFh) is not protected from table reads executed in other blocks
  EBTRB = OFF	;Boot block (000000-0007FFh) is not protected from table reads executed in other blocks
Config_End

;**** End of Fuse Configurator Settings ****
;-------------------------------------------------------------------------------


Xtal 48

Declare LCD_Type 0
Declare LCD_DTPin PORTB.4
Declare LCD_RSPin PORTB.2
Declare LCD_ENPin PORTB.3
Declare LCD_Interface 4
Declare LCD_Lines 2

Declare Adin_Res 10
Declare Adin_Tad FRC
Declare Adin_Stime 50

TRISA=15
TRISB=0

ADCON1=%1011
ADCON2=%10000000

Dim AN0 As ADRESL.Word
Dim AN1 As ADRESL.Word
Dim AN2 As ADRESL.Word
Dim AN3 As ADRESL.Word
Dim Sensor1 As Float
Dim Sensor2 As Float
Dim Sensor3 As Float
Dim Sensor4 As Float

DelayMS 300
Cls

Print At 1,1, "Merhaba Dunya"
DelayMS 500
Cls

Basla:

AN0=ADIn 0
Sensor1= (484*AN0)/1000
Print At 1,1,"Channel 1= ",Dec1 Sensor1


AN1=ADIn 1
Sensor2= (488*AN0)/1000
Print At 2,1,"Channel 2= ",Dec1 Sensor2
DelayMS 500

AN2=ADIn 2
Sensor3= (488*AN0)/1000
Print At 1,1,"Channel 3= ",Dec1 Sensor3


AN3=ADIn 3
Sensor4= (488*AN0)/1000
Print At 2,1,"Channel 4= ",Dec1 Sensor4
DelayMS 500

GoTo Basla
End


baran123

En iyisi lcd deki sürücüye uygun kütüphane kullanmak.

एक होना

similasyon da 2x16 lcd için kütüphane kullanmıyoruz neden 4x16 için kütüphane kullanıyoruz ?

z

Kütüphanede satırlara veri yazan kısmı bul.

Satır hesabı yapılan yerde ilk satır için bir şey ilave edilmezken diğer satırlara ofset verilen noktayı tespit et. Ofset değerlerini deneme yanılmayla bul.

0x80 yada 0xC0 ilave ediyordum diye aklımda kalmış.
Bana e^st de diyebilirsiniz.   www.cncdesigner.com

एक होना

Declare olarak LCD tanımlandığında lcd kütüphanesini mi çağırmış oluyoruz yoksa sadece tanımlama için  mi ?

yoksa lcd için kütüphane mi çağırmam gerekiyor ?

OG

FORUMU İLGİLENDİREN KONULARA ÖM İLE CEVAP VERİLMEZ.


OG

Verdiğin dosya 2x16 ve kod da

Declare LCD_Lines 2
2x16 ya göre ve simulasyon normal çalışıyor.

FORUMU İLGİLENDİREN KONULARA ÖM İLE CEVAP VERİLMEZ.

एक होना

hocam en son halini kaydetmemiştim.
4x16 lcd ye göre hazırlayıp göndereyim.

2x16 da sorun yok gayet sağlıklı çalışıyor.

tek sorun 4x16 lcd ekran seçtiğimde başlıyor.
Declare LCD_Lines 4 seçiyorum

1 ve 2 ci satır gayet normal 3 ve 4 satır ortadan başlıyor.

hocam 4x16 ekrana göre ayarladım bir de kodları ona göre düzenledim.

http://s3.dosya.tc/server3/q1j3yk/LM35_4xLCD.rar.html


FUNKY

lcd nin data sheet inde açıklama olması lazım
böyle yazılacak..

AN2=ADIn 2
Sensor3= (488*AN0)/1000
Print At 1,17,"Channel 3= ",Dec1 Sensor3


AN3=ADIn 3
Sensor4= (488*AN0)/1000
Print At 2,17,"Channel 4= ",Dec1 Sensor4

OG

FORUMU İLGİLENDİREN KONULARA ÖM İLE CEVAP VERİLMEZ.

एक होना


ergunbt

Hocamzın ellerine sağlık..1 veya 2 ekleme yaptım... bende düzgün çalıştı...

Print At 1,1, "Merhaba Dunya"
DelayMS 500
Print $FE,$40,$06,$09,$09,$06,$00,$00,$00,$00
Cls

Basla:

AN0=ADIn 0
Sensor1= (484*AN0)/1000
Print At 1,1,"Channel1=", Dec Sensor1,0          

AN1=ADIn 1
Sensor2= (488*AN0)/1000
Print At 2,1,"Channel2=", Dec Sensor2,0   

AN2=ADIn 2
Sensor3= (488*AN0)/1000
Print At 1,17,"Channel3=", Dec Sensor3,0

AN3=ADIn 3
Sensor4= (488*AN0)/1000
Print At 2,17,"Channel4=", Dec Sensor4,0 


DelayMS 500


GoTo Basla
End