Atmos, WDC65C02 and WDC65C22N and other

If you want to ask questions about how the machine works, peculiar details, the differences between models, here it is !
How to program the oric hardware (VIA, FDC, ...) is also welcome.
User avatar
HigashiJun
Flying Officer
Posts: 205
Joined: Tue Dec 10, 2019 9:29 am
Location: Tokyo (Japan)

Atmos, WDC65C02 and WDC65C22N and other

Post by HigashiJun »

As my ATMOS is now fully working again, I am playing around with it and trying to fit various alternative chips, such as DRAM, CPU, VIA etc.

Here are some random findings of my last experiences.

I realised that a 65C02 CPU (pin bent and wire modded) works great and also a 65C22N VIA runs smoothly, but only when not fitted at the same time.

When I fit a 65C02 and a 65C22N at the same time, my ATMOS starts to boot normally but then freezes before the BASIC screen appears.

Has someone experienced the same issue ?

Another weird thing is when I launch the excellent DIAGROM (without any add-on cards): with the original VIA fitted, the "timer test" passes but when a 65C22N is inserted, timer test fails.

Last interesting (?) thing: if I change the crystal oscillator for a 20 Mhz one, the ATMOS does not boot with the original 6502 CPU, supposed to support 2 Mhz (though its speed is only 1.66 Mhz with a 20 Mhz oscillator). However, with a WDC W65C02S8P-14, it boots and works flawlessly. Next time, I will try my overclocked ATMOS with my Cumana Reborn attached.

Cheers.
HigashiJun
User avatar
retroric
Pilot Officer
Posts: 125
Joined: Sun Nov 22, 2009 4:33 pm
Location: Paris, France

Re: Atmos, WDC65C02 and WDC65C22N and other

Post by retroric »

HigashiJun wrote: Sun Oct 11, 2020 12:11 pm Last interesting (?) thing: if I change the crystal oscillator for a 20 Mhz one, the ATMOS does not boot with the original 6502 CPU, supposed to support 2 Mhz (though its speed is only 1.66 Mhz with a 20 Mhz oscillator). However, with a WDC W65C02S8P-14, it boots and works flawlessly. Next time, I will try my overclocked ATMOS with my Cumana Reborn attached.
Hi,

What a coincidence... A few days ago I stumbled on a very old article by Fabrice F. in issue #138 (October 2001) of the CEO Magazine (pp. 25-26) about overclocking the ULA. The goal at the time was to see whether it was possible to double the ULA frequency from 12 to 24 MHz in an attempt to make the video signal compatible with VGA (as the Oric generates a video signal with a 15,625 kHz horizontal frequency, the idea was it could attain the 30 kHz frequency required by the VGA standard by doubling the ULA frequency).

Anyway, the article first explained why we have a 6502 at 2 Mhz and not just simply a 1 MHz version: as the ULA 1MHz clock duty cycle is not 50%, but 33%/66%, the 333 ns clock period is not enough for a 1 MHz 6502 CPU that requires 500 ns periods on Phi0. Hence the 2 MHz requirement for the 6502. So, doubling the ULA frequency would require a 4 MHz-capable 6502.

The article then went on explaining that doubling the ULA frequency also required halving RAM and ROM access times (which apparently can be done with newer EPROMS and some 4264 or 4464 RAM chips with access times of 100 ns), and also having the PSG and VIA chips also capable of running at 2 and 4 MHz respectively (the PSG being 2 Mhz-capable at standard, while the VIA required exchanging for a 4 MHz-certified version).

Tests with different quartz oscillators showed that the Oric could work with both a 16 MHz and 20 MHz quartz but unfortunately stopped working when fitting a 24 MHz one...

So in your case, the Oric should work with a 20 MHz oscillator as long as you fit both a 4 MHz 6502 and 4 MHz 6522 and ensure your EPROM and RAM access times are compatible (from what I understand you need chips with 100 ns or lower access times). However, it is unsure you'll get a useable picture as the horizontal frequency will be 26 kHz, too slow for VGA but probably too fast for normal RGB mode.
flag_fr RetrOric, aka laurentd75 flag_uk
            GitHub - RetrOric
User avatar
mikeb
Flight Lieutenant
Posts: 282
Joined: Wed Sep 05, 2018 8:03 pm
Location: West Midlands, UK
Contact:

Re: Atmos, WDC65C02 and WDC65C22N and other

Post by mikeb »

