Omnimaga

General Discussion => Technology and Development => Other => Topic started by: willrandship on June 25, 2013, 09:31:05 am

Title: z80-like portable computer for <$30! (If you build one)
Post by: willrandship on June 25, 2013, 09:31:05 am
First off, here's the parts list, with digikey links, and price breakdowns.
https://docs.google.com/spreadsheet/ccc?key=0ArVW6ZRBoIhOdFdyY25QMkppejJFc19sd1FpWF9UNHc&usp=sharing (https://docs.google.com/spreadsheet/ccc?key=0ArVW6ZRBoIhOdFdyY25QMkppejJFc19sd1FpWF9UNHc&usp=sharing)

Now, to the fun part!

This is a simple design for an ez8-based computer. The ez8 is, like the ez80, a modern chip based off of an old zilog chip. However, instead of being based on the z80, which we all know and love, it is based on the z8. This chip was designed to be similar to the z80 in syntactical programming, but the architecture itself is quite different. There is also a C compiler provided by Atmel for the non-gurus.

The computer has 2 ez8 chips, each running at 20 MHz, with 16 KB of flash, 2 KB of RAM, and 29 I/O ports. One of these acts as the primary CPU, for general tasks, while the other is slaved, doing tasks as it is polled, such as managing the included sound system (speaker and headphone port) as well as other routines.

The computer uses a B/W 128x64 display, with a built-in driver chip that makes interfacing it extremely simple. An 8-bit bus for data and instructions, with a few other bits on the side. Duty Cycle is adjustable, so greyscale should be easier than on the TI series.

The main method of input is intended to be a PS/2 keyboard. Also included is a MicroSD card slot, which will interface to the main chip via SPI.

For power, an LM237 regulator hooked to a 4xAA battery holder is also included.

Some notes:

For the most part, this project should be relatively easy to work with. The ez8 chips are 40-pin DIP, with sockets. Most (not all) of the components involved are thru-hole, and most of those that are not can be easily substituted with materials on hand. (For example, I plan to use a floppy connector for the prototype's SD card slot) As of yet, I have no plans to make boards for this, or any other manufacturing arrangements. If there's enough interest later, then maybe that can change ;).


Here's Zilog's page on the exact chip.
http://www.zilog.com/index.php?option=com_product&Itemid=26&task=parts&familyId=6&productId=Z8F1621&mpn=Z8F1621PM020EG&mpnid=5183&scrollmpn=1&rootpage=b3B0aW9uPWNvbV9wcm9kdWN0JnRhc2s9cHJvZHVjdCZidXNpbmVzc0xpbmU9MSZpZD0yJnBhcmVudF9pZD0yJkl0ZW1pZD01Ng== (http://www.zilog.com/index.php?option=com_product&Itemid=26&task=parts&familyId=6&productId=Z8F1621&mpn=Z8F1621PM020EG&mpnid=5183&scrollmpn=1&rootpage=b3B0aW9uPWNvbV9wcm9kdWN0JnRhc2s9cHJvZHVjdCZidXNpbmVzc0xpbmU9MSZpZD0yJnBhcmVudF9pZD0yJkl0ZW1pZD01Ng==)
Title: Re: z80-like portable computer for <$30! (If you build one)
Post by: Xeda112358 on June 25, 2013, 10:46:04 am
16KB of flash and 2KB of RAM, while doable, that seems like it isn't... much. With the 20MHz speed and 2 processors, is it possible to have more? TI calculators currently have more totally memory available just in RAM.

But otherwise, this is excellent! How fast does the LCD respond?

