i2c2oled (little brother of tty2oled)

Showcase builds, discuss cases, embedding MiSTer into existing computer cases.
User avatar
venice
Top Contributor
Posts: 788
Joined: Tue Jun 16, 2020 9:29 am
Location: Germany
Has thanked: 278 times
Been thanked: 278 times

i2c2oled (little brother of tty2oled)

Unread post 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
You do not have the required permissions to view the files attached to this post.

My MiSTer Add-On-Projects tty2oled, i2c2oled, SNAC2IEC
You can donate by sending a Postcard (Cardwarez) to me.

MiSTer_Kirk
Posts: 210
Joined: Thu Feb 04, 2021 11:42 pm
Has thanked: 18 times
Been thanked: 46 times

Re: i2c2oled (little brother of tty2oled)

Unread post 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.
User avatar
venice
Top Contributor
Posts: 788
Joined: Tue Jun 16, 2020 9:29 am
Location: Germany
Has thanked: 278 times
Been thanked: 278 times

Re: i2c2oled (little brother of tty2oled)

Unread post 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.

My MiSTer Add-On-Projects tty2oled, i2c2oled, SNAC2IEC
You can donate by sending a Postcard (Cardwarez) to me.

User avatar
RealLarry
Top Contributor
Posts: 883
Joined: Mon May 25, 2020 4:04 am
Location: San Junipero/DE/Earth
Has thanked: 120 times
Been thanked: 386 times

Re: i2c2oled (little brother of tty2oled)

Unread post 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 :)
Contributor of tty2oled, author of tty2tft, tty2rpi and update_tty2xxx
User avatar
RealLarry
Top Contributor
Posts: 883
Joined: Mon May 25, 2020 4:04 am
Location: San Junipero/DE/Earth
Has thanked: 120 times
Been thanked: 386 times

Re: i2c2oled (little brother of tty2oled)

Unread post 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...
Contributor of tty2oled, author of tty2tft, tty2rpi and update_tty2xxx
User avatar
RealLarry
Top Contributor
Posts: 883
Joined: Mon May 25, 2020 4:04 am
Location: San Junipero/DE/Earth
Has thanked: 120 times
Been thanked: 386 times

Re: i2c2oled (little brother of tty2oled)

Unread post by RealLarry »

Well, animation is possible:

Contributor of tty2oled, author of tty2tft, tty2rpi and update_tty2xxx
MiSTer_Kirk
Posts: 210
Joined: Thu Feb 04, 2021 11:42 pm
Has thanked: 18 times
Been thanked: 46 times

Re: i2c2oled (little brother of tty2oled)

Unread post 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.
RascalUK
Posts: 156
Joined: Mon Jun 08, 2020 2:02 pm
Location: Manchester, UK
Has thanked: 72 times
Been thanked: 23 times
Contact:

Re: i2c2oled (little brother of tty2oled)

Unread post by RascalUK »

I've got a couple of screens lying around at home. Any chance of a wiring diagram when you get a min?
User avatar
RealLarry
Top Contributor
Posts: 883
Joined: Mon May 25, 2020 4:04 am
Location: San Junipero/DE/Earth
Has thanked: 120 times
Been thanked: 386 times

Re: i2c2oled (little brother of tty2oled)

Unread post 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.
Contributor of tty2oled, author of tty2tft, tty2rpi and update_tty2xxx
User avatar
RealLarry
Top Contributor
Posts: 883
Joined: Mon May 25, 2020 4:04 am
Location: San Junipero/DE/Earth
Has thanked: 120 times
Been thanked: 386 times

Re: i2c2oled (little brother of tty2oled)

Unread post 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.
Contributor of tty2oled, author of tty2tft, tty2rpi and update_tty2xxx
RascalUK
Posts: 156
Joined: Mon Jun 08, 2020 2:02 pm
Location: Manchester, UK
Has thanked: 72 times
Been thanked: 23 times
Contact:

Re: i2c2oled (little brother of tty2oled)

Unread post by RascalUK »

Lol ;-)
User avatar
RealLarry
Top Contributor
Posts: 883
Joined: Mon May 25, 2020 4:04 am
Location: San Junipero/DE/Earth
Has thanked: 120 times
Been thanked: 386 times

Re: i2c2oled (little brother of tty2oled)

Unread post 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.
Contributor of tty2oled, author of tty2tft, tty2rpi and update_tty2xxx
MiSTer_Kirk
Posts: 210
Joined: Thu Feb 04, 2021 11:42 pm
Has thanked: 18 times
Been thanked: 46 times

Re: i2c2oled (little brother of tty2oled)

Unread post 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.
User avatar
venice
Top Contributor
Posts: 788
Joined: Tue Jun 16, 2020 9:29 am
Location: Germany
Has thanked: 278 times
Been thanked: 278 times

Re: i2c2oled (little brother of tty2oled)

Unread post by venice »

If you have a two color display you can do this 8-)
SSD1306_MiSTer_small_v2.jpg
You do not have the required permissions to view the files attached to this post.

My MiSTer Add-On-Projects tty2oled, i2c2oled, SNAC2IEC
You can donate by sending a Postcard (Cardwarez) to me.

User avatar
venice
Top Contributor
Posts: 788
Joined: Tue Jun 16, 2020 9:29 am
Location: Germany
Has thanked: 278 times
Been thanked: 278 times

Re: i2c2oled (little brother of tty2oled)

Unread post 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.
You do not have the required permissions to view the files attached to this post.

My MiSTer Add-On-Projects tty2oled, i2c2oled, SNAC2IEC
You can donate by sending a Postcard (Cardwarez) to me.

