Hello guys, I tried to drive a 0.96" 128x64 I2C oled screen whole week and I'm about to go crazy because of this... I'm able to run the screen with arduino but I want to do it with a 877f (well I'm stubborn...)
My oled screen using ssd1306 driver and I read it's datasheet, I examined all lines of arduino codes and PICC codes (I didn't try PICC codes just viewed) But I wasn't able to run the screen :\ I can't see if I'm missing something or there is something I don't know about. Is there anyone who used these oled screens with PIC ? Or any hint what might I'd be missing.

I worked on CircuitDomain's codes and tried many changes on it but none work in the end... I started with this topic : http://www.picbasic.co.uk/forum/showthread.php?t=17973

N
ow I'm just trying to see a working pixel on screen, and these are my codes;
Code:
'==========================MCU SETUP============================================  
Include "modedefs.bas"
DEFINE OSC 16
DEFINE I2C_SLOW 1 'to use 100kHz device over 4MHz oscillator
DEFINE I2C_HOLD 1


OPTION_REG=0
ADCON0=0
ADCON1=7
TRISA=%00111111
TRISB=%00000001
TRISC=0






'================================usuart========================================


'==============================BAUD SETUP=======================================


I2CDevice var byte
SCL var PortC.3         ' I2C Clock  PortC.3
SDA var PortC.4         ' I2C Data   PortC.4
DC VAR byte' "DATA OR COMMAND", $40=DATA; $80=COMMAND 
LCD_DATA VAR BYTE
COM VAR BYTE'COMMAND




I VAR BYTE
J VAR BYTE
X VAR BYTE' LCD POSITION X(0 TO 127)
Y VAR BYTE'LCD POSITION Y(0 TO 7)
CLEAR
'=============================================================================
'PAGE = $B0


I2CDevice = $78      'Display Address = $78,


PAUSE 20


GOSUB INIT




MAIN:


gosub FILL
pause 1000
gosub CLEAR_LCD
pause 1000


GOTO MAIN




'=========================lcd initialization====================================
INIT:


COM=$AE:GOSUB SEND_COMMAND' DISPLAY OFF
pause 10
COM=$20:GOSUB SEND_COMMAND' ADRESSING MODE
COM=$02:GOSUB SEND_COMMAND' Page adressing mode
COM=$81:GOSUB SEND_COMMAND' Send contrast
COM=$FF:GOSUB SEND_COMMAND'
COM=$A4:GOSUB SEND_COMMAND' display on continue 
COM=$A6:GOSUB SEND_COMMAND' $A6=NORMAL MODE;$A7=INVERSE MODE
COM=$AF:GOSUB SEND_COMMAND' DISPLAY ON
pause 10
 gosub CLEAR_LCD
 return
'===============================================================================
'==============================clear lcd========================================
CLEAR_LCD:




   FOR J=0 TO 7 
    FOR I=0 TO 127
        LCD_DATA=$00:GOSUB SEND_DATA  
    NEXT I
   NEXT J                             


RETURN 


'****************SEND COMMAND************************************************


SEND_COMMAND:
dc=$80


I2CWrite SDA,SCL,I2CDevice,DC,[COM]


RETURN 
'*****************************************************************************


'======================Send data===============================================
SEND_DATA:
DC=$40


I2CWrite SDA,SCL,I2CDevice,DC,[LCD_DATA]


RETURN
'===============================================================================
'=============================FILL=============================================
FILL:
FOR J=0 TO 7
FOR I=0 TO 127
LCD_DATA=$FF:GOSUB SEND_DATA
NEXT I
NEXT J
RETURN
'===============================================================================


'===========================================SET X AND Y=========================
SET_XY:
COM=$21:GOSUB SEND_COMMAND
COM=X:GOSUB SEND_COMMAND
COM=127:GOSUB SEND_COMMAND
COM=$22:GOSUB SEND_COMMAND
COM=Y:GOSUB SEND_COMMAND
COM=Y:GOSUB SEND_COMMAND
RETURN
'===============================================================================
END