Micro Controllers

68HC11 and 68HC05

During the later 1980s I started using the Motorola MC68HC11E9 single chip micro. Problem back then was that you couldn’t get Flash memory, so the single chip micros were one time programmable (OTP). That was a real pain because the OTP chips cost about $40 each and you only got one shot at it. The solution was to use the EVB development board which emulated the HC11 chip while you did the code development in RAM. There were some very expensive UV erasable chips that allowed testing before committing to a OTP chip; but these little buggers took 30 minutes to erase.

During the late 1990s I used the MC68HC11A1 in expanded mode with external memory for a short time before switching to the MC68HC11F1 in expanded mode with external Flash and RAM memory.

For a long time I also used a couple of small single chip versions of the 68HC05.

Although maybe not the cheapest micros available, they offered a good collection of functions in the one package and there was plenty of information available.

I haven’t used the HC11 in ages. It was a nice chip to program in assembly, quite fast and capable with some good code. I did find that it was very easy to translate existing HC11 assembly code to ARM assembly code. Maybe not the most efficient code, but it worked.

Choosing the PIC micro

During the late 1990s I decided to replace the Motorola MC68HC705J1 with another processor. I was finding the J1 a bit slow and short of code space.
Our 1604 control system used the 68HC705J1 processors in a number of modules. The plan was to change these to the new micro during upgrades. Due to the cost of the Motorola development tools and the problems I had getting them, and because Motorola wouldn’t release the programming information, I decided to switch to the Microchip PIC processors.

PIC micros, General

Using assembly, for the same end result you have to write more lines of source, but after assembly it’s smaller than for the Motorola 05J1 code. I missed the variety of instructions available in the 05J1. PIC single byte instructions were good and the register/memory structure was OK once you had it worked out.

I wasn’t impressed with MPLAB from Microchip. It was a windows application that didn’t support long file names, so I used the Cross32 assembler. The PicStart Plus programmer was a big improvement on the Motorola chip programming and I just used MPLAB to drive the programmer.

I found MPLAB difficult to use because I was familiar with a very different processor and development system. Because I didn’t have a lot of time and didn’t want to confuse things, I decided to use the Cross32 assembler for the PIC, even though MPASM is more versatile. I used the same source file layout etc for the PICs and other micros.

The PIC branch/skip instructions, jumping only one instruction, require a bit of a re-think after using other micros. I also miss the variety of branch instructions. Otherwise the PIC instructions can be related back to similar Motorola instructions. It’s was not very difficult to work through a Motorola 05J1 source file and convert it run in a PIC. Microchip provide quite a bit of sample code which is very useful when getting started.

I’m now using a small range of PIC micros. The main ones are the 12F629, 12F675, 16F676, 16F684, a couple of 18F chips and occasionally the 16F88 and 16F876.. These cover small, medium and larger projects. I’ve done my best to avoid larger projects in recent years but I quite like ARM7, STM32.

I now use Linux for everything except supporting old projects written using the Cross32 Assembler. Microchip have released a version of MPLAB that runs on my KUbuntu Linux. The install was easy and it seems to work well; although when I installed it,  it didn’t support my ICD2 or PicSatrt-2, so I had to buy a PicStart-3.

Other Micros

I still get a lot of people asking why I don’t use the latest XYZ chip with this or that new feature that runs at 100+ MHz. I have to explain that what I need costs < $2 and I expect to use hundreds or thousands of them. If I use the new micro, it would cost $10 each and be difficult to get. That aside, there is always a newer, brighter, faster micro just come available. 99 times out of 100 it’s not worth it. The one I already know and have tons of support for will still do the job. There’s a lot more to choosing a micro than getting a free sample of the latest release. The biggest things for me are: cost, availability, tools, information, code and existing knowledge-base.

I like to stick with the base part of any family. The manufacturer usually produces a few standard parts and then does the ones with special features, possibly targeting specific applications. By sticking with the standard part there is a greater chance that it will remain cost effective and available for longer. The specific parts will be discontinued when the market changes or if sales of that part are low.
At the hobby and one-off end, it’s common to purchase a CPU board with re-programmable memory and then connect a complex mass of circuitry to it. This approach is fine; cheaper although time consuming for one-off projects.
At the other end, where you’re expecting to manufacture 100’s or 1000’s of units, it’s usually cheaper to use a smaller chip and design a board specifically for that product.

Which Micro ???

“Which micro” is a discussion like Pepsi verses Coke. Nobody is right, nobody is wrong.
What you can get, what it costs and personal preference.

If I was starting from scratch it would probably be between Atmel and PIC. Knowing what I know now, I would choose the PIC again because I think there is better support and it’s more readily available when you need it.

I have often seen the popular hobby micros listed by my suppliers as “out of stock” and new stock expected in 30 to 50 weeks. Am I glad I don’t use that brand. I’ve never had any problems getting the standard PIC micros.

Transferred and updated from my www.pmb.co.nz site.

Leave a comment