Forum - MCS Electronics

 

FAQFAQ SearchSearch RegisterRegister Log inLog in

SSD1306 Oled I2c 0.96 inch
Goto page 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
bzijlstra

Bascom Ambassador



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

netherlands.gif
PostPosted: Tue Dec 16, 2014 3:38 pm    Post subject: SSD1306 Oled I2c 0.96 inch Reply with quote

We have stolen some code for the SPI SSD1306 Oled display from the neighbours (bascom-forum Germany) and got the I2c version of this display running. This is a simple code just to show that the Oled 0.96 inch is working with I2c.



Code:
'SSD1306 oled 0.96 i2C

$regfile = "m328pdef.dat"
$crystal = 16000000
$hwstack = 64
$swstack = 64
$framesize = 64

Dim Resetflag As Bit

Const Kontrast = &HFF                                       '00-FF Kontrast

Config Scl = Portc.5
Config Sda = Portc.4
Config Twi = 400000

Declare Sub Rstoled
Declare Sub Oled(byval Text As String * 16 , Byval Col As Integer , Byval Page As Integer)
Declare Sub Oled_init

I2cinit

Call Oled_init

Do
   If Resetflag < 1 Then
      Call Rstoled
      Resetflag = 1
      Call Oled( "   Merry Xmas   " , 0 , 9)
      Call Oled( "  and a Happy   " , 0 , 2)
      Call Oled( "    New Year    " , 0 , 3)
      Call Oled( "                " , 0 , 4)
      Call Oled( "                " , 0 , 5)
      Call Oled( "  Theo Kleijn   " , 0 , 6)
      Call Oled( "                " , 0 , 7)
      Call Oled( "  Ben Zijlstra  " , 0 , 8)
   End If
Loop

End

Sub Oled(byval Text As String * 16 , Byval Col As Integer , Byval Page As Integer)
   Dim Buchstabe As String * 1

   Dim Q As Integer
   Dim H As Integer
   Dim Temp As Integer
   Dim Senden As Byte
   Col = Col + 16
   Page = Page + 175
   I2cstart
   I2cwbyte &H78
   I2cwbyte &H80
   I2cwbyte Page                                             'Bestimmung Page (Y)
   I2cstop

   I2cstart
   I2cwbyte &H78
   I2cwbyte &H80
   I2cwbyte &H00
   I2cstop

   I2cstart
   I2cwbyte &H78
   I2cwbyte &H80
   I2cwbyte Col                                              'Bestimmung Page (Y)
   I2cstop

   I2cstart
   I2cwbyte &H78
   I2cwbyte &H80
   I2cstop

   I2cstart
   I2cwbyte &H78
   I2cwbyte &H40

   'Umwandlung von Buchstaben zu Asciiwert zu Clumndata der Datenbank
   For Q = 1 To 16
      Temp = 0
      Buchstabe = Mid(text , Q , 1)
      Temp = Asc(buchstabe)
      Temp = Temp - 32
      Temp = Temp * 8
      For H = 1 To 8
         Senden = Lookup(temp , Asciitab)
         I2cwbyte Senden
         Incr Temp
      Next H
   Next Q
   I2cstop
End Sub


Sub Rstoled                                                 'OLED RESET, Aufwecken, alles loeschen
   Dim I As Byte
   Dim J As Integer
   Dim Page As Byte
   Page = 176

   I2cstart
   I2cwbyte &H78
   I2cwbyte &H40                                            'Datenempfang
   For J = 0 To 1023
      I2cwbyte &H00                                         'sende "leere Column"
   Next J
   I2cstop
End Sub

Sub Oled_init
'OLED initialisation ***********************************************************

   I2cstart
   I2cwbyte &H78
    I2cwbyte &HAE                                       'DISPLAYOFF
    I2cwbyte &HD5                                       'SETDISPLAYCLOCKDIV
    I2cwbyte &H80                                       'ratio 0x80
    I2cwbyte &H00                                       'SETMULTIPLEX
    I2cwbyte &H3F                                       '   1f 128x32
    I2cwbyte &HD3                                       'SETDISPLAYOFFSET
    I2cwbyte &H00

    I2cwbyte &H40                                       'SETSTARTLINE
    I2cwbyte &H8D                                       'CHARGEPUMP
    I2cwbyte &H14                                       'vccstate 14
    I2cwbyte &H20                                       'MEMORYMODE
    I2cwbyte &H00                                       '
    I2cwbyte &HA1                                       'A0 upside down SEGREMAP
    I2cwbyte &HC8                                       'COMSCANDEC

    I2cwbyte &HDA                                       'SETCOMPINS
    I2cwbyte &H12                                       ' 02 128x32  12
    I2cwbyte &H81                                       'SETCONTRAST
    I2cwbyte Kontrast                                   'value 1-->256
    I2cwbyte &HD9                                       'SETPRECHARGE
    I2cwbyte &HF1                                       'vccstate  f1
    I2cwbyte &HDB                                       'SETVCOMDETECT

    I2cwbyte &H40                                      
    I2cwbyte &HA4                                       'DISPLAYALLON_RESUME
    I2cwbyte &HA6                                       'NORMALDISPLAY

    I2cwbyte &HAF