User avatar
venice
Top Contributor
Posts: 788
Joined: Tue Jun 16, 2020 9:29 am
Location: Germany
Has thanked: 278 times
Been thanked: 278 times

Re: i2c2oled (little brother of tty2oled)

Unread post 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.

My MiSTer Add-On-Projects tty2oled, i2c2oled, SNAC2IEC
You can donate by sending a Postcard (Cardwarez) to me.

User avatar
venice
Top Contributor
Posts: 788
Joined: Tue Jun 16, 2020 9:29 am
Location: Germany
Has thanked: 278 times
Been thanked: 278 times

Re: i2c2oled (little brother of tty2oled)

Unread post 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
You do not have the required permissions to view the files attached to this post.

My MiSTer Add-On-Projects tty2oled, i2c2oled, SNAC2IEC
You can donate by sending a Postcard (Cardwarez) to me.

User avatar
venice
Top Contributor
Posts: 788
Joined: Tue Jun 16, 2020 9:29 am
Location: Germany
Has thanked: 278 times
Been thanked: 278 times

Re: i2c2oled (little brother of tty2oled)

Unread post 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
You do not have the required permissions to view the files attached to this post.

My MiSTer Add-On-Projects tty2oled, i2c2oled, SNAC2IEC
You can donate by sending a Postcard (Cardwarez) to me.

User avatar
venice
Top Contributor
Posts: 788
Joined: Tue Jun 16, 2020 9:29 am
Location: Germany
Has thanked: 278 times
Been thanked: 278 times

Re: i2c2oled (little brother of tty2oled)

Unread post 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.

My MiSTer Add-On-Projects tty2oled, i2c2oled, SNAC2IEC
You can donate by sending a Postcard (Cardwarez) to me.

MiSTer_Kirk
Posts: 210
Joined: Thu Feb 04, 2021 11:42 pm
Has thanked: 18 times
Been thanked: 46 times

Re: i2c2oled (little brother of tty2oled)

Unread post by MiSTer_Kirk »

Thats ace. I need one of these now.
User avatar
venice
Top Contributor
Posts: 788
Joined: Tue Jun 16, 2020 9:29 am
Location: Germany
Has thanked: 278 times
Been thanked: 278 times

Re: i2c2oled (little brother of tty2oled)

Unread post by venice »

Update

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

/Edit
Pictures deleted, see next post.

My MiSTer Add-On-Projects tty2oled, i2c2oled, SNAC2IEC
You can donate by sending a Postcard (Cardwarez) to me.

User avatar
venice
Top Contributor
Posts: 788
Joined: Tue Jun 16, 2020 9:29 am
Location: Germany
Has thanked: 278 times
Been thanked: 278 times

Re: i2c2oled (little brother of tty2oled)

Unread post 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.

My MiSTer Add-On-Projects tty2oled, i2c2oled, SNAC2IEC
You can donate by sending a Postcard (Cardwarez) to me.

lui sito
Posts: 8
Joined: Thu May 13, 2021 7:19 pm

Re: i2c2oled (little brother of tty2oled)

Unread post by lui sito »

any scheme to connect in for officcial addons , (non villena´s style) ?
User avatar
venice
Top Contributor
Posts: 788
Joined: Tue Jun 16, 2020 9:29 am
Location: Germany
Has thanked: 278 times
Been thanked: 278 times

Re: i2c2oled (little brother of tty2oled)

Unread post 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?

My MiSTer Add-On-Projects tty2oled, i2c2oled, SNAC2IEC
You can donate by sending a Postcard (Cardwarez) to me.

lui sito
Posts: 8
Joined: Thu May 13, 2021 7:19 pm

Re: i2c2oled (little brother of tty2oled)

Unread post 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:
antoniovillena
Posts: 140
Joined: Sun May 24, 2020 8:11 pm
Has thanked: 2 times
Been thanked: 49 times

Re: i2c2oled (little brother of tty2oled)

Unread post 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
User avatar
venice
Top Contributor
Posts: 788
Joined: Tue Jun 16, 2020 9:29 am
Location: Germany
Has thanked: 278 times
Been thanked: 278 times

Re: i2c2oled (little brother of tty2oled)

Unread post by venice »

Does this help?
RTC.png
You do not have the required permissions to view the files attached to this post.

My MiSTer Add-On-Projects tty2oled, i2c2oled, SNAC2IEC
You can donate by sending a Postcard (Cardwarez) to me.

lui sito
Posts: 8
Joined: Thu May 13, 2021 7:19 pm

Re: i2c2oled (little brother of tty2oled)

Unread post by lui sito »

working

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

thank you guys!
You do not have the required permissions to view the files attached to this post.
User avatar
venice
Top Contributor
Posts: 788
Joined: Tue Jun 16, 2020 9:29 am
Location: Germany
Has thanked: 278 times
Been thanked: 278 times

Re: i2c2oled (little brother of tty2oled)

Unread post by venice »

lui sito wrote: Fri May 14, 2021 9:31 pm working
Great :)
If you create Pictures make them available please.

My MiSTer Add-On-Projects tty2oled, i2c2oled, SNAC2IEC
You can donate by sending a Postcard (Cardwarez) to me.

User avatar
venice
Top Contributor
Posts: 788
Joined: Tue Jun 16, 2020 9:29 am
Location: Germany
Has thanked: 278 times
Been thanked: 278 times

Re: i2c2oled (little brother of tty2oled)

Unread post 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.

My MiSTer Add-On-Projects tty2oled, i2c2oled, SNAC2IEC
You can donate by sending a Postcard (Cardwarez) to me.

Post Reply