Component for Oled-Display with SSD1309

Post here to discuss any new features, components, chips, etc, that you would like to see in Flowcode.
Post Reply
Jorg_Guldner
Posts: 50
http://meble-kuchenne.info.pl
Joined: Wed Dec 23, 2020 9:55 am
Been thanked: 4 times

Component for Oled-Display with SSD1309

Post by Jorg_Guldner »

Hello!
I found in other forums, that the component with SSD1306 shall works. I can`t get it running to 100%.
On the attached picture you can see the results. Can you create a component for SSD1309?




Best regards
Jörg
Attachments
SSD1309 component needed.png
SSD1309 component needed.png (416.97 KiB) Viewed 8049 times

BenR
Matrix Staff
Posts: 1924
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 501 times
Been thanked: 684 times

Re: Component for Oled-Display with SSD1309

Post by BenR »

Hello Jorg,

Have you tried changing the interlaced property to yes? Hopefully that's all that's required.

Jorg_Guldner
Posts: 50
Joined: Wed Dec 23, 2020 9:55 am
Been thanked: 4 times

Re: Component for Oled-Display with SSD1309

Post by Jorg_Guldner »

Hello!
I already tried it, but I got no success. The results are in the photos below.
Attachments
SSD1309 not working_02.png
SSD1309 not working_02.png (777.26 KiB) Viewed 8033 times

BenR
Matrix Staff
Posts: 1924
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 501 times
Been thanked: 684 times

Re: Component for Oled-Display with SSD1309

Post by BenR »

Hello,

I've hopefully tracked down the source of the problem and uploaded a new version to the update system that will shopefully solve the problem for you.

Jorg_Guldner
Posts: 50
Joined: Wed Dec 23, 2020 9:55 am
Been thanked: 4 times

Re: Component for Oled-Display with SSD1309

Post by Jorg_Guldner »

Hello!
I tried the changing and what happens was the following:
Please look at the 2 pictures, I sent before. The text and lines are the same places, but the dummy single pixels from line 33 to 64 are now away!
Thats all.....................


Regards

Jörg

BenR
Matrix Staff
Posts: 1924
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 501 times
Been thanked: 684 times

Re: Component for Oled-Display with SSD1309

Post by BenR »

Thanks Jörg,

I've had another go for you now and hopefully that will be better.

Jorg_Guldner
Posts: 50
Joined: Wed Dec 23, 2020 9:55 am
Been thanked: 4 times

Re: Component for Oled-Display with SSD1309

Post by Jorg_Guldner »

Hello!
With the latest update you can place objects over the whole pixels, that works. Good!
But now I found several bugs of the objects:
Lines: OK
Rectangle: OK
Contrast: No function
Circle: OK
Ellipse: In x-axis every second pixel is missing
Number: OK
String: OK
Font scaler: OK

Regards
J.Güldner
Attachments
SSD1309 not working_04.png
SSD1309 not working_04.png (1.69 MiB) Viewed 7987 times

BenR
Matrix Staff
Posts: 1924
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 501 times
Been thanked: 684 times

Re: Component for Oled-Display with SSD1309

Post by BenR »

Hello,

Many thanks for letting me know.

The Ellipse problem you mentioned has always been there for all displays and is a problem with the way the maths is done to make it efficient on 8-bit devices, it's really meant for drawing circles but we have extended it for ellipses too. Because your X is 2x the Y you are seeing every other pixel missing on the X. I've had a quick look at overcoming the problem and the only easy way is to have the ellipse filled and then the problem goes away. If you need a non filled ellipse then you draw a smaller ellipse inside and make this none transparent and this would help a bit but it's still not ideal.

The contrast might not do anything on an OLED display depending on how it's been implemented.

Steve-Matrix
Matrix Staff
Posts: 1465
Joined: Sat Dec 05, 2020 10:32 am
Has thanked: 204 times
Been thanked: 347 times

Re: Component for Oled-Display with SSD1309

Post by Steve-Matrix »

If you had plenty of processing power and were not worried about drawing speed, then it's relatively simple to draw non-filled ellipses yourself (for example, using routines similar to the following). Note that these are slow and will consume more memory in your device, so the inbuild routine is usually preferable.

Code: Select all

cx = 25     //centre x
cy = 25     //centre y
rx = 20     //radius x
ry = 10     //radius y
step = 0.1  //resolution (smaller = better)

theta = 0

loop while theta <= 2*pi
  x = cx + rx * cos(theta)
  y = cy + ry * sin(theta)
  plot(x, y)
  theta = theta + step
end loop

Code: Select all

cx = 25     //centre x
cy = 25     //centre y
rx = 20     //radius x
ry = 10     //radius y
step = 0.1  //resolution (smaller = better)

theta = 0
oldx = cx + rx
oldy = cy

loop while theta <= 2*pi
  x = cx + rx * cos(theta)
  y = cy + ry * sin(theta)
  drawline(oldx, oldy, x, y)
  oldx = x
  oldy = y
  theta = theta + step
end loop
The first plots individual points, whereas the second plots a line between the old and new coordinate. Tweak the step to adjust the resolution.

You could speed these up by calculating the arc in only one quadrant and using the symmetry properties of the ellipse to deduce the coordinates in the other quadrants.

I've attached an example flowchart. It's quite fast in simulation, but I've not tested it when running on a chip.
Attachments
ellipse.fcfx
(13.11 KiB) Downloaded 588 times

Jorg_Guldner
Posts: 50
Joined: Wed Dec 23, 2020 9:55 am
Been thanked: 4 times

Re: Component for Oled-Display with SSD1309

Post by Jorg_Guldner »

Hello!
I save the attachment from the ellipse to my flowcode library, thanks.
But back to the contrast: My test program writes in a loop 0x81 and 0x55. The pic drives the signals to the display, you can see on the picture.
What happens with the values?

Contrast:
I found under google an entry from a guy who says: There are displays on the market where the step up for the display voltage is done extern on the board and have no connection to the SSD1309 chip. So it is not possibly to adjust the contrast. This may be the reason while my display is not adjustable.



Best regards
J. Güldner
Attachments
SSD1309 not working_05.png
SSD1309 not working_05.png (159.76 KiB) Viewed 7942 times

Post Reply