I2cstop

End Sub



Asciitab:
   Data 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0,
   Data 0 , 0 , 6 , 95 , 6 , 0 , 0 , 0,
   Data 0 , 7 , 3 , 0 , 7 , 3 , 0 , 0,
   Data 0 , 36 , 126 , 36 , 126 , 36 , 0 , 0,
   Data 0 , 36 , 43 , 106 , 18 , 0 , 0 , 0,
   Data 0 , 99 , 19 , 8 , 100 , 99 , 0 , 0,
   Data 0 , 54 , 73 , 86 , 32 , 80 , 0 , 0,
   Data 0 , 0 , 7 , 3 , 0 , 0 , 0 , 0,
   Data 0 , 0 , 62 , 65 , 0 , 0 , 0 , 0,
   Data 0 , 0 , 65 , 62 , 0 , 0 , 0 , 0,
   Data 0 , 8 , 62 , 28 , 62 , 8 , 0 , 0,
   Data 0 , 8 , 8 , 62 , 8 , 8 , 0 , 0,
   Data 0 , 0 , 224 , 96 , 0 , 0 , 0 , 0,
   Data 0 , 8 , 8 , 8 , 8 , 8 , 0 , 0,
   Data 0 , 0 , 96 , 96 , 0 , 0 , 0 , 0,
   Data 0 , 32 , 16 , 8 , 4 , 2 , 0 , 0,
   Data 0 , 62 , 81 , 73 , 69 , 62 , 0 , 0,
   Data 0 , 0 , 66 , 127 , 64 , 0 , 0 , 0,
   Data 0 , 98 , 81 , 73 , 73 , 70 , 0 , 0,
   Data 0 , 34 , 73 , 73 , 73 , 54 , 0 , 0,
   Data 0 , 24 , 20 , 18 , 127 , 16 , 0 , 0,
   Data 0 , 47 , 73 , 73 , 73 , 49 , 0 , 0,
   Data 0 , 60 , 74 , 73 , 73 , 48 , 0 , 0,
   Data 0 , 1 , 113 , 9 , 5 , 3 , 0 , 0,
   Data 0 , 54 , 73 , 73 , 73 , 54 , 0 , 0,
   Data 0 , 6 , 73 , 73 , 41 , 30 , 0 , 0,
   Data 0 , 0 , 108 , 108 , 0 , 0 , 0 , 0,
   Data 0 , 0 , 236 , 108 , 0 , 0 , 0 , 0,
   Data 0 , 8 , 20 , 4 , 65 , 0 , 0 , 0,
   Data 0 , 36 , 36 , 36 , 36 , 36 , 0 , 0,
   Data 0 , 0 , 65 , 34 , 20 , 8 , 0 , 0,
   Data 0 , 2 , 1 , 89 , 9 , 6 , 0 , 0,
   Data 0 , 62 , 65 , 93 , 85 , 30 , 0 , 0,
   Data 0 , 126 , 17 , 17 , 17 , 126 , 0 , 0,
   Data 0 , 127 , 73 , 73 , 73 , 54 , 0 , 0,
   Data 0 , 62 , 65 , 65 , 65 , 34 , 0 , 0,
   Data 0 , 127 , 65 , 65 , 65 , 62 , 0 , 0,
   Data 0 , 127 , 73 , 73 , 73 , 65 , 0 , 0,
   Data 0 , 127 , 9 , 9 , 9 , 1 , 0 , 0,
   Data 0 , 62 , 65 , 73 , 73 , 122 , 0 , 0,
   Data 0 , 127 , 8 , 8 , 8 , 127 , 0 , 0,
   Data 0 , 0 , 65 , 127 , 65 , 0 , 0 , 0,
   Data 0 , 48 , 64 , 64 , 64 , 63 , 0 , 0,
   Data 0 , 127 , 8 , 20 , 34 , 65 , 0 , 0,
   Data 0 , 127 , 64 , 64 , 64 , 64 , 0 , 0,
   Data 0 , 127 , 2 , 4 , 2 , 127 , 0 , 0,
   Data 0 , 127 , 2 , 4 , 8 , 127 , 0 , 0,
   Data 0 , 62 , 65 , 65 , 65 , 62 , 0 , 0,
   Data 0 , 127 , 9 , 9 , 9 , 6 , 0 , 0,
   Data 0 , 62 , 65 , 81 , 33 , 94 , 0 , 0,
   Data 0 , 127 , 9 , 9 , 25 , 102 , 0 , 0,
   Data 0 , 38 , 73 , 73 , 73 , 50 , 0 , 0,
   Data 0 , 1 , 1 , 127 , 1 , 1 , 0 , 0,
   Data 0 , 63 , 64 , 64 , 64 , 63 , 0 , 0,
   Data 0 , 31 , 32 , 64 , 32 , 31 , 0 , 0,
   Data 0 , 63 , 64 , 60 , 64 , 63 , 0 , 0,
   Data 0 , 99 , 20 , 8 , 20 , 99 , 0 , 0,
   Data 0 , 7 , 8 , 112 , 8 , 7 , 0 , 0,
   Data 0 , 113 , 73 , 69 , 67 , 0 , 0 , 0,
   Data 0 , 0 , 127 , 65 , 65 , 0 , 0 , 0,
   Data 0 , 2 , 4 , 8 , 16 , 32 , 0 , 0,
   Data 0 , 0 , 65 , 65 , 127 , 0 , 0 , 0,
   Data 0 , 4 , 2 , 1 , 2 , 4 , 0 , 0,
   Data 128 , 128 , 128 , 128 , 128 , 128 , 128 , 128,
   Data 0 , 0 , 3 , 7 , 0 , 0 , 0 , 0,
   Data 0 , 32 , 84 , 84 , 84 , 120 , 0 , 0,
   Data 0 , 127 , 68 , 68 , 68 , 56 , 0 , 0,
   Data 0 , 56 , 68 , 68 , 68 , 40 , 0 , 0,
   Data 0 , 56 , 68 , 68 , 68 , 127 , 0 , 0,
   Data 0 , 56 , 84 , 84 , 84 , 8 , 0 , 0,
   Data 0 , 8 , 126 , 9 , 9 , 0 , 0 , 0,
   Data 0 , 24 , 164 , 164 , 164 , 124 , 0 , 0,
   Data 0 , 127 , 4 , 4 , 120 , 0 , 0 , 0,
   Data 0 , 0 , 0 , 125 , 64 , 0 , 0 , 0,
   Data 0 , 64 , 128 , 132 , 125 , 0 , 0 , 0,
   Data 0 , 127 , 16 , 40 , 68 , 0 , 0 , 0,
   Data 0 , 0 , 0 , 127 , 64 , 0 , 0 , 0,
   Data 0 , 124 , 4 , 24 , 4 , 120 , 0 , 0,
   Data 0 , 124 , 4 , 4 , 120 , 0 , 0 , 0,
   Data 0 , 56 , 68 , 68 , 68 , 56 , 0 , 0,
   Data 0 , 252 , 68 , 68 , 68 , 56 , 0 , 0,
   Data 0 , 56 , 68 , 68 , 68 , 252 , 0 , 0,
   Data 0 , 68 , 120 , 68 , 4 , 8 , 0 , 0,
   Data 0 , 8 , 84 , 84 , 84 , 32 , 0 , 0,
   Data 0 , 4 , 62 , 68 , 36 , 0 , 0 , 0,
   Data 0 , 60 , 64 , 32 , 124 , 0 , 0 , 0,
   Data 0 , 28 , 32 , 64 , 32 , 28 , 0 , 0,
   Data 0 , 60 , 96 , 48 , 96 , 60 , 0 , 0,
   Data 0 , 108 , 16 , 16 , 108 , 0 , 0 , 0,
   Data 0 , 156 , 160 , 96 , 60 , 0 , 0 , 0,
   Data 0 , 100 , 84 , 84 , 76 , 0 , 0 , 0,
   Data 0 , 8 , 62 , 65 , 65 , 0 , 0 , 0,
   Data 0 , 0 , 0 , 119 , 0 , 0 , 0 , 0,
   Data 0 , 0 , 65 , 65 , 62 , 8 , 0 , 0,
   Data 0 , 2 , 1 , 2 , 1 , 0 , 0 , 0,
   Data 0 , 60 , 38 , 35 , 38 , 60 , 0 , 0
 


