Sunday, June 24, 2018

Calculator Processors

Most of the microcontrollers and processors I have looked into using have been for my calculator projects. That's one of the main reasons I did my microcontroller comparison a few years ago. Recently, I have gotten interested in other chips I could use for calculator projects, in addition to the 6502, 6800 family, and 8051 chips I was interested in before.

The main two criteria I have are an external memory bus and through-hole package. Right away, this eliminates most modern microcontrollers, since almost all of them with an external memory bus are SMD only. In theory, I could use a chip without an external bus if it had a few hundred KB of RAM for data and a few hundred more KB of RAM or flash for program space, but I haven't found that in a through-hole package. Another point is that I would like the ability to load programs from an SD card, which is impractical if I need to have the chip reflash itself every time I load a program. Through-hole parts are more convenient to solder, and I would like to do a few more projects with them before I try to start making surface mount boards.

Modern microcontrollers
  • AVR - None of the ATmega series has an external bus. Some of the ATxmega series do, but they don't come in through-hole packages.
  • PIC - For a through-hole part, the PIC32 series is very impressive at 50mhz with 64KB RAM and 256KB of flash, but even this is not enough for what I am planning. The chip requires a separate programmer, and the compiler offers limited optimizations unless you pay, which is absurd in 2018 compared to its competition. It does have something called PMP, which offers a sort of data bus, but it can only address 12 bits, since the DIP part only has 28 pins. 
  • MSP430 - This chip worked well for my RPN Scientific Calculator, but it also lacks an external bus.
  • Propeller - This is an interesting chip but like the others, it lacks an external bus and does not have enough flash or RAM. The one interesting possibility is doing several calculations in parallel, although I don't know how I would use that for a calculator.
  • Zilog - They have some nice chips, including some processors with external buses, but I would like to use something different than what the TI-83 and similar models use.
  • LPC1114 - I really like this chip, and I am using it in my Pocket Calculator, but it also lacks an external bus, and it seems that it is no longer manufactured.
8051 derivatives
  • Dallas DS89C450 - This is the most impressive 8051 I have looked at. Single cycle execution, dual data pointers, and an external bus with page mode are really great. Other things I like are having built in GPIO, which means I can get away with not using a CPLD like I need with a 6502 system. Booting from internal flash also lets me get rid of a separate boot ROM. Right now I am thinking about working on a calculator with this chip before I start on one with a 6502 (or continue the 6502 graphing calculator I started), since the circuit would be much simpler. The main disadvantage is that loading programs from an SD card is typically not possible, since the code space is separate from the data space. One idea is to tie the signals for read and write together to unify the data and code spaces, although I am not sure if this is practical or if it reduces speed due to the delay of glue logic. Another downside is the awkwardness of using DPTRs, since I will mostly be working with data beyond the first 256 bytes of RAM.
  • NXP 80C51MX - I ran across the description of this chip but could not find a datasheet for it. It looks like it could solve my main problem with loading data into the code space, since the memory spaces are unified. It also has an extra 8 bits of address space, allowing it to address 16mb, although that is not too useful, since I should have enough GPIO to handle bank switching myself. It also has a 16 bit stack pointer, according to the link, which would be kind of useful.
  • Atmel AT80251 - The 251 family is an extension of the 151 family and seems to provide the same advantages as the 8051MX. It has a lot of other really neat things that got my attention, like a 16 and 32 bit ALU. Bizarrely, add and subtract with carry only work in 8 bit mode. I suppose with a 32 bit ALU you probably won't overflow very often, but it is still strange not to be able to use it. Also, the DA instruction that corrects BCD computations only works in 8 bit mode. BCD support is not absolutely necessary, but it is nice to have since most of my calculations will use it. Like the 8051MX, it has 16mb of address space, although I could not tell how it outputs the third byte. One disappointing thing is that addresses wrap at page boundaries, which makes it even less valuable compared to managing paging yourself. It also has three stage pipelining, which is supposed to be five times faster, although at 24mhz, it would definitely be slower than the DS89C450. It could make up some of the difference with other added functionality like multiple DPTRs and accumulator functions in all registers. It can also access 16 bits at a time from internal memory, although that is not very useful for me since the internal memory is not reprogrammable.
  • XA series - This is another 16 bit design that has a 24 bit address space. It also has pipelining, a 30mhz clock, and, unlike the other chips, a 16 bit bus mode, which should speed things up quite a bit. It doesn't seem to be derived directly from the 8051MX, since there are some differences, like lack of a unified code and data space and a lot of neat stuff with instructions  like auto increment and indirection. It also has a user stack that allows relative addressing, and some models have internal flash. I'm not sure how it's performance compares, but I'm really interested in using it, because the architecture seems so powerful compared to the other 8051s.
  • STC - This company makes single cycle 8051s like the DS89C450. Apparently, they are very cheap, especially compared to the Dallas chip. While it can access external data memory, it has no way to access external program memory, so I won't be using it.
