AT TINY 85 i2c non compatibile display SSD 1306

Any bugs you encounter with Flowcode should be discussed here.
Post Reply
solozerouno
Posts: 114
http://meble-kuchenne.info.pl
Joined: Tue Dec 08, 2020 4:36 am
Has thanked: 2 times
Been thanked: 2 times

AT TINY 85 i2c non compatibile display SSD 1306

Post by solozerouno »

Non ho provato con fc8 perchè non è un pacchetto che ho;
ho provato pero' con la versione prova 30 giorni DI FLC9 con compilazione AT TINY 85 ed ho provato a fare un piccolo flow con una scritta in posizione 10,10 ; in debug tutto ok ma quando compilo in hex e carico il tutto con un programmatore autocostruito con arduino che fa da programmatore:
se faccio lampeggiare su scheda digispark il led di PB0 tutto ok

ma se uso l' I2C per scrivere la scritta vengono fuori dei pixel sparsi qui e li....


compilo i hex FLC 9 poi con AVRDUDESS 2.1 con impostazioni::
programmer: arduino
mcu: tiny85
preset: arduino as isp
flash: programma generato da flowcode 9
com: porta in cui è visto arduino da AVRDUDESS

mnfisher
Valued Contributor
Posts: 981
Joined: Wed Dec 09, 2020 9:37 pm
Has thanked: 105 times
Been thanked: 516 times

Re: AT TINY 85 i2c not compatible display SSD 1306

Post by mnfisher »

Sorry - reply in English...

The attiny85 won't work with SSD1306 because there is insufficient RAM. Define the height as 16 (rather than 32 or 64) - and it can work ( just uses middle rows of display)

Martin

mnfisher
Valued Contributor
Posts: 981
Joined: Wed Dec 09, 2020 9:37 pm
Has thanked: 105 times
Been thanked: 516 times

Re: AT TINY 85 i2c non compatibile display SSD 1306

Post by mnfisher »

Something is wrong here..

I've just tested a display with ds3231 on an attiny85 - and it doesn't work (crashes in the display initialise - probably in Clear)
This looks like it is a memory issue - my code compiled to 8100 bytes (eek).

Smallest possible test - Initialise and a single Print - works. However, 7290 bytes! So not much space left for any other code?
(Note in both cases I set the display height to 16 - so RAM issues aren't the cause.) Optimisation set to -Os (optimised for size) - otherwise it won't fit in the 8k at all :-(

Martin

mnfisher
Valued Contributor
Posts: 981
Joined: Wed Dec 09, 2020 9:37 pm
Has thanked: 105 times
Been thanked: 516 times

Re: AT TINY 85 i2c non compatibile display SSD 1306

Post by mnfisher »

A bit more fiddling with this. I couldn't find the post in the old forums - where this probably belongs.

I had a play - and converted the SSD1306_i2c component to use a single buffer - instead of 8. This gave smaller code (my 'benchmark' is 3986 bytes compared to 4488 bytes using the component) - both gave the same display output - which on my display draws alternate lines vertically and then 'fills' the gaps - which isn't what I expected.
v9 (using the v9 component)- gives the same display (ie alternate lines) - and requires 9114 bytes (new font handling ?)

In v8 the changes give a 8% speed increase. v9 is slightly faster :) (Better i2c code??)

The v8 code won't compile in v9 unfortunately ReadAsciiLUT has gone from GLCD_Base :( - so I output result to UART instead of to the i2c display for comparison. Here just 3058bytes (including the UART component too!)

Just seen Ben's post - set interlaced to yes to get rid of the stripiness :P
speed.fcfx
(143.89 KiB) Downloaded 153 times
speed2.fcfx
(11.54 KiB) Downloaded 158 times
speed v9.fcfx
(13.3 KiB) Downloaded 154 times

Martin

mnfisher
Valued Contributor
Posts: 981
Joined: Wed Dec 09, 2020 9:37 pm
Has thanked: 105 times
Been thanked: 516 times

Re: AT TINY 85 i2c non compatibile display SSD 1306

Post by mnfisher »

And a version with a print that works in v9..
ssd1306Tiny.fcfx
(159.85 KiB) Downloaded 164 times
It has a simple Print - no scaling (or fonts) - but makes for a much smaller code. Which should allow use on the ATTiny and other 'smaller' MCUs. Note that the RAM limits still apply so a 64x128 display won't work with 512 bytes RAM (16 x 64 uses 256bytes RAM and should....)

Strangely - I can't export this as a component (you don't have a licence to do this...). I hope component creation isn't limited to pro-users? Trying to export in v8 (after editing and testing in v9) gives the same error :(

Edit - there are errors in the settings... Clicking on 'configuration the export settings' gives the same message before opening the dialog box. I can export other components?

Martin

BenR
Matrix Staff
Posts: 1756
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 446 times
Been thanked: 606 times

Re: AT TINY 85 i2c non compatibile display SSD 1306

Post by BenR »

Hi Martin,

The project file was licensed hence you weren't able to export. I've now removed the license info from the file for you.
ssd1306Tiny.fcfx
(160.37 KiB) Downloaded 156 times
Do you want me to make an official version of the v9 component with only a single buffer. The 8 buffers are a legacy thing from back when we used the sourceboost compiler on the PIC8 targets. It didn't support arrays bigger than 256 bytes.

mnfisher
Valued Contributor
Posts: 981
Joined: Wed Dec 09, 2020 9:37 pm
Has thanked: 105 times
Been thanked: 516 times

Re: AT TINY 85 i2c non compatibile display SSD 1306

Post by mnfisher »

Thanks Ben,

The single buffer gave a bit of a speed boost - but whether it's worth an upgrade to the component?

I think it's worth having a version that will work with smaller MCUs (so without the full font support) - I just used an 8x8 font (scaling would be easy enough to add too). Does this need to be a separate version since the font support is excellent for 'meatier' MCUs..

Martin

BenR
Matrix Staff
Posts: 1756
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 446 times
Been thanked: 606 times

Re: AT TINY 85 i2c non compatibile display SSD 1306

Post by BenR »

Hi Martin,

Here's a version of the v9 component with a single buffer you can try out for size. Be interesting to see how this one fares.

Simply extract and drop the file into your "C:\ProgramData\MatrixTSL\FlowcodeV9\Components" folder to try it out.
gLCD_SSD1306_i2c.zip
(14.36 KiB) Downloaded 160 times

Post Reply