Thanks to all who submitted code for the ssd1306.

Have fun
Ben Zijlstra
Theo Kleijn
Back to top
View user's profile Visit poster's website
mmarlette

Bascom Member



Joined: 30 Nov 2007
Posts: 311
Location: Delano, MN

usa.gif
PostPosted: Tue Dec 16, 2014 7:40 pm    Post subject: Reply with quote

Where is the LIKE button!!!!!

Nice job guys and thanks for all you do!!!!!
Back to top
View user's profile
i.dobson

Bascom Expert



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

switzerland.gif
PostPosted: Tue Dec 16, 2014 10:25 pm    Post subject: Reply with quote

Hi Ben,

It's funny I'm working on exactly the same Display (Atleast the same Driver chip).

For me the Display is up side down, but other than that it's working ok. I've even written a quick and dirty VB app to convert a small BMP to a Bascom data commands.

I've uploaded a small Video to http://mail.planet-ian.com/oled.mkv


Regards
Ian Dobson

_________________
Walking on water and writing software to specification is easy if they're frozen.
Back to top
View user's profile
bzijlstra

Bascom Ambassador



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

netherlands.gif
PostPosted: Tue Dec 16, 2014 11:11 pm    Post subject: Nice demo Reply with quote

Ian

Nice demo. If you check bascomforum.de Heiko / HKipnik made a SPI driver with bascom-fonts and all kind of box, line subroutines. Have still to check that code.

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

Bascom Member



