I2C for the Oric

This is the right place to discuss on how to implement hardware vsync, adding a VIA or AY chipset, puting multiple roms, or how to design a new flash expansion card.
User avatar
Dbug
Site Admin
Posts: 4444
Joined: Fri Jan 06, 2006 10:00 pm
Location: Oslo, Norway
Contact:

Re: I2C for the Oric

Post by Dbug »

Chema wrote: Sun Feb 23, 2020 5:46 pm I probably misunderstood something, but I thought this device plugged in the printer board, thus not interfering with a disc unit.
Sure, but then you can't print or use most of the joystick adapters, we are back to the "I can use this, but not that anymore" issue :D
Making it part of the cumana reborn, makes getting one mandatory, and, despite how great it is, I have a controller and a cumulus (and an Erebus).
Alternatively, maybe this "modem/wifi" device could be implemented as part of a bus amplifier (so it could replace the cumubus), with its own address decoding (that does not interfere with the Cumana, Jasmin, Speech Synthesizer, etc...) to expose directly some registers in page 3, so you don't have to go through the VIA to send or receive data?
User avatar
Badger
Pilot Officer
Posts: 84
Joined: Sat Sep 22, 2018 10:04 am
Location: Wigan, England

Re: I2C for the Oric

Post by Badger »

Chema wrote: Sun Feb 23, 2020 5:46 pm I probably misunderstood something, but I thought this device plugged in the printer board, thus not interfering with a disc unit.
As it stand tt does connect to the printer port. The expansion port is left free for anything else.

The module is essentially an arduino, so has lots of extra I/O pins that could be made available for other things, However in this configuration some software is needed on the Oric which takes up some memory.

If it were made part of a disk type unit then the software could be in Overlay Ram/Rom.

These are the modules I used https://www.amazon.co.uk/gp/product/B07M8Q38LK/.
I only bought 3 as I thought I might end up destroying at least 1 :D (all 3 still working).

I am sure that a terminal/bbs style piece of software could be written , even a web-browser or email client.
flag_uk Amateurs built the Ark, Professionals built the Titanic.
User avatar
ibisum
Wing Commander
Posts: 1646
Joined: Fri Apr 03, 2009 8:56 am
Location: Vienna, Austria
Contact:

Re: I2C for the Oric

Post by ibisum »

Oh, I completely missed its a printer-based device. Makes much more sense.

>I think these are exciting times. If back in the 80's someone had told me that one day I could load anything from anywhere with my Oric I would have laughed.

Very definitely agree with you here. I mean, we're putting Oric's on the Internet. My 13-year old head would have exploded to know this was one day going to happen, ffs...


Oric will be competing with the Amstrad M4 user experience, which I guess we will match/catch-up with soon enough. Being able to handle the machine from a web-server is a ridiculously great way to admin an 8-bit machine ..
User avatar
Chema
Game master
Posts: 3014
Joined: Tue Jan 17, 2006 10:55 am
Location: Gijón, SPAIN
Contact:

Re: I2C for the Oric

Post by Chema »

Dbug wrote: Sun Feb 23, 2020 7:36 pm
Sure, but then you can't print or use most of the joystick adapters, we are back to the "I can use this, but not that anymore" issue :D
You have a point there, Dbug. If you have a printer, making use of it while connected to the internet makes sense. Joysticks, well... only if you plan to make multiplayer games :)

However, to be pragmatic, the device as it is designed seems really simple to build (thus cheap!). The fact that it can be used with a floppy drive out of the box is an important plus. As it has been said, you could have a terminal emulator, an ftp client, some kind of transfer tools, etc. which make use of the upper RAM and could store things on disk. That would rock!

And also, something using the same method as Erebus (patching a ROM which is placed in overlay RAM), could be used to load a game from a tap stored on another computer acting as server.
Alternatively, maybe this "modem/wifi" device could be implemented as part of a bus amplifier (so it could replace the cumubus), with its own address decoding (that does not interfere with the Cumana, Jasmin, Speech Synthesizer, etc...) to expose directly some registers in page 3, so you don't have to go through the VIA to send or receive data?
Yes, all the devices using incompatible (overlapping) page 3 addresses is madness. That is why some joysticks cannot be used with Microdisc, I think. But that would need a full redesign.
Badger wrote: The module is essentially an arduino, so has lots of extra I/O pins that could be made available for other things, However in this configuration some software is needed on the Oric which takes up some memory.
If you are willing to share the schematics and any needed software, and it is, as I expect, a simple circuit, I could ask for help designing the PCB and even building a small batch.
User avatar
Badger
Pilot Officer
Posts: 84
Joined: Sat Sep 22, 2018 10:04 am
Location: Wigan, England