6800 family
  • 6809 - These are neat chips with some architectural advantages over the 6502 like 16 bit indexes, 16 bit arithmetic, and 8 bit hardware multiplier. The last feature especially is useful because I would only need two small tables to do BCD multiplying quickly. Having a 16 bit stack pointer is also great for allocating temporary memory for functions without having to give up the X index like you do on the 6502. The main reason I won't use it is that the max speed is only 2mhz, and I think i can make up for the 6502's shortcomings compared to the 6809 by running it at a much higher speed.
  • 6309 - This is a clone of the 6809 that has a second "native" mode which enables additional registers and instructions. This mode is more efficient, and the chip itself runs at at least 3.5mhz. A few months ago, I bought one of these to play with, and I would like make something out of it eventually, even if it less powerful than a 6502 running at much higher speed.
  • 68HC11 - From what I can tell, the core of these microcontrollers may be a little different from the 6809 and 6309. One difference is that they have a multiplexed bus, which even at 5mhz would probably offer less performance than the 6309, not counting the increase from native mode. Other microcontrollers in this family, like the 68HC12 and 68HC16, don't seem to be available in DIP or PLCC.
6502 family
  • 65C02 - This is the first processor I started working with, and it has been really fun to play with. There is also a really active community which has helped me with the few projects I have done with it. Compared to most of the other chips I am looking at, the architecture is somewhat primitive, but it is fun to use anyway. Writing a whole operating system for an advanced graphing calculator would not be as convenient with this chip, since it lacks an efficient way (like a frame pointer or 16 bit stack pointer) to allocate temporary memory for functions, but I have been thinking a lot about a software solution to this problem that should increase performance a lot. I definitely want to make a calculator with this processor.
  • 65C816 - This chip runs like a 65C02 until you switch it into 16 bit mode. This mode solves a lot of the frustrations from working with the 6502, including outputting a third address byte in a clever way to extend the address space. Personally, I have never been that interested in working with this chip, although it is generally superior to the 65C02 and 6309. To me, it would be more interesting to build a calculator around either a more interesting vintage chip or a more capable 16 bit chip.
  • 65C134 - This is the microcontroller version of the 65C02. It has 4KB of mask ROM, which is not at all useful to me if I can't reprogram it. That aside, the max speed is only 8mhz, a lot less than the 14mhz max of the 65C02. The one good thing is that it has some GPIO which would simplify memory mapping, although that doesn't make up for the other shortcomings.
  • 65C265 - This is the microcontroller version of the 65C816. It is also limited to 8mhz and mask ROM programmed. One interesting thing is that it can output all 24 bits of its address space without multiplexing, unlike the 65C816. In general, though, it is not useful to me.
  • Other microcontrollers - There is a large amount of 6502 compatible microcontrollers made by many other companies. Some of them add interesting additions like using zero page addresses as accumulators. None of the ones I looked at met my criteria and matched the speed of the 65C02.
Other microprocessors
  • 1802 - This is a kind of quirky processor I read about in relation to retro and homebrew computers. It has sixteen 16 bit registers, although the accumulator is only 8 bits. Any of the sixteen registers can be the program counter, and it has no dedicated stack pointer or sub routine mechanism, which makes it an odd beast. A friend of mine sent me one he had (thanks, Rex!) that I want to play with. According to Wikipedia, the performance of the chip is much lower compared to others like the 6502, since it takes a lot of cycles per instruction, but it is interesting enough to use for a scientific calculator at the very least. There are also improved versions, like the 1805 and 1806, which add stack support and BCD arithmetic which will both be really important for a calculator.
  • Motorolla 68000 - This is a neat chip, and people do make homebrew computers out of it, but I would like to use something different, since the TI-89 already uses it.
  • HD6120 - This is a PDP-8 on a chip, which has a 12 bit architecture. One homebrew project I have seen uses it. I'm mainly curious about it because the assembly instructions for it are so bizarre. Like the 1802, I am interested in it because it is quirky, not because it has much processing power.
  • NS32CG160 - This is based on the NS32016, which is has a full 32 bit core with eight registers and a 16 bit wide bus. This is interesting by itself, especially considering that it has separate BCD add and subtract instructions that can work on 32 bits at a time! It also has a prefetch queue, which will speed things up. The original NS32016, as well as its more efficient successor the NS32032, require an external chip to generate non overlapping clock pulses. The NS32CG160 has this timing mechanism built in and can reach 25mhz, which is why I will use it if I use any chips from this family. I couldn't find this chip or any similar ones like the NS32FX16 on eBay, so I might try buying a junk device that has one to salvage it. The biggest disadvantage is that it only comes in PLCC, which I can use but is not as convenient as DIP.
  • i960 - This is another 32 bit processor that comes in PLCC. It has sixteen general purpose registers, four sets of sixteen local registers, an instruction cache, and parallel execution of some instructions, which gives it an edge over just about all the other chips I have looked at. The datasheet claims really high performance, which I could make use of. The only thing that makes me hesitate is the long and complicated initialization routine to get the chip running. 
  • TMS320 - This is a digital signal processor with a 32 bit accumulator and separate 16 bit address and data buses. It has some neat features like fast multiple/accumulate, like you would expect with a DSP, and a pipelined repeat function. Even though it is not technically a microcontroller, it has a timer and serial port, which are both useful. One thing I really like is the separate address space for I/O, which might eliminate the need for a CPLD. They are also plentiful on eBay. The main drawback seems to be no BCD support.
  • ADSP-21xx - Like the TMS320, this is a DSP in PLCC68. Maximum instruction time is listed as 40ns, compared to 80ns for the TMS320, although I'm not sure how that works out for what I am want to use it for. It has a 24 bit data bus, which is a little strange. It also has an algebraic style assembly format and a separate, optional address mode for boot code. Unlike the TMS320, it does not have a separate I/O address space.
  • TMS9995 - This is another older but interesting architecture. It has some neat features, considering how old it is, like a relocatable register file in RAM, 16 bit ALU, and many addressing modes. The data bus is 8 bit, unlike its predecessor the TMS9900, but it only requires one 5v source, rather than three different voltages. It has a built in shift register, which I might be able to use for memory mapping. From what I can tell, the low clock speed, many cycles per instruction, and 8 bit bus mean performance probably won't be very high. If I ever use this, it would be out of curiosity for the architecture.
  • TMS99105 - This is a superset of the TMS9995 with new instructions including stack operations. The most interesting thing is the macrostore feature where you can remap unused opcodes. I'm not sure how this is much better than a subroutine call, other than saving a tiny amount of program memory, but it does allow you to address an extra 64k of memory space. Like the TMS9995, it comes in a DIP package, but instead of a separate address bus with a multiplexed 8 bit data bus, it multiplexes a 16 bit data bus and a 16 bit address bus on the same pins. It's clock speed is twice as fast as the TMS9995. The one downside I have found is that it costs about $35 on eBay, compared to only about $5 for the TMS9995.