Joined: 24 May 2005
Posts: 435
Location: Hilversum - The Netherlands

netherlands.gif
PostPosted: Wed Dec 17, 2014 12:00 am    Post subject: Reply with quote

December seems to be the "buy yourself a present" month Cool

I found that display at Banggood.com recently and thought "why not ? .... Just for the fun of it"
And ordered one.

Thanks

Nard

_________________
Bascom AVR ver 2.0.8.6
Dragon-lair: http://www.aplomb.nl/TechStuff/Dragon/Dragon.html
"leef met vlag en wimpel, maar hou het simpel"
Back to top
View user's profile
albertsm

Administrator



Joined: 09 Apr 2004
Posts: 5920
Location: Holland

blank.gif
PostPosted: Wed Dec 17, 2014 10:31 am    Post subject: Reply with quote

Well done ! Always a pleasure to see your projects. you make a great team.
Thanks for sharing. And of course for the nice wishes Very Happy

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

Bascom Expert



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

switzerland.gif
PostPosted: Wed Dec 17, 2014 10:45 am    Post subject: Reply with quote

Hi Ben,

Using you init code for the OLED doesn't work for me (Black screen).

I'm using this one instead:

Code:
 
  I2cstart
  I2cwbyte &H78
  I2cwbyte &H8D
  I2cwbyte &H14                                             'Charge pump
  I2cwbyte &HAF
  I2cstop

  I2cstart
  I2cwbyte &H78
  I2cwbyte &H80
  I2cwbyte &HAF                                             'Wake up display
  I2cstop

  I2cstart
  I2cwbyte &H78
  I2cwbyte &H80
  I2cwbyte Contrast                                         'Contrast
  I2cstop

  I2cstart
  I2cwbyte &H78
  I2cwbyte &H80
  I2cwbyte &H20                                             'Adressmapping
  I2cstop

  I2cstart
  I2cwbyte &H78
  I2cwbyte &H80
  I2cwbyte &H00                                             'Adressmapping Horizontal
  I2cstop
 


At least looking at yout code I understand why the Display is up side down (A1/A0 upside down SEGREMAP).

If anyones interested I'll update/finish the BMP2Data program and release is here.

Regards
Ian Dobson

_________________
Walking on water and writing software to specification is easy if they're frozen.
Back to top
View user's profile
mmarlette

Bascom Member



Joined: 30 Nov 2007
Posts: 311
Location: Delano, MN

usa.gif
PostPosted: Wed Dec 17, 2014 3:09 pm    Post subject: Reply with quote

Ian,

I for one would be interested in your program.

Hopefully we will see it posted here.

TIA,

Mark
Back to top
View user's profile
bzijlstra

Bascom Ambassador



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

netherlands.gif
PostPosted: Wed Dec 17, 2014 3:36 pm    Post subject: power cycle oled ssd1306 Reply with quote

Ian

At first I also used the init-code you are using, but after a power cycle nothing on the display so I have used the init code from Heiko/Hkipnik and now after a power cycle everything is oke.

Have fun
Ben Zijlstra
Back to top
View user's profile Visit poster's website
i.dobson

Bascom Expert



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

switzerland.gif
PostPosted: Wed Dec 17, 2014 3:52 pm    Post subject: Reply with quote

Hi Ben,

I'll have another look at the init code again, when I get a bit more time. At the moment the most important thing is to get a simple demo up and running, just to show what's possible.

mmarlette here's my quick and dirty BMP2Data program. Just load a small graphic, click in Generate and copy/paste the data lines into your bascom program. The program just reads the top,left 128x64 Pixels and only Looks for Black Pixels.

In my Bascom program I'm using this code to load the Image into the OLED.

Code:

'Graphic 4
  Restore Smily
  Call Dump_graphic()
end

'-----------------------------------------------------------------------------
Sub Dump_graphic
  'Function    : Dump a graphic to to LCD
  'Author      : Ian Dobson
  'Inputs      : None
  'Outputs     : None
  'Limitations : The i2c bus needs to be initalised before calling this routine
  '
  '              The graphic needs to be selected with restore before calling
  '              this routine
  '              The memory map of the display is 8x128 bytes per line and
  '              8 lines
  'Date        : 15.12.2014
  Dim X As Byte
  Dim Y As Byte

  I2cstart
  I2cwbyte &H78
  I2cwbyte &H80
  I2cwbyte 176                                              'Select Row
  I2cstop

  I2cstart
  I2cwbyte &H78
  I2cwbyte &H80
  I2cwbyte &H00
  I2cstop

  I2cstart
  I2cwbyte &H78
  I2cwbyte &H80
  I2cwbyte 16                                               'Select start column
  I2cstop

  I2cstart
  I2cwbyte &H78
  I2cwbyte &H80
  I2cstop

  I2cstart
  I2cwbyte &H78
  I2cwbyte &H40

  For Y = 1 To 128
  For X = 1 To 8
    Read Send
    I2cwbyte Send
  Next X
  Next Y
  I2cstop
End Sub

