Panda381 / ATX80

ZX-80 computer clone with ATmega8 processor and with BASIC interpreter written in AVR assembler.
36 stars 3 forks source link

increasing RAM to 2k #1

Open robert-rozee opened 1 month ago

robert-rozee commented 1 month ago

hi, this is a very neat project!

if using an atmega328p processor (2k RAM, 32k flash) how difficult would it be to increase the usable RAM setting from the current 1k limit to instead be 2k? and, at the same time, change the program slot sizes for the external eeprom to 2k as well?

i'm rather hoping it may be possible with just be a couple of patches to the pre-built ATX80_328.hex file.

cheers, rob :-)

Panda381 commented 1 month ago

I assume the ATmega328 processor uses more memory, but I'm not sure - it's been many years and I don't remember much of it. And I wouldn't even see it promising to develop this project further. It was more just a study, but it has drawbacks - it doesn't allow to emulate Z80 code and therefore many Z80 programs don't work. Nowadays I would rather solve this with Raspberry Pico - I plan to implement this emulation in the Picopad project, too.

robert-rozee commented 1 month ago

the ATX80 has an elegance of design that the pico does not quite capture, hence my interest in it. and i don't really see the lack of Z80 code access as detracting from it.

yes, the major difference going from atmega8 to atmega328 is the amount of RAM (1k -> 2k) and flash (8k -> 32k). apart from that are just improved specs and additional onboard peripherals. i'll have a dig through your source and see if i can find out where the RAM size is set.

fyi, you may like to have a look at mmbasic for the pico. see: https://geoffg.net/picomite.html https://geoffg.net/picomitevga.html with source here: https://github.com/UKTailwind/PicoMite and a user community here: https://www.thebackshed.com/forum/ViewForum.php?FID=16 mmbasic also runs on the 28-pin DIP pic32mx170: https://geoffg.net/MicromiteMX170.html

cheers, rob :-)

Panda381 commented 1 month ago

The processor definitions are in the include.inc file. Differences for ATmega328 are set here, such as larger RAM - they are taken from the processor definition in the compiler (e.g. E2END specifies the EEPROM size). The ATX80 uses larger memory in the case of the ATmega328.

Yes I know PicoMite, it uses my PicoVGA display driver.

My plan was to continue with the ZX81 (as the ATX81). I started it, but didn't finish it, I started to work on other projects instead. https://www.breatharian.eu/hw/atx81/index_en.html

But I later used its math library in my other projects with calculators (ET-58, ET-57): https://www.breatharian.eu/hw/index_en.html

robert-rozee commented 1 month ago

The ATX80 uses larger memory in the case of the ATmega328.

excellent, although i do see that in boot.S lines 208-209 have the number 950 hard-coded, while lines 236-236 have 951 hard-coded. hopefully these are just limits on the maximum size of the program recovered after a reboot.

i'm interested enough to have ordered a pack of 50x push buttons from ebay, and upon their arrival (on a slow boat from china) will build up a complete atx80. how close did the atx81 come to being complete? it would be neat to also have access to other I2C devices such as the MCP23017 through the use of PEEK and POKE instructions to a buffer!

cheers, rob :-)

Panda381 commented 1 month ago

Maybe you're right about the restriction, I'm sorry, I don't know. I don't remember the details. :-( That's the downside of programming in assembly, that the function of the program is not so obvious and after a while the author doesn't understand it very well.

As I remember, the difference between the ATX81 and the ATX80 is that the ATX81 includes functional most of the float math code (rewritten from the original ZX81 code), display support (VGA/PAL/NTSC), PS/2 keyboard support, and some BASIC command parsing. It was obvious that the entire ATX81 code would not fit in the ATmega8 memory, so I started a second project, the ATX80, where I first solved only the BASIC interpreter. So the ATX80 has a working BASIC, but it doesn't have float math. The merging of the two projects into full working ATX81 never happened.

Later, I started relaying a minicomputer with an ATmega1284 processor (as "the world's last 8-bit computer"), because it has enough flash memory (128 KB) for large programs from the ZX Spectrum, and it also has enough RAM (16 KB) to use pixel graphics like the ZX Spectrum. It was intended to be a full-featured equivalent of the ZX Spectrum. I implemented the display handler and graphics modes, and that worked fine, but then I quit because I started working on 32-bit microchips instead.