View previous topic :: View next topic |
Author |
Message |
albertsm
Joined: 09 Apr 2004 Posts: 5921 Location: Holland
|
Posted: Thu Dec 18, 2014 5:14 pm Post subject: |
|
|
Thanks for the converter. And also for the new demos
While bascom does not mind the , at the end, a future version will complain for sure. _________________ Mark |
|
Back to top |
|
|
i.dobson
Joined: 05 Jan 2006 Posts: 1570 Location: Basel, Switzerland
|
Posted: Fri Dec 19, 2014 8:24 am Post subject: |
|
|
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 _________________ Walking on water and writing software to specification is easy if they're frozen. |
|
Back to top |
|
|
aphawk
Joined: 23 Jan 2010 Posts: 168 Location: Brazil
|
Posted: Wed Dec 31, 2014 8:42 pm Post subject: |
|
|
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 |
|
|
bzijlstra
Joined: 30 Dec 2004 Posts: 1179 Location: Tilburg - Netherlands
|
|
Back to top |
|
|
albertsm
Joined: 09 Apr 2004 Posts: 5921 Location: Holland
|
Posted: Fri Jan 30, 2015 3:00 pm Post subject: |
|
|
I got my LCD and Ben's code worked just fine
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 |
|
|
albertsm
Joined: 09 Apr 2004 Posts: 5921 Location: Holland
|
Posted: Fri Jan 30, 2015 4:31 pm Post subject: |
|
|
ok, driver seems to work
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 |
|
|
AndersL
Joined: 25 Jan 2010 Posts: 92 Location: Kragerψ,Norway
|
Posted: Sat Feb 07, 2015 6:10 pm Post subject: |
|
|
Just a note about these displays:
I tested a SPI version connected to a Nano V3 (with code from Hkipnik; thanks a lot ), 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 |
|
|
hobby
Joined: 12 Apr 2004 Posts: 109 Location: Brussels
|
Posted: Sat Jun 13, 2015 12:10 pm Post subject: |
|
|
Hello Mark,
I can not find the driver in the shop.
You can buy it?
thank you
Olivier |
|
Back to top |
|
|
albertsm
Joined: 09 Apr 2004 Posts: 5921 Location: Holland
|
Posted: Sat Jun 13, 2015 3:08 pm Post subject: |
|
|
it is free in the next update. send an email to support and you can test the beta driver. _________________ Mark |
|
Back to top |
|
|
albertsm
Joined: 09 Apr 2004 Posts: 5921 Location: Holland
|
Posted: Fri Aug 28, 2015 3:41 pm Post subject: |
|
|
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 |
|
|
enrico58
Joined: 09 Mar 2009 Posts: 1
|
Posted: Sat Oct 03, 2015 11:04 am Post subject: |
|
|
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 |
|
|
albertsm
Joined: 09 Apr 2004 Posts: 5921 Location: Holland
|
Posted: Sat Oct 03, 2015 9:31 pm Post subject: |
|
|
you can get it with the update wiz and the 2079 lic file. _________________ Mark |
|
Back to top |
|
|
luizabbadia
Joined: 11 Dec 2007 Posts: 112 Location: rio de janeiro
|
Posted: Sun Dec 27, 2015 1:47 am Post subject: |
|
|
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 |
|
|
luizabbadia
Joined: 11 Dec 2007 Posts: 112 Location: rio de janeiro
|
Posted: Sun Dec 27, 2015 1:48 am Post subject: |
|
|
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 |
|
|
luizabbadia
Joined: 11 Dec 2007 Posts: 112 Location: rio de janeiro
|
Posted: Sun Dec 27, 2015 1:49 am Post subject: |
|
|
sorry...wrong post,wrong time... |
|
Back to top |
|
|
|