|
![]()
I am often asked which micro
should I use and why?
This is a series notes based on questions that I have been asked by people considering the purchase of a microprocessor training or development system, generally for home or hobby use. People designing or working with microcontrollers each have their own favorites. It's a bit like asking which is the best car or which is better Pepsi or Coke. There is no best. Each is possibly better suited to some specific task, but will also handle many other tasks with little difficulty. I'm sure there are people who will disagree with some of the points below. Please let me know what you disagree with and why, or even what you agree with. I would like your comments so that I can make this page more useful. Email me.
|
|
Contents:
Q1. Which microcontroller, module or system should I get?
This question is often asked. Unfortunately, I don't think there's a simple answer. Often there is a desire to learn about embedded systems without having a specific project in mind. I would suggest that you think about what you want to achieve and wether or not you want to build up your own hardware. Building your own can reduce the cost, but can also cause some problems for the beginner, such as component sourcing, assembly and fault-finding. Having a project in mind right from the start will provide valuable direction. I think that there are two general categories of system available: Just about any board or module purchased will require some sort of interfacing circuitry. Few will drive relays directly, especially large relays. In most cases the pins on the module are connected directly to the micro chip. If you plan to run wires more than a few feet, some protection circuitry will be required to prevent damage to the micro. What this means is that eventually you will have to purchase a few resistors, capacitors, transistors and diodes, and get the soldering iron heated up. If you're experimenting at home or at school, something like a Basic Stamp is probably a good starting point. With a few switches, LED's etc. you can be up and running quickly. Achieving something quickly is probably the best way to ensure that you stick with it. If you're planning a robotics or more complex project then you should probably look at one of the more versatile controllers, one that does not tie you to a specific programming language or tool set. There will be more work involved, but the potential is there for some very impressive results. Q2. What's it likely to cost? As with many questions, that depends. If you've got plenty of patience, and want to do a lot of research and reading, it can be done for $50 to $80 NZD ($25 to $$40 USD). On the other hand, if you want to take it out of the box, plug it into your computer and write your first program before bedtime, you will be paying $100 to $300 NZD ($50 to $200 USD). The cheapest solutions usually involve purchasing a bare circuit board or kitset, and building it yourself. The plug and go solution is more costly but usually eliminates assembly and hardware problems. Q3. What can go wrong? The most common problem would be the untimely death of a critical component. Electronic components are pretty robust and very long lived when treated with respect and care. Unfortunately, when taking the cheapest track and building your own hardware, there are many more things that can cause problems. One design or construction fault is usually quite easy to find. When you have two or more at the same time, many frustrating hours, or days of fault finding pass before things are rectified, or you call for more expert assistance. Remember also that the pre-built systems are usually bare circuit boards and should be treated with great care. A stray wire or unplanned connection can (to be blunt) blow the crap out of it. Q4. Someone told me I needed a really fast one with "hyper-something", do I? This depends on what you want to do, but, 9 times out of 10, NO. Generally, the higher level languages are slower so you need a faster micro to get the same performance as a slow micro programmed in assembly language. Most applications do not require the latest generation of high speed micro. If you are starting out and your project demands a 20MHz processor, you should probably choose another project and/or program at least some of it in assembly language. A 4MHz clock on just about any of the currently available microcontrollers should be enough for most things if it's programmed in assembly language. Q5. What can I make it do?
Just about anything. What you do with it will probably be influenced by your other interests. Q6. What does PMB recommend? If you're starting from scratch then go with a system that is operational straight out of the box. This will probably save you many hours or days of frustration and confusion. If you have some previous experience with electronic circuits and/or programming and want to save some money, the build-it-yourself option could be considered. You may start with Basic to get things going, but you should learn to use assembly language before moving on to another high level language like C. Assembly will give you an in-depth understanding of the microprocessor, its peripherals, and how it works. This is essential for later on. Assembly language routines are often used with high level languages to achieve things that would otherwise not be possible or would be too slow. Q7. Where do the PMB systems stand? The CPU_3A* modules and development board combination is similar to the CPU_1A1 but includes a slightly faster HC11, on-board real time clock and provides screw terminal connections for much of the HC11 standard I/O. Development and programming are pretty much the same as for the CPU_1A1. The CPU_1A* modules and development board combination is operational straight out of the box. It can be programmed in assembly language, basic, or a high level language like C. Basic and assembly language are supported as supplied. Higher level languages require a third party compiler. The CPU_1A1 is a very powerful little control module. It was originally designed to be reasonably powerful, small size and low cost, specifically for embedding as a central controller into OEM equipment. Since it has been made generally available it has been used by other OEMs, research groups, hobbyists and schools; mostly outside of New Zealand. How to get started with the CPU_1A1 The GPC_4A4 is a module that requires some previous experience and a PIC micro programming tool or programmer. That said, it's cheap, powerful and feature rich. It is intended for embedded applications that require a relatively fast little micro in a confined space. Module or Chip Should you use a Basic Stamp, one of the PMB modules or just a PIC chip? It will depend on what you want to achieve, how much experience you you already have, and how much you want to learn. How complex a project you have in mind will determine how powerfull the processor chosen will need to be and what resources it will need. Resources are the memory, input-output capability and sometimes interrupt capability. How fast the CPU is will also depend on your chosen programming language. The Basic Stamp
The CPU_1A* and CPU_3A* Modules
PIC Chips
Processor Life Expectancy Motorola has discontinued one or two of the low volume HC11 family members. One was popular with hobbyists because of its on-board 2K of reprogrammable EEPROM memory. Motorola originally described this one as a "No ROM part for expanded systems". It would also have been useful for testing code segments of larger single-chip applications. This does not affect any of our products. Although I have never used this chip, it seems that quite a few hobbyists (mostly) will be inconvenienced. I do understand Motorola's decision if they are selling fewer than 100,000 per year as I have read. With so many versions of the HC11 existing, it stands to reason that some will be short lived and others will last for ages. When looking for a processor with maximum life expectancy it makes sense not to choose the latest offering, to ignore the manufacturers marketing plan, and not to choose a chip with special peripheral functions built in; but to choose the most popular and cost effective member of an established family from a major manufacturer. I would expect that a lot of the micros with internal special function blocks or that come from specialist (non-mainstream) manufacturers will be relatively short lived. As the variety of these chips increases it makes sense that the volume of some produced will be lower. It is also logical that every manufacturer will discontinue some chips as they introduce new ones. Especially when they are offering 30 or more versions of what is essentially the same part. I've been using the HC11 for a long time now, originally the OTP HC711E9, now the HC11F1. I have no immediate plans to stop using the HC11F1. The E9 to F1 change was due to the One-Time-Programmable and 12K ROM limitations. At the time I looked at changing processors, but the cost and work involved was too great. I chose to attach flash and sram chips to the HC11F1, sticking with standard parts. This created the CPU_1A1 module as a direct replacement for my E9 OTP single chip module. At the time, everyone I talked to recommended a different processor. I looked at the HC12 but it was too expensive, and I could not get samples or small quantities. I also looked at the PICs and AVRs. These were generally more expensive for a similar function, were not always available, and I would have had to re-tool and re-write a lot of code. We have not yet had any problems getting the HC11F1. In most cases, to get a comparable feature set in another processor, the cost was the same or higher. Granted; the newer processor usually came with a few more MHz of speed, which did not justify a change. An advantage of using a CPU module assembled from standard parts is that in the future the module can be redesigned using a newer processor (and/or CPLD) and easily worked into new and existing products. Our HC11 products go into residential homes and commercial building; cost is always important. Generally, the newer the processor the more it costs. For the extra cost you get, a bit more speed, a bit more memory and it is usually difficult to get. Not a very good deal when you already have a processor that is cheaper, does the job and is readily available. By the time the "new" processor becomes readily available and cost effective, there is another newer one available. All components seem to go through cycles of being "easy to obtain, low price" and "difficult to obtain, high price". This doesn't matter too much when you're using 5 or 20 micros per year, but can destroy a product or business when you must have 200 and you've just been told that the price has doubled and the lead time is 20 weeks. Conclusion I believe that the main HC11 family members will be around for many years yet. Of course Motorola want us to use the more recently released processors. They are most likely more profitable; possibly coming from a newer plant and selling at a higher price. A CPU no longer available I know of a company in New Zealand that designed a networked product based on an 8-bit Intel micro that had an internal communications processor (8044). They spent years and a small fortune developing this product which I thought was well ahead of anything else that was available. After 1000 to 1500 units had been manufactured and a number of large sites installed, Intel announced that the processor was being discontinued. This meant the end of the product. The company no longer exists, but that may not be due to the problems with the processor. I think that it is fairly obvious that this processor was a "special", and would most likely be a low volume part, leading to an early demise. I think that the idea is to stick with the basic parts. In this example it would have been a little more complex to use an 803* processor and a separate network processor but it would have made a huge difference to the company and it's customers. it's easy to be wise after the event
Building and programming embedded systems can be very rewarding.
|
|
|
|
PMB home |
|
last updated: 16 July 2004 |