I2C modules

623 views
Skip to first unread message

Steve Cousins

unread,
Feb 3, 2021, 3:44:59 PM2/3/21
to retro-comp
I've been working on a range of I2C modules suitable for experimenting and developing software.

I2C chain A - w600.jpg

These can be used with any 5-volt I2C bus master, such as the I2C port on SC126 and SC137.

I hope to make I2C a well-supported way of expanding retro hardware. More details here.

Steve

Kurt Pieper

unread,
Feb 3, 2021, 3:56:18 PM2/3/21
to retro-comp
Hi Steve,

good idea.

Very good. These modules fit into my dream.
I will buy various modules.

Kurt

TonyD

unread,
Feb 4, 2021, 4:01:37 AM2/4/21
to retro-comp
Hey Steve

Like Kurt says good idea and nice looking boards. A great addition to the retro project

Tony

Terry Fox

unread,
Feb 4, 2021, 1:37:09 PM2/4/21
to retro-comp
Adding an I2C 0.96 inch OLED display might be fun as well!

Bill Shen

unread,
Feb 4, 2021, 4:24:38 PM2/4/21
to retro-comp
128x64 OLED display is I2C ready, so it is a matter of connecting the signals to the right pins; software driver is more complex, but entirely do-able.  https://www.youtube.com/watch?v=OnShBKl0Ys0

I have placed an order for 128x128 1.5" OLED display.  Eager to play with it.
https://www.ebay.com/itm/3pcs-1-5inch-I2C-OLED-Display-Module-SSD1327-Driver-Chip-Support-for-UNO/153696175425

Another I2C device is RTC such as PCF8563.  Combining RTC with OLED display and you can have a clock.  It is a long complicated way just to have a Timex, but then that's what we do!

https://www.youtube.com/watch?v=6nNLhokMJ5I 

Steve Cousins

unread,
Feb 4, 2021, 5:31:12 PM2/4/21
to retro-comp
Thanks for the words of support guys.

My next module will probably be a real-time clock using the MCP7940M chip (as this is stocked by RS here in the UK) and I've already purchased a few.

Yes, I2C lends itself to interfacing small displays. 

My current modules could be used with a backplane (see photo) but stability is rather poor with only 6 pins. Angled header pins for I/O would also be required, but these would get in the way when the modules are fitted directly together (see earlier photo). I think the current modules are best suited to experimentation and software development. The stability issue would be greatly improved if a double row male header is used, rather than the single row I currently use. Hm! Why didn't I think of that earlier!

If case mounting or backplane style modules are required I think a slightly different physical layout would be more appropriate. Early days yet and PCBs are quite easy to design and cheap to manufacture. If we can get the necessary software support in place then I can see plenty of scope for different hardware designs.

Steve

IMG_20210204_221052682.jpg

Phillip Stevens

unread,
Feb 4, 2021, 7:35:22 PM2/4/21
to retro-comp
Steve Cousins wrote:
I've been working on a range of I2C modules suitable for experimenting and developing software.

One module that you might consider adding is a Grove adaptor module between your pin-header and Grove I2C connector?

Seeed uses a 4 pin connector, optionally with a latch, on all their very extensive range of Grove I2C modules (link to UK based Cool Components).
Seeed are also "all in" on I2C. Their Grove Wiki explains where this platform, and lists their range of existing products.

Having a Grove adaptor, or even a Grove connector on your SC137 Module, adds a wide range of existing options to your I2C portfolio.
I haven't used it, but Sparkfun have also produced a connector for their I2C called Qwiic. I guess a similar story applies for their range of products.

I hope to make I2C a well-supported way of expanding retro hardware. More details here.

Sharing your love of I2C, I wrote some device code for the PCA9665, which is now available in z88dk.
Similar I2C driver support could easily be added for SC137 module and for the SC126, if similar device level (bit bang) functions were available.
As the SCZ180 is supported in z88dk, I could put the I2C device code in pretty easily.

The z88dk drivers are used to support a temperature/pressure sensor, and a small LCD screen.
But, then I sort of got distracted, and stopped at these two.

But using the Seeed Libraries, it is pretty easy to add libraries for the rest of their I2C Modules.
Seeed have a nice 1.12" OLED screen, for example.

Cheers, Phillip

Bill Shen

unread,
Feb 4, 2021, 8:49:59 PM2/4/21
to retro-comp
Because I2C uses only 2 pins at relatively low clock rate, it is easy to design a bit-bang I2C interface.  Most of my SBC have 4-pin I2C interface (SDA, SCL, GND, VCC) on 0.1" pitch.  The pin out is compatible with 128x64 OLED display, but it is also easy to interface with a simple ribbon cable.  Here are a few examples:

Zuno_with_OLED_F.jpgT68KMB_ascii_table_F.jpgZZRCC_I2C_annotatated_F.jpg

Andy Semark

unread,
Feb 5, 2021, 12:37:11 PM2/5/21
to retro-comp

Just ordered a couple of SC137, I have seen a review on  Tindie from Kurt about using under CPM, does anyone have any details on this?

Steve Cousins

