![]() |
|
|
|
|
Firmware holds the true "power" in electronic design: it represents the amount of intelligence we include in our projects, and it is greatly dependant on our designing skills. Learn Hardware Firmware and Software Design is, indeed, the best book available to start hardware, firmware and software design. In order to work with Microchip technology you need to know Microchip Firmware Development Tools. They are: 1. MpLab IDE 2. ICD2 In Circuit Serial Debugger/Programmer 3. C30 compiler 4. USB/Serial cable adaptor Of course, there are alternative tools to those listed above, and there will be references to some of them, in due time. However, in order to work successfully with the LHFSD book and HCK kit, the tools mentioned above are strongly recommended. Following are few brief notes about each mentioned tool. |
||||||||||||
IDE means "Integrated Development Editor": a generic name given to many development interfaces; for example, Visual Basic IDE. Microchip's MpLab IDE is used to interface firmware with the hardware PCB using few programming and debugging tools, such as: ICD2, ICE2000, ICE4000, PICStart Pus, etc. The good news is, MpLab IDE is totally free for use! In addition, MpLab is very easy to work with. In order to download the latest version of MpLab check this link: link to MpLab at Microchip. Always work with the latest MpLab version available, and never be afraid to upgrade. We have used MpLab since version 3.60 with many types of controllers; since then, there have been tens of MpLab upgrades, but we managed to keep our firmware working without problems. Following is a picture of the running MpLab V7.41. Note that Edition 4 of LHFSD running ED4RV1 source code was written for MpLab V7.60. |
||||||||||||
![]() |
||||||||||||
ATTENTION MpLab version V7.60 makes the transition to Windows Vista, and it is very advanced. On the other hand, version 7.60 works a bit different from all previous versions. For step-by-step instructions of working with MpLab V7.60 we recommend LHFSD Edition 4. |
||||||||||||
ICD2 (In Circuit Debugger 2) is mandatory to work with Microchip controllers. All you have to do is buy it, with the power adaptor and serial cable included. Next, follow Microchip documentation for installing the USB driver on your PC. This is all you do with ICD2. It works only as a hardware interface between firmware source code, MpLab, and your hardware PCB board (the controller itself). ICD2 is a very good tool and it is nicely priced (around 150 USD). It is used to Debug/Program all Microchip controllers having Flash memory--which is, most of them. Following are few links to Microchip's website: 1. link to ICD2 page at Microchip 2. link to other Development Tools 3. Link to Microchip Forum If you will have any problems while working with ICD2, then you have the LHFSD book Edition 4 which tells you everything you need to know. In addition, you have the MpLab Help where all errors are described, including ways to solve them, and then you have Microchip Technical Support team for problems related to ICD2. Even more, Microchip Forum above will help you with any other hardware/firmware/programming problems you may have. |
||||||||||||
ATTENTION The last version of C30, V3.00, has a minor compiler bug. Consequently, all source code supplied with Editions previous to Edition 4 do not work anymore with C30 V3.00. The last source code issued with Edition 4 was numbered ED4RV1 in order to keep track of future changes. In addition, ED4RV1 was written specifically to work with C30 V3.00 and greater. In the future the compiler bug in C30 V3.00 is going to be corrected, but have no worries: ED4RV1 will continue working just as well. The book LHFSD presents 12 complete firmware programs (all working) and each is written in ANSI C. That means you need an ANSI C compiler. The best option is Microchip's C30, particularly because Microchip allows for a 60 day free trial period. That is everything you need to start learning firmware programming. Initially, they were C17, then C18, and lastly C30 ANSI C compilers. The C17 family of controllers has ended its life cycle, therefore C17 it is no longer offered at Microchip. You are left with two options, C18 and C30, and you need to decide on which to use. Of course, C30 is the best choice because it allows you to work on the latest and most powerful controllers. However C18 works with a fairly large number of old model controllers (84), and it is about half the price. Note, however, that C18 may become deprecated/obsolete, sometime in the near future, while C30 is still in its development childhood. Besides C30 cover about 97 new, faster, more powerful controllers. In LHFSD is explained in details how to work with C30, but you should be aware that using C18 requires exactly the same steps. In fact you will see no difference when working with either tool, because both C18 and C30 work behind MpLab. Even more there are many 3rd party compilers you could use, as an alternative to C30, and the difference is minimal. That is the beauty of working in C: portability! Note that we do not recommend C18 compiler. The best is to start developing firmware using C30. Now, there is also the Assembler alternative, and it is completely free. The question is: "Why pay money for a C compiler, when you could use Assembler for free?" Well, try to answer this question first: "Why do you think Microchip people say their C30 compiler is worth almost 1000 USD, when Assembler is totally free?" If you look at Texas Instruments they sell their Code Composer DSP C compilers for about 3000 USD; Motorola sells Code Warrior for about 5000 USD. Why do you think those people decided to ask that much for their C compilers, when there is also the free Assembler option for any of them? Even more, you should think of what you are going to use when you will learn working with 32-bits controllers and processors. Not Assembler for certain! Assembler is a terrible waste of time, both in development time and in debugging. Never forget that time is THE MOST PRECIOUS THING in our short lives. Following are links to Microchip compilers mentioned above. 1. link to C18 compiler at Microchip 2. link to C30 compiler at Microchip Other sites of interest which offer alternative ANSI C compilers are: 1. HI-TECH Software 2. IAR Systems 3. Byte Craft Ltd Any of the above companies offer C compilers for Microchip controllers. We worked only with Hi-Tech compilers, for few years, and we was well satisfied. (It appears Hi-Tech compilers are a bit faster, they are simpler to use, and a bit more efficient; in addition you could also shave one or two hundred dollars from the price of C30). The good news is, it is possible you will find cheaper firmware tools than C30 (though C30 is still the best option since it is developed by Microchip). As for using the source code presented in LHFSD with other 3rd party compliers, have no fears: it will work perfectly well, with only minor modifications in the header file. Note that we do recommend Microchip C30 (and minimum) V3.00 for Edition 4 of LHFSD book and HCK kit. |
||||||||||||
The USB/Serial cable adaptor allows you to control your PCBs using a high level programming language as is Visual Basic. The LHFSD book explains in details how to develop software programs: 1. to control your PCBs for testing/calibration purposes 2. to create commercial PC programs which will interface with your PCBs as stand-alone applications ![]() All USB/Serial (also named USB/RS232) cable adaptors are simple hardware tools, and they come with a software driver. Newer PCs do not have the (hardware) serial port anymore (DB9), particularly the laptops. Of course most people are buying these days laptops, because the tower and the desktop PCs are just old mastodons. After you install your USB/Serial cable adaptor software driver you can use it as a "virtual" serial port (COMx) working over USB with no additional modifications. The advantage is, it is a lot easier to develop applications for RS232 compared to USB. The LHFSD book explains how to build an excellent RS232 serial communication interface in one work-day; in contrast, if you intend to use USB, then building an USB driver will take you few good months of pains! In addition, any USB driver built for commercial purposes requires that you purchase a licence which needs to be updated each year. The price of the USB/Serial cable adaptor is roughly 10..20 USD, depending on where you buy it from. The picture on right presents the USB/Serial cable adaptor built by Sabrent, model M501-1022, 12 USD at www.TigerDirect.ca All prices at TigerDirect.ca are in CDN. However, there are many other sellers of USB/Serial cable adaptors. |
||||||||||||
LINKS
|
||||||||||||
|
||||||||||||
| Back to HFS Tools
page |
||||||||||||
| Send your
comments regarding this page using support@corollarytheorems.com Page last updated on: February 02, 2008 © Corollary Theorems Ltd. All rights reserved. |
||||||||||||
| ||||||||||||