• entries
222
606
• views
590742

Emulators and neatened wiring

1577 views

I've decided to switch to a regular 10MHz Z80 rather than a Z180, given the difficulty of using an SDIP 64. I now have a DIP 40 Z80 ready for use, but as I don't have the programmer for the Flash chip (which will hold the OS) there's not much I can do with it physically. I have therefore cobbled together a basic emulator to help develop some of the software beforehand.

To cut hardware costs I'm going to try and handle input in software. One bit of hardware I'm planning on having is an eight-bit open collector I/O port. Open collector pins float high in their reset state, and any device connected to the pin can drive it low. AT devices (keyboard and mouse) use this type of electrical connection, as does the I2C bus and the TI calculator link port. I can use up the eight pins easily - two pins per AT device (keyboard and mouse) makes four, two pins for the I2C bus and two pins for a TI calculator link port.

The I2C bus I mentioned above is a simple way to enhance the computer once built. There will be one device permanently attached to the bus, a DS1307 real-time clock, which will be used to provide time-keeping functions for the OS as well as generating periodic interrupts (the chip could be configured to trigger an interrupt 100 times a second, useful for timing game logic). I could then leave empty space on the circuit board to add other I2C devices over time, or have a socket on the case that could be used to plug in additional I2C modules.

Now that I have some more tools, namely a desoldering pump, I tidied up the horrible hack job I'd done on the graphical LCD (replacing the multiple wires with a single pin header).

Yes, still the PICAXE here, but I'm using its 256 byte EEPROM to store a 32x64 pixel image of Sonic that is repeated four times horizontally.

I'm still not sure what I'm doing with regards to memory or storage. I'm still working on the simple assumption that ROM is 32KB ($0000..$7FFF) and RAM is 32KB ($8000..$FFFF) but this wastes a lot of memory and isn't very flexible at all. I've planned a bank-switching MMU, but as this will require at least four registers to store what appears in each of the four 16KB windows it will end up being physically very large and painful to wire.

As for storage, I have no idea. I have some 32KB I2C EEPROMs, but 32KB isn't exactly very large. Alternatively, I have an old 512MB SD card, and could try talking to it over bit-banged SPI. (SD cards use 3.3V, though, which complicates matters - not to mention that bit-banged SPI is going to be a little sluggish). I also have a USB module which can talk to USB mass storage devices over a serial connection, so maybe I should add a UART to the project. Adding a fully-blown USB module (which also plays WMA, MP3 and MIDI files) to such an otherwise low-tech computer feels like heresy, though.

I have some questions;

What kind of microcontrollers are you using ? I notive that you change language sometimes.

How do you program them ?

Quote:
 Original post by MarijnStevens What kind of microcontrollers are you using ? I notive that you change language sometimes.
I'm using PICAXE microcontrollers (mainly the PICAXE-28X1). They are cheap and have a host of goodies on-board (the 28X1 has hardware I2C, SPI, and serial; it has numerous analogue inputs and PWM outputs) with an easy and feature-packed programming language (including useful routines such as infrared communications and keyboard input). The documentation is excellent and the development tools are free.

Quote:
 How do you program them ?
This is their main advantage, in my eyes - you don't need a hardware programmer. The small price increase over a regular PIC covers a BASIC interpreter that is preprogrammed onto the chip. A simple circuit (two resistors) is used to connect the PICAXE to a computer's serial port, and your BASIC program can be sent directly to the PICAXE using the program editor software, in-circuit.

These chips are not without their disadvantages - they only have small amounts of storage and interpreting BASIC is never going to be as fast as running native assembly - but they more than make up for these shortcomings with their ease of use and low price.

Thanks for your kind words! [smile]

Always cool seeing low level hardware projects. I'm currently working on my own CPU out of 74** TTL Logic chips. Difficult, but fun!

Heya benryves, just thought I'd post and say your project looks really cool and has re-inspired me to get one of those LCDs and do something spectrumesque with the 8 bit microcontroller I liberated from university years ago :) I was just wondering, roughly how do you go about driving the LCD modules in graphics mode? For instance, with your Sonic demo, do you upload your sonic sprite as a load of custom characters and draw them in the correct character positions or do you actually have per-pixel control?

Cheers

Jamie

Create an account

Register a new account