SSD1306 I2C with Pic16f1937!

For general Flowcode discussion that does not belong in the other sections.
jgu1
Posts: 708
http://meble-kuchenne.info.pl
Joined: Thu Dec 03, 2020 8:25 pm
Location: Denmark
Has thanked: 593 times
Been thanked: 157 times

Re: SSD1306 I2C with Pic16f1937!

Post by jgu1 »

Hi Martin!

I have made a test. Save the displaymacro in a Lib. and loaded it Global. (just like with your nice Max7719) restart FC and open your test and try to put in the device, get the message not enough ram. I use the pic16f1937.
I try to start a new program and only add your display, same message.

I have meanwhile testet FC10 SSD1306 on Pic18f4550 and on an Arduino, Working.
For my sake Martin, you don't have to spend more time on it, but thank you many times for your job and have no doubts at all that you will probably make it work. ;)

If you want, I will like to help and make test for you if this can help. :)

Any way, I att. my txt file from my compiling.

Br jorgen
Attachments
ssd_test.msg.txt
(2.04 KiB) Downloaded 105 times
New.msg.txt
(2.02 KiB) Downloaded 107 times

mnfisher
Valued Contributor
Posts: 1224
Joined: Wed Dec 09, 2020 9:37 pm
Has thanked: 119 times
Been thanked: 628 times

Re: SSD1306 I2C with Pic16f1937!

Post by mnfisher »

Hmm,

That looks like the glcd_ssd1306 component buffer. Did you include the FC component as well / by mistake?

(_FCV_0cc51_gLCD_SSD1306_i2c1__DRAM0) Looks like one of the standard component buffers unless it's part of the i2c code - in which case it's over to Ben...

Martin

mnfisher
Valued Contributor
Posts: 1224
Joined: Wed Dec 09, 2020 9:37 pm
Has thanked: 119 times
Been thanked: 628 times

Re: SSD1306 I2C with Pic16f1937!

Post by mnfisher »

Can you post your code...

jgu1
Posts: 708
Joined: Thu Dec 03, 2020 8:25 pm
Location: Denmark
Has thanked: 593 times
Been thanked: 157 times

Re: SSD1306 I2C with Pic16f1937!

Post by jgu1 »

Hereby.
Attachments
ssd_test.fcfx
(13.22 KiB) Downloaded 105 times
New.fcfx
(8.21 KiB) Downloaded 105 times

mnfisher
Valued Contributor
Posts: 1224
Joined: Wed Dec 09, 2020 9:37 pm
Has thanked: 119 times
Been thanked: 628 times

Re: SSD1306 I2C with Pic16f1937!

Post by mnfisher »

I see what's wrong. It is code for the flowcode component - which I forgot to delete (in the component). It's not used but it doesn't get optimised out...

Try:
SSD1306_Min.fcpx
(4.34 KiB) Downloaded 141 times
ssd1306_min.fcfx
(31.99 KiB) Downloaded 139 times

Martin

jgu1
Posts: 708
Joined: Thu Dec 03, 2020 8:25 pm
Location: Denmark
Has thanked: 593 times
Been thanked: 157 times

Re: SSD1306 I2C with Pic16f1937!

Post by jgu1 »

Hi again Martin!

Used the new files, change my tartget to the Pic16f1937, working 4 "times "Hello world" ;)
Attachments
ssd1306_min.fcfx
(32.06 KiB) Downloaded 103 times
ssd1306_min.msg.txt
(2.79 KiB) Downloaded 105 times

mnfisher
Valued Contributor
Posts: 1224
Joined: Wed Dec 09, 2020 9:37 pm
Has thanked: 119 times
Been thanked: 628 times

Re: SSD1306 I2C with Pic16f1937!

Post by mnfisher »

Excellent ! Looking good on the memory front - still a good bit of flsah left (and could pare down the character set for more if needed).

Can you use it as a component too?

Martin

jgu1
Posts: 708
Joined: Thu Dec 03, 2020 8:25 pm
Location: Denmark
Has thanked: 593 times
Been thanked: 157 times

Re: SSD1306 I2C with Pic16f1937!

Post by jgu1 »

Hi Martin!

Yes certanly, very velcome, but a component like in FC10 or like your Max7219, so I am able to set Font, size, print String and number, ect. like in FC component please ;)

Thank´s jorgen

mnfisher
Valued Contributor
Posts: 1224
Joined: Wed Dec 09, 2020 9:37 pm
Has thanked: 119 times
Been thanked: 628 times

Re: SSD1306 I2C with Pic16f1937!

Post by mnfisher »

Great it's working.

The aim was 'small' - if you need different fonts etc, then it's back to the FC component. There is PrintNumber - and you could add other 'utility' routines easily - convert to string and then PrintString.

Different size text is much harder - it relies on the memory layout of the display where one byte sent sets 8 pixels (8 rows) - This is why text is limited to 4 rows (should this be 0..3 (or 0..7 for 64 pixel) ?) One idea is to read data back from the display rather than using a buffer on the MCU. It should be possible - but performance might be too slow to be useful.

Changing font is fairly easy - charSet is just a lookup table of the font data (dates all the way back to the MAX7219 - it is the same font :-) for a consistent look and feel!) So as long as the font is 8 pixels 'high' (it can be a different width) it would be possible to do (So use a 5 pixel wide fornt to save space?)

Apart from the 9 byte buffer - it's fairly light on RAM usage (function calls use some of course) - so it should run on MCUs with minimal RAM.

Martin

chipfryer27
Valued Contributor
Posts: 1320
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 321 times
Been thanked: 462 times

Re: SSD1306 I2C with Pic16f1937!

Post by chipfryer27 »

Hi Martin

Thanks for sharing all of the above. Whilst I have used the display on a 39' it wasn't for anything other than displaying a value on a basic chart, probably coz the chip was already in my programmer when I tested something or other.

I think your component will come in very handy for those that need to use a device with limited resources. Not everything needs multicolour "wide-screen" touch-sensitive capabilities :)

Regards

Post Reply