HigashiJun wrote: Sun Oct 11, 2020 12:11 pm Another weird thing is when I launch the excellent DIAGROM (without any add-on cards): with the original VIA fitted, the "timer test" passes but when a 65C22N is inserted, timer test fails.
As the code was written and tested against a 6522A (as standard) it's likely that it's missing something that's different about the initialise and setup of the 65C22 -- I've no idea what though, having never experimented with such exotic items :)
User avatar
HigashiJun
Flying Officer
Posts: 205
Joined: Tue Dec 10, 2019 9:29 am
Location: Tokyo (Japan)

Re: Atmos, WDC65C02 and WDC65C22N and other

Post by HigashiJun »

retroric wrote: Sun Oct 11, 2020 5:19 pm
HigashiJun wrote: Sun Oct 11, 2020 12:11 pm Last interesting (?) thing: if I change the crystal oscillator for a 20 Mhz one, the ATMOS does not boot with the original 6502 CPU, supposed to support 2 Mhz (though its speed is only 1.66 Mhz with a 20 Mhz oscillator). However, with a WDC W65C02S8P-14, it boots and works flawlessly. Next time, I will try my overclocked ATMOS with my Cumana Reborn attached.
Hi,

What a coincidence... A few days ago I stumbled on a very old article by Fabrice F. in issue #138 (October 2001) of the CEO Magazine (pp. 25-26) about overclocking the ULA. The goal at the time was to see whether it was possible to double the ULA frequency from 12 to 24 MHz in an attempt to make the video signal compatible with VGA (as the Oric generates a video signal with a 15,625 kHz horizontal frequency, the idea was it could attain the 30 kHz frequency required by the VGA standard by doubling the ULA frequency).

Anyway, the article first explained why we have a 6502 at 2 Mhz and not just simply a 1 MHz version: as the ULA 1MHz clock duty cycle is not 50%, but 33%/66%, the 333 ns clock period is not enough for a 1 MHz 6502 CPU that requires 500 ns periods on Phi0. Hence the 2 MHz requirement for the 6502. So, doubling the ULA frequency would require a 4 MHz-capable 6502.

The article then went on explaining that doubling the ULA frequency also required halving RAM and ROM access times (which apparently can be done with newer EPROMS and some 4264 or 4464 RAM chips with access times of 100 ns), and also having the PSG and VIA chips also capable of running at 2 and 4 MHz respectively (the PSG being 2 Mhz-capable at standard, while the VIA required exchanging for a 4 MHz-certified version).

Tests with different quartz oscillators showed that the Oric could work with both a 16 MHz and 20 MHz quartz but unfortunately stopped working when fitting a 24 MHz one...

So in your case, the Oric should work with a 20 MHz oscillator as long as you fit both a 4 MHz 6502 and 4 MHz 6522 and ensure your EPROM and RAM access times are compatible (from what I understand you need chips with 100 ns or lower access times). However, it is unsure you'll get a useable picture as the horizontal frequency will be 26 kHz, too slow for VGA but probably too fast for normal RGB mode.
Interesting...

My ATMOS was OK with 100ns DRAM and also with the original 150ns chips.

My EPPROM is a Hitachi HN4827128G (250ns) and works with any glitches.

Thanks to your explanations, I understand now why the ATMOS does not boot with the original PSU but only with the 65C02.

But since my machine does not want to go further than the boot screen with the 65C02 and 65C22 fitted at the same time (why :?: ), I have fitted the 65C02 and the original 6522 VIA when overclocking, and the ATMOS booted even with a VIA rated at 2Mhz...

As for the picture, it is normal on my TV set. I use the connection I have described in another thread:

https://forum.defence-force.org/viewtop ... 043#p22043

Cheers.
HigashiJun
User avatar
HigashiJun
Flying Officer
Posts: 205
Joined: Tue Dec 10, 2019 9:29 am
Location: Tokyo (Japan)

Re: Atmos, WDC65C02 and WDC65C22N and other

Post by HigashiJun »

mikeb wrote: Sun Oct 11, 2020 6:23 pm
HigashiJun wrote: Sun Oct 11, 2020 12:11 pm Another weird thing is when I launch the excellent DIAGROM (without any add-on cards): with the original VIA fitted, the "timer test" passes but when a 65C22N is inserted, timer test fails.
As the code was written and tested against a 6522A (as standard) it's likely that it's missing something that's different about the initialise and setup of the 65C22 -- I've no idea what though, having never experimented with such exotic items :)
Ok, so the two 65C22 I have are not faulty...

Thank you for this clarification !

:D
HigashiJun
User avatar
HigashiJun
Flying Officer
Posts: 205
Joined: Tue Dec 10, 2019 9:29 am
Location: Tokyo (Japan)

Re: Atmos, WDC65C02 and WDC65C22N and other

Post by HigashiJun »

@retroric:

I have just found the article by Fabrice F. you mentioned in your post.