Smily:
  Data 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 128 , 128 , 128 , 192 , 192 , 192 , 192 , 224 , 224 , 224 , 224 , 224 , 224 , 224 , 224 , 224 , 224 , 192 , 192 , 192 , 192 , 128 , 128 , 128 , 128 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0,
  Data 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 128 , 192 , 224 , 240 , 112 , 120 , 60 , 28 , 14 , 14 , 7 , 7 , 3 , 3 , 3 , 1 , 1 , 1 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 1 , 1 , 1 , 1 , 3 , 3 , 3 , 7 , 7 , 15 , 14 , 30 , 60 , 120 , 120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 3 , 3 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0,
 


Regards
Ian Dobson

_________________
Walking on water and writing software to specification is easy if they're frozen.
Back to top
View user's profile
mmarlette

Bascom Member



Joined: 30 Nov 2007
Posts: 311
Location: Delano, MN

usa.gif
PostPosted: Wed Dec 17, 2014 4:43 pm    Post subject: Reply with quote

Ian,

Excellent!!!

Thanks,

Mark
Back to top
View user's profile
bzijlstra

Bascom Ambassador



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

netherlands.gif
PostPosted: Wed Dec 17, 2014 5:42 pm    Post subject: BMP2DATA Reply with quote

Ian

It works perfect your BMP2DATA

Here the proof Wink



Have fun
Theo Kleijn
Ben Zijlstra
Back to top
View user's profile Visit poster's website
i.dobson

Bascom Expert



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

switzerland.gif
PostPosted: Wed Dec 17, 2014 6:03 pm    Post subject: Reply with quote

Hi Ben,

Thanks for the feedback. Maybe one day I'll get the time to tidy up the code, but first I need to get a working Demo to show to a customer/prove that we have a useable concept.

Did you use my code for sending the graphic to the OLED?

Regards
Ian Dobson

_________________
Walking on water and writing software to specification is easy if they're frozen.
Back to top
View user's profile
bzijlstra

Bascom Ambassador



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

netherlands.gif
PostPosted: Wed Dec 17, 2014 6:09 pm    Post subject: ssd1306 code... Reply with quote

Ian

Here the code we have put together from Bascom-forum Germany and what you have made...

Code:
'oled 0.96 i2C

$regfile = "m328pdef.dat"
$crystal = 16000000
$hwstack = 64
$swstack = 64
$framesize = 64

Dim Resetflag As Bit
dim send as byte

Const Kontrast = &HFF                                       '00-FF Kontrast

Config Scl = Portc.5
Config Sda = Portc.4
Config Twi = 400000

Declare Sub Rstoled
Declare Sub Oled(byval Text As String * 16 , Byval Col As Integer , Byval Page As Integer)
Declare Sub Oled_init
declare sub dump_graphic

I2cinit

Call Oled_init

Do
   If Resetflag < 1 Then
      Call Rstoled
      Resetflag = 1
      Call Oled( "   WisClub.nl   " , 0 , 9)
      Call Oled( "                " , 0 , 2)
      Call Oled( "Fijne Kerstdagen" , 0 , 3)
      Call Oled( "     en een     " , 0 , 4)
      Call Oled( "  Gelukkig 2015 " , 0 , 5)
      Call Oled( "                " , 0 , 6)
      Call Oled( "en uitkijken met" , 0 , 7)
      Call Oled( "nozzles/solderen" , 0 , 8)
      wait 5
      'Graphic 4
      Restore Smily
      Call Dump_graphic()
      wait 5
   End If
Loop

End

Sub Oled(byval Text As String * 16 , Byval Col As Integer , Byval Page As Integer)
   Dim Buchstabe As String * 1
   Dim Q As Integer
   Dim H As Integer
   Dim Temp As Integer
   Dim Senden As Byte
   Col = Col + 16
   Page = Page + 175
   I2cstart
   I2cwbyte &H78
   I2cwbyte &H80
   I2cwbyte Page                                             'Bestimmung Page (Y)
   I2cstop

   I2cstart
   I2cwbyte &H78
   I2cwbyte &H80
   I2cwbyte &H00
   I2cstop

   I2cstart
   I2cwbyte &H78
   I2cwbyte &H80
   I2cwbyte Col                                              'Bestimmung Page (Y)
   I2cstop

   I2cstart
   I2cwbyte &H78
   I2cwbyte &H80
   I2cstop

   I2cstart
   I2cwbyte &H78
   I2cwbyte &H40

   'Umwandlung von Buchstaben zu Asciiwert zu Clumndata der Datenbank
   For Q = 1 To 16
      Temp = 0
      Buchstabe = Mid(text , Q , 1)
      Temp = Asc(buchstabe)
      Temp = Temp - 32
      Temp = Temp * 8
      For H = 1 To 8
         Senden = Lookup(temp , Asciitab)
         I2cwbyte Senden
         Incr Temp
      Next H
   Next Q
   I2cstop
End Sub


