Forum - MCS Electronics

 

FAQFAQ SearchSearch RegisterRegister Log inLog in

SSD1306 Oled I2c 0.96 inch
Goto page Previous  1, 2, 3, 4  Next
 
Post new topic   Reply to topic    www.mcselec.com Forum Index -> BASCOM-ARDUINO
View previous topic :: View next topic  
Author Message
albertsm

Administrator



Joined: 09 Apr 2004
Posts: 4736
Location: Holland

blank.gif
PostPosted: Thu Dec 18, 2014 5:14 pm    Post subject: Reply with quote

Thanks for the converter. And also for the new demos Smile
While bascom does not mind the , at the end, a future version will complain for sure.

_________________
Mark
Back to top
View user's profile Visit poster's website
i.dobson

Bascom Expert



Joined: 05 Jan 2006
Posts: 1520
Location: Basel, Switzerland

switzerland.gif
PostPosted: Fri Dec 19, 2014 8:24 am    Post subject: Reply with quote

Hi Mark,

The converter is just a quick and dirty hack to let me Setup a demo (The program took less than 1 hour to write and test). There are other bugs in the code (Handling of Colours, too large graphics etc) but it's enough for me.

Maybe I'll fix the bugs when I get some time, but as long as you feed it with small 128x64 black&white BMP's it works, if and when the Bascom Compiler complains about a trailing "," in a data Statement the user will just have to delete it.

Regards
Ian Dobson

_________________
Home of AVRTimer, the Bascom timer value calculator.
http://www.planet-ian.com

Walking on water and writing software to specification is easy if they're frozen.
Back to top
View user's profile Visit poster's website
aphawk

Bascom Member



Joined: 23 Jan 2010
Posts: 152
Location: Brazil

brazil.gif
PostPosted: Wed Dec 31, 2014 8:42 pm    Post subject: Reply with quote

Hi,

I'm trying to use this display to create one battery discharge graphics, and need some kind of function to set / reset one unique point in the 128x64 screen.

I see in datasheet that I can only write 8 pixels at a time, then I must make some type of "Ram Buffer" using 1K Sram ( i use Arduino Uno ) , and then send all data when updating, like the program to make screen dump showed here.

This can be very useful because we can make graphics in real time, setting only the correct points at X-Y screen.

Someone know how this can be done using one function like SET (x,y ) and RESET ( x,y ) ?

Thanks a lot !

Paulo
Back to top
View user's profile
bzijlstra

Bascom Ambassador



Joined: 30 Dec 2004
Posts: 1179
Location: Tilburg - Netherlands

netherlands.gif
PostPosted: Wed Dec 31, 2014 9:38 pm    Post subject: shadow ram etc... Reply with quote

http://guy.carpenter.id.au/gaugette/2012/11/11/font-support-for-ssd1306/

Have a look at this link...

Have fun
Ben Zijlstra
Back to top
View user's profile Visit poster's website
albertsm

Administrator



Joined: 09 Apr 2004
Posts: 4736
Location: Holland

blank.gif
PostPosted: Fri Jan 30, 2015 3:00 pm    Post subject: Reply with quote

I got my LCD and Ben's code worked just fine Smile
So i decided to make a driver. There is one thing i do not understand from the data sheet.
I am using the I2C mode and refer to 8.1.5.1 page 20.
The protocol uses the slave address followed by a control byte. This control byte has Co bit 7 for continuation. And DC bit for data/control indication.
From the data sheet :

Quote:
After the transmission of the slave address, either the control byte or the data byte may be sent across
the SDA. A control byte mainly consists of Co and D/C# bits following by six “0” ‘s.
a. If the Co bit is set as logic “0”, the transmission of the following information will contain
data bytes only.
b. The D/C# bit determines the next data byte is acted as a command or a data. If the D/C# bit is
set to logic “0”, it defines the following data byte as a command. If the D/C# bit is set to
logic “1”, it defines the following data byte as a data which will be stored at the GDDRAM.
The GDDRAM column address pointer will be increased by one automatically after each
data write.


So i read that after the slave address either a control or data byte can be sent.
And in case of a control byte it has six '0's. After this control byte either data or control can follow.
But when i look at the command to set the display oN, it is &HAF. DC is low which is right for a command. But that is it. I would expect that first something like &B10_00_0000 would be needed and that then the &HAF should be sent.

But this one byte seems to be enough. And no need for these 6 0 bits?
The data sheet says : a. If the Co bit is set as logic “0”, the transmission of the following information will contain data bytes only.
It does not say what the state of "1" means. Probably that it is not data but command? But what is this following information? Maybe they mean the bits that follow and not the bytes that follow after the current transmission?

Ok, so i thought the Co is part of the command and this bit 7. But there are also commands with a bit7 set to 0.
What i am missing here? Now based on the sample code i could come a long way, but i like to understand things.

_________________
Mark
Back to top
View user's profile Visit poster's website
albertsm

Administrator



Joined: 09 Apr 2004
Posts: 4736
Location: Holland

blank.gif
PostPosted: Fri Jan 30, 2015 4:31 pm    Post subject: Reply with quote

ok, driver seems to work Very Happy
All usual commands supported. A pity that did not implement i2c read. My test chip does not have enough ram to create 1KB shadow ram otherwise i would have added that as well.
A neat little lcd.

_________________
Mark
Back to top
View user's profile Visit poster's website
AndersL

