Author Topic: z80-like portable computer for <$30! (If you build one)  (Read 59856 times)

0 Members and 2 Guests are viewing this topic.

Offline willrandship

  • Omnimagus of the Multi-Base.
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2953
  • Rating: +98/-13
  • Insert sugar to begin programming subroutine.
    • View Profile
z80-like portable computer for <$30! (If you build one)
« 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

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==
« Last Edit: June 25, 2013, 09:34:39 am by willrandship »

Offline Xeda112358

  • they/them
  • Moderator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: z80-like portable computer for <$30! (If you build one)
« Reply #1 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!

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: z80-like portable computer for <$30! (If you build one)
« Reply #2 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.

Offline Juju

  • Incredibly sexy mare
  • Coder Of Tomorrow
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 5730
  • Rating: +500/-19
  • Weird programmer
    • View Profile
    • juju2143's shed
Re: z80-like portable computer for <$30! (If you build one)
« Reply #3 on: June 25, 2013, 01:03:22 pm »
Sounds fun to do ^_^

Remember the day the walrus started to fly...

I finally cleared my sig after 4 years you're happy now?
THEGAME
This signature is ridiculously large you've been warned.

The cute mare that used to be in my avatar is Yuki Kagayaki, you can follow her on Facebook and Tumblr.

Offline Streetwalrus

  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3821
  • Rating: +80/-8
    • View Profile
Re: z80-like portable computer for <$30! (If you build one)
« Reply #4 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
« Last Edit: June 25, 2013, 01:24:25 pm by Streetwalker »

Offline Keoni29

  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2466
  • Rating: +291/-16
    • View Profile
    • My electronics projects at 8times8
Re: z80-like portable computer for <$30! (If you build one)
« Reply #5 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.
If you like my work: why not give me an internet?








Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: z80-like portable computer for <$30! (If you build one)
« Reply #6 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.

Offline TIfanx1999

  • ಠ_ಠ ( ͡° ͜ʖ ͡°)
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 6173
  • Rating: +191/-9
    • View Profile
Re: z80-like portable computer for <$30! (If you build one)
« Reply #7 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

Offline willrandship

  • Omnimagus of the Multi-Base.
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2953
  • Rating: +98/-13
  • Insert sugar to begin programming subroutine.
    • View Profile
Re: z80-like portable computer for <$30! (If you build one)
« Reply #8 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)
« Last Edit: June 25, 2013, 05:33:13 pm by willrandship »

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: z80-like portable computer for <$30! (If you build one)
« Reply #9 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?

Offline willrandship

  • Omnimagus of the Multi-Base.
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2953
  • Rating: +98/-13
  • Insert sugar to begin programming subroutine.
    • View Profile
Re: z80-like portable computer for <$30! (If you build one)
« Reply #10 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.
« Last Edit: June 25, 2013, 06:45:45 pm by willrandship »

Offline Xeda112358

  • they/them
  • Moderator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: z80-like portable computer for <$30! (If you build one)
« Reply #11 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).

Offline willrandship

  • Omnimagus of the Multi-Base.
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2953
  • Rating: +98/-13
  • Insert sugar to begin programming subroutine.
    • View Profile
Re: z80-like portable computer for <$30! (If you build one)
« Reply #12 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.
« Last Edit: June 25, 2013, 06:48:25 pm by willrandship »

Offline Xeda112358

  • they/them
  • Moderator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: z80-like portable computer for <$30! (If you build one)
« Reply #13 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.

Offline willrandship

  • Omnimagus of the Multi-Base.
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2953
  • Rating: +98/-13
  • Insert sugar to begin programming subroutine.
    • View Profile
Re: z80-like portable computer for <$30! (If you build one)
« Reply #14 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.