Other microcontrollers
  • 80C196 - The MCS-96 family has members numbered 8095, 8096, and 80196, which is confusing, since you might (incorrectly) assume that the 196 is the successor to the 96 series. Actually, there are a few improvements and extra instructions, but the difference isn't big. Chips in this family (there are a lot of variations) come in SDIP and PLCC, and there are quite a few for sale on eBay. The chips runs at at least 20mhz from what I've found. The architecture itself can do 16 bit arithmetic and a limited number of 32 bit operations like shift. There is no accumulator or register set like other chips. Instead, the majority of bytes in the first 256 bytes of RAM can be used like general purpose registers. Instructions can take three operands, so that the result of a calculation doesn't necessarily have to be stored in the first operand. From what I can tell, there is no BCD support of any kind. There is also a 296 family, but it doesn't come in DIP or PLCC.
  • Renesas H8 - There is a confusing amount of subfamilies in the H8 series. The numbering of the parts makes keeping them straight pretty tough. Many of the chips I have looked at have an external, non-multiplexed bus, which is why they are so interesting. It sounds like the H8/500 subfamily would be better than the H8/300 subfamily, but apparently there are H8S/300 chips in DIP, which appear to be superior to both. I have to do more research to figure out which one would be the best for what I need. Lots of other chips are more interesting to me than the H8, but I may consider using one of them eventually.
  • UPD78C10A - This is one of the chips I found randomly on eBay. It is based on the 87AD architecture, which I had never heard of. The datasheet shows it is an accumulator based architecture with a few extra registers. It has a multiplexed bus and does not come in DIP. I could not find anything too special about it compared to similar chips.
  • HPC - The naming of this family is also a little confusing since different variations are numbered HPC16, HPC26, HPC36, etc. It turns out the first number just indicates whether the chip is commercial, industrial, military, or automotive. This is also an accumulator based microcontroller in PLCC with multiplexed address bus, which puts it low on my list. Reading through the data sheet, there were a few interesting things I saw, like a watchdog circuit that catches memory accesses out of range. It claims high code efficiency with lots of one byte op codes, although the datasheet shows that they expect data already in some of the registers to achieve this. One byte jump +/- 32 bytes is neat, as well as a one byte jump to sub routine that uses a table of 16 subroutine addresses. It has 16 bit BCD, which is useful, but all of this is still less impressive than the other 16 bit chips.
Conclusion
This list ended up a lot longer than I intended because I found so many new chips. Here are my top picks from the list:
  • LPC1114 - My first priority is to finish the Pocket Calculator I recently started using this chip.
  • DS89C450 - The next calculator I am planning on building will use this chip, since I should be able to avoid using a CPLD, and it may be faster than the 6502 calculator I want to build.
  • 65C02 - I have wanted to use this chip for a long time, but I want to try out some of my ideas building other calculators and work on a program I have been thinking about for preprocessing 6502 assembly.
  • 6309 and 1805 - Neither of these chips is especially powerful, but it would be fun to make a simpler calculator with one of them.
  • XA series and NS32CG160 - I would also like to make a calculator out of one of the more powerful processors in PLCC package and these two look like the best candidates.

No comments:

Post a Comment