> I've recently gotten interested in the 6800 processor. Has
> anyone ever used one in a project?
Uh-oh! Uh-oh! The gauntlet has been thrown down and now I must defend my friend the 6502!
In his book "65816/65802 Assembly-Language Programming", author Michael Fischer says, "The 6800 was designed on a shoestring budget. The 6800 came out in February 1974 and was based on the architecture of the then relatively popular PDP-8 minicomputer. It was designed as a compromise between a controller and a general-purpose processor, which resulted in an instruction set that was not especially useful for either application. Later in 1974, eight people who had been involved in the development of the 6800 left Motorola and went to work for MOS Technology..." They built on what they had learned at Mot, and the 6502 was out a year later.
Comparing the old 6800 and 6502 in their original versions is not terribly relevant if you want to know what you can do with them today. Both families have evolved, and I don't think there's any reason to use the slow, instruction-strapped original versions when the newer ones are so much nicer.
> I haven't used one yet, but from reading the books, I see several
> nice features:
> Tri-state address bus. With a 6502, to do any sort of "DMA"
> activity, you'll have to use separed tristate buffers...
The 65816 has a BE (bus enable) pin (pin 40 of the PLCC) for that. [Edit: The W65c02 does too-- pin 36 of the DIP.] It also has VDA (valid data address) and VPA (valid program address) outputs, plus ML (memory lock) to ensure the integrity of read-modify-write instructions in a system where something else also has access to the same memory, ant VP (vector pull) to indicate that a vector location is being addressed during an interrupt sequence. This signal may be used to select and prioritize interrupts from several sources by modifying the vector address.
> Richer instruction set than 6502. It may be that some of them are
> not too useful, but the 6800 has a more complete set of
> instructions, I think.
The 6800 has 197 op codes compared to 65c02's 202. Admittedly, the 02's 32 op codes for BBS, BBR, RMB, and SMB have the bit number built into the op code itself and not into the operand, which may make the op code list look artificially high. But the 65c02 has more than twice as many addressing modes as the 6800 (15 versus 6). The 65816 has 24 addressing modes, and 255 op codes (without the BBR etc above), and one reserved for future expansion with 2-byte op codes.
Comparing any two families of processors, you're likely to find a nice thing or two about one that's not on the other. I've designed PIC microcontrollers into a few products, partly because they're easily available off the shelf with a lot of I/O options, and we can program them ourselves easily. The microprocessor at the heart of a PIC has a couple of instructions that would be nice to have on the 6502; but generally, I hate the PIC's uP. It's extremely clumsy, and takes twice as many instructions and twice as many clock cycles to do a job as the 65c02 would take, if the PIC can do it at all.
> The 6800 descendants are still very popular, and I believe can
> execute 6800 instructions (like 68HC11).
True. Both families have evolved. There definitely are more microcontroller choices in 68 than in 65, by a long shot. On the other hand, the performance of the modern 65's is generally beyond that of the 68's.
> A wider variety of peripheral chips were made for the 6800.
Is that true? The 65's offered the
- 6520
- 6521 PIA
- 6522 VIA
- 6523 TPI
- 6524 PIAT
- 6525 TPI
- 6526 CIA
- 6529 single-port interface (20-pin)
- 6530 RAM, I/O, and Timer
- 6532 RAM, I/O, and Timer
- 6545 CRTC
- 6551 ACIA
- 6552 dual ACIA
- 6560 VIC (NTSC)
- 6561 VIC (PALB)
- 6567 VIC (NTSC)
- 6569 VIC (PALB) text
- 6572 VIC (PALN)
- 6573 VIC (PALM)
- 6582 SID
- 5710 FDC
- 8722 MMU
- 8360 Text-Editing Device
- +other 8000-series that were directly 6502-compatible
(This list does not include the 20 or so 6502 variations like the 6508, or the 65-family microcontrollers, like the 65F11.)
Unfortunately, most of these creatures have gone extinct. Of those, even if you can still find some, they won't work at the faster clock speeds that the modern 65c02 can run. Again, there are many more 68-family modern microcontroller variations available off the shelf.
> - A 16-bit stack pointer. You can put the stack anywhere in memory,
> and it can grow as large as you want!
The 65816 has a 16-bit stack pointer. Its stack-relative addressing modes make it much more efficient to work with parameters passed from routine to routine by way of the stack.
> - 16-bit index register. You can use an indexed addressing mode
> across all of memory!
Again, the 65816 has two 16-bit index registers. You can also use them in 8-bit mode. The index register mode, 8- or 16-bit, is selected through bit 4 of the status register.
> - A separate vector for Software Interrupt (SWI) - so the 6800 has
> a total of 4 vectors in the top of memory. Th 6502 shares the BRK
> vector with IRQ.
The 65816 has a separate BRK vector, and adds the COProcessor and abort interrupt vectors.
> - A 'HALT' signal, which causes the CPU to stop and release the
> buses and the R/W line, so that another device can take over the
> bus (like for DMA). The halt can also be done in software - there
> is a Wait For Interrupt instruction, where the 6800 releases the
> bus until an interrupt occurs.
In addition to the BE input, the 65816 has the SToP and WAIt instructions. I had in mind that although WDC's 65c02 does not have the BE, it does have STP and WAI-- but I can't find that information right now. I've never used them myself.
> Some 6800 down-sides:
> - Requires a 2-phase non-overlapping clock, like the 6501 did.
> This clock is not really TTL - the spec says that it must go to
> close to Vcc level. I think this is easily achieved with an open-
> collector driver, though.
The 6501 was a closer knock-off of the 6800, and Mot sued MOS over it. In an out-of-court settlement, MOS quit making the 6501 and came up with the improved 6502.
Using 74HCxx or 74ACxx parts, the high logic state is really pulled up very close to 5V without the heavy speed and power penalties of going to open-collector.
> When it was new, the 6800 cost 3 times as much as a 6502; but of
> course that's irrelevant now... Both are just a few bucks each.
The 65816 is only about a dollar more than the '02 also. I believe the microcontroller versions of both families however can get up into the $20-$30 range. At the low end of the range, the 68-based microcontrollers are much cheaper.
[I tried to edit this, and Delphi cut it off before the end; so it finishes up in 137.10.]