Project Z - Inferno computer

Thread Starter

Robin Mitchell

Joined Oct 25, 2009
819
Hi everyone,

In the past 6 months i have REALLY learnt alot about CPU's, memory etc...
So i am starting a new project called:
PROJECT Z - INFERNO

It is a z80 based computer with 64K ram, a very tiny OS (hopefully less than 1K), video out and possibly (but unlikely) one channel sound.

I have already made simple z80 systems only consisting of CPU and memory. I am using two PIC18F45K20, one for video and the other for keyboard + IO control (allthough i need someone to advise me a smaller, better chip to use as keyboard control, the PIC18F45K20 is big :p ).

This will all be mounted in one 80's style case with PS2 keyboard etc...
I want it to have tape memory as well (for external storage) but need help on that one...unless i use the PIC18F45K20 extra port as a decoder..yeah that could work...Anyway

The OS is dead simple, it has only these commands:
N - Start a new program
S - Save program
L - Load new program

When in new program mode, it firsts asks for an address, then the data to be stored in that address and then displays the line.

What do you think, any questions, adivce???
Could really use some for the OS and tape interface...
Thanks


forgot to mention, it will have a composite video as well so it can connect to most tv's :p
Also, how do you connect to a floppy device :S ???
 
Last edited:

thatoneguy

Joined Feb 19, 2009
6,359
Try an SD card instead of a floppy or tape interface.

Floppy is unreliable, tape requires essentially another processor inside for modulation on recording/reading (QAM, maybe a modem could be hacked?)
 

Wendy

Joined Mar 24, 2008
23,429
God, don't use a tape device. You want a tape device I have a nice old TRS80 I would be willing to give you, with a complete set of maintenance and programming books.

I would spend hours writing code, only to loose it because audio tape is unreliable. By comparison diskettes are much better, and hard drives (and later) are better that that.

The Commodore PET, TRS80, Apple, and many more managed to do audio tape with not too much extra circuitry. PET's were 6502 (as were Apple), and used a simple FSK scheme that was the best by far. Of course, they also used PROM to program the CPU to read the data. TRS80's were Z80, as were Sinclairs.

I've been doing this computer stuff for a very long time. Does it show?

The best simple design I've ever seen was the Timex Sinclair (not the color model). With 5 chips, including the Z80 and 7805, it was a complete Z80 computer. They saved a few too many pennies on the power supply jack though, so I gave it up in frustration. Nothing like writing an 8K BASIC program and loosing it because the power jack wiggled. The Z80 generated the video signal, and read the cassette tape petty well with these constraints.

I would seriously consider dipping deep into prior art on this. There are some seriously cool designs out there.

http://oldcomputers.net/zx81.html
 

thatoneguy

Joined Feb 19, 2009
6,359
The best simple design I've ever seen was the Timex Sinclair (not the color model). With 5 chips, including the Z80 and 7805, it was a complete Z80 computer. They saved a few too many pennies on the power supply jack though, so I gave it up in frustration. Nothing like writing an 8K BASIC program and loosing it because the power jack wiggled. The Z80 generated the video signal, and read the cassette tape petty well with these constraints.

I would seriously consider dipping deep into prior art on this. There are some seriously cool designs out there.

http://oldcomputers.net/zx81.html
I made one of those kits 30 some years ago. I fondly remember the "Fast mode" that simply stopped updating the display so it could do calculations faster.

That and the pain of losing 8 hours of typing on that stupid tiny membrane keyboard. That was my first extra computer project, building a "real" keyboard for one.
 

Thread Starter

Robin Mitchell

Joined Oct 25, 2009
819
i have a spectrum :p (well two acctually)
bbc micro, commodore 64, amstrad 464 and electron XD
Love them all

I want to do this computer as little chips as possible with inbuild membrain keyboard (jokes, molded keyboard ;) )
 

Wendy

Joined Mar 24, 2008
23,429
Figure an 8 bit computer can use 64K max. The C128 got around this limitation, as did the XT, by switching banks of 64K RAM, which was a major pain in the assets for programmers. It also meant some precious RAM had to be lost, as (if memory serves) it needed to be common to all the banks to communicate values for programs that used more than 64K.

What my rambling is leading up to is it should be possible to use an SD card as both HD and RAM, with the right drivers. I mean seriously, 512K SD card is almost impossible to find anymore, and you need RAM. A Z80 is so slow by current standards (2Mhz?) that an SD card might be able to keep up.

I was typing this the same time Mitch was making his post, so I'll add another thought. You need a PROM for the OS, the SD card might be able to fill this need too. It can be programmed at any modern computer, and them become an integral part of your project. Just a thought.

If you can use a conventional keyboard. You'll sprain something otherwise. When I saw the Sinclair version I loved it, because keyboard were "part" of the computer and this one was immune to drinks. I like the replaceable keyboard much better, it is easier to type on at speed, and it is cheap.
 
Last edited:

Thread Starter

Robin Mitchell

Joined Oct 25, 2009
819
why is the maximum memory accessible by 8 bit 64K ? I though it was 512K...
8 bit CPU's have 16 bit addressing....2^16 = 65536
65536 * 8 = 524288 = 524K memory
 

Wendy