unread,
Feb 13, 2021, 2:49:24 PM2/13/21
to retro-comp
Thanks Phillip

It is good news that you have some I2C support in z88dk.

SC137 can be set to the same address as the I2C port on SC126. The I/O bits are the same. The only differences are:
  • SC126 uses the other bits on the port for other things so the code should leave these bits in their default states.
  • SC126 does not have a read function on SCL so clock stretching is not possible.
  • SC126 drives SCL both high and low, so only one bus master can be connected (and also this prevents clock stretching).
Essentially the same code can be used for both SC127 and SC126. My example program works on both.

I also have a combined RTC and I2C bus master card for the Z50Bus. This is SC144 and again it is software compatible.

I agree adapters are a good idea.

As Bill says, bit-bang I2C is easy to implement. In my mind, it is a no-brainer to include it in a system.

I haven't had much time recently so I haven't got much further but I have tested several of the modules. I'm building an example program that performs some simple functions with each module it finds.

As soon as I'm happy with the modules I'll make the designs public. I'll also offer PCBs and probably kits as well on Tindie. I believe the community requires all these things to be both public domain and available for convenient purchasing in order to get a good following, and thus encourage support from others.

Steve

Kurt Pieper

unread,
Mar 14, 2021, 7:14:46 PM3/14/21
to retro-comp
Small exercises with SC407.
Here is the software.
i2c8574.txt please change i2c7564.z80 or .mac
The i2c routine comes from Steve's example.

z80asm i2c8574

Kurt
Bild2.jpg

Bild1.jpg
i2c8574.txt

Kurt Pieper

unread,
Mar 16, 2021, 4:01:21 PM3/16/21
to retro-comp

Here is Steve's program with the adjustment z80asm (under CPM).

Kurt
i2cdemo8.z80.txt

Interocitor Steve

unread,
May 4, 2021, 11:54:42 AM5/4/21
to retro-comp
Hello Steve,

I see you have been busy.  Good for you.  It has been a while for me, but I am still around.  Studied quaternions a bit and now need to test some free code, need a development environment, might need a Windows machine to get the best tool(s).  We shall see.  This is still an awesome group.  I thank you for your great contributions.

=Steve.

Kurt Pieper

unread,
May 10, 2021, 9:41:00 AM5/10/21
to retro-comp
Hi,

I have now been able to program Steve's modules in C thanks to Marco's information.

Marco's LCD application was adapted for my application. The SC406 module with the TC74 sensor is also programmed with C. Hang the software on it.

Fine thing, that's how I imagined it. I'm getting a little closer to my weather station.

Greetings from the Rhine

Kurt
lcdtc74.com.txt
lcdtc74.c.txt

Kurt Pieper

unread,
May 10, 2021, 9:47:41 AM5/10/21
to retro-comp
Here is another photo.
Use with the SC126.

Bild2.jpg

Kurt

Steve Cousins

unread,
May 10, 2021, 5:51:04 PM5/10/21
to retro-comp
Hi Kurt, that's a nice project. Perhaps I should produce a PCB in the same style as the other I2C modules that includes the digital I/O chip and a header for an LCD module.

Steve



Marty Yanik

unread,
May 14, 2021, 5:25:43 PM5/14/21
to retro-comp
I've been trying to duplicate Kurts experiment with the SC407. I downloaded his (And Steves) I2C8574 program and assembled it with Z80ASM without any errors. My setup is an SC137 addressed at 020H, and an SC407 addressed at 000, like Kurts photo. The program loads and waits for the 'Return' to be pressed. After that I get a quick flash of the SCL and SDA LEDs when hitting keys 1-8 and the 0 key (Nothing when the 9 key is hit). No lights appear on the SC407. If I press a switch on the SC407 its LED lights and goes out when the switch is released. I have two SC407s; one with termination resistors and one without. Both do the same thing. Any pointers to get this functional?

Thanks

Marty

Kurt Pieper

unread,
May 14, 2021, 6:29:03 PM5/14/21
to retro-comp
Hi
the I2C address SC407 = 000 should not be.
Test with scan.com the ADDR of the SC407 ..
Depending on the chip and jumper setting.
Show times the jumper setting.

I currently have SC137 = 0C (20H also works) and SC407 = 4EH.
 
scan.com = scanner i2c addr

greeting
Kurt
scan.com.txt

Kurt Pieper

unread,
May 14, 2021, 6:34:03 PM5/14/21
to retro-comp
The program scan.com is set to the ADDR of the SC137 on 020H.
Also only works with 020H.

Bildschirmfoto_2021-05-15_00-22-59.png

Kurt Pieper

unread,
May 14, 2021, 7:15:26 PM5/14/21
to retro-comp
Here is the good advice and software from Marco.
https://groups.google.com/g/retro-comp/c/m8jUuTY8u34/m/Q5WCP1xZAgAJ

Kurt

Marty Yanik

unread,
May 15, 2021, 1:15:50 PM5/15/21
to retro-comp

Thanks Kurt. I'll give the Scan.com program a try next week.

Marty
Reply all
Reply to author
Forward
0 new messages