PDA

View Full Version : Help With OLED Display / 128X64 SSD1306



Denner
- 23rd May 2013, 12:07
Hello,

Buy this Oled screen of 0.96 ", but so far it works.
I work connecting to the I2C Bus, the Micro is a 18F4550 to 20MHz.

Oled Display Image and Data Sheet: http://www.ebay.co.uk/itm/0-96-128x64-OLED-Display-Module-SSD1306-Arudino-AVR-/130536921656

Pins Board:
3V3 D0 (SCLK)
RS D1 (SDIN)
(http://www.ebay.co.uk/itm/0-96-128x64-OLED-Display-Module-SSD1306-Arudino-AVR-/130536921656) CS D2
WR D3
RD D4
RES D5
VIN D6
GND D7

Connection ProtoBoard:
D1 (SDIN) => B0 (SDA)
D0 (SCLK) => B1 (SCL)
3V3 => 3V3 (VCC)
VIN unknow 3V3 (VCC)
GND => GND
VBAT => +
BS0 => 0
BS1 => 1
BS2 => 0
*The other pins are not connected (RS,CS,WR,RD,RES, D02 to D7).


I have to connect more things!!, Hope for help me with this project!.

THX.

Denner
- 24th May 2013, 11:15
At the moment the code doesn´t work. HELP!!

THX.

'''''''''''''''''''''''''''''''''''''''''''''''''' '''''''''''''''''''''''''''''''''''''''''''''''''' ''''''''''''''''''''''''''''''
' CODE
'''''''''''''''''''''''''''''''''''''''''''''''''' '''''''''''''''''''''''''''''''''''''''''''''''''' '''''''''''''''''''''''''''''

Device = 18F4550 'Work PIC
Declare Xtal 20 'Set 20Mhz

All_Digital true 'Set All Digital Port

'Pins, I2C BUS ----------------------------------------------
Declare I2C_Slow_Bus On 'SLow el bus I2C
Declare SDA_Pin PORTB.0 'I2C (SDA)
Declare SCL_Pin PORTB.1 'I2C (SCL)
Declare Hbus_Bitrate 100 'I2C Bitrate 100Hz

'------------------------------------------------------------
' Program
'-------------------------------------------------------------
DelayMS 200 ' Wait for the PIC® micro to stabilise

'Initialitation of display Commands (data Sheet)
HBStart 'Send a Start condition to the I2C bus
HBusOut 0x3C 'Control, (Slave address)
HBusOut 0 'LowByte R/W#=0
HBusOut 0xAE 'Display off
HBusOut 0xD5 'Set Osc Frequency
HBusOut 0x80
HBusOut 0xA8 'Set Mux Ratio
HBusOut 0x3F
HBusOut 0xD3 'Set Display Offset
HBusOut 0x00
HBusOut 0x8D 'Set charge Pump regulator
HBusOut 0x14 'Or 0x10
HBusOut 0xA1 'Set Segment re-map or 0xA0
HBusOut 0xC8 'Set COM Output Scan Direction or 0xC0
HBusOut 0xDA 'Set COM pins Hardware Configuration
HBusOut 0x12 'or 0x02
HBusOut 0x81 'Set Contrast Control
HBusOut 0x81 'or 0x22, 0xCF
HBusOut 0xD9 'Set Pre-Charge Period
HBusOut 0xF1 'or 0xF22
HBusOut 0xDB 'Set VCOMH Deselect Level (Display Start Line)
HBusOut 0x40 'Display Start At 0
HBusOut 0xA5 'Set Disable Entire Display On or 0xA4h
HBusOut 0xA6 'Set Normal/ A7h Inverse Display
HBusOut 0xAF 'Set Display ON
HBStop 'Send a Stop condition to the I2C bus


Ini:
DelayMS 1000
'HBusOut 0x3C 'Control, (Slave address)
'HBusOut 0 'LowByte R/W#=0
HBReStart 'Send a Restart condition
HBusOut $A7 'All Pixels ON
DelayMS 1000
HBusOut $A6 'All Pixels OFF
DelayMS 1000
HBusOut 0xAE 'Display OFF
HBStop
GoTo Ini

End
Edit Post
Reply
Reply With Quote



+ Reply to Thread
« Previous Thread | Next Thread »
Thread Information

Dave
- 24th May 2013, 11:45
AS far as I can see, This isn't PICBASIC code.

Demon
- 24th May 2013, 13:27
Whatever you are doing, I hope you didn't include the forum commands at the bottom of your code.

Robert

Denner
- 24th May 2013, 22:20
Hey Dave,
Yes, I'm Sorry is Proton Compiler. But seem more or less.

Denner
- 24th May 2013, 22:27
Hello Demon,
Could you be more explicit, I would appreciate.
Can you tell me missing or there are extra code, which I do wrong.

Thx.

Demon
- 25th May 2013, 15:40
Hello Demon,
Could you be more explicit, I would appreciate.
Can you tell me missing or there are extra code, which I do wrong.

Thx.

I was talking about this stuff:

Edit Post
Reply
Reply With Quote



+ Reply to Thread
« Previous Thread | Next Thread »
Thread Information

Robert