ULA revistited.

Any discussions related to the creation of new hardware or software for the ZX80 or ZX81
Post Reply
User avatar
Andy Rea
Posts: 1606
Joined: Fri May 09, 2008 2:48 pm
Location: Planet Earth
Contact:

ULA revistited.

Post by Andy Rea »

a few years back i did this... (suprised it's still there ! )

http://homepage.ntlworld.com/deborah.cl ... A/ula.html

and today i finally, after 2 weeks did this...

Image
Image
Image
Image
Image

it provides a good steady picture thanks to back porch generation, i need to tweak the resisitor values but thats trivial, uses 2 * gal20v8 and 4 * gal 16v8 and 1 * 74ls374.

i used wincupl to generate the files for the gals, maybe not the best software and certainly not bug free, and also a learning curve for me.

i'll do a full write up and post more details soon.

Regads Andy
what's that Smell.... smells like fresh flux and solder fumes...
sirmorris
Posts: 2811
Joined: Thu May 08, 2008 5:45 pm

Re: ULA revistited.

Post by sirmorris »

:shock: :shock: :shock: :shock: :shock: :shock: :shock:

THIS IS AMAZING!

:shock: :shock: :shock: :shock: :shock: :shock: :shock:
sirmorris
Posts: 2811
Joined: Thu May 08, 2008 5:45 pm

Re: ULA revistited.

Post by sirmorris »

Andy - all that in only 5 GALs? You could get all of that into a small fpga... Any plans for that? You've learned wincupl (I also went through that pain for zxpand) so the next step shouldn't hurt so much ...
User avatar
Andy Rea
Posts: 1606
Joined: Fri May 09, 2008 2:48 pm
Location: Planet Earth
Contact:

Re: ULA revistited.

Post by Andy Rea »

Yes i would like to do it all in one device, i know Bodo Wenzel managed to fitt it all in a MACH210, if i had someway of programming these i would try and get hold of some, the other options are use a different device, but 5v devices are becomming harder to get, i suppose a 3.3v device with 5v tolerant io's might work ok, but again i don't have the equipment to program these devices.

I'm looking at getting some plcc Gals which would make the footprint smaller so it may still be possible to squeeze this baby inside the zeddies case.

and i think i can tweak the design slightly so that instead of 2* 20v8 and 4*16v8 i can used another 16v8 instead of a 20v8, saves all of 4 pins :?
Regards Andy
what's that Smell.... smells like fresh flux and solder fumes...
User avatar
Andy Rea
Posts: 1606
Joined: Fri May 09, 2008 2:48 pm
Location: Planet Earth
Contact:

Re: ULA revistited.

Post by Andy Rea »

Here is the shcematic, too big to upload to the forum.

https://picasaweb.google.com/lh/photo/K ... directlink


Whoops missed off a 47K resitor connected between GND and Tape-in :oops:

regards Andy.
Last edited by Andy Rea on Sat Mar 26, 2011 8:47 am, edited 2 times in total.
what's that Smell.... smells like fresh flux and solder fumes...
User avatar
Andy Rea
Posts: 1606
Joined: Fri May 09, 2008 2:48 pm
Location: Planet Earth
Contact:

Re: ULA revistited.

Post by Andy Rea »

ZX81 ULA Replacement - Version 2.

By Andy Rea.

March 2011.

Disclaimer... this document may contain errors or ommissions and is used entirely at your (zx81's) risk :-)

Way back in the early part of 2007 i created a ULA replacement using just 74XX logic IC's the details of which can be found at http://homepage.ntlworld.com/deborah.cl ... A/ula.html

it used 22 IC's was power hungry and as much as i would have liked there was no way it was going to fit insdide the ZX81's case.

Fast forward nearly 4 years and the soldering iron is warmed up and ready to go with a smaller ULA replacment, but this time using programable logic chips, 5 off gal16v8 and 1 off gal20v8 and 1 off 74ls374, the basic principal is that no expensive equipment is needed, it's possible to build your own programmer for the 16v8 and 20v8 devices, you can find instructions on the internet, alternativly programmers can be bought for around £30 on eaby but i can't say anything about the quality.

-=-=-=-=-=-=-=-=-=-

Lets outline the project details.

The aim of this project is to create a ZX81 ULA equivalent using easily obtained (50p each [if you shop around]) chips, the only connections to the ZX81 that are allowed is the 40 pins of the original ULA socket. but before we begin lets have a re-cap of the function of each of the ULA pins.

Pin Function mode mode Function Pin

1-- A7' ---------- O ---- P --- +5V -- 40
2 --A8' ---------- O ---- O --- A6' -- 39
3 --A2' ---------- O ---- O --- A5' -- 38
4 --A1' ---------- IO --- O --- A4' -- 37
5 --A0' ---------- IO --- O --- A3' -- 36
6 --/RD --------- I ---- I --- OSC -- 35
7 --/IORQ ------- I ---- P --- GND -- 34
8 --/WR --------- I ---- I --- KBD0 -- 33
9 --/MREQ ------ I ---- IO -- D0 -- 32
10 --/M1 --------- I ---- I --- KBD1 -- 31
11 --A14 --------- I ---- IO -- D1 -- 30
12 --/RAMCS --- O ---- I --- KBD2 -- 29
13 --/ROMCS --- O ---- IO -- D2 -- 28
14 --/CLK ------- O ---- I --- KBD3 -- 27
15 --/NMI ------- O ---- IO -- D3 -- 26
16 --TV-TAPE --- O ---- I --- KBD4 -- 25
17 --/HALT ----- I ---- IO -- D4 -- 24
18 --A15 -------- I ---- IO -- D5 -- 23
19 --D7 --------- IO --- I --- UK/US-- 22
20 --TAPE IN --- I ---- IO -- D6 -- 21

(arrrghh trying to format on here is a night mare :? )

O = output, I = inpout, IO = input and output
p = power connection.

in my design i use 5*gal 16v8 1*gal20v8 and 1*74ls374 a total of 7 IC's compared to 22 used in the original all 74xx design. however the logic follows reasonably closely to that of my original design.

Each of the programmable Gals has been given a name, this name is kind of related to it's function.

DECODE :- this chip uses, A0, /RD, /IORQ, /WR, /MREQ, A14, A1 as inputs from the ULA socket and does the memory decoding and the io decoding, including the 2 latches that control Vsync, and NMI pulse generation. it also has 2 inputs not from the ULA, these are a buffered 6.5Mhz clock, used to generate the 3.25Mhz clock that feeds to the CPU, and also /Hsync which is used in conjunction with NMI latch to produce the MNI pulses. it's outputs are 3.25Mhz clock, /NMI, /ROMCS, /RAMCS that are connected to pins on the ULA, it has other outputs used in other parts of the circuit, /FERD (used to trigger a read port $FE) and /Vsync used in tv signal generation.

NMI207 :- this chip is not connected to the ULA pins (apart from power) it is an 8 bit counter that runs off the 3.25Mhz clock, if left free running it will count from 1 to 207 incrementing on each clock cycle, when the output is at count 207 the next clock cycle will trigger it to roll round to a count of 1 missing out zero completely, this gives us a Hsync pulse of 16 cycles as on an original ULA not the 15 that other designs (including my old one) use. it has an additional input that will reset and hold the count at 1 for as long as this input is asserted.

LNC :- line counter, this is used to create the lowest 3 bits of the alternate memory address used during the refresh period in a video cycle, it's actually a state machine, but uses the /Vsync from DECODE along with Bits 7, 6, 4 from the NMI207 count, bits 6 and 7 are used to produce /Hsync and bit 4 is used to time the duration of a back porch region in the video output, it also genrates the /Csync used in the video output. it count output is Tri-stated so the address lines are only fed during the refresh time of a video cycle.

FERD :- a simple but essential part of the design, it has 2 uses first to read port $FE which simply copies the data present at it's inputs (KBD4 thru KBD0, uk/us bit and tape-in signal) and it also forces all the datalines low when a forced NOP is needed.

STATE :- named because when i first thought about the design this was going to be a state machine, however it turned into a counter with a load of combinatorial logic based on the counters output. The counter waits until M1 is asserted and begins to count, during the first memory read it checks whether this M1 cycle should be a video cycle by testing D6, A15 and /HALT if the condition is met a latch is set so that the rest of the video cycle can continue even thought the condition on D6, A15 may change, it then forces a NOP by asserting the FERD chip to do so and at the same time (nano seconds before the data lines are forced low) signals the 74ls374 to latch the current state of the data-bus, after the forced NOP the alternate address lines are enabled and just before the end of the refresh the databus is loaded into the shift register VSHF.

VSHF :- shift register, clocked at 6.5Mhz unless it has recently loaded a databyte it will continuosly output white (high level output) or during the Hsync and back porch region it will always output white, this avoids the display 'messing up' if video cycles are active during the back porch period although i only know of 1 program that does such. during load time the invert input is taken into consideration and if asserted the data bus is inverted before loading the shift register.

i'll include the WinCupl files for any one interested.

Regards Andy
Attachments
ula2.zip
(56.43 KiB) Downloaded 745 times
what's that Smell.... smells like fresh flux and solder fumes...
superfo
Posts: 74
Joined: Wed Jul 08, 2009 9:12 am

Re: ULA revistited.

Post by superfo »

Thank you for detail.
User avatar
Paul
Posts: 1511
Joined: Thu May 27, 2010 8:15 am
Location: Germanys west end

Re: ULA revistited.

Post by Paul »

Thanks for this execelent work!
I love it.
About the cheap programmers on ebay I can say that I have a TOP2009 with windows software that works very well.
It is very cheap and programs GALs up to 22V10 and Eprom TMS 2564 as well which is pincompatible to the original Sinclair ROM and an ideal replacement for this.
It is not the same quality as my batronix, but it supports way more chips to program.
It also gives the possibility to test 40xx and 74xx chips as well as RAM (this has a autodetect the type of chip but it fails testing 74LS74 :( )
So it is not perfect, but still very much worth the little money it costs.
In theory, there is no difference between theory and practice. But, in practice, there is.
User avatar
Andy Rea
Posts: 1606
Joined: Fri May 09, 2008 2:48 pm
Location: Planet Earth
Contact:

Re: ULA revistited.

Post by Andy Rea »

I've made a little alteration... not much but...

essensially when the back porch is active the signal level on the video output is the same as black pixels, so instead of forcing the video to white so it does'nt interfere with the mixing of Csync, video, porch, i have made the video black during back porch and done away with the resistor and other connection to back porch output, so now we are only mixing Csync and video to create the composite sync.

the alteration in the VSHF.pld file is also minor.

old line " s7.d = ((d7 $ !invert) & load & !blank) # (s6 & !load & !blank) # blank; "
new line " s7.d = ((d7 $ !invert) & load & !blank) # (s6 & !load & !blank); "

simples.

regards Andy
what's that Smell.... smells like fresh flux and solder fumes...
Prime
Posts: 134
Joined: Thu Mar 24, 2011 3:02 am

Re: ULA revistited.

Post by Prime »

Hi Andy,

I'm looking to try and convert your PAL design to a single CPLD (after prompting by SirMorris) and a few descretes, but as usual I'm fine with the digital stuff but fall
down when it comes to things like transistors.....

Could you do me a favor and double check the two transistor oscilator circuit for me, I have replicated it but cannot get it to work and produce the 6.5MHz signal.

Failing that I'll see if I can source a 6.5MHz cristal (or oscilator module, even a multiple frequency would be ok as I have room in the CPLD to make a divider to devide down
from say 13MHz).

Cheers.

Phill.
Post Reply