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
luizabbadia

Bascom Member



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

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

sorry wrong post,wrong duplication,wrong question
Back to top
View user's profile MSN Messenger
i.dobson

Bascom Expert



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

switzerland.gif
PostPosted: Sun Dec 27, 2015 8:46 am    Post subject: Reply with quote

Hi luizabbadia,

I think this is the code (I had a harddisk Crash a while ago and lost afew files)

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
luizabbadia

Bascom Member



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

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

Many thanks for your attention and quick reply ,Ian!
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 11:46 am    Post subject: Reply with quote

Yes!! It works...thanks!!
That helped me to debug and find one problem!
A bad contact in the protoboard....
Now Mark´s program works too!!!!
Thanks a lot!!
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 11:51 am    Post subject: Reply with quote

Ok[/img]
Back to top
View user's profile MSN Messenger
i.dobson

Bascom Expert



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

switzerland.gif
PostPosted: Sun Dec 27, 2015 12:29 pm    Post subject: Reply with quote

Hi,

Glad to be of Service.

Ian

_________________
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
Mrshilov

Bascom LCD Guru



Joined: 24 Jan 2009
Posts: 313
Location: Russia

russia.gif
PostPosted: Sat Feb 06, 2016 7:16 pm    Post subject: Reply with quote

glcdSSD1306.lib not work on Xmega. CPU hangs. In this example even LED flash not work.

Code:
$regfile = "xm256a3budef.dat"
$crystal = 32000000
$hwstack = 100
$swstack = 100
$framesize = 100


Config Osc = Disabled , 32mhzosc = Enabled
Config Sysclock = 32mhz , Prescalea = 1 , Prescalebc = 1_1

Dim Count As Byte
Led Alias Portd.2 : Config Portd.2 = Output

Dim Twi_start As Byte
Config Twic = 400000
I2cinit

$lib "glcdSSD1306.lib"


'************************** Here LED flashes
For Count = 1 To 8
   Toggle Led
   Waitms 300
Next Count


'************************** After this string CPU hangs
Config Graphlcd = Custom , Cols = 128 , Rows = 64 , Lcdname = "SSD1306"


'************************** Here LED not flashes
Do
   Toggle Led
   Waitms 100
Loop


End
Back to top
View user's profile
EDC

Bascom Expert



Joined: 26 Mar 2014
Posts: 605

poland.gif
PostPosted: Sun Feb 07, 2016 12:25 am    Post subject: Reply with quote

My little investigation take me into Xmega.lib
Address for register of I2C channel is keeped in Z so R30 and R31 cannot be altered.
But LPM for reading from flash uses R30 and R31 so in first when InitLCD read data from flash with LPM then Z is blurred and address for I2C reg is broken

I test this because when I write in lib like this
Code:
ldi r17,&H78
 Call _i2c_write
 ldi r17,&HAE
 Call _i2c_write
 ldi r17,&HD5
 Call _i2c_write
 ldi r17,&H80...
..etc (data for init)

then I have progress..
I can even CLS when I change Loop in lib for 1024 bytes sending $00 builded on R30|R31 to R28|R29

But now for LCDDAT again LPM is used and so on Very Happy

I`m not that good so my experiments can take time but I find this like very interesting learning Very Happy
Back to top
View user's profile Visit poster's website
albertsm

Administrator



Joined: 09 Apr 2004
Posts: 4778
Location: Holland

blank.gif
PostPosted: Wed Feb 10, 2016 10:22 pm    Post subject: Reply with quote

you found out correct. the twi in xmega uses Z. so Z must be saved.
I sent you a driver in support.

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

Bascom Member



Joined: 18 Feb 2016
Posts: 19

poland.gif
PostPosted: Fri Aug 26, 2016 11:17 am    Post subject: Reply with quote

Hello.
I wanted to make your own font style Display 7-segment for SSD1306.
I have drawn all the numbers in the format bmp.
I do not know how to convert bmp format to ASCII table.
Please advice.
Back to top
View user's profile
bzijlstra

Bascom Ambassador



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

netherlands.gif
PostPosted: Fri Aug 26, 2016 3:01 pm    Post subject: Font editor Reply with quote

Check in Bascom-AVR tools / font editor

and also a nice tool

http://bart-projects.cba.pl/font.html

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

Bascom Member



Joined: 18 Feb 2016
Posts: 19

poland.gif
PostPosted: Fri Aug 26, 2016 5:40 pm    Post subject: Reply with quote

Yeah.
I forgot about the Font Editor.
Now I have a beautiful style digit seven segment display.

Thanks a lot.
Back to top
View user's profile
Duval JP

Bascom Member



Joined: 22 Jun 2004
Posts: 849
Location: France

france.gif
PostPosted: Sun Aug 28, 2016 5:20 pm    Post subject: Reply with quote

Hello all,
holidays off ? OK Wink

I'm just playing with the small oled display
Because I'm lazy, I use the : Config Graphlcd = Custom , Cols = 128 , Rows = 64 , Lcdname = "SSD1306"
nice tool it works fine

many thanks Ben, Ian and Mark !

but impossible to use pset, line or circle
do you have an idea to set/reset one pixel? I will do the sub after

Thanks for your help
JP Wink

My test here :

$regfile = "M328pdef.dat"

$crystal = 16000000
$hwstack = 128
$swstack = 64
$framesize = 128
'$baud = 57600
'----include and lib------------------------------------------------------------------
$include "font8x8.font"
$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
'---- config-------------------------------------------------------------------------
Config Clockdiv = 1
Config Submode = New ' new method for sub

Config Sda = Portc.4
Config Scl = Portc.5
Config I2cdelay = 5 ' the Ds3232 is working only to 100kHz but it's work to 200kHz
Config Twi = 400000
Config Graphlcd = Custom , Cols = 128 , Rows = 64 , Lcdname = "SSD1306"
'----- variables----------------------------------------------------------------------
Dim jbyte as byte, kbyte as Byte
dim jtext as string*3
dim Xbyte as Byte, ybyte as byte

Setfont Font8x8 ' select font
I2cinit

Lcdat 1 , 1 , "BASCOM-AVR"
Lcdat 2 , 10 , "1995-2015"
wait 2
cls
kbyte=1
for Jbyte= 65 to 75
jtext=chr(jbyte)
Lcdat 4, kbyte , jtext;
'waitms 100
kbyte=kbyte+10
next
kbyte=1
for Jbyte= 128 to 138
jtext=chr(jbyte)
Lcdat 5,kbyte , jtext;
kbyte=kbyte+8
next
kbyte=1
for Jbyte= 139 to 149
jtext=chr(jbyte)
Lcdat 6,kbyte , jtext;
kbyte=kbyte+8
next

Lcdat 8 , 5 , "MCS Electronics" , 1
Wait 2
end
Back to top
View user's profile Visit poster's website
pier_pe

Bascom Member



Joined: 18 Feb 2016
Posts: 19

poland.gif
PostPosted: Sun Aug 28, 2016 8:17 pm    Post subject: Reply with quote

Hello.
To do what you want to have to read data from the display. In I2C mode, this is impossible.

http://www.mcselec.com/index2.php?option=com_forum&Itemid=59&page=viewtopic&t=13125&highlight=ssd1306
This link is the solution.
Back to top
View user's profile
Mrshilov

Bascom LCD Guru



Joined: 24 Jan 2009
Posts: 313
Location: Russia

russia.gif
PostPosted: Sun Aug 28, 2016 9:10 pm    Post subject: Reply with quote

This lib lets do it (uses 1kbytes video buffer in SRAM).
Back to top
View user's profile
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 3 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