EDIT: Now I see that there is a microSD slot, cool!
Title: Re: z80-like portable computer for <$30! (If you build one)
Post by: DJ Omnimaga on June 25, 2013, 12:54:20 pm
Seems interesting. TO answer Xeda, I think it should be fine with 2 KB of RAM as long as the RAM doesn't have to be used for storate purpose like on Z80 calcs. In fact 2 KB might be more than enough in many cases, but I think 16 KB of flash storage might not.
Title: Re: z80-like portable computer for <$30! (If you build one)
Post by: Juju on June 25, 2013, 01:03:22 pm
Sounds fun to do ^_^
Title: Re: z80-like portable computer for <$30! (If you build one)
Post by: Streetwalrus on June 25, 2013, 01:23:24 pm
Seems interesting. TO answer Xeda, I think it should be fine with 2 KB of RAM as long as the RAM doesn't have to be used for storate purpose like on Z80 calcs. In fact 2 KB might be more than enough in many cases, but I think 16 KB of flash storage might not.
Depends. a 128*64 screen needs 1024 bytes of RAM for buffering. And the other kB gets filled up pretty quickly. Let alone greyscale which requires at least two buffers. 128kB of RAM FTW. :P
Title: Re: z80-like portable computer for <$30! (If you build one)
Post by: Keoni29 on June 25, 2013, 01:23:37 pm
Seems interesting. TO answer Xeda, I think it should be fine with 2 KB of RAM as long as the RAM doesn't have to be used for storate purpose like on Z80 calcs. In fact 2 KB might be more than enough in many cases, but I think 16 KB of flash storage might not.
With an SD card for storage you won't need a lot of internal flash. Just for storing the bootloader and some tools maybe.
Title: Re: z80-like portable computer for <$30! (If you build one)
Post by: DJ Omnimaga on June 25, 2013, 04:04:41 pm
Well it depends for the screen, since you can always store directly to the LCD like on the TI-84 Plus CSE (which doesn't even have close to enough RAM for buffering by itself). As for other KBs I thought that maybe map data could fill it up fast, but other than that you could maybe do some decent games.

And yeah with external SD card support I guess the lower internal Flash doesn't need to be as high.
Title: Re: z80-like portable computer for <$30! (If you build one)
Post by: TIfanx1999 on June 25, 2013, 05:16:03 pm
This sounds pretty sweet Will. I'll be looking forward to seeing pictures/ videos of your progress. :D
Title: Re: z80-like portable computer for <$30! (If you build one)
Post by: willrandship on June 25, 2013, 05:18:40 pm
The internal flash isn't low at all for having a basic OS. I was thinking a simple program loader, with support for loading from USB. The programs would then implement such things as BASIC interpreters and such.

Also, the screen is NOT driven by the ez8. It has its own driver, and the ez8 chip only has to feed one byte of screen data at a time.

Another thing to remember: There is technically another 16K of flash and 2K of RAM available in the auxiliary ez8. The plan is to have it be a slave CPU that you can send tasks to, but if you desire, those tasks could include loading and running programs, or even managing on-the-fly decompression of data.

The LCD datasheet lists the ability to adjust duty cycle ie. framerate, from anywhere up to 60 hz down to 5 or 6. This fact alone makes it far easier to make greyscale happen: You can tune the LCD to your game's timing, rather than the other way around!

Also, for those wondering why the low specs in some areas, this is because my first priority was cost. This thing will be under $30 for parts, and it's a dual core handheld computer, with a good LCD. Just moving to a microprocessor instead and having more RAM and Flash would likely boost the cost by at least $5. Also, you would lose the two CPU bit.

Oh also, I was debating whether the LCD should be on the coprocessor, and now I think it should, specifically for greyscale. Even if you can't fit a whole buffer, you could go atari-style and store individual greyscale sprites and have a background buffer that can be displayed in any of 16 shades (Yes, more than 4, because it would be totally possible with a chip dedicated to it)
Title: Re: z80-like portable computer for <$30! (If you build one)
Post by: DJ Omnimaga on June 25, 2013, 06:29:01 pm
Yeah at first I was concerned about the Flash because I missed the SD card part. I was sure it had no external storage support. By the way, would programs be installable on external storage or would it be like Android phones where most apps have to be installed on the memory without the possibility of moving them over the card?
Title: Re: z80-like portable computer for <$30! (If you build one)
Post by: willrandship on June 25, 2013, 06:34:21 pm
Any program running off of the SD card would have to be copied into RAM first, and executed there. This means it would have to be <2k. However, they would load relatively quickly.

I'm actually debating about having a shared RAM pool now....it would be really handy.

In any case, the parts are ordered for my first prototype, and they should arrive in about a week.

To more directly answer your question, there is no installing at all. If a program is on the card, or in the flash, or in the RAM, it can run. If it's not, it can't.
Title: Re: z80-like portable computer for <$30! (If you build one)
Post by: Xeda112358 on June 25, 2013, 06:46:25 pm
Hmm, why does it have to load to RAM to run? Is there no way to let it run from flash? If it is an interpreted program, I would imagine that it could be sourced directly from flash (though this has potential to be slower).
Title: Re: z80-like portable computer for <$30! (If you build one)
Post by: willrandship on June 25, 2013, 06:48:06 pm
Oh, it runs from flash, it just wouldn't run from the SD card, and I don't think anyone wants a loader to write to flash from the SD card. The chip is designed for the primary program memory to be from flash.
Title: Re: z80-like portable computer for <$30! (If you build one)
Post by: Xeda112358 on June 25, 2013, 06:50:15 pm
Oh, I see .__. If it is possible, do you plan to have any kind of interpreted language? It might make it easier to keep program size down, but the cost would be consuming flash memory.
Title: Re: z80-like portable computer for <$30! (If you build one)
Post by: willrandship on June 25, 2013, 07:02:25 pm
There should be plenty of flash to spare, really. This is especially true if I make it possible to write SD card programs to Flash. (However, this would require some kind of position-independent code handling)

Another issue of interpreted languages is speed, but there's no reason they wouldn't work just fine.
Title: Re: z80-like portable computer for <$30! (If you build one)
Post by: willrandship on June 26, 2013, 12:58:29 pm
So, I was thinking about interpreters, and I think I have a good solution to the problem at hand:

There will be an interpreted language, with an editor. The language will be tokenized, and there will be relatively few commands, since I want to use 1 byte tokens only. This means anything that goes into a string must be one of these tokens. However, whenever possible the tokens will follow the ASCII character set. The other implication of this is the relatively few commands it allows. Because of this, there will be function support. One of the tokens defines a function, another calls it.

Since the primary interface will be a keyboard, most of the tokens are designed with this in mind. For example, C style logical operations. Another important note: Unless people complain loud enough, I plan to make the internal number system hexadecimal, with only a print function converting it back to decimal. (This is made very easy by the DA command, which encodes a hex number to a decimal number.)

I'm not sure whether it matters enough for it to support 2-byte numbers by default. 1-byte numbers would be much faster, and rarely do people actually NEED more than 255 for a particular number internally. (except maybe for health and such)

In any case, there would only be 158 available commands, assuming all characters available to type on the keyboard except tab (Which I'm using for an instruction catalog pop-up window) are available as individual tokens for use in variables or  strings. (actually a few more, since the math commands are on there)

Speaking of variables, a variable can be many types, and all the letters, numbers, and many symbols are valid for variable names. Since commands are tokenized, there is no worry that a variable will be confused with a command in the program itself.

Here's how entry will work. You start typing, and a window pops up with all possible commands that could match your input. You either keep typing, or select the command from the list. For example.

Type p
___________
|p (Variable)|             (Does not list other variables. You must type the vars exactly)
|pass         |
|print(        |
|_________ |

Pressing TAB would result in a list with no variable mentions, but containing all commands. Like TI's catalog, but just a small pop-up window. Think like mimas, for those who have used it.
Title: Re: z80-like portable computer for <$30! (If you build one)
Post by: Keoni29 on June 26, 2013, 03:56:08 pm
What about tokenizing a string that you type? Or doesn't it have enough ram for that?
Title: Re: z80-like portable computer for <$30! (If you build one)
Post by: willrandship on June 26, 2013, 03:56:52 pm
Well, I was just thinking of ways to make it easy to program. This is essentially tokenizing the string you type, but doing it one command at a time.
Title: Re: z80-like portable computer for <$30! (If you build one)
Post by: Keoni29 on June 26, 2013, 03:57:17 pm
Ah! very well. That will save ram too.
Title: Re: z80-like portable computer for <$30! (If you build one)
Post by: willrandship on June 26, 2013, 03:58:44 pm
Yeah. Also, I forgot to mention, I'm planning on having an interactive shell prompt as well, like python or Lua. It won't be the primary interface for running programs, but it will run identically to running a program, and you can drop to it from within one.
Title: Re: z80-like portable computer for <$30! (If you build one)
Post by: aeTIos on June 26, 2013, 05:15:12 pm
Might build this, when I have time and money.
Title: Re: z80-like portable computer for <$30! (If you build one)
Post by: DJ Omnimaga on June 26, 2013, 06:34:10 pm
One thing that would be nice is if you guys built your own Z80-like computer, you tried to make each of your own use the same hardware as much as possible. Who knows? Maybe that could make it easier to test an OS or something and eventually make such project viable for a commercial release. Of course, if anyone ever released such computer he would need to check patent stuff in respective countries, to ensure that everything used in the machine won't violate them or any other copyrights.
Title: Re: z80-like portable computer for <$30! (If you build one)
Post by: willrandship on June 26, 2013, 06:47:18 pm
That would be ideal. I'll be careful to make sure that the pins I use won't get in the way in the future, so they wouldn't need to be changed to accomodate additions to the circuits.
Title: Re: z80-like portable computer for <$30! (If you build one)
Post by: Xeda112358 on June 26, 2013, 10:58:24 pm
Some commands I think you should have are:
For math:
+,-,*,/,^,log2,sqrt() and maybe some trig functions
Some bit operations such as arbitrary shifts/rotates and bit-logic

For Graphics:
Line, Circle, Sprite, Rectangle, lcd refresh

For Input/Output:
getkey, Text()

And a few commands for creating and editing files.

That should make for a light language and still powerful. As well, there should be an easy way  to incorporate assembly for users that want to be very precise with what there program does.

If the math can return information such as the c,z, and sign flags (maybe store this in a system var), that would also be very useful. If users needed, say, 32-bit math precision, this would help.

Good luck!
Title: Re: z80-like portable computer for <$30! (If you build one)
Post by: willrandship on June 26, 2013, 11:01:27 pm
All good suggestions, yes. Although, I don't think I'd have a built-in sqrt function since there's no plan to support decimal numbers at all.

I haven't exactly started writing it yet :P maybe I'll change my mind.
Title: Re: z80-like portable computer for <$30! (If you build one)
Post by: DJ Omnimaga on June 27, 2013, 03:47:30 am
Ah yeah and also make sure that the hardware you'll use isn't rumored to be discontinued anytime soon. I know that old processors are still made, but you still have to be careful in case. :P

As for lack of decimal support, I think that 2 bytes numbers might be a good idea if memory doesn't become a big issue, since this would make it incredibly hard to create some kinds of games. For example, in RPGs, there are many stats that can go beyond 255 and damage calculation (defense, elemental weaknesses, magic power, etc) would be a major hassle. I wonder if there is a tutorial online explaining how this was done on older consoles? Even the 1987 Final Fantasy has numbers over 255.
Title: Re: z80-like portable computer for <$30! (If you build one)
Post by: Sorunome on June 27, 2013, 07:54:43 am
If someone mass-produced 'em I might actually buy one ^^
Title: Re: z80-like portable computer for <$30! (If you build one)
Post by: Keoni29 on June 27, 2013, 12:40:19 pm
I was trying to build a small single board computer out of a z80 too, but it became a huge mess of wires. Wireing up data and address busses is a huge pain and when it doesn't work correctly you'd have to check every connection. With a cpu like the ez8 there is ram and rom inside, so no messy wires here. I think I'm gonna get something similar: an mcu that can run code ram or a cpu with built in rom and ram.
Title: Re: z80-like portable computer for <$30! (If you build one)
Post by: zigzagjoe on June 27, 2013, 05:45:53 pm
Honestly, if you are going to make a design from scratch, you may as well use a more current design - the ez8 does not make that cut, being just as elderly as the z80. By the way, the only similarity between the z80 and the z8 is assembly mnemonic.... you will not be able to use existing code without a rewrite.

By the way, putting two independent CPUs will just increase the headaches involved in general purpose programming, rather like what happened to the sega saturn. Worse, these are microcontrollers, effectively independent systems by themselves - they will not be able to share a bus seeing as it's fully internal, and synchronization would be a nightmare. Unless one is going to be a dedicated co-processor handling IO, display, or other such things, it will be largely wasted as it would be incredibly cumbersome to use.

Since you won't be able to use any existing code anyways, you may as well go for an ARM chip, such as the LPC1114. (http://www.digikey.com/product-detail/en/LPC1114FN28%2F102,12/568-10143-5-ND/3430860) 50mhz, 32-bit ARM Cortex-M0 with 4kb of SRAM and 32kb of flash. The SRAM and flash is unfortunately small, but it is still an order of magnitude more powerful then what you've suggested, never mind cheaper at less than 3$ per. Plus, it comes in a nice DIP package and has vastly more toolchain support - gcc.

Grab this 240x320 2.4" Color LCD (http://www.digikey.com/product-detail/en/NHD-2.4-240320SF-CTXI%23-1/NHD-2.4-240320SF-CTXI%23-1-ND/2626410) - 15$. 3.3v-tolerant and has a built in ILI9340 controller again, requiring an 8 bit interface and 4 control lines (CS, WR, RD, RS).

Use an 8x8 key matrix: use the 8 pin data bus that is also connected to the LCD for input, and hook up a 74HC165 Shift-in register - 3 pins, CLK-out, LD-out, Ser-in to read it out. You may be able to find an existing keyboard module you could use, or just design a PCB. Alternatively, you could use PS/2 as you suggested.

2 more pins for a bit-banged USB interface - the ARM is easily fast enough to manage USB low speed, it should be able to manage full speed as well. SD card interface would occupy another 4 pins - MOSI, MISO, CLK, and CS; one of the SPI interfaces. Could use an I2C eeprom or flash instead of a SD card. Probably makes more sense: less overhead, by far.

Unfortunately, it seems that it would be difficult to use NXP's ISP interface in-situ, but the uC may be able to reprogram itself via a bootloader. If you could bake enough USB into the bootloader, programming could become quite simple. ASM programs will be incredibly difficult, however; 4kb of SRAM would be enough for some programs and overhead, but it's nowhere near enough for a complete binary program. An interpreted language would be possible, but honestly rather depressing. a Forth clone could be decent, though - not too much overhead in the interpreter.

Though, discussing a language now; doesn't that strike you as counting eggs before they hatch? You need to have working hardware before you can do much else, and it will not be as simple as buying all the parts and wiring them together - you will need hardware to program the uCs, as well as toolchains, debugging facilities (meter and logic analyzer), passives for LCD and uC(s). It's a great feeling to get it all together but it's a lot of work before you have something working. If you've got the background for it, by all means go for it, but if not I'd recommend playing with standalone microcontrollers first.
Title: Re: z80-like portable computer for <$30! (If you build one)
Post by: TIfanx1999 on June 27, 2013, 05:53:04 pm
Wow, that's one heck of a first post. Welcome to Omnimaga zigzagjoe! What brings you here? You should head over and <a href=http://www.omnimaga.org/index.php?board=10.0>introduce yourself</a>. The main reasons for will choosing this processor (and a low res b&w display) is it's similarity to the Z80, (which powers many of the TI calculators we all know and love) and low cost. Maybe an ez80 would be an option, but I'm unsure how that would affect cost.
Title: Re: z80-like portable computer for <$30! (If you build one)
Post by: tr1p1ea on June 27, 2013, 06:21:52 pm
'The Omnimaga Portable Computer Kit' ?

My main suggestion would be to go for something that is very low power, especially if portability is a goal of this project.
Title: Re: z80-like portable computer for <$30! (If you build one)
Post by: TIfanx1999 on June 27, 2013, 06:27:33 pm
Yea, an Omni computer kit would be sweet! ^^
Title: Re: z80-like portable computer for <$30! (If you build one)
Post by: willrandship on June 27, 2013, 06:43:39 pm
@zigzagjoe

The ez8 is far newer than the z80. It's actually as new as the ez80, both being redesigned versions of their architecture. For one thing, the original z8 only came as OTPROM at best, Mask ROM at worst, with no On-chip debugger. Hardly suitable for this kind of project.

I only brought up languages because other people asked. I was just discussing ideas while I waited for parts to arrive, and you're absolutely right that it's far too soon to start working on any such thing.

Using an ARM chip would make this a far more complex project, for the same reason using a z80 would: To get any kind of decent setup you need ROM and RAM chips external to the chip, AND there are practically no prototyping-friendly options. Good luck finding an ARM chip that has 29 I/O pins, a reasonably fast clock speed, and a DIP layout.

Even using an ARM MCU like you suggest has major drawbacks, not the least of which being the fact that the 32-bit ARM architecture has MASSIVE code compared to this 8-bit MCU. It would need at least 4 times as much Flash to EQUAL the size for programming ability. So, in terms of program size, the two chips are equal in Flash and the ez8 takes the lead in RAM. (Of course, this would change depending on how much of the program is data, etc. but it's mostly accurate)


The coprocessor will be just that: A coprocessor, with a fixed set of commands, mostly dedicated to audio. It will communicate with the main CPU via a hardware UART connection, which is relatively easy to use. (Also only 1 pin) Since the audio clearly won't take up all the CPU time, it would be easy enough to also handle I/O management along this line, using a  2-byte transfer protocol. The only reason I don't put the LCD on this CPU is so it's possible to drive it directly, in case there are any hidden features of the LCD people wish to take advantage of.

The LCD is perfect for the CPU I chose, and cheaper than the one you recommend. Also, why use a shift register when you can use a port directly? It's far faster that way, and I do have the I/O to spare thanks to choosing a larger chip.

The hardware SPI makes the SD card access easy, on the byte level at least. For filesystem management, this part becomes a fair amount more complicated, but this at least is something far less rigid at the moment.

PS/2 is the easiest part of the build.

I'm well aware that code cannot be shared between the z80 and the ez8. The register file differences alone make this quite obvious. I merely mentioned it because it will ease the transition for many of the people here who have programmed for the z80, compared to switching to a new architecture like PIC, AVR or ARM.

I don't plan to use USB at all, and don't see a valid reason to. Rather, there is a built in Debugging interface that is designed  to map to RS-232, which allows for programming the board directly, with a variety of other wonderful features. An FTDI cable would work perfectly, unlike many ARM debuggers which cost far more.


I think the disconnect is this: I didn't design this thing to be the most power-effecient, powerful board I could. If I wanted that, I'd just buy a Raspberry Pi and start from there. Far more power, better screen interfaces, etc.

P.S. If I went ARM, I would go with Native USB, not bit-banged. Why skimp on something so useful?

@Art of Camelot
I avoided the ez80 for two reasons: It's not an MCU, so it would be far more complex to build (and far more expensive), and it doesn't come in a DIP package. Otherwise, it's a far better chip in most regards. Faster, more RAM space, etc.

@Tr1p1ea
The chip is quite low-power. If anything, the screen will be the biggest draw, or the speakers. The CPUs will be negligible in comparison. I can't find any power draw specifications in their documentation, but I'll be sure to post some info when I get a setup built.
Title: Re: z80-like portable computer for <$30! (If you build one)
Post by: TIfanx1999 on June 27, 2013, 06:55:36 pm
Yep, makes sense. Very nice detailed answer as well. :)
Title: Re: z80-like portable computer for <$30! (If you build one)
Post by: zigzagjoe on June 27, 2013, 07:18:45 pm
z8, which the ez8 is based on, is just as elderly as the z80. Sorry, should have made that more clear. The ez8 is faster than the z8, but it will still be blown out of the water by any newer processor - such as the ARM Cortex-M0, powering that one chip, which is fully pipelined nevermind 32 bit and running at several times the clock frequency.

The ARM chip I linked was a microcontroller, too - no need to futz with ROM and RAM chips. If you give up DIP requirement, even more options become available. Could also use a module such as the teensy3 rather than a raw MCU, but it drives price up. That specific one, the LPC1114, has 22 IO pins available, which based on some quick futzing about is sufficient for the set up I described. Also, has 4kb of SRAM, vs 2kb per ez8 chip. 50mhz also strikes me as quite a reasonable speed. The IO pins are the hardest part, relatively, and with a shift register (or PS/2 instead) it's a nonissue.

Code size is a concern, though with thumb available it reduces the damage to some degree. Additionally, ARM/Thumb instructions are likely more powerful on a per instruction basis thus *possibly* leading to fewer instructions. Would need to do research to confirm that, though. Going to be hard to fit much more than a basic OS, library routines, and a simple interpreter in either of their ROM spaces, though. Achilles's heel.

The shift register was mentioned due to IO constraints of that specific ARM chip; it lowers the pin requirement to where that chip is usable. For scanning a key matrix, the speed reduction is largely moot. Or, of course, just use PS/2 and don't worry about it.

Yes, that LCD is cheaper, but it's also greyscale at a fraction of the resolution. For $4 more, it seems to me that getting colour and significantly more pixels is quite worth it. Does use more power, though, due to the backlighting.

Accessing a SD is not as easy as you seem to think, though: even throwing filesystems out the window, you must operate on a 512byte block basis, which eats into available RAM. Using the fatlib for AVR as a guideline, you are looking at something like 600-1200 bytes of RAM dedicated to the SD interface (with a FS), never mind code size. Implementing a PC-compatible FS, such as FAT32, will drive complexity way up, and be a pain to write with the lack of good development tools. No PC compatible FS throws away the primary benefit to using a removable storage interface. An i2c flash/eeprom IC will be far simpler to deal with, and maybe save a few pins, too.

USB I mentioned simply because you could: the 50mhz ARM can manage low-speed interfacing with user code active, and probably can do full speed interfacing (12mbs) with full cpu usage. It's a freebie - why not? A dedicated hardware interface is much better, as you say, but you can't get a DIP ARM chip that has it. The presence of a USB interface would also be a point in favor of not using a SD card. A USB stack will use up some RAM and ROM, though.

There are ez80 MCUs, but they are only available in large SMD packages. Pain in the ass to deal with for a hobbyist. Basically, I mentioned this first because it was a fun thought-experiment, and second because two ez8s increases hardware complexity, code complexity, cost, power use and reduces performance.... for the gain of similar mnemonics. Buying a PI or other some such is boring; having a hardware design that one can understand and tweak as well as play with bare metal code is way more fun.

@Art_of_camelot: Registered mostly to reply to this post; I was bored, and it was fun to design a minimal system (as outlined in my post). Originally discovered it as I had to purchase a TI-84 C for a class - can't use 89 :( - and was doing research concerning it. Absolutely disgraceful what TI ended up shipping, also, could have been so much more.

EDIT: Spelling
Title: Re: z80-like portable computer for <$30! (If you build one)
Post by: TIfanx1999 on June 27, 2013, 07:24:39 pm
Yes, unfortunatley the TI-84+ CSE is a bit of a disappointment. TI could have done really neat things with it. Anyho, I'd suggest looking around. There's a pretty broad spectrum of things going on around here. :)
Title: Re: z80-like portable computer for <$30! (If you build one)
Post by: zigzagjoe on June 27, 2013, 07:27:41 pm
Unfortunately, it looks like eeproms only go up to 128k (1mbit) in DIP packages. Though, there is this flash chip (http://www.digikey.com/product-detail/en/W25Q80BVDAIG/W25Q80BVDAIG-ND/2208452). 8 pin DIP, 1mb (8 megabit), 52 cents. Page size is 256b, which is okay. Obviously the byte level access an EEPROM could provide would be better, but this is still nice. Will be vastly simpler to interface with compared to a SD, even with having to deal with pages.

Here's the 128k I2C eeprom: http://www.digikey.com/product-detail/en/CAT24M01LI-G/CAT24M01LI-GOS-ND/2683760

Also, Here's a 128k SPI SRAM (?!): http://www.digikey.com/product-detail/en/23LC1024-I%2FP/23LC1024-I%2FP-ND/3543083
Could be interesting....
Title: Re: z80-like portable computer for <$30! (If you build one)
Post by: willrandship on June 27, 2013, 08:10:37 pm
The SD card is for the purpose of being able to interface to a computer. EEPROM chips over SPI do not satisfy this requirement.

A linking protocol would, but that would require special linking software. That gets very messy.

The SRAM would be nice, but it wouldn't work as program memory. You would have to copy back and forth from it, so it wouldn't exactly be ideal. It would, however, be much faster than accessing an SD card.
Title: Re: z80-like portable computer for <$30! (If you build one)
Post by: zigzagjoe on June 27, 2013, 08:52:55 pm
Not for binary program memory, no; there's no way around that for either MCU without using one that exposes some of its internal bus. But for an interpreted program, it could be used to defray operating expenses of a SD card, possibly. Would be unable to keep much/any user code in RAM. Just something interesting i saw, anyways.

Linking software can get messy if it's allowed to grow out of control, but it'd be superior to using SD card in terms of access speed and ease. At the simplest level, though, linking software is quite simple, especially compared to rolling a whole SD stack. Of course, you'd want to implement either serial over USB or just plain bit banged serial, but hey, options. For programming, eeprom usage would be more deterministic than FAT layered on SD; simpler to deal with.

Just some thoughts, anyways.
Title: Re: z80-like portable computer for <$30! (If you build one)
Post by: willrandship on June 27, 2013, 09:02:02 pm
If I implement a linking protocol it will probably be over the DBG interface. You can run code directly, write to Flash or RAM, and lots of other fancy features.

Also, a USB link cable is just an FTDI cable.

SD cards would be easy if I bypass filesystems, and just allocate chunks of it to user programs, but then the PC-side portion is harder. That way it's just an SPI Flash chip.
Title: Re: z80-like portable computer for <$30! (If you build one)
Post by: zigzagjoe on June 27, 2013, 09:15:59 pm
You're still going to have to deal with the SD interface, which is quite a bit more complex than a SPI/I2C flash will be. I'd recommend looking over sdfatlib (AVR code) to see just exactly what you're getting into. Specifically, Sd2Card.cpp and Sd2Card.h. Also, low-level access to a device is a privileged operation, will complicate PC software to some degree.

FTDI cable is another way of accomplishing serial over USB; was suggesting the virtual com port method of serial (or raw HID) in the context of that ARM design - not actually using serial, just showing up like that to the PC. Can simplify programming of the link software.
Title: Re: z80-like portable computer for <$30! (If you build one)
Post by: tr1p1ea on June 27, 2013, 09:25:31 pm
Perhaps there could be 2 systems designed?
Title: Re: z80-like portable computer for <$30! (If you build one)
Post by: willrandship on June 27, 2013, 09:27:31 pm
zigzagjoe, the SD interface has an SPI mode that's directly supported. It is exactly the same as what an SPI flash chip would do. sdfatlib only applies if you use a FAT filesystem, and do software SPI.
Title: Re: z80-like portable computer for <$30! (If you build one)
Post by: zigzagjoe on June 27, 2013, 09:42:40 pm
The SPI interface is what you are using to send SD commands. You most certainly are not accessing it 'exactly the same' as a flash chip - the physical interfaces are the same, the software interfaces are very different. Don't dismiss what I'm saying out of hand - you do not know everything. Again, see Sd2Card.cpp. That is the interface you will need to use to read and write blocks from a SD card.

Yes, there is a portion for software SPI, there is also a portion for hardware SPI. Yes, it has a FAT component, which is not part of Sd2Card.cpp - it's written in layers, of which Sd2Card is the lowest, and directly interfaces with the SD card. Fat functions use Sd2Card, and so on. Course, you can have a look at those if you like (can be rather terrifying).
Title: Re: z80-like portable computer for <$30! (If you build one)
Post by: AlexisVieira on June 27, 2013, 10:11:46 pm
can someone post a photo of one of this "portable computers"?
Title: Re: z80-like portable computer for <$30! (If you build one)
Post by: willrandship on June 27, 2013, 10:15:24 pm
Alexis, this is a project I'm building. I only just got the parts, so there's not much to look at for the moment. :P
Title: Re: z80-like portable computer for <$30! (If you build one)
Post by: Keoni29 on June 28, 2013, 04:10:33 am
I am pro-vga output or at least composite out. Could you make an expansion port on it so you can hook up one of these vga boards?
http://www.microvga.com/
Title: Re: z80-like portable computer for <$30! (If you build one)
Post by: willrandship on June 28, 2013, 01:31:25 pm
There will, at the very least, be a pin header. 0.1" spacing, so it should be easy enough to attach to.
Title: Re: z80-like portable computer for <$30! (If you build one)
Post by: Keoni29 on June 28, 2013, 02:40:16 pm
That's good to hear. A lot of SPI devices can be connected to a 3,3v expansion port, so that's great.
Title: Re: z80-like portable computer for <$30! (If you build one)
Post by: zigzagjoe on June 28, 2013, 04:56:36 pm
Was bored, so finished hashing out the ARM-based idea. Click here for google doc with block diagram, pin assignments and parts manifest. (https://docs.google.com/spreadsheet/ccc?key=0AngVr3jzx80vdGI3Q0ZwNmJxOUNNYnBlOTZBb1liMFE)

Too bad this is the only DIP ARM chip out there; it's a bit IO constrained, though you could free up to 3 GPIO pins along with 8 bit data bus and SPI, at the cost of piezo speaker and PC link. One more GPIO if the reset switch is deemed unnecessary... could just use a momentary-off switch on Vpp for the same effect, i suppose?

An interesting idea I had is that from whatever interpreted language, an ARM routine could be loaded into RAM and run from RAM to effect an increase in speed in crucial areas. Kind of want to build it... would be fun to write the core code.
Title: Re: z80-like portable computer for <$30! (If you build one)
Post by: willrandship on June 28, 2013, 05:52:34 pm
Well, with an ARM chip you might as well just load something like eLua onto the chip.

Would anyone be terribly offended if I dedicated all the analog input option pins to other things? It's the only port on the chip that doesn't have other stuff I want to use for its own purpose (like UART and SPI)

You could still have analog input through the coprocessor chip, though. It wouldn't be as fast, and would be bottle-necked by audio processes, but it would be available if anyone DID need it.
Title: Re: z80-like portable computer for <$30! (If you build one)
Post by: Spyro543 on June 28, 2013, 06:08:15 pm
What exactly would it be needed for? I can't think of anything besides some kind of weird expansion bay...
Title: Re: z80-like portable computer for <$30! (If you build one)
Post by: Keoni29 on June 28, 2013, 06:52:27 pm
A mic? Not sure if it has enough ram to do anything with analog signal processing.


@zigzagjoe really nice and cheap. The ram would be kind of a problem though. Aren't there cpu in that series with more ram?
Title: Re: z80-like portable computer for <$30! (If you build one)
Post by: zigzagjoe on June 28, 2013, 07:42:14 pm
A mic? Not sure if it has enough ram to do anything with analog signal processing.


@zigzagjoe really nice and cheap. The ram would be kind of a problem though. Aren't there cpu in that series with more ram?

Yeah, you can get ones with more RAM and ROM, but only in surface mount packages. That's one of two ARM chips in a DIP form factor available, so went with it in in the spirit of a hobbyist-friendly design. Other one is an 8-pin relative with even fewer resources, definitely not going to cut it.

If you throw DIP out the window, though, there's a lot of options - USB client, as much RAM/ROM as you could want, and more powerful Cortex-M3/M4 cores, to name a few. Possibly even a display interface, though that would increase complexity quite a bit.

Truthfully, it probably makes the most sense to just get a board made anyways, seeing as there are very few graphical LCD modules with through-hole-friendly layouts. FPC connectors, which you'd use for the display proposed by the OP, are all SMD. That color LCD is a hair better in that it has solder pads that you could conceivably solder wires to, but it's meant to be soldered to a board.

It'd also allow you to integrate a keyboard matrix for a semi-handheld product. As long as you don't go whole hog with BGA chips, SMD can be done at home without *too much* effort via a heat gun or toaster oven. Have even heard of people doing it purely by hand.

I think it could be a fun project anyways, working with the limited resources of the LPC1114. You would want most code to be interpreted code, with just the lowest level routines stored in ROM. Bootloader, input, low-level comms (rs232 or usb), display routines, storage routines, floating-point emulation, interpreter (obviously), and a basic monitor program. All the stuff that needs to be fast. Still, going to have a look to see what $3 gets you in a SMD ARM chip.

Re: eLua. Not enough RAM/ROM to manage it. You'd want as minimalistic a language as possible, if using the LPC1114. Fancier [SMD] ARM chips would have enough RAM that you could set things up that entire user binaries could be copied to a specific offset in RAM and execute them from there.
Title: Re: z80-like portable computer for <$30! (If you build one)
Post by: Keoni29 on June 29, 2013, 03:01:41 am
Soldering components to smd isn't that bad, but soldering wires instead of using a ribbon cable will give you a bad time. I once had bridge an entire ribbon cable with 22 traces in a psone lcd screen using wires. In the end it worked though, but it took me about two hours. Afterwards the lcd started glitching and there was smoke and then I blacked out.
Title: Re: z80-like portable computer for <$30! (If you build one)
Post by: willrandship on July 03, 2013, 05:54:06 pm
That's why I ordered a breakout board for the LCD. :P If I start making lots, I'm definitely going to put in a standard connector on the board.
Title: Re: z80-like portable computer for <$30! (If you build one)
Post by: Keoni29 on July 20, 2013, 01:30:43 pm
I had a look at the IDE and especially the blink LED example that came with it. I understand that most of the code is for setting up the microcontroller and not for the cpu itself, but it's a lot of code right there. Have you seen it? Do you know if there is a community that uses these mcu, because I am sure I won't be able to figure out everything myself.
Title: Re: z80-like portable computer for <$30! (If you build one)
Post by: Keoni29 on July 23, 2013, 06:12:58 pm
*Minor bump*
http://8times8.host56.com/ez8tut.html
I am working on this tutorial as I'm learning how to program for the device. I thought that would be the best way to keep everyone updated about it.
Title: Re: z80-like portable computer for <$30! (If you build one)
Post by: DJ Omnimaga on July 23, 2013, 09:51:19 pm
That is cool to hear :)
Title: Re: z80-like portable computer for <$30! (If you build one)
Post by: Sorunome on July 24, 2013, 05:09:12 am
yay, that's cool!/me expects awesome stuff :P
Title: Re: z80-like portable computer for <$30! (If you build one)
Post by: Keoni29 on July 24, 2013, 05:13:56 am
The pressure is on. I will be working on the tutorial again as soon as I have written some more example code.

Edit: I updated the tutorial. http://8times8.host56.com/ez8tut.html
Title: Re: z80-like portable computer for <$30! (If you build one)
Post by: willrandship on July 30, 2013, 12:00:53 am
Today I half-finished an opcode reference for the ez8. It's on Keoni's site, right here.

http://8times8.host56.com/ez8tut/reference/Opcodes.php

I'm planning on adding another part to it detailing the exact effects of every opcode by its hex value, but for now that should do.
Title: Re: z80-like portable computer for <$30! (If you build one)
Post by: Keoni29 on July 30, 2013, 05:05:24 am
We think Zilog should hop onto the Maker train and support creative minds. They are not doing this at the moment which is a shame because they already have nice devboards that don't cost a lot. The main problem is the lack of tutorials on how to program for their eZ8 microcontroller. That's why we started building our own tutorial and programmers reference.

There is one major hurdle to overcome when you want to get into eZ8 programming and that is the Zilog SmartCable. You need one of these or else it won't work with the IDE. The communication protocol with the debug interface (which you use to program the chip with) is fairly standard TTL level UART (rs232 serial, but 3V/5V levels) A normal usb to TTL converter does not work with their IDE as we tested. The cable is hard to get for a fair price. They go for about $30 and shipping is expensive. The eZ8 itself is a really cheap microcontroller at $6 for the most powerful 64k flash model and around $3 for a 16k flash version.

We hope that our website will encourage people to start programming for the eZ8. I try to be on #zilog on EFnet (http://chat.efnet.org:9090/?channels=%23zilog) as often as possible.

I think most of you already know how to get to our website (I posted the link in IRC a quite often), but those of you who don't: http://www.8times8.host56.com/ez8tut
Title: Re: z80-like portable computer for <$30! (If you build one)
Post by: Keoni29 on August 05, 2013, 04:46:09 pm
There has been quite an overhaul to the tutorial pages. For starters: the tutorial now has a dedidated website: http://ez8tut.sourceforge.net/
It contains more than just the ASM programming tutorial. There is a reference for programming and for the CPU and peripherals. There will also be resources such as example code, routines and user submitted content. I am in the process of creating a CMS
Title: Re: z80-like portable computer for <$30! (If you build one)
Post by: Keoni29 on August 08, 2013, 08:58:37 am
I'm almost able to interface with my lcd display. I have to put a lot of delay in the program since it is a really slow display. When I step trough the program in debug mode it works find and I can initialize the LCD module and put characters on it :D
Title: Re: z80-like portable computer for <$30! (If you build one)
Post by: Streetwalrus on August 08, 2013, 01:36:01 pm
Nice to hear it's coming alive. :D
Title: Re: z80-like portable computer for <$30! (If you build one)
Post by: Keoni29 on August 09, 2013, 06:04:30 am
Allright! It works now. I think it works with all character displays since the delays are super long :P

Edit: Oh I see there is a little bit of a bug in my example program: Line 2 appears on line 3 and line 3 appears on line 2. This is because of how the driver works. No real problem here.
Title: Re: z80-like portable computer for <$30! (If you build one)
Post by: TIfanx1999 on August 09, 2013, 07:59:59 am
Very nice Keoni! :D
Title: Re: z80-like portable computer for <$30! (If you build one)
Post by: Keoni29 on August 09, 2013, 04:15:11 pm
It is a bit annoying how the lcd puts those lines in the wrong place. That way you have to manually keep track of where your cursor is or read from the display every time you check if it should do a line wrap. I guess that is what you get for using a driver that has been designed for driving 1 and 2 line displays.
Title: Re: z80-like portable computer for <$30! (If you build one)
Post by: Keoni29 on August 10, 2013, 04:53:15 am
This little trick is achieved by using custom characters. It is an 8x8 sprite on a 20x4 character display. To resemble my logo I had to put an empty line in the double pixel character, so it is a little bit off, but it looks allright I guess.
Title: Re: z80-like portable computer for <$30! (If you build one)
Post by: Keoni29 on August 11, 2013, 11:46:51 am
http://ez8tut.sourceforge.net/highlighter.php/
I wrote a syntax highlighter for eZ8 syntax. It exports to html and BB forumcode. Example:
include "ez8.inc"

vector reset = 1000h
org 1000h

main:
   di         ;Disable interrupts as we won't be using them
   srp #00h      ;Set working registers base address (Working registers are R0-R15)
   ldx SPH,#00h      ;Set stack pointer base address
   ldx SPL,#FFh      ;(the stack is 00ffh - 0000h so 256 bytes large)
   
   ldx PAADDR, #01h   ;Access the data direction subregister
   ldx PACTL,#00h      ;Set data direction of port B to all outputs. 0 = output, 1 = input
   ld  R4,   #77h      ;Load register R0 with EEh. This will be our rotated value.
   brk         ;Breakpoint. The debugger will stop the cpu here.Press the go button to
            ;continue execution.
loop:
   ldx PAOUT, R4      ;Load the output register of port B with the value of our counter.
   rr R4         ;Increase our counter by 1.   
   call delay      ;Call our delay function.
   jp loop         ;Jump back to loop
delay:
      
   ld R0,#0Fh      ;Load value 0FFFh in the 16 bit register pair RR0 (consists of R0 and R1)
   ld R1,#FFh
outer:
   ld R2,#FFh      ;Load value 0FFh in 8 bit register R2

   djnz R2,$      ;Decrease
   decw RR0
   jp nz, outer      ;While the register pair has not reached 0 (nz) yet jump back to outer
   ret         ;Return from routine


There is a bug in omnimaga's stylesheet that causes the preformatted text to look different from normal pre tags apparently since this should format right.
Title: Re: z80-like portable computer for <$30! (If you build one)
Post by: DJ Omnimaga on August 16, 2013, 07:38:46 pm
Wow I like it so far Keoni29 :D
Title: Re: z80-like portable computer for <$30! (If you build one)
Post by: willrandship on August 16, 2013, 09:17:09 pm
We're currently discussing using a parallax propeller to handle various I/O tasks, including hardware-generated VGA/Composite video. While the propeller works on handling the various I/O devices like the SD card, keyboard, video, audio, etc., the ez8 has plenty of time to run user programs.
Title: Re: z80-like portable computer for <$30! (If you build one)
Post by: Keoni29 on August 17, 2013, 09:51:04 am
I am a complete noob with propeller chip, but I managed to combine two programs: the TV terminal library and the Serial library. I made a serial terminal :) At the moment it is one way. I have not hooked up a keyboard to the propeller yet.
Title: Re: z80-like portable computer for <$30! (If you build one)
Post by: aeTIos on August 17, 2013, 01:48:03 pm
So how far is this from being build-ready? I'd like to solder this thing together :3
Title: Re: z80-like portable computer for <$30! (If you build one)
Post by: Keoni29 on August 17, 2013, 01:59:38 pm
Well you could already build it. There is just no software for it yet :P
Title: Re: z80-like portable computer for <$30! (If you build one)
Post by: aeTIos on August 17, 2013, 02:04:16 pm
ah lol... so there are no changes in the part list and such.
Title: Re: z80-like portable computer for <$30! (If you build one)
Post by: Keoni29 on August 17, 2013, 02:07:54 pm
Yes there have been quite a lot of changes
Title: Re: z80-like portable computer for <$30! (If you build one)
Post by: willrandship on August 17, 2013, 07:22:30 pm
The only really solid things about the project currently are:

ez8 micro: get a 64xx series one, please. The 082A series is smaller, but has an internal oscillator. However, the difference in flash causes several problems for programming for cross-compatibility.

speaker: Get one. It will probably be hooked to the propeller, but that could change.

SD card: See speaker. Same reasoning.

Keyboard: Get a PS/2 female port unless you want to chop off a plug.

Other than that, it's hard to guarantee anything. Most of the other circuitry won't affect compatibility, as long as it works. Video is a difficult question, since LCDs cost a lot of money (read: >$15 for anything good) and the propeller supports VGA and Composite out of the box. Right now, we're thinking VGA, with various text and graphics modes the propeller will handle.

For example, text mode with customizable fonts would make for an easy monochrome tile system, and there will probably also be a color tile system. There will definitely not be a direct 24-bit color bitmap mode, since that would take 230 KB just for a 320x240 resolution, and the propeller chip only has 32 K total. Text modes can be much higher resolution, though, as can certain drawing-based methods, if someone codes them ;)

The method for interfacing the ez8 to the propeller is still being discussed. The ideal, in my opinion, would be a shared RAM area. By using an SPI RAM chip (32k or so) or perhaps by making the propeller's 32k RAM space available over SPI, the graphics could be implemented in a framebuffer, and other devices could be handled simply by writing the correct byte.
Title: Re: z80-like portable computer for <$30! (If you build one)
Post by: Keoni29 on August 19, 2013, 09:36:45 am
Propeller chip running a demo program of it receiving and processing bytes from the eZ8 at 115200 baud. Haven't tested it at a higher rate yet. Video generation and serial is handled by cogs running ASM code. The processing of data is done by an interpreter, so that is a little bit slow. I have to put delay in between writes because of this. When I switch to all ASM that should not be a problem anymore.

Edit:This is composite video by the way.
Title: Re: z80-like portable computer for <$30! (If you build one)
Post by: TIfanx1999 on August 19, 2013, 04:46:42 pm
Very nice! :D
Title: Re: z80-like portable computer for <$30! (If you build one)
Post by: Keoni29 on August 19, 2013, 04:54:12 pm
Thanks. I am gonna search for a nice graphics engine to use. I learned the Spin interpreted language used by the propeller by looking at the library code. I am far from being able to write propeller ASM (short: PASM), but I think using someone elses graphics engine would do just fine.
Title: Re: z80-like portable computer for <$30! (If you build one)
Post by: Keoni29 on August 20, 2013, 05:23:09 am
Oh, I have not showed it here, but I was working on a wooden enclosure for the thing.
(http://8times8.host56.com/wp-content/uploads/2013/08/2013-08-14-13.53.34.jpg)
I posted it on my blog, but I was not sure if I put if on omni yet.
Title: Re: z80-like portable computer for <$30! (If you build one)
Post by: Keoni29 on August 23, 2013, 10:31:04 am
I am working on a new graphics engine for the propeller chip. This engine has 16 colors per tile instead of 4. It might even become 16 colors per 16x1 pixels, but I'm not sure yet. Tomorrow I will work on smooth scrolling and maybe sprites.

Edit: Forgot to attach the captured picture. This composite video comes from the propeller chip and is captured using a pci video capture device.
I blend two tiles together by alternating them rapidly to achieve this effect. One of the tiles has horizontal color bars and the other has vertical grayscale bars. You could blend together any color you like. I still have about 130 unused cycles in between tile processing and outputting pixel data, so I have some cyles left for sprites.
Title: Re: z80-like portable computer for <$30! (If you build one)
Post by: aeTIos on August 23, 2013, 02:30:59 pm
Problem: I think you need a monitor for this which I don't have D:
Title: Re: Re: z80-like portable computer for <$30! (If you build one)
Post by: DJ Omnimaga on August 23, 2013, 05:33:10 pm
Very nice Keoni :D.
Title: Re: z80-like portable computer for <$30! (If you build one)
Post by: Keoni29 on August 23, 2013, 06:19:35 pm
Problem: I think you need a monitor for this which I don't have D:
It will work on any ntsc compatible television with composite video input. (pal looks like crap, but it is possible)
Title: Re: z80-like portable computer for <$30! (If you build one)
Post by: aeTIos on August 24, 2013, 03:31:21 am
Hmm.. I see.  Still doesn't get me a TV lol.
Title: Re: z80-like portable computer for <$30! (If you build one)
Post by: Keoni29 on August 24, 2013, 05:00:47 am
You know what's crazy? A second hand crt television is a lot cheaper than a monochrome lcd. It also has the added benefit of being a color display and it has a larger resolution than those cheap 128*64 lcd displays.
Title: Re: Re: z80-like portable computer for <$30! (If you build one)
Post by: DJ Omnimaga on August 24, 2013, 11:53:56 am
Is that why the TI-89 and Classpad 330 still cost $160? :P
Title: Re: z80-like portable computer for <$30! (If you build one)
Post by: Keoni29 on August 24, 2013, 02:15:26 pm
No, for consumers lcd screens are expensive. They are cheaper in bulks.
Title: Re: z80-like portable computer for <$30! (If you build one)
Post by: Keoni29 on August 25, 2013, 12:00:07 pm
Allright! Horizontal scrolling works now :D I have to make it nicer now because it does not clip tiles yet.
It's very very hackish. I modify the frame time for the back and front porch to get scrolling. I can scroll smoother than per pixel this way :D
Title: Re: z80-like portable computer for <$30! (If you build one)
Post by: DJ Omnimaga on September 10, 2013, 01:31:28 am
Do you mean like on the 84+CSE or just some custom ASM routines to ease game development?
Title: Re: z80-like portable computer for <$30! (If you build one)
Post by: Keoni29 on September 10, 2013, 03:07:12 am
I modified the ASM of the video driver. It did have scrolling out of the box, but since the video driver takes tiles I have to use some accurate code to be able to scroll with clipping. In the V axis that is not a big problem. Just set the video counter to the offset multiplied by the horizontal tilecount and there you have your vertical scrolling, but horizontal is a bit more tricky and it involves messing with the video scale register in real time (it contains timer values).

The video generator can only assign 4 colors per pixel per tile and to shift the tile grid you need to shorten a tile on the left and shift in another tile that is 16 - the size of the leftmost tile in pixels. To do this you set the video timer so it fetches new data after for example 7 pixels have been drawn. Then switch back to 16 pixels and draw the other tiles like normal. Then do the last 9 pixels using the same trick I used on the leftmost tiles.

So this is what happens:
do visible porch line
while it draws that: set video timer to 7 pixels
tile0 << 9 (leaves you with 7 more pixels)
send shifted tile data to video generator using the WAITVID instruction
while it draws that: set video timer to 16 pixels
do all of the tiles in the middle
at the last tile you set the video timer to 9 pixels
tilex << 7 (leaves you with 9 more pixels)
do visible front porch line

repeat for all lines you want to scroll horizontally.


I have not implemented it this way yet though. I am focussing on school at the moment.
Title: Re: z80-like portable computer for <$30! (If you build one)
Post by: DJ Omnimaga on September 10, 2013, 04:15:49 am
I don't understand much sadly since this is very technical, but would this be as fast as if it was built in in the same way as the 84+ LCD can wrap around?
Title: Re: z80-like portable computer for <$30! (If you build one)
Post by: Keoni29 on September 10, 2013, 04:17:21 am
It's all about racing the electron beam: Decrease tile size at the front, draw all the tiles, fill in leftover space at the back. That is how it shifts.
Title: Re: z80-like portable computer for <$30! (If you build one)
Post by: willrandship on September 10, 2013, 05:12:27 am
DJ, this is VGA/Composite output. If it doesn't run at 60 FPS, it doesn't have a steady image, since the electron beam keeps tracing, and gets off.
Title: Re: z80-like portable computer for <$30! (If you build one)
Post by: Keoni29 on September 15, 2013, 09:38:24 am
I just hooked up a commodore 64 keyboard to the eZ8 computer. The c64 keyboard is just a matrix of switches like this:
It's really easy to read individual keys.
(http://www.waitingforfriday.com/images/thumb/e/ee/C64_Keyboard_Schematics_PNG.png/600px-C64_Keyboard_Schematics_PNG.png)

Should be able to make some interactive software now :D
Title: Re: z80-like portable computer for <$30! (If you build one)
Post by: Eiyeron on September 15, 2013, 09:39:22 am
PORT VIM! PORT VIM! With this editor, you'll have quite an easy way to code on it!
Title: Re: z80-like portable computer for <$30! (If you build one)
Post by: Keoni29 on September 15, 2013, 11:48:35 am
I just managed to read every single keypress event. The cpu store all key states in registers. That way it knows which keys should not cause a trigger because they are held down. I am now gonna write a simple typing demo I guess?

Edit:



I recorded some footage using my video capture card. It shows how it reads key input from the c64 keyboard.
The first byte is the column number. The second byte corresponds to the bit of the pressed key.
Example:
Key E is 0x02_40 because it's the 2nd column and it's the 6th key, so 2^6 = 0x40
Title: Re: z80-like portable computer for <$30! (If you build one)
Post by: Keoni29 on September 18, 2013, 04:32:26 pm
There we go: String input. Very crude and no fancy features like delete, return and shift yet though (cause who needs those?)

Title: Re: z80-like portable computer for <$30! (If you build one)
Post by: Keoni29 on October 05, 2013, 08:03:15 am
Working on a string parser. I got this down already:
-User input
-Keyboard string gets stored
-Tokenizer for single tokens

To do:
-Tokenizer that takes a string and converts all the words into tokens.
-Token interpreter.

Spoiler For Spoiler:
Title: Re: z80-like portable computer for <$30! (If you build one)
Post by: Keoni29 on October 06, 2013, 03:01:17 pm
After a lot of frustration and a day of work:

You can now run programs from the shell. Every command corresponds to a pointer to a program. Just type it in, hit return and the cpu will do the rest for you! Isn't that convenient?
Title: Re: z80-like portable computer for <$30! (If you build one)
Post by: Streetwalrus on October 06, 2013, 03:45:03 pm
It sounds awesome but unfortunately I can't watch the video. :/
Title: Re: z80-like portable computer for <$30! (If you build one)
Post by: Happybobjr on October 06, 2013, 03:49:31 pm
Looks really cool!
Title: Re: z80-like portable computer for <$30! (If you build one)
Post by: Streetwalrus on October 06, 2013, 03:57:38 pm
Well, I've been able to watch it and it looks really cool. :D
Title: Re: z80-like portable computer for <$30! (If you build one)
Post by: Keoni29 on October 06, 2013, 06:16:16 pm
Thank you. I worked really hard on it this weekend.
Title: Re: z80-like portable computer for <$30! (If you build one)
Post by: willrandship on October 06, 2013, 09:22:20 pm
That's pretty fancy. Are the programs being run on the propeller or the ez8?
Title: Re: z80-like portable computer for <$30! (If you build one)
Post by: TIfanx1999 on October 07, 2013, 12:08:16 am
Nice work Keoni! :)
Title: Re: z80-like portable computer for <$30! (If you build one)
Post by: Keoni29 on October 07, 2013, 02:17:35 am
Everything runs on the ez8. Th propeller chip is just a serial terminal at the moment.
Title: Re: z80-like portable computer for <$30! (If you build one)
Post by: DJ Omnimaga on October 07, 2013, 11:46:38 am
I like how this runs on a TV. It makes it look even more old school. You should do a small game demo on it. ^^
Title: Re: z80-like portable computer for <$30! (If you build one)
Post by: Keoni29 on October 07, 2013, 12:08:14 pm
Yeah I took that into consideration when I had to choose between VGA, LCD and TV.
Title: Re: z80-like portable computer for <$30! (If you build one)
Post by: Keoni29 on October 11, 2013, 08:53:24 am

link (https://www.youtube.com/watch?v=4DyPKRJV9PI&feature=c4-overview&list=UUgo1GFM82sOconrrbybnEbw)

After a 5 hour non-stop coding session I finally got the string parsing to work. With the new routines I wrote I am able to split a string up in segments and store the address of the segments in a table with pointers.

Example:
command "string with spaces in it" 2345 OtherStuff
is interpreted as:
command
string with spaces in it
2345
OtherStuff

These are all strings. There is no routine for converting strings to integers yet. Data conversion should be taken care of by the program.

Program PING is fairly straightforward.
pseudocode:
Code: [Select]
print "pong:"
if argc>=2
print argv[1]
end
return
Title: Re: z80-like portable computer for <$30! (If you build one)
Post by: Streetwalrus on October 11, 2013, 11:27:15 am
Cool ! You make me more and more want to build an ez80 (not typo) based computer. :D
Title: Re: z80-like portable computer for <$30! (If you build one)
Post by: Keoni29 on October 11, 2013, 11:31:56 am
Yeah I'd like to work with that microprocessor some day too. I might just order a bunch sometimes.
Title: Re: z80-like portable computer for <$30! (If you build one)
Post by: Spyro543 on October 11, 2013, 12:35:09 pm
Nice to see that you're making some real progress! I haven't really worked on my PIC computer idea at all...(you can thank the new Terraria update for that :P)
Title: Re: z80-like portable computer for <$30! (If you build one)
Post by: Keoni29 on October 13, 2013, 05:03:21 pm
I have an evaluation board with an eZ8 on it that I use for developing the software. It's a lot more convenient than my previous setup with a tv capture card. Once the firmware is done I will put it all in a box with a keyboard on it and use it as a stand-alone device.

Screenshot of the pc serial terminal software I use at the moment:
(http://img.ourl.ca//terminal.png)
This is a program I am working on that allows you to hex edit flash.
Title: Re: z80-like portable computer for <$30! (If you build one)
Post by: willrandship on October 13, 2013, 08:17:16 pm
Imagine how much easier that would be if we had access to the external data memory bus. Up to 64 KB of external RAM? Memory-map some to external peripherals and we'd have a pretty sweet hardware bus (not to mention another 64 KB of RAM)
Title: Re: z80-like portable computer for <$30! (If you build one)
Post by: Keoni29 on October 14, 2013, 02:51:24 am
I'd suggest using an eZ80 in that case.
Title: Re: z80-like portable computer for <$30! (If you build one)
Post by: Eiyeron on October 14, 2013, 02:52:27 am
I like how the fist thing we see is a SYNTAX ERROR! :p
Title: Re: z80-like portable computer for <$30! (If you build one)
Post by: willrandship on October 14, 2013, 03:26:13 am
@keoni, the reason I brought it up is that the CPU core supports it. They just don't have any ICs with the address pins broken out.
Title: Re: z80-like portable computer for <$30! (If you build one)
Post by: Keoni29 on October 14, 2013, 03:29:44 am
I was doing some other work on the computer and I made a typo :P
Title: Re: z80-like portable computer for <$30! (If you build one)
Post by: willrandship on October 15, 2013, 07:02:05 pm
So, I got it uploaded to my dev board, and I'm having a bit of an issue.

I'm getting the right length of responses (approx 130 characters on reset ie. the startup message, pong: + whatever string I pinged) However, the text I get back is 100% garbage. Something's not right here. Have tried on two separate computers, same issue.

Specifically, here's the startup message.
Code: [Select]
00 40 40 40 40 40 4A 4A  4A 40 C5 BA 78 40 C3 CF .@@@@@[email protected]@..
CD F0 F5 F4 C5 F2 40 F3  F9 F3 F4 C5 CD 40 4A 4A  ......@......@JJ
4A 40 40 40 40 40 0D 76  74 8B 40 B2 8F 8D 4C 40  J@@@@@[email protected]@
74 8B 40 B2 81 8D 4C 40  7B 40 C3 CF CD CD C1 CE  [email protected]@{@......
C4 F3 40 C2 F5 C9 CC F4  40 C9 CE 4E 0D C2 F9 40  ..@[email protected]...@
8B C5 CF CE C9 72 79 40  4D 4D 40 C5 BA 78 F4 F5  .....ry@[email protected]..
F4 4E F3 CF F5 F2 C3 C5  C6 DF F2 C7 C5 5E CE C5  .N...........^..
F4 0D 0D B2 C5 C1 C4 F9  40 F4 CF 40 F2 CF C3 CB  ........@..@....
41 0D                                             A.
Title: Re: z80-like portable computer for <$30! (If you build one)
Post by: Keoni29 on October 16, 2013, 02:27:04 am
Check the baud rate. I set it to 115200 baud in the source, but you can change if your pc cannot handle it.
Title: Re: z80-like portable computer for <$30! (If you build one)
Post by: willrandship on October 16, 2013, 02:28:16 am
I'll try it, but this PC should be able to handle it. I'll go with 9600 first, and scale it up from there.
Title: Re: z80-like portable computer for <$30! (If you build one)
Post by: Keoni29 on October 20, 2013, 07:30:33 am
Demo of the character display released.
http://ez8tut.sourceforge.net/media/charDisplay_v1_2.zip
I tested it with my own display. It should work with most character display modules.
Title: Re: z80-like portable computer for <$30! (If you build one)
Post by: Keoni29 on January 01, 2014, 06:52:13 am

Tile based graphics. Very slow communication with the video generator though.
Title: Re: z80-like portable computer for <$30! (If you build one)
Post by: TIfanx1999 on January 02, 2014, 05:21:52 pm
Very cool! Could definitely use some speed, but it's still awesome! :D
Title: Re: z80-like portable computer for <$30! (If you build one)
Post by: Keoni29 on January 02, 2014, 05:24:29 pm
The read buffer size seems to be hardcoded and I think the read buffer is located in the cog's own memory. I am not going to rewrite the code for serial. Instead I am going to write code for an SPI slave which writes the incoming bytes to shared memory where the tilemap is stored. This means that the bytecode interpreter is only needed to bootstrap the cores, but it does not act like a bridge anymore. This will increase the speed!
Title: Re: z80-like portable computer for <$30! (If you build one)
Post by: Keoni29 on January 06, 2014, 01:42:40 pm
Testing my syntax highlighter with the graphics test code:

; Graphics.inc
; Tile based graphics. For use with the Parallax Propeller multicore chip.

; Routine: copy tilemap
; RR2 holds pointer to the tilemap in flash
cp_tilemap:   
   ;add R5,#20h      ;Calculate address of last tile
   ;adc R4,#01h
   ld R1,#0
row:
   ld R0,#0      ;Amount of columns
tile:
   ldc R2,@RR4
   call w_tile
   incw RR4
   inc R0
   cp R0,#17
   jr ne,tile
   inc R1
   cp R1,#15
   jr ne,row

   ret

w_tile:
   push R0
   ;Send x coordinate
   call putc
   call delayshort
   call delayshort

   
   ;Send y coordinate
   ld R0,R1
   call putc
   call delayshort
   call delayshort
   
   ;Send tile number
   ld R0,R2
   call putc
   call delayshort
   call delayshort
   call delayshort
   pop R0
   ret
   
Title: Re: z80-like portable computer for <$30! (If you build one)
Post by: Keoni29 on February 21, 2014, 09:20:58 am
Because the propeller chip is not well suited for this project I decided to go with a gameduino for graphics instead. The propeller chip is really meant to be used as the master in a computer system which is not the case here. When it's a slave device the communication is really slow since it does not have hardware SPI nor RS232.

The gameduino has some nice features including 256 hardware sprites and 512 pixel xy smooth scrolling.
I am working on the gameduino driver code for the eZ8 computer. So far I can initialize the gameduino and set the background to whatever color I want. I need to write some fill routines now for filling large chunks of the gameduino's internal memory. I can port most of the gameduino library to asm quite easily because I made the macro's very similar to the gameduino library functions.

Edit: I might split from this topic since my computer is not quite portable anymore.

Title: Re: z80-like portable computer for <$30! (If you build one)
Post by: Keoni29 on February 23, 2014, 03:29:39 pm
Still writing the standard gameduino routines. It is tedious work, but when it's all done it will be much easier to work with it. I made a little test program that reads I/O portB and puts its content on the screen. Those dots are custom characters. Because of the way the gameduino works I had to use two separate characters (one for each color.) The gameduino has a palette for every character, but not for every tile on the screen. This results in a lot of tile duplicating when you want different colors for the same tile on one screen. This is the opposite of what the NES does for example and it is not very convenient. You can get a lot of colors on screen, but it will result in some speed loss.

Some things I will be working on next week:
- Reworking the OS a bit so it is possible to load and execute programs fetched from the PC via serial.
- Adding jump tables for the serial interrupt, so applications can use it.
- Maybe experiment with timers (especially the watchdog timer. whenever it times out it will dump the working register contents on screen)
Title: Re: z80-like portable computer for <$30! (If you build one)
Post by: Keoni29 on February 24, 2014, 05:09:23 pm
I am working on a file transfer interface. To pull files from my pc to the eZ8 I first send the filename over serial and then a program running on my pc dumps the content of the file over serial. At the moment it only works with files that are exactly 512 bytes long (the size of a flash page)

Syntax on eZ8:
load page# filename(max 16 characters)
Syntax on PC:
serialDisk port

You can later execute the machinecode by typing:
execute page#
It will execute from the page's base address, so the first instruction needs to be there.
Title: Re: z80-like portable computer for <$30! (If you build one)
Post by: Streetwalrus on February 24, 2014, 05:27:52 pm
Quite some nice progress Keoni ! :D
Title: Re: z80-like portable computer for <$30! (If you build one)
Post by: Keoni29 on February 25, 2014, 12:51:56 pm
I did some more work today. Mostly upgrading/rewriting existing routines. For example: The str2dec routine is now called str2int. It will now reject any characters that are not numbers. The return value used to be only 8 bit, but now it is 16 bits.

I am also working on a graphical demo for the computer. So far I have been able to display a 200x216 pixel image on screen. It uses up the entire character memory of the gameduino. I can double the size of the image if I use the sprites as well. It took quite a bit of crunching to get it to fit in the character memory. I had to go from 25x27=675 tiles to only 256.
Title: Re: z80-like portable computer for <$30! (If you build one)
Post by: Keoni29 on February 26, 2014, 03:27:04 pm
Working on a midi player program for the eZ8. This morning I found out that the midi file format is not as complicated as I thought. It is just a stream of midi events.

Research:
(http://img.ourl.ca/research.png)

I will be using the second UART for midi out. I have a little module for my electronic drum set that has all of the standard midi sounds in it, so I will be using that to generate the sounds!
Title: Re: z80-like portable computer for <$30! (If you build one)
Post by: Streetwalrus on February 26, 2014, 04:06:17 pm
That does sound cool. :D Thouh it would be more retro like if you used one of those C64 SIDs you have.;)
Title: Re: z80-like portable computer for <$30! (If you build one)
Post by: Keoni29 on February 26, 2014, 04:42:15 pm
Good thing I came prepared: http://ourl.ca/20468
Title: Re: z80-like portable computer for <$30! (If you build one)
Post by: Streetwalrus on February 26, 2014, 04:57:39 pm
Wait are you using this ? I got slightly confused and thought you didn't. :/
Title: Re: z80-like portable computer for <$30! (If you build one)
Post by: Keoni29 on February 26, 2014, 06:25:21 pm
I can use both because you can daisy chain midi devices.
Title: Re: z80-like portable computer for <$30! (If you build one)
Post by: Streetwalrus on February 26, 2014, 06:31:33 pm
Oh that's cool. :D
Title: Re: z80-like portable computer for <$30! (If you build one)
Post by: Keoni29 on February 27, 2014, 04:46:34 am
YES! I finally managed to get the midi output working. What I was doing wrong before was that I sent a midi parameter that was 8 bits long instead of 7 bits. This caused some issues.

Now I am going to work on a midi player! I need to figure out a way to time it first. I was thinking about using the vblank interrupt that the gameduino can provide.
Title: Re: z80-like portable computer for <$30! (If you build one)
Post by: Keoni29 on February 27, 2014, 04:01:08 pm
New features:
-Improved hex monitor
-Syscall vector table
-Midi!
-Random improvements to the code
-Blinking cursor :w00t:

I am also re-doing most of the comments. Example:
;===================================================================================================
; S Y S C A L L   V E C T O R   T A B L E
;===================================================================================================
   org 0800h
;0800h : I/O operations ----------------------------------------------------------------------------
   dw putc                                     ;+0
   dw puts                                     ;+2
   dw puts_r                                   ;+4
   dw putFd                                    ;+6
   dw puti                                     ;+8
   dw puth                                     ;+10
   dw 0,0,0,0,0,0,0,0,0,0                      ;(reserved)
   dw spi_transfer                             ;+30
   dw spi_transfer_buffer                      ;+32
   dw 0,0,0,0,0,0,0,0                          ;(reserved)
   dw midiout                                  ;+48
   dw 0,0,0,0,0                                ;(reserved)
;0840h : Memory operations -------------------------------------------------------------------------
   dw F_unlock                                 ;+0
   dw F_erase_page                             ;+2
   dw 0,0,0,0,0,0,0,0,0,0,0,0,0,0              ;(reserved)
;0850h : Video operations --------------------------------------------------------------------------
   dw gd_cpy                                   ;+0
   dw gd_copy                                  ;+2
   dw gd_fillmeup                              ;+4
   dw gd_char_pal                              ;+6
   dw 0,0,0,0,0,0,0,0,0,0,0,0                  ;(reserved)
;0860h : Math routines -----------------------------------------------------------------------------
   dw div_8                                    ;+0
   dw 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0            ;(reserved)
Title: Re: z80-like portable computer for <$30! (If you build one)
Post by: Streetwalrus on February 27, 2014, 06:04:54 pm
Kewl to see this progress. :D
Title: Re: z80-like portable computer for <$30! (If you build one)
Post by: Keoni29 on February 28, 2014, 01:37:18 pm
I am working on a header file that contains all the data you need to develop software for the operating system.

This sample program uses the syscall: puts (print text on screen/terminal)
;===================================================================================
; M E S S A G E   B O X
; eZ8 OS sample program
;
; Description:
;    Draws a box on screen
; Upcoming features:
;  - Custom text in the box
;===================================================================================

   include "eZ8OS.inc"

prg_org(14)      ;Program resides in page 14 of file memory
   
prg_message:
   push cr_x
   push cr_y   
   
   ld cr_x,#30
   ld cr_y,#15
   str_out(str_box_h)
   scrolldown
   str_out(str_box_v)
   scrolldown
   str_out(str_box_v)
   scrolldown
   str_out(str_box_h)
   
   pop cr_y
   pop cr_x
   ret
;===================================================================================
; D A T A   A R E A
;===================================================================================   
str_box_h:
   asciz "+----------------+"
str_box_v:
   asciz "|                |"
;===================================================================================
; M A C R O'S
;===================================================================================
str_out MACRO str
   ld R0,#HIGH(str)
   ld R1,#LOW(str)
   syscall puts
ENDMAC str_out

scrolldown MACRO
   ld cr_x,#30
   inc cr_y
ENDMAC
;-----------------------------------------------------------------------------------
Title: Re: z80-like portable computer for <$30! (If you build one)
Post by: Keoni29 on March 03, 2014, 04:32:47 am
The eZ8 computer plays back MIDI files now!!!
Title: Re: z80-like portable computer for <$30! (If you build one)
Post by: TIfanx1999 on March 03, 2014, 04:57:23 am
That's awesome! :D
Title: Re: z80-like portable computer for <$30! (If you build one)
Post by: Keoni29 on March 06, 2014, 03:18:06 pm

Added a userport. It has 3.3v, 5v, 8IO pins and serial rx tx
The serial tx signal is shifted up from 3.3v to 5v so it can be used for stuff like midi.
Title: Re: z80-like portable computer for <$30! (If you build one)
Post by: Keoni29 on March 07, 2014, 03:46:31 pm
I just hooked up the keyboard to the new board I made. Now I do not have to use the psion pocket computer for input anymore. This frees up the serial port for sending and receiving files from my pc.


The midi files take up a lot of space in flash memory. I can barely fit 3 midi files on the internal flash. That's why I need to include some external memory into the eZ8 computer. I was thinking about using one of these 128Mbit flash roms: http://nl.farnell.com/spansion/s25fl127sabmfi101/memory-flash-128mbit-8soic/dp/2328002 (http://nl.farnell.com/spansion/s25fl127sabmfi101/memory-flash-128mbit-8soic/dp/2328002)
I can store about 300-400 midi files on this chip!
(http://nl.farnell.com/productimages/farnell/standard/GE8SOIC-40.jpg)
Title: Re: z80-like portable computer for <$30! (If you build one)
Post by: Keoni29 on March 14, 2014, 03:46:12 am
I just ordered the memory. It will probably take a little while before it gets shipped to me, so that gives me some time to think about the extended filesystem. Because I made file headers variable-sized I can add things like extended addresses. Only the first block has an extended address, so the other blocks in the file cannot exceed a sector of 64KB. I might add something to work around that. The lower byte in the 'next_block_address' field of the block header is there just so the filesystem won't get confused. It is not actually used at the moment. I could use it to indicate that the file continues in a different 64KB sector.
Title: Re: z80-like portable computer for <$30! (If you build one)
Post by: DJ Omnimaga on April 04, 2014, 02:36:10 am
Wow I watched this video above and the music really sounds great! :D For some reasons I was expecting chiptune-like stuff (nes or sega style), although that would still have been cool. I am curious if that is still progressing btw? I'm glad you continued working on this, although I missed most of the updates lol.

Title: Re: z80-like portable computer for <$30! (If you build one)
Post by: Keoni29 on April 05, 2014, 06:09:44 am
I am waiting for the flash rom to arrive. Then I can continue working on the filesystem.
Title: Re: z80-like portable computer for &lt;$30! (If you build one)
Post by: DJ Omnimaga on April 05, 2014, 12:13:30 pm
I see. Also did you manage to stay under $30 so far? I know sometimes that shipping fees can make a big difference (eg on Ebay some people charge $25 shipping just for a Magic card)
Title: Re: z80-like portable computer for <$30! (If you build one)
Post by: Keoni29 on April 05, 2014, 12:47:45 pm
For the prototype it is well over $30. The gameduino alone cost me $40+10shipping+$20tax+customs fees. It was pretty expensive.
Title: Re: z80-like portable computer for <$30! (If you build one)
Post by: aeTIos on April 05, 2014, 12:48:48 pm
That said, I think you didnt really follow the parts list eventually...
Title: Re: z80-like portable computer for <$30! (If you build one)
Post by: Keoni29 on April 05, 2014, 12:53:21 pm
Nope not really. The parts list was based on the old portable design. I kind of deviated from that idea. I might go back to it though since the operating system allows the use of multiple output devices. I only need to add driver code for an lcd screen.
Title: Re: z80-like portable computer for <$30! (If you build one)
Post by: Keoni29 on April 06, 2014, 10:50:39 am
I have been experimenting with floppydrives today. I found out that you can pretty much define your floppy's data density yourself if you write data slow enough. An IBM formatted double density floppy's shortest pulse length is 4microseconds. The eZ8 runs at 20MHz, so that is a minimum of 80 clocks per signal change. In order to simplify the operating system I will use a second eZ8 to control the floppy drive.
Title: Re: z80-like portable computer for <$30! (If you build one)
Post by: Streetwalrus on April 06, 2014, 02:30:27 pm
Oh that's pretty cool. I think the same goes for HDDs actually.
Title: Re: z80-like portable computer for <$30! (If you build one)
Post by: Keoni29 on April 06, 2014, 03:02:59 pm
I am still figuring out how this works, so this information is not 100% correct!
Old hard drives use the same magnetization patterns as floppy disks. It is called MFM (Modified Frequency Modulation)
I just read a datasheet of a diskette drive. Data is stored as changes in the magnetization layer. On a transition a short low pulse can be detected at the DataRead pin of the drive. The time in between those pulses represents a bit pattern.
2us pulse = a > next up: a
3us pulse = ab > next up: b
4us pulse = ab > next up: a

Example of a pattern starting with logic 1.
Pulse length: 2  3  3  4  ...
Bit pattern:  1  10 01 10 1...

The byte on the end

I do not know how the start of a sector is marked yet though.
Title: Re: z80-like portable computer for <$30! (If you build one)
Post by: DJ Ryan Knutson on April 06, 2014, 04:06:29 pm
Raspberry Pi anyone?
Title: Re: z80-like portable computer for <$30! (If you build one)
Post by: Streetwalrus on April 06, 2014, 05:35:26 pm
And here comes a troll who knows nuthin' 'bout retro programming. Nah jk. :P I do have an RPi, and it's not the same thing at all. There is a nostalgic feel in making this, plus it's diy and more challenging due to limited resources.
Title: Re: z80-like portable computer for <$30! (If you build one)
Post by: DJ Omnimaga on April 07, 2014, 01:35:30 am
We have to understand that the new generation of kids for the most part have never heard of anything other than the Xbox One and Playstation 4. :P They don't even know the Playstation 3 nor the Xbox 360 exists and think that gaming started the day they got their first console and to them, any game (other than Minecraft and Flappy Bird) that has worse graphics than Call of Duty: Ghosts, is worthless. :P

Seriously, though, what Street said. The Raspberry Pi is *not* an old school computer. Keoni29's Z80 computer, which uses a 30 years old processor, on the other hand, is.
Title: Re: z80-like portable computer for <$30! (If you build one)
Post by: aeTIos on April 07, 2014, 02:29:19 am
Raspberry Pi anyone?
Not sure why this dude got downvoted on this post though, its not like he really meant to troll (at least I hope so O.O)
Voted up to compensate because I feel like that post doesnt deserve it.
I am still figuring out how this works, so this information is not 100% correct!
Old hard drives use the same magnetization patterns as floppy disks. It is called MFM (Modified Frequency Modulation)
I just read a datasheet of a diskette drive. Data is stored as changes in the magnetization layer. On a transition a short low pulse can be detected at the DataRead pin of the drive. The time in between those pulses represents a bit pattern.
2us pulse = a > next up: a
3us pulse = ab > next up: b
4us pulse = ab > next up: a

Example of a pattern starting with logic 1.
Pulse length: 2  3  3  4  ...
Bit pattern:  1  10 01 10 1...

The byte on the end

I do not know how the start of a sector is marked yet though.
Cool stuff thar keoni!
Title: Re: z80-like portable computer for <$30! (If you build one)
Post by: Keoni29 on April 07, 2014, 05:40:59 am
It is tough to find all of this information condensed in one webpage/datasheet, because the technology is obsolete. I bet there are some great websites out there, but they have been buried below thousands of floppy drive music tutorials.
Title: Re: z80-like portable computer for <$30! (If you build one)
Post by: TIfanx1999 on April 07, 2014, 06:28:42 am
You're probably right since music seems to be the thing most floppy drives are used for these days.


@Aetios: I don't think it was meant to be trollish either. Hard to say since it was such a short and vague comment.

The point with this machine isn't just to have access to a cheap old school machine. It's about the process of going through and doing it yourself. That's what makes it interesting. So while the end goal may be similar, this is a more involved process.
Title: Re: z80-like portable computer for <$30! (If you build one)
Post by: Keoni29 on April 07, 2014, 08:51:23 am
That is right. Not only did we choose to design the hardware ourselves, but we also wanted to write the operating system for it from scratch. There are not a lot of people who use this microcontroller in the way we do.
Title: Re: z80-like portable computer for <$30! (If you build one)
Post by: Streetwalrus on April 07, 2014, 12:34:17 pm
I don't think it's trollish either. Me saying it was was trollish though (hence the "jk"). That said, I didn't downvote the post.
Title: Re: z80-like portable computer for <$30! (If you build one)
Post by: DJ Omnimaga on April 08, 2014, 01:07:42 am
Unless he was joking, I felt it didn't have much its place in this thread. It's like if he implied that this project was a waste of time because the Rasberry Pi is considerably more powerful for an even lower price, a view that fails to see the point of any retro computer project and the possibility that the project was done for fun.
Title: Re: z80-like portable computer for <$30! (If you build one)
Post by: Keoni29 on April 08, 2014, 09:14:39 am
If I did not care for the esthetics of my projects I would have started writing android apps a long time ago.
Title: Re: z80-like portable computer for <$30! (If you build one)
Post by: Streetwalrus on April 08, 2014, 11:19:01 am
Exactly the same reason why I still program for calcs instead of Android and PCs. :P
Title: Re: z80-like portable computer for <$30! (If you build one)
Post by: Keoni29 on April 08, 2014, 11:42:16 am
Oh I do program pc's, but mainly for tools and stuff. Recently I started writing bootable code for x86 machines too.
Title: Re: z80-like portable computer for <$30! (If you build one)
Post by: Streetwalrus on April 08, 2014, 11:52:48 am
I only program in Python for school on PCs. :P We do some pretty awesome math stuff (I implemented a nice matrix library, including a Gaussian elimination function). :D
Title: Re: z80-like portable computer for <$30! (If you build one)
Post by: DJ Omnimaga on April 08, 2014, 05:44:51 pm
I just kinda prefer old school style games and stuff. But again, there is also the fact that if I made a retro game for today's computers, it would have an hard time competing directly against Final Fantasy 14 and such games. (unless it was released on a site dedicated to retro or outdated hardware stuff like here)
Title: Re: z80-like portable computer for <$30! (If you build one)
Post by: Keoni29 on April 14, 2014, 01:19:23 pm
Yay I got the 16MB flash rom in the mail, so I can start working on the extended filesystem :D
Best part is that my school got it for me, so I did not have to pay for it. The guy who runs the lab is super cool!

Edit: I managed to read the manufacturer's details from the IC. Next I will work on the extended filesystem!
Title: Re: z80-like portable computer for <$30! (If you build one)
Post by: bb010g on April 27, 2014, 04:26:33 pm
Chiptunes, retro programming, pixel art, and their ilk have reached a point to where they are not done due to limitations or to appeal to nostalgia (most of the time), but as a way to force creativity and minimalism. You only have so much to work with and cannot astound with thin fanciness, so you put a lot into everything. Each color and note have to be picked carefully out of a limited toolbox. It's a lot like calculator programming. It's a challenge, and can be beautiful when done well.
Title: Re: z80-like portable computer for <$30! (If you build one)
Post by: Streetwalrus on April 29, 2014, 01:49:25 pm
That is the true wonder of it actually and also why I do it. This is also what you find in retro games. Carefully crafted stuff that ends up as a quality game, while modern devs produce abominations like CoD. The good old HL2 is way better even though it's not even retro, you can see it was made with love. :3
Title: Re: z80-like portable computer for <$30! (If you build one)
Post by: Keoni29 on May 24, 2014, 09:17:55 am
Using a rs232 to telnet bridge on my PC I managed to go on BBS boards! My eZ8 computer is ONLINE!

Read the full article here:
http://8times8.host56.com/?p=430
Title: Re: z80-like portable computer for <$30! (If you build one)
Post by: Keoni29 on October 08, 2014, 05:48:10 pm
I worked on the operating system again today. New features are:
Executing files
Syntax: execute <filename> [OPTIONS]
Options:
f : Force execute even if execute flag is not set.

Creating files
Syntax: fwrite <filename> list of decimal values separated by spaces (at least 1 value)

VT100 terminal control characters
Added control characters to do stuff like clearing the screen. This is only for rs232. I want to create a better terminal emulator for the vga display.

Even more stuff under the hood
Stuff that makes my life easier


I noticed my old code is a bit sloppy. I might have to revisit some routines to make them foolproof.
Title: Re: z80-like portable computer for <$30! (If you build one)
Post by: DJ Omnimaga on October 14, 2014, 02:29:40 am
GLad to see this revived :D