Page 3 of 5
Re: SSD1306 I2C with Pic16f1937!
Posted: Fri Sep 06, 2024 1:25 pm
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
Re: SSD1306 I2C with Pic16f1937!
Posted: Fri Sep 06, 2024 2:06 pm
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
Re: SSD1306 I2C with Pic16f1937!
Posted: Fri Sep 06, 2024 2:57 pm
by mnfisher
Can you post your code...
Re: SSD1306 I2C with Pic16f1937!
Posted: Fri Sep 06, 2024 4:14 pm
by jgu1
Hereby.
Re: SSD1306 I2C with Pic16f1937!
Posted: Fri Sep 06, 2024 8:32 pm
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:
Martin
Re: SSD1306 I2C with Pic16f1937!
Posted: Sat Sep 07, 2024 8:18 am
by jgu1
Hi again Martin!
Used the new files, change my tartget to the Pic16f1937, working 4 "times "Hello world"

Re: SSD1306 I2C with Pic16f1937!
Posted: Sat Sep 07, 2024 8:28 am
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
Re: SSD1306 I2C with Pic16f1937!
Posted: Sat Sep 07, 2024 9:29 am
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
Re: SSD1306 I2C with Pic16f1937!
Posted: Sat Sep 07, 2024 9:51 am
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
Re: SSD1306 I2C with Pic16f1937!
Posted: Sat Sep 07, 2024 10:54 am
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