Help for OLED Display

mikroC, mikroBasic and mikroPascal PRO for Microchip’s 8-bit PIC MCUs.
Post Reply
Author
Message
pieadi
Posts: 30
Joined: 02 Jun 2012 18:46

Help for OLED Display

#1 Post by pieadi » 18 Jan 2023 08:48

Hello, I am looking for an example of code in Mikrobasic for the implementation of a 128x32 monochrome SSD 1306 oled display in I2C.
Best regards.
Pierre

User avatar
filip
mikroElektronika team
Posts: 11874
Joined: 25 Jan 2008 09:56

Re: Help for OLED Display

#2 Post by filip » 20 Jan 2023 08:48

Hi,

Have you checked LibStock ?
https://libstock.mikroe.com/project_cat ... ew/29/oled

Regards,
Filip.

pieadi
Posts: 30
Joined: 02 Jun 2012 18:46

Re: Help for OLED Display

#3 Post by pieadi » 23 Jan 2023 08:58

Hello,
Thank you for your answer but unfortunately I can't find an example in Mikrobasic under this link.
The only example is for an Oled SSD1306 128x64, while I'm looking for SSD Oled 128x32
Best regards.
Pierre

AntiMember
Posts: 136
Joined: 02 Jan 2020 19:00

Re: Help for OLED Display

#4 Post by AntiMember » 23 Jan 2023 17:24

https://libstock.mikroe.com/projects/vi ... asic-pic18
Pins and I2C rewrite for the chip used. Don't use tftlcdtest or fix 0x63 to 0x31.
I2C address can be 0x78 or 0x7A.

Code: Select all

symbol x_size                                =    128
symbol x_max                               =     128
symbol x_min                               =      0
symbol y_size                               =     32
symbol y_max                               =      4
symbol y_min                                =     0

''symbol ON                                    =     1
'symbol OFF                                   =     0

symbol ROUND                                =     1
symbol SQUARE                               =     0

symbol buffer_size                          =     512 '(x_max * y_max)
 ''typedef Mychrarray as byte[512]

 dim buffer as char[512]

Code: Select all

    OLED_write(Set_Multiplex_Ratio_CMD, CMD) 
    OLED_write(0x1F, CMD)                         

pieadi
Posts: 30
Joined: 02 Jun 2012 18:46

Re: Help for OLED Display

#5 Post by pieadi » 26 Jan 2023 16:15

Hello AntiMember,
Thanks for your help.
Can you tell me in which part of the code should be the I2C address module (0x78 or 0x7A)?
Best Regards
Pierre

AntiMember
Posts: 136
Joined: 02 Jan 2020 19:00

Re: Help for OLED Display

#6 Post by AntiMember » 26 Jan 2023 18:53

Hello pieadi.
In this example, this is not used. I2C here is programmatically emulated for one device on the bus. I don't know how it works.
It's just that this is the only example on mikrobasic that was found...
I gave the address in case you want to implement a hardware I2C with a choice of devices on the bus..

pieadi
Posts: 30
Joined: 02 Jun 2012 18:46

Re: Help for OLED Display

#7 Post by pieadi » 27 Jan 2023 08:11

Hello AntiMember,
Thanks for your help.
I better understand how to use an OLED display.
I continue my tests and hope i find the solution.
Best regards.
Pierre

izing.ferenc@gmail.com
Posts: 1
Joined: 03 Oct 2023 03:36

Re: Help for OLED Display

#8 Post by izing.ferenc@gmail.com » 09 Oct 2023 18:00

I am using Mikrobasics and PIC16F1829 for my project.
Can someone help me how to handle the 4-wire SSD1306 OLED display with hardware I2C?
Display address: 0x78

Post Reply

Return to “PIC PRO Compilers”