Re: I2C for the Oric

Post by Badger »

Chema wrote: Mon Feb 24, 2020 10:08 am
If you are willing to share the schematics and any needed software, and it is, as I expect, a simple circuit, I could ask for help designing the PCB and even building a small batch.
I am more than willing to share everthing.
At the moment everything is in its basic proof of concept form.
The code for both the Oric and ESP8266 NodeMCU is on github at https://github.com/BadgeOric/Oric-I2C

The most difficult part is preparing the NodeMCU to work with the Arduino IDE. Its not actually hard to do, just there seem to be several different methods written up on the internet as the instructions from the supplier were out of date.

What I will do is prepare one of the spare modules I have, and write down each step to produce some kind of step by step guide.

I'll also draw some kind of schematic although that is basically 2x4.7k resistors and 3 male to female dupont wires.

For the wires :-
Any of the top row of pins on the oric printer port goto one of the ground pins on the NodeMCU.
Looking from the rear of the oric, bottom row of printer port, 2nd pin from left goes to pin D2 on the NodeMCU
Oric, bottom row of printer port, 3rd pin from left goes to pin D1 on the NodeMCU

One each of the 4.7k resistors goes from 3.3v on the Nodemcu to D1 and to D2.

Once the nodemcu is setup doe use with the arduino ide the "socket_server3.ino" file creates a basic bridge between wifi and oric.

The main file for the oric is the generici2c.s file. This is the assembly code that communicates with the nodemcu. There is an accompanying basic file that was used for testing. If you compiled just the generici2c.s file without auto run etc then you can control the send and receive with modifying some zero page locations. The assembly file does contain comments .

I'll write something up ove the next few days (time allowing) about preparing the Nodemcu module but for now here is a picture of one :D
nodemcu.JPG
nodemcu.JPG (117.07 KiB) Viewed 8110 times
flag_uk Amateurs built the Ark, Professionals built the Titanic.
User avatar
Badger
Pilot Officer
Posts: 84
Joined: Sat Sep 22, 2018 10:04 am
Location: Wigan, England

Re: I2C for the Oric

Post by Badger »

I was intending to do a write up of how to setup the ESP8266 module for use with the Arduino IDE but someone has done a pretty good instructable that can be found here https://www.instructables.com/id/Quick- ... duino-IDE/

All I would add is that if you don't already have the Arduino IDE then get it from here https://www.arduino.cc/en/main/software and not the Windows App Store if using windows. I had issues with the app store version.

Any problems then just post up and I'll see if I can help out.

Ian
flag_uk Amateurs built the Ark, Professionals built the Titanic.
User avatar
ibisum
Wing Commander
Posts: 1646
Joined: Fri Apr 03, 2009 8:56 am
Location: Vienna, Austria
Contact:

Re: I2C for the Oric

Post by ibisum »

Pretty soon I'm going to give this a try - but I'll use the PlatformIO IDE. Heard of it yet? Its a lot more useful than Arduino, and compatible with it also ..

https://platformio.org

I use this to do my development work on the MS3000 project ..
User avatar
Badger
Pilot Officer
Posts: 84
Joined: Sat Sep 22, 2018 10:04 am
Location: Wigan, England

Re: I2C for the Oric

Post by Badger »

ibisum wrote: Sat Feb 29, 2020 10:54 am Pretty soon I'm going to give this a try - but I'll use the PlatformIO IDE. Heard of it yet?
No, I hadnt heard of it, but looks interesting.

Will certainly give it a try.
flag_uk Amateurs built the Ark, Professionals built the Titanic.
User avatar
ibisum
Wing Commander
Posts: 1646
Joined: Fri Apr 03, 2009 8:56 am
Location: Vienna, Austria
Contact:

Re: I2C for the Oric

Post by ibisum »

Cool! Be sure to dig into the library manager .. lots of stuff in there that could make the journey to get the Oric on the Internet a little easier ..
User avatar
Badger
Pilot Officer
Posts: 84
Joined: Sat Sep 22, 2018 10:04 am
Location: Wigan, England

Re: I2C for the Oric

Post by Badger »

There are now a couple of new files on github https://github.com/BadgeOric/Oric-I2C

I2CCload.tap along with I2CCload.s (the source)
and
Socket_Client.exe