Bascom Member



Joined: 25 Jan 2010
Posts: 89
Location: Kragerψ,Norway

norway.gif
PostPosted: Sat Feb 07, 2015 6:10 pm    Post subject: Reply with quote

Just a note about these displays:
I tested a SPI version connected to a Nano V3 (with code from Hkipnik; thanks a lot Smile), and today I received a I2C version to test.
I disconnected VCC and GND from the SPI display and connected them to the new I2C display.
The funny thing was that the SPI display was still working without VCC and GND!
Obviously it collects its power from the data lines.

_________________
Anders
Back to top
View user's profile
hobby

Bascom Member



Joined: 12 Apr 2004
Posts: 104
Location: Brussels

belgium.gif
PostPosted: Sat Jun 13, 2015 12:10 pm    Post subject: Reply with quote

Hello Mark,

I can not find the driver in the shop.
You can buy it?

thank you
Olivier
Back to top
View user's profile
albertsm

Administrator



Joined: 09 Apr 2004
Posts: 4736
Location: Holland

blank.gif
PostPosted: Sat Jun 13, 2015 3:08 pm    Post subject: Reply with quote

it is free in the next update. send an email to support and you can test the beta driver.
_________________
Mark
Back to top
View user's profile Visit poster's website
albertsm

Administrator



Joined: 09 Apr 2004
Posts: 4736
Location: Holland

blank.gif
PostPosted: Fri Aug 28, 2015 3:41 pm    Post subject: Reply with quote

based on your the code a driver was created and added in 2078/2079:

Code:
'-------------------------------------------------------------------------------
'                       SSD1306-I2C.BAS
'                     (c) MCS Electronics 1995-2015
'          Sample to demo the 128x64 I2C OLED display
'
'-------------------------------------------------------------------------------
$regfile = "m88pdef.dat"
$hwstack = 32
$swstack = 32
$framesize = 32
$crystal = 8000000
Config Clockdiv = 1                                         ' make sure the chip runs at 8 MHz

Config Scl = Portc.5                                        ' used i2c pins
Config Sda = Portc.4
Config Twi = 400000                                         ' i2c speed

I2cinit

$lib "i2c_twi.lbx"                                          ' we do not use software emulated I2C but the TWI
$lib "glcdSSD1306-I2C.lib"                                  ' override the default lib with this special one

#if _build < 20784
  Dim ___lcdrow As Byte , ___lcdcol As Byte                 ' dim these for older compiler versions
#endif

Config Graphlcd = Custom , Cols = 128 , Rows = 64 , Lcdname = "SSD1306"
Cls
Setfont Font8x8tt                                           ' select font

Lcdat 1 , 1 , "BASCOM-AVR"
Lcdat 2 , 10 , "1995-2015"
Lcdat 8 , 5 , "MCS Electronics" , 1
Waitms 3000

Showpic 0 , 0 , Plaatje

End


$include "font8x8TT.font"                                   ' this is a true type font with variable spacing


Plaatje:
   $bgf "ks108.bgf"                                         ' include the picture data
 

_________________
Mark
Back to top
View user's profile Visit poster's website
enrico58

Bascom Member



Joined: 09 Mar 2009
Posts: 1

italy.gif
PostPosted: Sat Oct 03, 2015 11:04 am    Post subject: Reply with quote

I am interested in trying the OLED with bascom, but I can not find the library I am interested in trying the OLED with bascom, but I can not find the library glcdSSD1306-I2C.lib you have a suggestion on how to download it ?.


Thank you for support

Enrico
Back to top
View user's profile
albertsm

Administrator



Joined: 09 Apr 2004
Posts: 4736
Location: Holland

blank.gif
PostPosted: Sat Oct 03, 2015 9:31 pm    Post subject: Reply with quote

you can get it with the update wiz and the 2079 lic file.
_________________
Mark
Back to top
View user's profile Visit poster's website
luizabbadia

Bascom Member



Joined: 11 Dec 2007
Posts: 112
Location: rio de janeiro

brazil.gif
PostPosted: Sun Dec 27, 2015 1:47 am    Post subject: Reply with quote

Hello Ian!
Is it possible for you to post your code here?
I have the same display CRIUS CO-16 ( v1.0) but the code that Ben Zijlstra kindly posted does not work with my display.
I tried to dissect the controller code, but...
Thanks
Back to top
View user's profile MSN Messenger
luizabbadia

Bascom Member



Joined: 11 Dec 2007
Posts: 112
Location: rio de janeiro

brazil.gif
PostPosted: Sun Dec 27, 2015 1:48 am    Post subject: Reply with quote

Hello Ian!
Is it possible for you to post your code here?
I have the same display CRIUS CO-16 ( v1.0) but the code that Ben Zijlstra kindly posted does not work with my display.
I tried to dissect the controller code, but...
Thanks
Back to top
View user's profile MSN Messenger
luizabbadia

Bascom Member



Joined: 11 Dec 2007
Posts: 112
Location: rio de janeiro

brazil.gif
PostPosted: Sun Dec 27, 2015 1:49 am    Post subject: Reply with quote

sorry...wrong post,wrong time...
Back to top
View user's profile MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    www.mcselec.com Forum Index -> BASCOM-ARDUINO All times are GMT + 1 Hour
Goto page Previous  1, 2, 3, 4  Next
Page 2 of 4

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum