Atmos with a Slice of Raspberry Pi

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.
Post Reply
User avatar
Equinoxe
2nd Star Corporal
Posts: 24
Joined: Thu Sep 06, 2018 1:18 am
Location: Saskatchewan, Canada

Atmos with a Slice of Raspberry Pi

Post by Equinoxe » Sat May 25, 2019 7:25 am

Hopefully this project is of interest to some folks here - I'm planning on embedding a Raspberry Pi zero within a functioning Oric Atmos with the idea of being able to switch between the two as needed (ideally by using a hardware switch it would either boot the Atmos or the Pi (running Linux) with just the keyboard being a truly shared component. The main benefit of doing this (for me anyways) is being able to run any Oric emulator as needed with full support of Wifi, Bluetooth, HDMI and USB (and maybe the Funct key can even be trapped to be useful for console switching :))

For the keyboard I've found a possible solution here https://github.com/LeifBloomquist/OricKeyboardReader which uses a Teensy (Arduino clone) to convert the Atmos keyboard to USB. Assuming this works then I just connect it to the Pi assuming I can find room for both.

I'm still at a very elementary stage in my understanding of electronics and would welcome anyone's thoughts on the following:

- Can I/Should I pull 5V for the Pi directly from the Oric's regulator (e.g. cut the traces, add a SPDT switch so only one is powered which would allow a common PSU to be used (can they both share a common ground in this case?). The main benefit being complete assurance that both can't be powered at the same time. (the Pi apparently draws around 140mA with LED enabled)

- Is the Teensy USB route the most optimal route to make the keyboard useful? I know the Pi has a useful set of GPIO pins but I wouldn't know where to start in terms of directly attaching the keyboard and building a driver and I can't seem to find any similar projects that are built this way.

- What suggestions does anyone have for making sure the keyboard is 'happy' with its new companion from an electrical point of view? i.e. can I simply make a 'Y' 14 pin cable and assume it should work as the Oric will be powered down when the Teensy is on or do I need to isolate the signals with diodes etc. for the Oric and Teensy?

- Any suggestions for where to cleanly present the HDMI and USB ports from the Pi? I'm thinking of removing the guts of the modulator and using the hole left behind when the RCA port is removed which would leave the Oric as close to 'stock' as possible.

- Does anyone know if the Pi can easily present the same RGB signal as the Oric which might allow the same RGB port to be used via SCART?

- Has anyone already tried this project or similar with advice to share from their experience?

Thanks in advance for taking the time to read the long post and possibly offer some thoughts on this!

User avatar
mikeb
Pilot Officer
Posts: 97
Joined: Wed Sep 05, 2018 8:03 pm
Location: West Midlands, UK
Contact:

Re: Atmos with a Slice of Raspberry Pi

Post by mikeb » Sat May 25, 2019 6:26 pm

Equinoxe wrote:
Sat May 25, 2019 7:25 am
Can I/Should I pull 5V for the Pi directly from the Oric's regulator
I would say no -- a fully working PI may peak higher than that 140ma, and then you've got your USB peripherals etc. which need power. If the power sags, the PI will start to misbehave, if you're lucky you'll get a "rainbow patch" on the screen to tell you it's marginal. If not, you'll just get a complete flake out/reset :)

The regulator in Oric is a 1A device, and with the Oric powered, there's nominally 100ma left for peripherals. It is nominally 5v -- a PI really needs more like 5.2v sending at it to make sure you have 5v *on* the board.

Edit to add: Actual measured currents :-
Raspberry PI B2 (bare board): Off = 66mA, Idling = 206mA, Low usage = 300mA, Full 4 core hammering = 420ma ...

One of the number one problems with PIs misbehaving, corrupting SD cards is caused by people skimping on the power, and thinking they'll get away with it. Underrated adapters (mis-rated on label), wired with cheap high resistance Steel/Aluminium wires) come into this category too.

Also be careful: Oric's 5v internal supply is upside down. The regulator is a negative regulator, in the "ground" line, so you will have to be very careful what you do around this -- it's a recurring worry for anything where the incoming "9v" to the Oric is anything other than the original, floating, isolated, 9V DC source. If you power it from anything that could bridge the powersupply "ground" to the PI/Oric "ground" you will end up with the regulator being bypassed, and 9V on the PI and Oric. This is bad.

If it had been a regular 7805 (positive) in the positive line, this wouldn't be a problem. There would be a clear single ground, and a 9v/5v split.

What you actually have is a single 5v/9v common line, and two different grounds, 4v apart (!)
Equinoxe wrote:
Sat May 25, 2019 7:25 am
- Does anyone know if the Pi can easily present the same RGB signal as the Oric which might allow the same RGB port to be used via SCART?
You have HDMI output, or composite video. Depending on model, you may have an RCA jack (phono), or a pair of pads on the PCB to connect your own connector/coax to. There is no RGB and sync output -- so colour composite or you'll be looking at an HDMI to SCART converter too.

User avatar
Voyageur
2nd Star Corporal
Posts: 26
Joined: Thu Oct 18, 2018 8:25 am
Location: Sydney

Re: Atmos with a Slice of Raspberry Pi

Post by Voyageur » Sun May 26, 2019 12:04 am

Last year I've made an ORICPI for the fun.
You could have a look at forums.oric.org, "OricPi" and "Clavier ORIC en USB" (in flag_fr ).
I replaced the original mother board with a small one, including a Raspberry Pi, an Arduino Leonardo and a USB Hub.
The OricPi worked with Chameleon and it was OK !

But your project is more ambitious.
Mikeb has well explained the problems of the power supply.
Consider that the PI's GPIO work at 3.3 V and the Oric at 5 V (floating !) :oops:
You will need some level adapters...
You will also have to electrically isolate the added boards, there may be interference and noise problems due to the many cables to be put in place, the temperature can increase inside by a less air circulation. There is not much room inside the case of the Oric.
I saw on the Net some use of a PI to convert RGB to HDMI. Maybe if you are a good programmer, you can make your own RGB + Sync converter...

But why, as you get an excellent HDMI output with the PI ? Recent TFT LCD can manage different video inputs, just select the source.
Maybe a good option is to use two ORIC, one original, one modified with a PI inside ?
In my opinion, it's a solution to have fewer problems to overcome...

Bon courage !
Oric Atmos : a new life !

User avatar
mikeb
Pilot Officer
Posts: 97
Joined: Wed Sep 05, 2018 8:03 pm
Location: West Midlands, UK
Contact:

Re: Atmos with a Slice of Raspberry Pi

Post by mikeb » Sun May 26, 2019 4:41 pm

Voyageur wrote:
Sun May 26, 2019 12:04 am
There is not much room inside the case of the Oric.
I didn't address this most obvious point :oops: It would take some serious crowbarring to get it in.

I do think the suggestion for building it into an Oric/Atmos case (minus the original motherboard) is the best idea.

User avatar
Equinoxe
2nd Star Corporal
Posts: 24
Joined: Thu Sep 06, 2018 1:18 am
Location: Saskatchewan, Canada

Re: Atmos with a Slice of Raspberry Pi

Post by Equinoxe » Mon May 27, 2019 7:54 pm

Thanks for the feedback so far - the Pi Zero isn't much bigger than the Arduino board used in the OricPi so both should squeeze in alongside the existing motherboard - heat might be a slight concern so I'll keep an eye on that once its up and running. They Pi Zeros seem to run pretty cool and definitely take a lot less power than their full sized brethren however I agree that Pis generally like a nice stable supply otherwise they do odd things. Thinking about this some more it's probably simpler to wire a DPDT switch to a decent 2A 5V PSU and bypass/remove the regulator altogether and simply wire the switched 0v/5v lines to both the Pi and Oric - any thoughts on if this presents any concerns?

On the RGB topic I was just trying to make the flip from legacy Oric to PiOric as simple as possible. Given the feedback it's probably easiest to just wire both the Scart/HDMI converter and the PiOric HDMi to a cheap external HDMI switch

(On a side note, I have two Oric's for this specific reason - one will always be 'stock' and the other an experimental hybrid platform but with a view to still trying to preserve its originality in case I ever want/need to revert it)

User avatar
mikeb
Pilot Officer
Posts: 97
Joined: Wed Sep 05, 2018 8:03 pm
Location: West Midlands, UK
Contact:

Re: Atmos with a Slice of Raspberry Pi

Post by mikeb » Tue May 28, 2019 4:59 pm

Equinoxe wrote:
Mon May 27, 2019 7:54 pm
... wire a DPDT switch to a decent 2A 5V PSU and bypass/remove the regulator altogether and simply wire the switched 0v/5v lines to both the Pi and Oric - any thoughts on if this presents any concerns?
That's a better approach, IMO, once you are on the "inside" of the regulator, supplying ground and +5V in the normal way becomes easier -- your ground is truly ground, your +5V is +5V and there's no ambiguity. It's that bit "outside" the regulator, in 9V land, that's confusing.

If you do bypass the regulator (as in remove it and short input to output), then this will mean the Oric must never (accidentally) be used with the regular supply :)

Also: You wouldn't need a DPDT switch, you could leave the grounds commoned. You still have some interesting problems with needing to power the ICs on the Oric keyboard PCB without powering the rest of Oric though!

User avatar
Equinoxe
2nd Star Corporal
Posts: 24
Joined: Thu Sep 06, 2018 1:18 am
Location: Saskatchewan, Canada

Re: Atmos with a Slice of Raspberry Pi

Post by Equinoxe » Sat Jun 01, 2019 5:11 pm

I was thinking the use of the DPDT switch along with using diodes on the 14 way y cable I'll have to make would help isolate the Oric from the Teensy. I don't have a working rig yet so what I'm not sure about is if I mechanically isolate the 5v and 0v lines would the 4051 signal pins still have a chance of powering up the Oric when the Teensy is in use?

User avatar
mikeb
Pilot Officer
Posts: 97
Joined: Wed Sep 05, 2018 8:03 pm
Location: West Midlands, UK
Contact:

Re: Atmos with a Slice of Raspberry Pi

Post by mikeb » Sat Jun 01, 2019 8:36 pm

Equinoxe wrote:
Sat Jun 01, 2019 5:11 pm
I was thinking the use of the DPDT switch along with using diodes on the 14 way y cable I'll have to make would help isolate the Oric from the Teensy. I don't have a working rig yet so what I'm not sure about is if I mechanically isolate the 5v and 0v lines would the 4051 signal pins still have a chance of powering up the Oric when the Teensy is in use?
It's bad form to cut the voltage rails from a chip and then stuff signals into inputs. Technically it violates the requirement that inputs are kept within the voltage rails (+/- a margin allowed on the datasheet, e.g. -0.4v and 5.2v) --- and yes you can end up back-feeding the voltage rails that way, due to diodes hidden inside the chips (protection diodes that are now biased the wrong way) :(

Proceed with caution!

User avatar
Equinoxe
2nd Star Corporal
Posts: 24
Joined: Thu Sep 06, 2018 1:18 am
Location: Saskatchewan, Canada

Re: Atmos with a Slice of Raspberry Pi

Post by Equinoxe » Sun Jun 23, 2019 6:59 pm

This endeavor sounds a bit trickier than I first imagined, nevertheless I'm determined to plug away until I hit a hard roadblock and have fun trying - On that note, do you know if there is an IC that exists that would allow me to create a 14 way SPDT switch bank (I'm probably not describing that correctly but hopefully you get the gist) to fully isolate the keyboard from the other alternate host - I'm guessing this is what KVMs use so I'm wondering if this is a common piece of technology I could easily leverage.

Many thanks!

User avatar
mikeb
Pilot Officer
Posts: 97
Joined: Wed Sep 05, 2018 8:03 pm
Location: West Midlands, UK
Contact:

Re: Atmos with a Slice of Raspberry Pi

Post by mikeb » Mon Jun 24, 2019 4:48 pm

If you want reasonably bi-directional, capable of handling various logic levels and analogue too, you could look at CMOS bilateral switches (e,g, 4066) a.k.a transmission gates. You may need to roll your own "double throw" by using two on-off switches, and negating the logic of on compared to the other, I'm sure other ICs exist with the double-pole built in.

Otherwise, you can do clever stuff with TTL/CMOS logic gates directly (if you can guarantee direction and logic levels) to select between two signals to a common output, look up NAND or NOR based 2:1 mulitplexers.

Both of these technologies are used inside the ULA :)

http://oric.signal11.org.uk/files/pub/u ... Schems.pdf

Post Reply