Page 1 of 11

i2c2oled (little brother of tty2oled)

Posted: Tue Apr 20, 2021 8:49 pm
by venice
Just for fun 8-) (Part 2)…

This MiSTer-Bash-Script-Add-On uses the i2c Interface on the DE10-Nano’s LTC Connector to drive a small i2c based SSD1306 OLED Display with 128x64 Pixel showing (currently only) Pictures or (new) Text based on the running core.
Antonio Villena builds IOBoards with such small builtin OLED Displays and asked for support, so here we are :D

Donating!
If you enjoy the project and if you like to donate to me send me a postcard with an nice picture of your City/Area/Location/Country/Continent/Planet.
Drop me an PM with the Subject "Cardware" and I will answer.

!! WARNING !!
This Add-On uses the MiSTer's i2c Bus. Wrong usage can confuse the MiSTer's i2c Bus or worse!
You need to make sure you use the right i2c Bus as the MiSTer has more than one.

Go to https://github.com/venice1200/MiSTer_i2c2oled for details.

SSD1306_MiSTer_small.jpg
SSD1306_C64_small.jpg

There is space for a lot improvement and it's not fast as tty2oled, but is really cool to see what you can do with a bit of bash scripting, 4 wires and a small Display.

Ideas:
Check for an connected i2c Display on start Done
Create an C/C++ Application for much more speed

More PIX here https://github.com/ingloriond/MiSter_I2 ... c2oled_pix

Re: i2c2oled (little brother of tty2oled)

Posted: Wed Apr 21, 2021 12:53 am
by MiSTer_Kirk
That looks a cool little thing.
Can you animate the images ?
Was thinking something like an animated 1541 drive would be superb, or for Atari - the 1050, or even a 1010 cassette drive.

Re: i2c2oled (little brother of tty2oled)

Posted: Wed Apr 21, 2021 6:10 am
by venice
MiSTer_Kirk wrote: Wed Apr 21, 2021 12:53 am ..
Can you animate the images ?
..
I don't think the Bash Script is fast enough but an (C/C++) Program should support that.
Like I wrote, there is space for improvement.

Re: i2c2oled (little brother of tty2oled)

Posted: Wed Apr 21, 2021 9:29 am
by RealLarry
MiSTer_Kirk wrote: Wed Apr 21, 2021 12:53 am That looks a cool little thing.
Can you animate the images ?
Was thinking something like an animated 1541 drive would be superb, or for Atari - the 1050, or even a 1010 cassette drive.
We, Venice and myself, are already working on the next level of core display. There, and with the actual tty2oled devices (ESP8266, ESP32), it would be possible in principle but requires more "AI logic" to display animations. And people who are willing to create these animations.
Noted as feature request :)

Re: i2c2oled (little brother of tty2oled)

Posted: Wed Apr 21, 2021 9:33 am
by RealLarry
venice wrote: Wed Apr 21, 2021 6:10 am
MiSTer_Kirk wrote: Wed Apr 21, 2021 12:53 am ..
Can you animate the images ?
..
I don't think the Bash Script is fast enough but an (C/C++) Program should support that.
Like I wrote, there is space for improvement.
Bash's speed would be sufficient for sure. But display's speed? Dunno. The easiest way for an animation would be a small set of pictures, sent one after one. We'll see...

Re: i2c2oled (little brother of tty2oled)

Posted: Wed Apr 21, 2021 10:26 am
by RealLarry
Well, animation is possible:


Re: i2c2oled (little brother of tty2oled)

Posted: Wed Apr 21, 2021 11:00 am
by MiSTer_Kirk
RealLarry wrote: Wed Apr 21, 2021 9:29 am
MiSTer_Kirk wrote: Wed Apr 21, 2021 12:53 am That looks a cool little thing.
Can you animate the images ?
Was thinking something like an animated 1541 drive would be superb, or for Atari - the 1050, or even a 1010 cassette drive.
We, Venice and myself, are already working on the next level of core display. There, and with the actual tty2oled devices (ESP8266, ESP32), it would be possible in principle but requires more "AI logic" to display animations. And people who are willing to create these animations.
Noted as feature request :)
Yeah, thanks for the reply. I wasn't thinking about complex animation, more a static image of a 1541, but with flashing lights for loading games.

Re: i2c2oled (little brother of tty2oled)

Posted: Wed Apr 21, 2021 11:11 am
by RascalUK
I've got a couple of screens lying around at home. Any chance of a wiring diagram when you get a min?

Re: i2c2oled (little brother of tty2oled)

Posted: Wed Apr 21, 2021 11:40 am
by RealLarry
MiSTer_Kirk wrote: Wed Apr 21, 2021 11:00 am
RealLarry wrote: Wed Apr 21, 2021 9:29 am
MiSTer_Kirk wrote: Wed Apr 21, 2021 12:53 am That looks a cool little thing.
Can you animate the images ?
Was thinking something like an animated 1541 drive would be superb, or for Atari - the 1050, or even a 1010 cassette drive.
We, Venice and myself, are already working on the next level of core display. There, and with the actual tty2oled devices (ESP8266, ESP32), it would be possible in principle but requires more "AI logic" to display animations. And people who are willing to create these animations.
Noted as feature request :)
Yeah, thanks for the reply. I wasn't thinking about complex animation, more a static image of a 1541, but with flashing lights for loading games.
EDITED: I know. This was only an example that animation is possible. I'm with you that a very small animation of a core's splash screen or something like this would be sufficient. But this would mean that Bash/Daemon has to permanently send data to the device. Still doable.

EDIT
Rest of my post deleted. Wrong thread. Mea culpa.

Re: i2c2oled (little brother of tty2oled)

Posted: Wed Apr 21, 2021 11:44 am
by RealLarry
RascalUK wrote: Wed Apr 21, 2021 11:11 am I've got a couple of screens lying around at home. Any chance of a wiring diagram when you get a min?
What type of screens (type of chip that the display is driven by)? We're experimenting with ILI9341 based display for now...
EDIT: Damn! We're at the i2c2oled thread here. Forget about my post.

Re: i2c2oled (little brother of tty2oled)

Posted: Wed Apr 21, 2021 11:58 am
by RascalUK
Lol ;-)

Re: i2c2oled (little brother of tty2oled)

Posted: Wed Apr 21, 2021 12:24 pm
by RealLarry
RascalUK wrote: Wed Apr 21, 2021 11:58 amLol ;-)
Yes, bad day today :)
But have a look at https://file.pcbway.com/websponsor/18/0 ... 99_Top.png and
https://github.com/MiSTer-devel/Hardwar ... tc_1.3.pdf for the i2c connection.

Re: i2c2oled (little brother of tty2oled)

Posted: Wed Apr 21, 2021 2:17 pm
by MiSTer_Kirk
RealLarry wrote: Wed Apr 21, 2021 11:40 am EDITED: I know. This was only an example that animation is possible. I'm with you that a very small animation of a core's splash screen or something like this would be sufficient. But this would mean that Bash/Daemon has to permanently send data to the device. Still doable.
Ok, thanks for the explanation.

Re: i2c2oled (little brother of tty2oled)

Posted: Thu Apr 22, 2021 2:37 pm
by venice
If you have a two color display you can do this 8-)
SSD1306_MiSTer_small_v2.jpg

Re: i2c2oled (little brother of tty2oled)

Posted: Thu Apr 22, 2021 2:42 pm
by venice
RascalUK wrote: Wed Apr 21, 2021 11:11 am I've got a couple of screens lying around at home. Any chance of a wiring diagram when you get a min?
The i2c/SPI Header of the official RTC1.3 has no Power pin, only Data and GND :shock: if I am right.
So you have to get 3.3v power from another pin on the board.

I was sponsored by Antonio Villena with (t)his RTC which has solder Pins for i2c and 3.3v power. But without some Pin-Text on the Board :|
I have attached the drawing he sent to me.
https://www.antoniovillena.es/store/pro ... h-battery/
rtc_antonio2.png

//Edit
First Fixes available on Github.

Re: i2c2oled (little brother of tty2oled)

Posted: Sat Apr 24, 2021 4:19 pm
by venice
Github User MickGyver created an Tool for conversion of XPM to PIX Files.
See https://github.com/venice1200/MiSTer_i2 ... n/XPMToPIX

The tool works well and should run wherever .NET Core Framework 3.1+ is installed. Actually only testet on Windows.
I have tested it by dropping an folder with XPM's onto the "XPMtoPIX.exe" file, Voila 8-)

From the XPMToPIX.txt:
Converts all XPM images in a folder to PIX used by MiSTer i2c2oled.

Usage:
XPMToPIX [folder]

If you run XPMToPIX without the folder argument, then XPMToPIX will convert
all XPM files in the folder where XPMToPIX was run from.

Re: i2c2oled (little brother of tty2oled)

Posted: Mon Apr 26, 2021 9:40 am
by venice
I added some Picture templates to Github: https://github.com/venice1200/MiSTer_i2 ... /templates
i2c2oled_Header_MiSTer_FPGA.png
i2c2oled_Header_FPGA.png

Re: i2c2oled (little brother of tty2oled)

Posted: Wed Apr 28, 2021 12:16 pm
by venice
Update
The actual version of i2c2oled got Basic Support for Text.

I embedded an 8x8 Pixel Font from https://github.com/greiman/SSD1306Ascii (MIT License) into the Script.

Code: Select all