The 15,625 Khz the Oric generates should not be a major problem to connect it to a VGA monitor, provided that monitor is able to handle such a signal.

Here is a list of modern monitors supporting 15 Khz analog signals:

http://15khz.wikidot.com/

I personally have a NEC Multisync LCD 1990FXp I use with my Atari STE and it works really great.

I think making a 5 PIN RGB to VGA adapter in order to directly connect the ORIC to the monitor is also possible.

Cheers.
HigashiJun
User avatar
mikeb
Flight Lieutenant
Posts: 282
Joined: Wed Sep 05, 2018 8:03 pm
Location: West Midlands, UK
Contact:

Re: Atmos, WDC65C02 and WDC65C22N and other

Post by mikeb »

HigashiJun wrote: Mon Oct 12, 2020 9:08 am But since my machine does not want to go further than the boot screen with the 65C02 and 65C22 fitted at the same time (why :?: )
Could be completely wrong here, but wasn't one of the changes around the 65C02 and 65C22 something to do with the IRQ line (out from VIA, in to CPU) being changed from TTL drive (idle high, active low) to Open-Collector (active low, idle=floating) to allow wire-ORing of interrupt sources together onto a common line?

If you are using a 65C02 and 65C22 it could be that your Oric is hanging because there is either a) A constant interrupt source that won't clear (line is stuck low) or b) The expected interrupts to switch to/from TEXT/HIRES mode, invoked at boot up, aren't arriving (line is stuck high). Either could be down to the IRQ line stuck in a wrong state due to wrong drive/input conditions from using "different" chips.

Someone that's investigated this properly should chip in now (please!) ;)
User avatar
6502Nerd
Pilot Officer
Posts: 111
Joined: Thu Oct 08, 2020 9:48 pm
Location: Leicestershire, UK
Contact:

Re: Atmos, WDC65C02 and WDC65C22N and other

Post by 6502Nerd »

[Being transparent - I did not read the original question properly and see that the it is a 65C22N being used in the Atmos experiment - but leave edited notes here in case it is useful]

Yes you are absolutely right - WDC actually have 2 versions of the 65c22 - version 'S' and version 'N'. I have only used the 'S' version and it seems this is the most common variant available (personal experience only, could be wrong).

This is what the datasheet says:

"The W65C22N and older NMOS and CMOS IRQB output is/was an open drain pull
down only, thus allowing the IRQB signal to be wire ORed with an external resistor for a common
microprocessor IRQB input line. The W65C22S IRQB can be wire ORed with a pull down diode that is
forward biased when IRQB is low.

The IRQB pin on the W65C22S is a standard totem pole output. The W65C22S IRQB signal was meant for
logically ORing rather than wire ORing the IRQ’s of a system."

So to plug it in to an Oric, one might need to be careful of anything else that could pull the IRQ line low [but in principle it should be fine with 65C22N]. I have a homebrew computer with 3 devices that signal on IRQ - two 'S' VIAs and one TMS9918 video chip. I needed to add diodes between to make sure they could be wire ORed to the 65c02.

But on a regular Oric-1 or Atmos, there is only the 6522 that can generate interrupts I think? So this may not be the problem..[even is using 'S' version]
User avatar
HigashiJun
Flying Officer
Posts: 205
Joined: Tue Dec 10, 2019 9:29 am
Location: Tokyo (Japan)

Re: Atmos, WDC65C02 and WDC65C22N and other

Post by HigashiJun »

Thanks for your explanations.

My ATMOS boots normally with the W65C22N and its original CPU (ie. 6502). It also boots normally with the W65C02 and its original 6522 VIA.

It starts to boot with a W65C22N and a W65C02 but then freezes.

That is the issue I cannot explain.
HigashiJun
DigitalDunc
2nd Star Corporal
Posts: 31
Joined: Sun Jan 05, 2020 2:38 pm
Location: Leicester, UK

Re: Atmos, WDC65C02 and WDC65C22N and other

Post by DigitalDunc »

I know this last comment is quite an old one, but the S and N versions of the W65C22 differ in their nIRQ pin behaviour. The S version having a totem-pole output and the N version having an open drain output. In actual fact, there are more differences in pin behaviour that have consequences for peripherals on the printer port too.

On the bright side, the modern W65C22’s have rather excellent drive capability compared to their older versions. More even than the datasheet states in fact.
User avatar
HigashiJun
Flying Officer
Posts: 205
Joined: Tue Dec 10, 2019 9:29 am
Location: Tokyo (Japan)

Re: Atmos, WDC65C02 and WDC65C22N and other

Post by HigashiJun »

Thank you for this new comments.

I still plan to experiment all this CPU & VIA related things in my new Atmos, but lack of time is the main problem...
HigashiJun
Post Reply