Oct 09 discussion in cosmacelf Yahoo! group by Lee Hart, about a PIC emulating an 1802 versus an impementation as an ELF-like system, only with serial-based interconnections. For convenience, I'm calling this a "SELF" for serial ELF. See the Web page "http://www.retrotechnology.com/memship/memship.html" at for more information. - Herb Johnson Oct 8th Re: [cosmacelf] A Starter System: My Thoughts and Experiences [Mark Graybill wrote a substantive post, about his start with microcomputers, his experiences teaching digital logic and small systems including building ELF systems. Lee reponds with exerprts from Mark's posts.] Mark Graybill wrote: > I've thought of doing a starter system based around a microcontroller > emulation of a processor... [but] the 8085 project was worth because I > don't have to worry about the fidelity of my simulation Very true. There is an overpowering tendency to get a program "mostly correct", and then lose interest and move on to something else. The simulation is left a little buggy, and so not entirely reliable. Later, you spend hours trying to fix an emulated program, only to discover that it was due to a bug in the emulation rather than in the emulated program. Very frustrating! A *real* CPU eliminates this problem. > I had been building many computers and many circuits before I ever > decided to build a digital computer system... I could > build all sorts of different circuits from scratch because of playing > with the 100-in-1 kit and various others like it... Same here. I think this background is vital to have for a solid understanding of electronics. It's equivalent to a mechanical engineer starting with Legos, then bicycles, then lawnmower engines before he learns to work on cars. To some, working on simpler systems seems like a waste of time. Why not eliminate all those tedious early steps, and start them right out at the top when they get to college? But, that's not how we learn. You wind up with electrical engineers that don't know that resistors get hot, or mechanical engineers that don't know which way to turn a nut to loosen it... or computer engineers that don't know that it's even possible to do anything with less than megabytes of memory, GHz clock speeds, and huge compilers. > Micro trainers are nice, but they really only have limited utility > unless there's been some groundwork laid before getting to that > point. I wonder if the way to do it is by having a simple micro that has an ELF-like front panel. But then have it start with *really* simple programs (one or two instructions), that teach it to be an AND gate, or OR gate, or NAND... Then progress to slightly longer programs to make a flip-flop, or counter, or 4-bit adder. This way, the student is learning what the building blocks do, without having to literally build a circuit with different chips. I think the key to learning is to a. Keep the steps very small, b. But allow the student to do them very quickly, c. And find some useful purpose for them, so he/she immediately sees why you would want to do it. I bought one of Terrepin's "ProBot" turtle robots. It arrived today. http://www.terrapinlogo.com/pro-bot.php Right now, my son is on the kitchen floor, with a large sheet of paper, drawing shapes with it in Logo. A kid that's normally addicted to TV or computer games has been doing this for two hours straight! Each program he enters takes less than a minute. Each one executes in another minute (to draw a 5-pointed star, or push a jar lid (hockey puck) to a goal, etc. So he's easily gone through 100 programs in that time. :-) [Lee was shown a PIC PIC12F629 processor which could emulate an 1802. Here's his response:] Looks like a great start! It seems sub-minimal, though: - Where are the mode switches (reset, wait, load, run)? - Multiplexing the 8 in / 8 out ports like this means you can't easily hook anything else to them. - How do you expand it (more memory, more I/O)? I'm envisioning something like a "CPU" chip, one or more serial "memory" chips, and one or more "I/O" chips. The CPU chip: ------------ - 2 power pins - +5v - GND - 2 serial memory pins (I2C), or 3 serial memory pins (SPI) - SCL (clock) - SCL (clock) - SDA (data) - SDI (data in) - SDO (data out) - 2 (I2C) or 3 (SPI) serial I/O pins - SCL (clock) - SCL (clock) - SDA (data) - SDI (data in) - SDO (data out) - and perhaps 1 or more of the 1802's control pins - Q output - /INT input - /EF1 input - /EF2 input - /EF3 input - /EF4 input - /CLEAR input - /WAIT If all of these were on one chip, it would need 2+3+3+8=18 pins. The memory chip --------------- The memory chip would be one of the many standard 8-pin serial memories. The 2-wire I2C interface needs fewer pins, but is slower. I2C parts generally have 3 address select pins that you hard-wire to allow up to 8 chips on the same 2-wire bus. The 3-wire SPI interface mainly allows a greater choice of chips, and is much faster. Some examples: - 24C02 256 byte EEPROM I2C EEPROMs are moderately fast to read, - 24C04 512 byte EEPROM very slow to write, nonvolatile, - 24C08 1k byte EEPROM and cheap ($0.29 to $1.95 for the - 24C16 2k byte EEPROM chips shown). Max clock speed <400KHz. - 24C32 4k byte EEPROM - 24C256 32k byte EEPROM - 24C512 64k byte EEPROM - PCF8570 256 byte I2C RAM RAMs are fast read, fast write, but - 23K64 8k byte SPI RAM lose their data when power is off. - 23K256 32k byte SPI RAM $1.49 to $4.41 for the chips shown. - FM24C04 512 byte FRAM Ramtron ferroelectric RAMs. Fast - FM24C16 2k byte FRAM read/write like RAMs, but nonvolatile. - FM24C64 8k byte FRAM Expensive. Available in both I2C (24C) - FM24C256 32k byte FRAM or SPI (25C) versions. $1.19 to $11.51 - FM24C512 64k byte FRAM for the chips shown. I rather like the idea of trying the Ramtron chips. They write as fast as they read, and are non-volatile. But they are single sourced, and only available in surface-mount packages. SPI may make the most sense because it's faster. A random address read takes about 40 bits. I2C with a 400 KHz clock, that's a 10 KHz bus rate (equivalent to an 1802 with an 80 KHz clock speed). SPI with an 8.9 MHz clock is equivalent to an 1802 at the usual 1.76 MHz ELF clock speed. I/O chips --------- There are an enormous variety of I2C and SPI I/O chips; parallel ports, UARTs, A/D converters, etc. But as a starting point, I like the TI PCF8574; it's simple, cheap, and available. It has an I2C interface so only 2 pins are needed, and up to 8 of them can be used. One interesting option is to use the first PCF8574 to provide the eight 1802 control signals; Q, EF1-4, /INT, /CLEAR, and /WAIT. That gets us back to an 8-pin "CPU" chip. The memory and I/O serial buses could be combined; but the most straightforward approach is to have separate buses for memory and I/O, since they are used simultaneously in the 1802 architecture. [the poster of the circuit referred to it as a "novelty minimalist circuit"] Understood. True minimalism would be something like a PIC or Atmel micro, 8 data switches, 8 data LEDs, an IN pushbutton, Q LED, and two mode switches (Run, Clear, Wait, and Load). No other external parts, except maybe a bypass capacitor and reverse polarity protection diode. Run it on 3v (two AA cells) and you don't need series resistors for the LEDs. Use SPDT switches and you don't need resistors or diodes. It takes a micro with 2 power + 9 outputs + 11 inputs = 22 pins. Of if you want to be clever, Charlieplex the LEDs; 4 output pins drives up to 12 LEDs (but then only one is on at a time; they are multiplexed). This saves 5 pins, so 17 pins are needed. Cleverer still; multiplex the switches to save more pins. But this adds diodes or resistors. I'll bet it could be done with an 8-pin micro. :-) [A seperate thread talked about a "Microtutor II: a modern microcomputer trainer". A number of correspondants discussed various features...] The idea is fine; but somehow, the implementation always seems to veer off course. A KISS design (Keep It Simple Stupid) would be a challenge. We've had microcomputers for 30+years now. Once in a while, a simple one comes out. But almost immediately, complexity sets in. I think it's because those clever enough to expand it can't resist the urge to tack on complexity (because they *like* complexity)! Instead of doing more with less; it winds up doing a little more with far more. :-( How do you keep people "on course"? There's an overpowering urge to add "just one more feature", but fail to fully debug what's already there. The documentation never quite gets written. Things that are needed get left out because they were hard to implement, while useless features that were easy and interesting to the developers get put in instead. An advantage of older systems like the 1802 is that the technology was so primitive that it *forced* you to develop efficient solutions or you couldn't make it work at all! Today, if a problem takes over 5 minutes, people give up and throw in another megabyte and raise the clock speed another 100 MHz. :-) -- [Another poster referred to the ELF.] Of course, you can build the original ELF as described in the Popular Electronics articles. Or, I think the Spare Time Gizmos "ELF 2000" is still available. This is a more modern redesign of the original ELF. More chips, but also more features. [Lee then re-introduced his "membership card" ideas. See the Web page "http://www.retrotechnology.com/memship/memship.html" at for more information. Look for the text file "memship09.txt" link. - Herb Johnson]