|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?注册
x
PIC系列英文原版书籍之2:Programming PIC Microcontrollers with PICBASIC
Introduction
Electronics has been my hobby and profession for over 25 years. I started as a
young child building kits from Radio Shack and projects described in electronics
magazines and books. When microprocessors were first developed, I was fascinated
with them. I was a bit too young to really understand how they worked, but I could
see they would replace the batches of discrete integrated circuits (ICs) my previous
electronic projects depended on. I soon discovered microprocessors required many
more tools and resources (like money) than I could afford. This made it difficult to
build a home lab for micro-based designing so I never got involved during all the
early years of microprocessor development.
I went on to earn a bachelor’s degree in electrical engineering and made electronics
my profession. Although I had learned how to program and work with some
of the best microprocessor tools, I still didn’t see the opportunity to build a home
lab for microprocessor development without spending a bunch of money.
Then I discovered the Microchip PIC family of microcontrollers. They were
inexpensive, easy to purchase through various sources, and development tools were
inexpensive. I bought a PIC programmer and started playing with electronics as a
hobby again. Although I developed some interesting projects using Microchip
assembly code, I really longed for a simple form of programming like the BASIC
language because I didn’t have a lot of spare time.
A company named Parallax began advertising a small PIC-based computer
module called the “Basic Stamp” that could be programmed in a form of BASIC. I
bought one and I started playing with it. It was easy to use, and I had a lot of fun
with it. But it had memory limitations and was a bit expensive to make permanent
designs with. I had spent a lot of time developing gadgets and really wanted to turn
a couple of my ideas into products I could market.
xi
I thought about developing my own Basic compiler for the Parallax computer
module that would allow me to program a PIC directly. Then I saw an advertisement
for a new product from microEngineering Labs called the PicBasic compiler. It
could convert a program written for the Parallax module into the code format
required to program a PIC. It used the same commands as the Parallax module along
with a few more. I purchased one immediately and began designing in PicBasic.
I found it to be a simple but very powerful compiler. I could develop complex
projects in a few days rather than weeks or months with assembly language. I
designed a few products and began to market them through my website at
www.elproducts.com. I also decided to write an article for Nuts and Volts magazine
about the Microchip PICs and fortunately got it published in July 1998. I was then
approached about writing a book on PICs. I never thought of myself as an author
but I saw it as an opportunity to share my knowledge about PICs and PicBasic with
those who might enjoy this stuff as much as I do.
As I wrote, many things got in the way and this book took far longer to write
than I had originally expected. But the delay allowed this Basic programming
method to become more popular. New compilers from other companies, new programming
accessories and hardware began to show up all over the place. The PICs
and the PicBasic compilers improved as well.
As it evolved and my own experience increased, I tried to capture as much as
possible in this book but still keep it at the entry level. One result of my increasing
experience was to modify the original outline to include a chapter on robotics.
Robotics has become very popular during the time I wrote this book, and I believe
it’s because there were more people like me who were using all the new affordable
yet powerful microcontroller tools to develop robots in their home labs.
Using Basic to program microcontrollers began to be called embedded Basic
programming and recently I’ve seen job postings for PicBasic programmers. It’s
become harder to find people who are trained at programming in assembly code,
with so many electronic development companies switched to the C language. I
believe embedded Basic will be the next wave of programming for small module
high-volume designs since it’s so much easier to write and almost as efficient as C.
xii
I hope you find this book informative and challenging, not to mention enjoyable.
Everything in here was learned the hard way—by trial and error. Microchip has
some great components and the PicBasic compiler makes it easy for everyone to
become an embedded Basic designer. You can visit my website for more info on
some of the latest embedded Basic products. If you have any questions, I can be
reached via email.
Chuck Hellebuyck
Electronic Products
www.elproducts.com
chuck@elproducts.com |
|