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

0 Members and 1 Guest 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
Re: z80-like portable computer for <$30! (If you build one)
« Reply #120 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.

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 #121 on: October 14, 2013, 03:29:44 am »
I was doing some other work on the computer and I made a typo :P
If you like my work: why not give me an internet?








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 #122 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.
« Last Edit: October 16, 2013, 01:36:32 am by willrandship »

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 #123 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.
If you like my work: why not give me an internet?








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 #124 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.

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 #125 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.
If you like my work: why not give me an internet?








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 #126 on: January 01, 2014, 06:52:13 am »

Tile based graphics. Very slow communication with the video generator though.
If you like my work: why not give me an internet?








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 #127 on: January 02, 2014, 05:21:52 pm »
Very cool! Could definitely use some speed, but it's still awesome! :D

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 #128 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!
« Last Edit: January 02, 2014, 05:25:34 pm by Keoni29 »
If you like my work: why not give me an internet?








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 #129 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
   
If you like my work: why not give me an internet?








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 #130 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.

« Last Edit: February 21, 2014, 05:44:41 pm by Keoni29 »
If you like my work: why not give me an internet?








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 #131 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)
« Last Edit: February 23, 2014, 03:31:40 pm by Keoni29 »
If you like my work: why not give me an internet?








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 #132 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.
« Last Edit: February 24, 2014, 05:10:40 pm by Keoni29 »
If you like my work: why not give me an internet?








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 #133 on: February 24, 2014, 05:27:52 pm »
Quite some nice progress Keoni ! :D

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 #134 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.
« Last Edit: February 25, 2014, 12:53:31 pm by Keoni29 »
If you like my work: why not give me an internet?