Sub Rstoled                                                 'OLED RESET, Aufwecken, alles loeschen
   Dim J As Integer
   Dim Page As Byte
   Page = 176

   I2cstart
   I2cwbyte &H78
   I2cwbyte &H40                                            'Datenempfang
   For J = 0 To 1023
      I2cwbyte &H00                                         'sende "leere Column"
   Next J
   I2cstop
End Sub

Sub Oled_init
   'OLED initialisation ***********************************************************
   I2cstart
   I2cwbyte &H78
   I2cwbyte &HAE                                       'DISPLAYOFF
   I2cwbyte &HD5                                       'SETDISPLAYCLOCKDIV
   I2cwbyte &H80                                       'ratio 0x80
   I2cwbyte &H00                                       'SETMULTIPLEX
   I2cwbyte &H3F                                       '  1f 128x32
   I2cwbyte &HD3                                       'SETDISPLAYOFFSET
   I2cwbyte &H00

   I2cwbyte &H40                                       'SETSTARTLINE
   I2cwbyte &H8D                                       'CHARGEPUMP
   I2cwbyte &H14                                       'vccstate 14
   I2cwbyte &H20                                       'MEMORYMODE
   I2cwbyte &H00                                       '
   I2cwbyte &HA1                                       'A0 upside down SEGREMAP
   I2cwbyte &HC8                                       'COMSCANDEC

   I2cwbyte &HDA                                       'SETCOMPINS
   I2cwbyte &H12                                       ' 02 128x32  12
   I2cwbyte &H81                                       'SETCONTRAST
   I2cwbyte 255                                        'contrast value 1-->256
   I2cwbyte &HD9                                       'SETPRECHARGE
   I2cwbyte &HF1                                       'vccstate  f1
   I2cwbyte &HDB                                       'SETVCOMDETECT

   I2cwbyte &H40
   I2cwbyte &HA4                                       'DISPLAYALLON_RESUME
   I2cwbyte &HA6                                       'NORMALDISPLAY

   I2cwbyte &HAF
   I2cstop

End Sub


'-----------------------------------------------------------------------------
Sub Dump_graphic
  'Function    : Dump a graphic to to LCD
  'Author      : Ian Dobson
  'Inputs      : None
  'Outputs     : None
  'Limitations : The i2c bus needs to be initalised before calling this routine
  '
  '              The graphic needs to be selected with restore before calling
  '              this routine
  '              The memory map of the display is 8x128 bytes per line and
  '              8 lines
  'Date        : 15.12.2014
  Dim Xi As Byte
  Dim Yi As Byte

  I2cstart
  I2cwbyte &H78
  I2cwbyte &H80
  I2cwbyte 176                                              'Select Row
  I2cstop

  I2cstart
  I2cwbyte &H78
  I2cwbyte &H80
  I2cwbyte &H00
  I2cstop

  I2cstart
  I2cwbyte &H78
  I2cwbyte &H80
  I2cwbyte 16                                               'Select start column
  I2cstop

  I2cstart
  I2cwbyte &H78
  I2cwbyte &H80
  I2cstop

  I2cstart
  I2cwbyte &H78
  I2cwbyte &H40

  For Yi = 1 To 128
  For Xi = 1 To 8
    Read Send
    I2cwbyte Send
  Next Xi
  Next Yi
  I2cstop
End Sub

Smily:
data 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
data 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,14,14,254,254,254,254,14,14,0,0,0,112,48,48,48,48,240,240,224,192,0,0,0,0,240,240,240,240,32,48,240,240,240,224,0,0,0,0,0,0,0,0,0,0,48,254,255,255,255,51,51,0,128,224,224,240,112,48,112,240,224,224,128,0,0,0,240,240,240,240,32,48,48,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
data 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,112,112,127,127,127,127,112,112,0,0,60,126,127,127,99,35,127,127,127,127,0,0,0,0,127,127,127,127,0,0,127,127,127,127,0,0,0,0,0,0,0,0,0,0,0,127,127,127,127,0,0,0,15,63,63,127,112,96,112,127,63,63,15,0,0,0,127,127,127,127,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
data 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
data 0,0,0,0,0,0,0,0,0,0,0,0,0,248,248,248,248,56,56,56,248,248,240,224,0,0,0,192,192,192,192,128,192,192,0,0,0,128,192,192,192,192,192,192,128,0,0,0,0,128,192,192,192,192,192,192,192,0,0,0,220,220,220,220,0,0,0,128,192,192,192,192,252,252,252,252,0,0,0,0,0,128,192,192,192,192,192,192,128,0,0,0,0,192,192,192,192,128,192,192,192,192,128,0,0,0,192,248,248,248,248,192,192,192,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
data 0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,14,14,14,15,7,7,1,0,0,0,255,255,255,255,0,0,0,0,62,127,255,255,204,140,140,143,143,207,239,0,0,231,207,159,159,156,252,252,248,113,0,0,0,255,255,255,255,0,0,126,255,255,255,129,128,255,255,255,255,0,0,0,62,127,255,255,204,140,140,143,143,207,239,0,0,0,255,255,255,255,0,0,255,255,255,255,0,0,0,0,255,255,255,255,128,128,128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
data 0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,1,1,1,1,0,0,0,0,1,1,1,0,1,1,1,1,0,0,0,0,0,0,1,1,1,1,1,1,1,0,0,0,0,1,1,1,1,0,0,1,1,1,1,0,0,0,0,0,0,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
data 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,