font=(
"0x00" "0x00" "0x00" "0x00" "0x00" "0x00" "0x00" "0x00"  # Space
"0x00" "0x00" "0x00" "0x00" "0x5F" "0x00" "0x00" "0x00"  # !
...
"0x00" "0x42" "0x42" "0x76" "0x08" "0x08" "0x00" "0x00"  # }
"0x00" "0x00" "0x04" "0x02" "0x04" "0x02" "0x00" "0x00"  # ~
)

The usage...

Code: Select all

set_cursor 16 2           # Set Cursor at Page (Row) 2 to the 16th Pixel (Column)
showtext "MiSTer FPGA"    # Some Text for the Display

sleep 1.0                 # Wait a moment

set_cursor 16 4           # Set Cursor at Page (Row) 4 to the 16th Pixel (Column)
showtext "by Sorgelig"    # Some Text for the Display
...and the result.
TextFont_small.jpg

Update 2
If no PIX is available the Corename is now shown instead of the "No Picture available"-PIX.
You need to add "misterheader.pix" (see Github) to your system.
Corename_with_Header_small.jpg

Re: i2c2oled (little brother of tty2oled)

Posted: Thu Apr 29, 2021 1:55 pm
by venice
Press Play on Tape >>>
MiSTer_Kirk wrote: Wed Apr 21, 2021 12:53 am ...
Was thinking something like an animated 1541 drive would be superb, or for Atari - the 1050, or even a 1010 cassette drive.
Font based Animation Demo


It's a mix of an Background PIX and two "Icons"

//Edit
Update uploaded to Github.
The tiny Data(s)sette-Animation runs before an Corename-PIX is loaded.
You need the "pressplay.pix" (see Github) on your system.

Re: i2c2oled (little brother of tty2oled)

Posted: Thu Apr 29, 2021 5:18 pm
by MiSTer_Kirk
Thats ace. I need one of these now.

Re: i2c2oled (little brother of tty2oled)

Posted: Fri Apr 30, 2021 2:00 pm
by venice
Update

10-Step "Loading..." Animation added.
You need the "loading.pix" (see Github) on your system.

/Edit
Pictures deleted, see next post.

Re: i2c2oled (little brother of tty2oled)

Posted: Sat May 01, 2021 8:42 am
by venice

Update

"loading" Animation and... :mrgreen:

If the embedded Video isn't working use this link https://i.imgur.com/9WI8i4P

You need the "ncc1701.pix" (see Github) on your System.
Just a test to see if pixel scrolling is working.

//Edit
I uploaded the PIX Slideshow-Viewer "i2c2oled_slideshow.sh".
Add it to /media/fat/Scripts, make it executable and run it from CLI, SSH or from the Script Menu.
You will see if your PIX are fine or producing calculation errors :mrgreen: because of too much/less Pixels.


Re: i2c2oled (little brother of tty2oled)

Posted: Thu May 13, 2021 7:20 pm
by lui sito
any scheme to connect in for officcial addons , (non villena´s style) ?

Re: i2c2oled (little brother of tty2oled)

Posted: Fri May 14, 2021 6:35 am
by venice
lui sito wrote: Thu May 13, 2021 7:20 pm any scheme to connect in for officcial addons , (non villena´s style) ?
Do you mean the official RTC Board?
If Yes which version?

Re: i2c2oled (little brother of tty2oled)

Posted: Fri May 14, 2021 1:38 pm
by lui sito
venice wrote: Fri May 14, 2021 6:35 am
lui sito wrote: Thu May 13, 2021 7:20 pm any scheme to connect in for officcial addons , (non villena´s style) ?
Do you mean the official RTC Board?
If Yes which version?
hi venice
thanks for answering i have rtc v1.3. :ugeek:

Re: i2c2oled (little brother of tty2oled)

Posted: Fri May 14, 2021 1:42 pm
by antoniovillena
The official RTC board has no VCC pin. But you can extract from the connector by soldering a wire. The 4 wires you need are: VCC, GND, SDA and SCL

Re: i2c2oled (little brother of tty2oled)

Posted: Fri May 14, 2021 3:06 pm
by venice
Does this help?
RTC.png

Re: i2c2oled (little brother of tty2oled)

Posted: Fri May 14, 2021 9:31 pm
by lui sito
working

photo-2021-05-14-23-14-48.jpg

thank you guys!

Re: i2c2oled (little brother of tty2oled)

Posted: Sat May 15, 2021 9:17 am
by venice
lui sito wrote: Fri May 14, 2021 9:31 pm working
Great :)
If you create Pictures make them available please.

Re: i2c2oled (little brother of tty2oled)

Posted: Sat May 15, 2021 4:41 pm
by venice
Update
The i2c2oled Script got an I2C Device ID detection.
If the OLED-Device is not found at the given ID the Script ends with Exit Code 1.