SSD1306 128X64 OLED EKRAN PIC877 UYGULAMASI

Başlatan Dtmf, 08 Nisan 2020, 21:38:44

Dtmf

s.a arkadaslar basıt ama guzel bır calısma oldu ssd1306 oled 128x64ekrana resım basmayı basardım sızlerle paylasmak ıstedım gelıstırmek ısteyen arkadaslara kolay gelsın :)

Device=16F877A
XTAL=20
ALL_DIGITAL TRUE
Include "Modedefs.bas"
TRISA = 0:PORTA=0
TRISC=0:PORTC=%11000000
PORTD = 0:PORTD=0
PORTE = 0:PORTE=0
Symbol SDA=PORTC.7
Symbol SCL=PORTC.6
Dim I2CDevice As Byte 
Dim DCM As Byte'"VERİ VEYA KOMUT", $ 40 = VERİ; $ 0 = COMMAND 
Dim LCD_DATA As Byte 
Dim COM As Byte 'COMMAND 
Dim A As Word
Clear
I2CDevice =$78
DelayMS 500 
DCM=0 
;===========EKRAN AYAR KOMUTLAR========
I2COUT SDA, SCL, I2CDevice, [DCM, $AE] 'Kapalı görüntü 
DelayMS 10 
I2COUT  SDA, SCL, I2CDevice, [DCM,$D3,$00] 
DelayMS 10 
I2COUT SDA, SCL, I2CDevice, [DCM, $40]' Ekran başlangıç ??çizgisini ayarla 0 
DelayMS 10 
I2COUT  SDA, SCL, I2CDevice, [DCM,$8D,$14] 'Set Şarj Pompası Dahili, genellikle gerekli 
DelayMS 10 
I2COUT SDA, SCL, I2CDevice, [DCM,$20,$10] 'Sayfa adresleme modu 
DelayMS 10 
I2COUT  SDA, SCL, I2CDevice, [DCM,$A1]' 
DelayMS 10  
I2COUT  SDA, SCL, I2CDevice, [DCM,$C8] 'yi başlatır. ' 
DelayMS 10 
I2COUT SDA, SCL, I2CDevice, [DCM,$DA,$12]' set COM pin = 128x64 = 12 $ 128x32 = $ 02 ' I2CWrite SDA, SCL, I2CDevice, [DC, $ 81, $ 01]' Set contra st düşüğe 
DelayMS 10 
I2COUT  SDA, SCL, I2CDevice, [DCM,$A4] 'devam ekran 
DelayMS 10 
I2COUT  SDA, SCL, I2CDevice, [DCM,$A6]' $ A6 = NORMAL MOD; $ A7 = TERS MOD 
DelayMS 10 
I2COUT SDA, SCL, I2CDevice, [DCM,$AF] 'Display On 
DelayMS 50 
GoSub LCDSIL
DelayMS 50 
;=============================================================================
BASLA: 
DCM= $40 
I2COUT SDA, SCL,I2CDevice, [DCM,000,000,000,000,000,000,000,000,000,000,000,000,128,240,240,248,_
254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,_
254,254,254,254,254,254,254,248,248,248,248,128,000,000,000,000,_
000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,_
000,000,000,000,000,000,000,000,000,000,000,000,000,128,128,128,_
248,248,248,248,254,254,254,254,254,255,255,255,255,255,255,255,_
255,255,255,255,255,255,254,254,254,254,254,254,254,254,254,254,_
254,240,128,128,000,000,000,000,000,000,000,000,000,000,000,000,_
000,000,000,000,000,000,000,254,254,255,255,255,255,255,255,255,_
255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,_
255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,240,_
240,240,240,240,240,240,240,240,240,240,240,240,240,240,240,240,_
240,240,240,240,240,240,240,240,240,240,240,240,240,255,255,255,_
255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,_
255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,_
255,255,255,255,255,000,000,000,000,000,000,000,000,000,000,000,_
000,000,000,000,000,000,000,003,003,031,031,031,031,255,255,255,_
255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,_
255,255,255,255,255,255,255,255,063,063,063,031,015,015,003,017,_
017,016,016,016,028,000,000,000,003,003,003,031,031,031,031,031,_
031,003,003,001,001,001,000,000,000,000,028,028,028,001,001,001,_
031,031,031,031,063,063,255,255,255,255,255,255,255,255,255,255,_
255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,_
255,031,015,015,001,000,000,000,000,000,000,000,000,000,000,000,_
000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,_
000,000,000,001,001,001,001,001,001,001,001,001,001,001,255,255,_
255,255,255,255,255,255,255,001,000,000,000,000,000,000,000,000,_
000,224,224,224,030,001,001,001,002,002,002,000,000,000,000,000,_
000,224,224,002,001,001,001,001,001,001,030,030,030,000,000,000,_
000,000,000,000,000,000,255,255,255,255,255,255,255,255,255,000,_
000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,_
000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,_
000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,_
000,000,000,000,000,000,000,000,000,000,000,000,000,000,255,255,_
255,255,255,255,255,255,255,254,252,252,252,224,192,192,000,000,_
000,015,015,015,016,254,254,254,255,255,255,227,227,227,227,227,_
224,227,227,255,255,255,255,255,255,255,204,204,204,000,000,000,_
032,032,032,032,048,048,063,063,063,063,063,063,255,255,255,000,_
000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,_
000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,_
000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,_
000,000,000,000,000,000,000,000,000,000,000,000,000,000,063,063,_
063,063,255,255,193,221,221,014,030,030,030,016,032,032,032,192,_
192,192,192,192,193,206,206,206,031,031,031,030,030,030,030,030,_
031,030,030,031,031,031,223,223,223,223,192,192,192,032,032,032,_
000,000,000,000,029,029,014,206,206,206,206,206,224,241,241,012,_
000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,_
000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,_
000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,_
000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,_
000,000,001,001,003,031,031,028,028,028,028,032,032,032,032,097,_
097,067,067,067,095,255,255,255,094,094,094,126,126,126,126,126,_
062,062,062,094,254,254,255,255,255,255,255,255,255,096,096,096,_
060,060,060,060,032,032,030,031,031,031,031,031,001,001,001,000,_
000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,_
000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,_
000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,_
000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,_
000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,_
000,000,000,000,000,001,001,001,006,006,006,006,006,006,006,006,_
006,006,006,006,007,007,003,003,003,003,001,001,001,000,000,000,_
000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,_
000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,_
000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000]
DelayMS 10 
End
;===============================LCDSIL===============
LCDSIL:
DCM=$40 
For A=0 To 511
I2COUT SDA, SCL,I2CDevice, [DCM,0,0] 
DelayUS 2
Next
DelayMS 100
Return

Powered by EzPortal