Asciitab:
   Data 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0,
   Data 0 , 0 , 6 , 95 , 6 , 0 , 0 , 0,
   Data 0 , 7 , 3 , 0 , 7 , 3 , 0 , 0,
   Data 0 , 36 , 126 , 36 , 126 , 36 , 0 , 0,
   Data 0 , 36 , 43 , 106 , 18 , 0 , 0 , 0,
   Data 0 , 99 , 19 , 8 , 100 , 99 , 0 , 0,
   Data 0 , 54 , 73 , 86 , 32 , 80 , 0 , 0,
   Data 0 , 0 , 7 , 3 , 0 , 0 , 0 , 0,
   Data 0 , 0 , 62 , 65 , 0 , 0 , 0 , 0,
   Data 0 , 0 , 65 , 62 , 0 , 0 , 0 , 0,
   Data 0 , 8 , 62 , 28 , 62 , 8 , 0 , 0,
   Data 0 , 8 , 8 , 62 , 8 , 8 , 0 , 0,
   Data 0 , 0 , 224 , 96 , 0 , 0 , 0 , 0,
   Data 0 , 8 , 8 , 8 , 8 , 8 , 0 , 0,
   Data 0 , 0 , 96 , 96 , 0 , 0 , 0 , 0,
   Data 0 , 32 , 16 , 8 , 4 , 2 , 0 , 0,
   Data 0 , 62 , 81 , 73 , 69 , 62 , 0 , 0,
   Data 0 , 0 , 66 , 127 , 64 , 0 , 0 , 0,
   Data 0 , 98 , 81 , 73 , 73 , 70 , 0 , 0,
   Data 0 , 34 , 73 , 73 , 73 , 54 , 0 , 0,
   Data 0 , 24 , 20 , 18 , 127 , 16 , 0 , 0,
   Data 0 , 47 , 73 , 73 , 73 , 49 , 0 , 0,
   Data 0 , 60 , 74 , 73 , 73 , 48 , 0 , 0,
   Data 0 , 1 , 113 , 9 , 5 , 3 , 0 , 0,
   Data 0 , 54 , 73 , 73 , 73 , 54 , 0 , 0,
   Data 0 , 6 , 73 , 73 , 41 , 30 , 0 , 0,
   Data 0 , 0 , 108 , 108 , 0 , 0 , 0 , 0,
   Data 0 , 0 , 236 , 108 , 0 , 0 , 0 , 0,
   Data 0 , 8 , 20 , 4 , 65 , 0 , 0 , 0,
   Data 0 , 36 , 36 , 36 , 36 , 36 , 0 , 0,
   Data 0 , 0 , 65 , 34 , 20 , 8 , 0 , 0,
   Data 0 , 2 , 1 , 89 , 9 , 6 , 0 , 0,
   Data 0 , 62 , 65 , 93 , 85 , 30 , 0 , 0,
   Data 0 , 126 , 17 , 17 , 17 , 126 , 0 , 0,
   Data 0 , 127 , 73 , 73 , 73 , 54 , 0 , 0,
   Data 0 , 62 , 65 , 65 , 65 , 34 , 0 , 0,
   Data 0 , 127 , 65 , 65 , 65 , 62 , 0 , 0,
   Data 0 , 127 , 73 , 73 , 73 , 65 , 0 , 0,
   Data 0 , 127 , 9 , 9 , 9 , 1 , 0 , 0,
   Data 0 , 62 , 65 , 73 , 73 , 122 , 0 , 0,
   Data 0 , 127 , 8 , 8 , 8 , 127 , 0 , 0,
   Data 0 , 0 , 65 , 127 , 65 , 0 , 0 , 0,
   Data 0 , 48 , 64 , 64 , 64 , 63 , 0 , 0,
   Data 0 , 127 , 8 , 20 , 34 , 65 , 0 , 0,
   Data 0 , 127 , 64 , 64 , 64 , 64 , 0 , 0,
   Data 0 , 127 , 2 , 4 , 2 , 127 , 0 , 0,
   Data 0 , 127 , 2 , 4 , 8 , 127 , 0 , 0,
   Data 0 , 62 , 65 , 65 , 65 , 62 , 0 , 0,
   Data 0 , 127 , 9 , 9 , 9 , 6 , 0 , 0,
   Data 0 , 62 , 65 , 81 , 33 , 94 , 0 , 0,
   Data 0 , 127 , 9 , 9 , 25 , 102 , 0 , 0,
   Data 0 , 38 , 73 , 73 , 73 , 50 , 0 , 0,
   Data 0 , 1 , 1 , 127 , 1 , 1 , 0 , 0,
   Data 0 , 63 , 64 , 64 , 64 , 63 , 0 , 0,
   Data 0 , 31 , 32 , 64 , 32 , 31 , 0 , 0,
   Data 0 , 63 , 64 , 60 , 64 , 63 , 0 , 0,
   Data 0 , 99 , 20 , 8 , 20 , 99 , 0 , 0,
   Data 0 , 7 , 8 , 112 , 8 , 7 , 0 , 0,
   Data 0 , 113 , 73 , 69 , 67 , 0 , 0 , 0,
   Data 0 , 0 , 127 , 65 , 65 , 0 , 0 , 0,
   Data 0 , 2 , 4 , 8 , 16 , 32 , 0 , 0,
   Data 0 , 0 , 65 , 65 , 127 , 0 , 0 , 0,
   Data 0 , 4 , 2 , 1 , 2 , 4 , 0 , 0,
   Data 128 , 128 , 128 , 128 , 128 , 128 , 128 , 128,
   Data 0 , 0 , 3 , 7 , 0 , 0 , 0 , 0,
   Data 0 , 32 , 84 , 84 , 84 , 120 , 0 , 0,
   Data 0 , 127 , 68 , 68 , 68 , 56 , 0 , 0,
   Data 0 , 56 , 68 , 68 , 68 , 40 , 0 , 0,
   Data 0 , 56 , 68 , 68 , 68 , 127 , 0 , 0,
   Data 0 , 56 , 84 , 84 , 84 , 8 , 0 , 0,
   Data 0 , 8 , 126 , 9 , 9 , 0 , 0 , 0,
   Data 0 , 24 , 164 , 164 , 164 , 124 , 0 , 0,
   Data 0 , 127 , 4 , 4 , 120 , 0 , 0 , 0,
   Data 0 , 0 , 0 , 125 , 64 , 0 , 0 , 0,
   Data 0 , 64 , 128 , 132 , 125 , 0 , 0 , 0,
   Data 0 , 127 , 16 , 40 , 68 , 0 , 0 , 0,
   Data 0 , 0 , 0 , 127 , 64 , 0 , 0 , 0,
   Data 0 , 124 , 4 , 24 , 4 , 120 , 0 , 0,
   Data 0 , 124 , 4 , 4 , 120 , 0 , 0 , 0,
   Data 0 , 56 , 68 , 68 , 68 , 56 , 0 , 0,
   Data 0 , 252 , 68 , 68 , 68 , 56 , 0 , 0,
   Data 0 , 56 , 68 , 68 , 68 , 252 , 0 , 0,
   Data 0 , 68 , 120 , 68 , 4 , 8 , 0 , 0,
   Data 0 , 8 , 84 , 84 , 84 , 32 , 0 , 0,
   Data 0 , 4 , 62 , 68 , 36 , 0 , 0 , 0,
   Data 0 , 60 , 64 , 32 , 124 , 0 , 0 , 0,
   Data 0 , 28 , 32 , 64 , 32 , 28 , 0 , 0,
   Data 0 , 60 , 96 , 48 , 96 , 60 , 0 , 0,
   Data 0 , 108 , 16 , 16 , 108 , 0 , 0 , 0,
   Data 0 , 156 , 160 , 96 , 60 , 0 , 0 , 0,
   Data 0 , 100 , 84 , 84 , 76 , 0 , 0 , 0,
   Data 0 , 8 , 62 , 65 , 65 , 0 , 0 , 0,
   Data 0 , 0 , 0 , 119 , 0 , 0 , 0 , 0,
   Data 0 , 0 , 65 , 65 , 62 , 8 , 0 , 0,
   Data 0 , 2 , 1 , 2 , 1 , 0 , 0 , 0,
   Data 0 , 60 , 38 , 35 , 38 , 60 , 0 , 0
 