I2CCload loads high into memory ($9400) and set the "!" extension vector.
Socket_Client is a small windows app that connects to the wifi module, opens a tap file and sends it over wifi.

Usage:
Set IP address and port on Socket_Client and connect:
Select your tap file to transfer
check "send header" box
click send

On the oric
Load I2CCload.tap
type !

It should load the tap file you sent.

On the Socket_Client program there is a label that shows the start address for assembly programs. Just issue a call #xxxx to run
For basic just type run - see caveats below.

How it works and caveats.
The Socket_client application takes the original tap file and strips off the header. It uses header.exe from the OSDK to do this so you need to have OSDK installed and the path setup correctly.
It examines the file and creates a new header that the I2CCload program will use.
This new header are the values in the "poke labels" shown for info on the Socket_Client

On the oric the jump vector at $2f5 is altered so that typing ! will run the assembly routine that first gets the new header and then gets the tap data.

It only works with single part tap files at the moment and a number of basic programs fail when it comes to reading data statements.

There must be no spaces in either the file-path or tap file name.

Error trapping in the Socket_Client application is very basic so dont be too shocked if you get a few unhandled exception errors (trying to connect to an IP/Port combination that does not exist, selecting files with spaces in path or name and some others)

I used the excelent Oric_Explorer application to view the tap file information and see if a file was suitable.

I tested with 2 random commercial games (PSS Centipede and IJK PLayground 21) and both worked perfectly.

If anyone would like the vb source for the Socket_Client I'll upload that too.

Ian
flag_uk Amateurs built the Ark, Professionals built the Titanic.
User avatar
Badger
Pilot Officer
Posts: 84
Joined: Sat Sep 22, 2018 10:04 am
Location: Wigan, England

Re: I2C for the Oric

Post by Badger »

Minor update to I2CCload.tap and source.

Fixed the loading of basic programs over wifi.

The load routine now sets the variables and arrays pointers at $9c/d and $9e/f to be after the and of the basic program.

Without this the basic starts at $501 and the variables at $503 which means on first run the program will over-write itself with variable storage.

Minor update to Socket_server3.ino - no difference as its for future use when 2 way comms or saving is required (changed one of the buffers from char to byte)

Update to Socket_clent - extra error trapping (but still no spaces in file or pathnames) and can now alter the values to submit your own header (useful for hires pictures with or headerless tap files)

Files can be found at :-
https://github.com/BadgeOric/Oric-I2C

Currently also working on a wifi-gateway , which kind of works but I have no idea how to parse html onto an oric screen.
flag_uk Amateurs built the Ark, Professionals built the Titanic.
User avatar
Badger
Pilot Officer
Posts: 84
Joined: Sat Sep 22, 2018 10:04 am
Location: Wigan, England

Re: I2C for the Oric

Post by Badger »

Minor Update.

Since its been a while since I last posted. Current state of play is :-

Working on a telnet client over wifi and bbs connection.
I have the 2 way comms working over wifi between the Oric and my PC running Mystic BBS locally.

Still lots of bugs, and the Oric display gets corrupted easily by stray attributes.

Wifi module crashes when receiveing large chunks of data (watchdog timer kicks in, almost solved this)

Not decided to do the whole 80 column to 38 column display thing yet.

But it is progressing slowly.

Regards
Ian
flag_uk Amateurs built the Ark, Professionals built the Titanic.
User avatar
Dbug
Site Admin
Posts: 4444
Joined: Fri Jan 06, 2006 10:00 pm
Location: Oslo, Norway
Contact:

Re: I2C for the Oric

Post by Dbug »

Good luck, and keep us informed :)
Would be cool to be able to have an Oric BBS running on Defence Force on an actual Oric machine :D
User avatar
ibisum
Wing Commander
Posts: 1646
Joined: Fri Apr 03, 2009 8:56 am
Location: Vienna, Austria
Contact:

Re: I2C for the Oric

Post by ibisum »

I too fantasise about just what sort of BBS is going to be possible once this is working .. imagine streaming HIRES and TEXT continuously from a remote machine ..
User avatar
Badger
Pilot Officer
Posts: 84
Joined: Sat Sep 22, 2018 10:04 am
Location: Wigan, England

Re: I2C for the Oric

Post by Badger »

At the moment a full page of text takes about a second to transfer and Hires about 4 seconds.

It will speed up a little once I get the timings squeezed, at the moment I'm concentrating on accuracy, but I doubt hires streaming would be possible other than as a picture viewer.
flag_uk Amateurs built the Ark, Professionals built the Titanic.
Post Reply