Joined Mar 24, 2008
23,429
why is the maximum memory accessible by 8 bit 64K ? I though it was 512K...
8 bit CPU's have 16 bit addressing....2^16 = 65536
65536 * 8 = 524288 = 524K memory
Nope. This is a weakness you have been fighting from square one. Memory is measured in bytes, not bits.

A 8 bit computer has a data buss of 8 bits (1 byte). While it is not true anymore this used to mean it had an address buss of 16 bits (two bytes). 2^16 = 65536 bytes Note the difference between bytes and bits.

There are very good reasons why the address buss was double the data buss (and the data buss is separate from the address buss).

Take a typical 8 bit CPU assembly language command that is 3 bytes long,

LD A LO,HI

LOAD A is the first byte (the opcode), LO and HI are two bytes that make a 16 bit address. The LO HI convention simplifies circuitry in the CPU, much like reverse polish did for calculators. A is loaded with the byte stored at the address.

On your earlier CPU experiments you were trying to use a 12 bit address for a 4 bit word (a 4 bit CPU). How would you create an assembly command as shown above in 3 bytes? It would need 4 bytes, which eats up a small memory bank fast. It also screws up the LO HI convention something fierce.

A 4 bit CPU such as the 4004 can have a max of 256 bytes. Each byte is 4 bits long. Everything is scaled down, but the commands still follow the 3 byte command format convention.

The Pentium and beyond the conventions started shifting a bit, so I'm not checked out on theory as I am 8 bit computers. However, I think I can extrapolate some details. They still use 3 byte commands, using the LO / HI convention. Each byte is 16 bits however, and the address is 32 bits long (still two bytes). The means the max address for the early 16 bit machines is around 4.3Gig. The power of squaring adds up fast. I *think* in terms of data usage on hard drives and what not 8 bits is still considered a byte.

What assembly languages do you know? This would help you in learning and completing your goals. I have two under my belt, 6502 and Z80. Z80 is a spin off of the 8080 processor, as is the 8086. They are cousins of the same family.
 
Last edited:

Wendy

Joined Mar 24, 2008
23,429
You want a language that is a dream to learn look at the 6502. By the time Z80's came along they had evolved dramatically from the original 4004 op code set. Evolution means there are commands that were just created and stuffed into the op code set without any organization.

The 6502 on the other hand, was written from scratch around 8 bit concepts. All the commands relate to each other and are grouped logically, which makes learning them much simpler. You can can extrapolate 6502 commands looking at others. Back in the heyday of the C64 many young programmers were writing code directly to video memory (using characters from the keyboard), no assemblers required, because of this organization. You typed in a stream of characters, did a sys call and if you got it right it worked.

The Z80 is a more powerful processor, it has some really powerful op code commands, but you're going to need a manual just to look up the op code set until you start memorizing it. The stand alone commands, and commands that are not grouped together, are killers. However, you'll come across some commands you didn't know existed (such as looping for example) that will allow you to simplify chunks by 15 bytes or more. Memory in 8 bit CPUs is at a premium (unlike today), so it mattered.
 

thatoneguy

Joined Feb 19, 2009
6,359
You might be interested in the Heathkit et-3400 as a computer/breadboard combo. http://www.vintage-computer.com/heathkit3400.shtml I got mine for $20 at a flea market and it's great fun, with a small monitor in ROM and simple enough to actually understand what's happening. There's a whole world of old computer buffs around, check it out. And yes, I've got a couple of Sinclairs too.
Splendid Idea!

4 on eBay, one is $99 buy it now, others are $20-$50

May get you halfway to where you are trying to be, for a very decent value.
 

Thread Starter

Robin Mitchell

Joined Oct 25, 2009
819
Update, thinking about my OS system, KIWI: Here are notes on it and so on and so forth:

Rich (BB code):
Inferno Operating system (kiwi)

On boot up check IO port for graphics card
and retrive the version 

Display OS info

Menu:

-----------
New
Load
Run
View memory
-----------

New program:
Enter address:
Enter value:
>If Esc key entered, go back to menu
>Once data is entered, follow the sub routine Display and HEX display


Load:
Set data out to PIC


Run:
Set program counter to address location, if pause/break hit then reset CPU but not memory

View memory:
Print out memory contents between two numbers


Sub routines:
-----------------------------
Display ASCII character
- Set A to the character code
- Set B to the X pixle
- Set C to the Y pixle

On routine >>
> Out A, address = 0001
> Out B, address = 0010
> Out C, address = 0011
-----------------------------

-----------------------------
Display HEX character
- Set A to the number
- Set B to the X pixle
- Set C to the Y pixle

On routine >>
> Out A, address = 0100
> Out B, address = 0101
> Out C, address = 0110
-----------------------------


Rom info for text:

Add (HEX)    Binary
=====================

New
03E8            01001110
03E9            01100101
03EA            01110111

Load
03EB            01001100
03EC        01101111
03ED        01100001
03EF        01100100

Run
03F0        01010010
03F1        01110101
03F2        01101110

View Memory
03F3        01010110
03F4        01101001
03F5        01100101
03F6        01110111
03F7        00100000
03F8        01001101
03F9        01100101
03FA        01101101
03FB        01101111
03FC        01110010
03FD        01111001
 
Top