I was expecting that the text and the image would be changed every 5 seconds but that doesn't work. Have to check that... We changed your X and Y in Xi and Yi.

Have fun
Ben Zijlstra
Back to top
View user's profile Visit poster's website
i.dobson

Bascom Expert



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

switzerland.gif
PostPosted: Wed Dec 17, 2014 6:23 pm    Post subject: Reply with quote

Hi Ben,

This Looks wrong:

Code:
Do
    If Resetflag < 1 Then
       Call Rstoled
       Resetflag = 1
 


so the code in the do Loop will only be called once. Maybe try

Code:

Call Rstoled
do
      Call Oled( "   WisClub.nl   " , 0 , 9)
      Call Oled( "                " , 0 , 2)
      Call Oled( "Fijne Kerstdagen" , 0 , 3)
      Call Oled( "     en een     " , 0 , 4)
      Call Oled( "  Gelukkig 2015 " , 0 , 5)
      Call Oled( "                " , 0 , 6)
      Call Oled( "en uitkijken met" , 0 , 7)
      Call Oled( "nozzles/solderen" , 0 , 8)
      wait 5
      'Graphic 4
      Restore Smily
      Call Dump_graphic()
      wait 5
Loop
 


Regards
Ian Dobson

_________________
Walking on water and writing software to specification is easy if they're frozen.
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 1, 2, 3, 4  Next
Page 1 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