![]() |
||
|
Introductory Chapters
|
||
********************************************************************* Special fragment reprinting permission has been given to COROLLARY THEOREMS by O G POPA Few special characters were lost while copying and pasting into the HTML page ********************************************************************* LEARN HARDWARE FIRMWARE AND SOFTWARE DESIGN ISBN 9780978160449 © O G POPA Covers and graphic design by O G POPA. COPYRIGHT ENFORCEMENT No parts of this book may be reproduced in print or electronic format without written permission from O G POPA. No copies of this book in print or electronic format are allowed without prior written consent from O G POPA. No translations of this book are allowed without prior written consent from O G POPA. This book may be distributed only through sellers and resellers authorized by Corollary Theorems Ltd. All firmware and software programs, or fragments of programs, presented in this book are for educational purpose only, and they must not be included in any commercial product. Electrical schematics presented in this book may not be used for production of more than one PCB board per rightful buyer. The "rightful buyer" is the person who has paid the price required for this book to Corollary Theorems, or to other authorized resellers. The accompanying Source-Code on CD is an integral part of Edition 4, ISBN 9780978160449; therefore, it is protected by International Copyright Legislation as it is explained above. COPYRIGHT AND TRADEMARK ACKNOWLEDGEMENT We made all efforts to mark registered names in this book by capitalization, and by inserting the registered mark (®), or trademark (TM) symbols on the first occurrence; however, we cannot attest to the accuracy of the information. This book should not be regarded as misinformation or as an attempt to the validity of any registered mark, trademark, or service mark. Should there be any unintentional omission on our part, we will introduce corrections upon notice if that is reasonably possible. This book is compliant with all copyright and trademark legislations. To our knowledge, no copyrighted materials from external sources were inserted in this book. WARNING AND DISCLAIMER All information in this book is for educational purpose, only. The author, O G POPA, and the publisher, Corollary Theorems Ltd., worked hard together to make this book complete, accurate, and suitable for study; however, that does not imply any warranty or responsibility on their side. Due to special character hardware, firmware, and software design work have, accidents could happen. Under no circumstances should the author or Corollary Theorems Ltd. be held liable for any possible loss connected to the information presented in this book. FOR LIBRARY USE This book may not leave the library, and it will not be lent in any way or form. This book shall not be copied in any form. EDITIONS Edition 4 ISBN 9780978160449 © O G POPA, first published on August 15, 2007 Edition 3 ISBN 9780978160418 © O G POPA, first published on January 27, 2007 Edition 2 ISBN 0973567856 © O G POPA, first published on June 15, 2005 Edition 1 ISBN 0973567872 © O G POPA, first published on April 08, 2005 PUBLISHED AND DISTRIBUTED BY COROLLARY THEOREMS LTD. http://www.corollarytheorems.com/ #304 10420 148th Street Surrey, BC, V3R 3X4, Canada 1 604 581 9214 |
||
|
|
||
|
|
||
|
Now, one way or the other you will get your software tools for hardware design, but
the tragedy comes when building LHFSD-HCK. Although your board will work just fine, it is going to be rather
expensive for a learning aid. We will calculate its approximate costs when we study BOM (Bill of Materials). Fact
is, LHFSD-HCK is mandatory to implement all firmware and software programs in this book. Sure, as mentioned, if
you do have some experience or a very sharp logic, you do not necessarily need to experiment with the firmware and
software programs presented--in that case you will understand them logically, just by studying the accompanying
source-code files. However, little hands-on experience is crucial when working with microcontrollers, so ... You
see, microcontroller technology is somehow "custom", specific to each microcontroller brand, and even to
each microcontroller family. Each hardware/firmware development environment has particularities, and there are
specific "tricks" you need to know, in order to do the job properly. If you learn to control a
particular family of microcontrollers, and if that particular family is a powerful one--as is Microchip's Digital
Signal Controllers--then you have an enormous range of benefic applications ahead of you. |
||
|
|
||
|
|
||
NOTES Microsoft has vowed to preserve Visual Basic 6 functionality throughout the Vista period estimated at five years, plus five more years, for a total of ten years starting in 2007. Please check this page: http://msdn2.microsoft.com/en-us/vbrun/ms788708.aspx about Microsoft support of Visual Basic 6 lifetime. Even when Microsoft will cease upgrading/supporting actively Visual Basic 6, it will still remain functional for at least ten more years. However, if things will change, LHFSD will also be timely upgraded for future, new firmware/software environments. In addition, at Corollary Theorems website there is posted information about major source code changes from previous Editions. Note again that the only working alternative to Visual Basic 6 supported by Vista is Visual Basic 2005--I tested it. For the 4th Edition, I preferred using Visual Basic 6, because it has more useful features than Visual Basic 2005 has, and it is far simpler to understand and work with. Additional reasons in favor of using Visual Basic 6 are presented in Software Design, part 3 in this book. Besides, you can upgrade Visual Basic 6 to 2005 or 2007 at any time. You should use a second PC, if you want to work with ICD2 Debugger and Visual Basic in the same time. However, you could try a little harder and use both tools alternatively, on a single PC. An important issue is, you need both DB9 and USB ports on your PC machine. The best case scenario is to use one PC having RS232 serial interface--a DB9 connector--for Visual Basic and HyperTerminal, and a second one having one USB port for MPLAB ICD2. Please be aware that, lately, commercial PCs do not have DB9 connectors: they work only with USB ports. If that is your case, you need to buy an "USB-to-Serial" cable adapter. The one I use is built by Sabrent® (M501-1022), and it is very cheap at 12 USD-it works perfectly well with USB V1.1 protocol. There are very many USB-to-Serial cable adaptors, and all of them are very good. After installing the firmware driver, you should restart your computer to register the driver with Windows [except for Vista]. Next, you will have a virtual serial COMx port on your PC/Notebook/Tablet PC working over USB, and you could start developing a lot of useful applications. I inserted the USB-to-Serial cable adaptor picture for your reference. |
||
![]() Fig R1: USB to Serial cable adaptor Some readers may shy away thinking RS232 serial communications interface is outdated and they do not need to learn it anymore. Not so, dear readers. The RS232 application presented in this book is a very good learning lesson if you want to understand the basics of serial communications. In my next book of the hardware, firmware, and software design series, I will build a USB interface to control hardware, but you will see that there is a lot less to understand from it, in terms of serial communications. USB is handled by Windows, and by the built-in factory firmware drivers. On the other hand, there are still millions of serial applications developed for RS422, RS485, RS488, CAN, OBD, etc., and all work similar to the RS232 examples presented in this book. All industrial and professional grade PCs use the RS232 interface, and they will continue to use it for a long time. The USB-to-Serial cable adaptor will install a COMx port working over USB, and that will help you control hardware and firmware in many great applications. No matter how we take it, the RS232 interface is a mandatory lesson. Now, lets summarize the steps needed to start from ground up with hardware, firmware, and software design: STEP 1 Navigate to http://www.microchip.com and download last version of MPLAB IDE then install it on your PC. Take a day or two and study it, but do not get scared with its complexity. You are going to master it in no time, and you need to work with only a fraction of its (very advanced) features. STEP 2 Buy your MPLAB ICD2 from the most convenient supplier. Please buy ICD2 with the power supply adaptor, and with RS232 serial cable included. In Microchip website you will discover a list with all ICD2 suppliers. STEP 3 If you have only USB connectors on your PC, you need to buy an USB/RS232 cable adaptor from anywhere you discover the cheapest price. Install your driver according to manufacturer specifications: that will add a COMx serial port on your PC working over USB. Download LHFSD.exe from http://www.corollarytheorems.com and install it on your PC, just to see how it works for you. Please be aware that you will build LHFSD.exe application exactly as it is presented, therefore you will know how to modify everything inside, including the way it looks. For now, just study its (partial) functionality in order to understand what you are going to learn in part 3, Software Design. STEP 4 Buy this book, Learn Hardware Firmware and Software Design. If you decide to use LHFSD-HCK companion kit already built, you could get a fair price at Corollary Theorems. If you want to build the companion kit yourself, then use this book as guidance. Please be aware that building the kit by yourself is not easy: it takes a lot of time, and it is going to be way more expensive. STEP 5 Buy your version of Visual Basic 6 from wherever you find the cheapest price. Visual Basic 6 is better, easier to work with, and way more powerful than Visual Basic 2005 is. Besides, you could upgrade Visual Basic 6 later. STEP 6 Read this book first, and use LHFSD-HCK, MPLAB, and Visual Basic 6 only visually, at first, to understand the topics presented. STEP 7 Download your free trial period C30, student version compiler from http://www.microchip.com. Make sure you do have the necessary time (60 days) to work intensively with C30. STEP 8 Start working with each firmware and software application presented in this book. Try to implement the suggested tasks exercises until you feel confident you can modify and control each firmware program the way you want. STEP 9 After working with all programs presented in this book, you will master all Microchip dsPIC controllers. Think of whatever applications you need/want to implement, then buy C30 compiler: now, you have everything you need to start designing your own commercial products. Use this book as guidance in your future design work. At http://www.corollarytheorems.com we have a directory named "TOOLS": it contains many links to the products listed above. Again, do not be scared with the complexity of this learning process, and rest assured you will learn everything you need after working with LHFSD book and LHFSD-HCK kit. We monitor the book and the kit permanently for compliance with the latest developments in Windows, MPLAB, C30, and Visual Basic. This Requirements chapter is posted on the web at Corollary Theorems, and it will be modified to include future developments. Lastly, regarding your personal skills, you should know something about the basic notions of electronics, and you should have at least some idea about C and Visual Basic programming. It is advisable to keep few good C and Visual Basic programming reference books close to your hand, if necessary, while working with this book. NOTES The LHFSD-HCK we are going to build together in this book is in fact a custom-built, little PLC (Programmable Logic Controller). Therefore, those readers who know something about PLCs are going to assimilate the knowledge presented here very fast. Note that LHFSD-HCK is way cheaper than a standard PLC system, a lot easier to design, and far easier to maintain/troubleshoot/modify. In addition, a custom-built PLC is a proprietary, unique solution, therefore it protects intellectual property, and it may also prevent most attempts of reverse-engineering. As for the future, you do not have to worry. If you do understand and like what you read in this book, you will learn advanced electronics, ANSI C, and Visual Basic programming by yourself, in no time. *** |
||
Back to LHFSD main page |
||
| Send your
comments regarding this page using support@corollarytheorems.com Page last updated on: January 01, 2008 © Corollary Theorems Ltd. All rights reserved. |
||
|
||